1import{_ as Q}from"./CLink.vue.131f8df5.js";import{d as x,u as z,bj as Ce,c as E,o as c,e as g,k as p,f as L,w as $,g as I,t as u,j as R,n as S,F,p as G,h as o,aL as Z,_ as Se,M as Y,r as T,by as $e,S as P,m as Ie,A as ge,E as Le,bz as xe,H as Ee,aT as J,aU as ee,a1 as te,bA as se,ae as fe,i as Me,b5 as He,Z as W,l as Oe}from"./entry.f950ca0e.js";import{_ as me}from"./CHeading.vue.21708a8c.js";import{_ as Te}from"./CAlert.vue.96725451.js";import{_ as Re}from"./CText.vue.d6273233.js";import{u as Be}from"./mediaqueries.59013988.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="ffad580c-2c31-429b-b413-a75bfc9897c2",n._sentryDebugIdIdentifier="sentry-dbid-ffad580c-2c31-429b-b413-a75bfc9897c2")}catch{}})();(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="5f7334dc-7808-4784-8361-bb706e21cafc",n._sentryDebugIdIdentifier="sentry-dbid-5f7334dc-7808-4784-8361-bb706e21cafc")}catch{}})();const Ne={class:"flex flex-col p-6 gap-y-4"},Pe={class:"flex flex-col"},We={key:0,class:"flex flex-wrap gap-x-2"},ze={key:2,class:"flex items-center justify-end"},Fe=x({name:"RetailerDetailsCard"}),Ae=x({...Fe,props:{retailer:{}},setup(n){const{t}=z(),s=Ce(),e=E(()=>!!s["footer-content"]);return(l,m)=>{var k;const _=me,v=Re,h=Se,w=Q;return c(),g("div",Ne,[p("div",Pe,[L(_,{level:5},{default:$(()=>[I(u(l.retailer.name),1)]),_:1})]),p("address",null,[l.retailer.address?(c(),R(v,{key:0,element:"span",variant:"system-sm"},{default:$(()=>[I(u(l.retailer.address),1)]),_:1})):S("",!0)]),(k=l.retailer.offerings)!=null&&k.length?(c(),g("div",We,[(c(!0),g(F,null,G(l.retailer.offerings,r=>(c(),g("div",{key:r,class:"flex items-center gap-x-2"},[L(h,{name:"check_box"}),L(v,{el:"span",variant:"system-sm",class:"whitespace-nowrap"},{default:$(()=>[I(u(r),1)]),_:2},1024)]))),128))])):S("",!0),o(e)?Z(l.$slots,"footer-content",{key:1}):(c(),g("div",ze,[L(w,{variant:"primary",size:"small",icon:"open_in_new","icon-position":"right",to:l.retailer.link,target:"_blank","data-test":"retailer-link"},{default:$(()=>[I(u(o(t)("store.to_retailer")),1)]),_:1},8,["to"])]))])}}}),Ue={class:"text-sm text-gray-800"},Ve={class:"flex items-center justify-end pt-4 font-bold"},je=x({name:"MapInfoWindow"}),Ze=x({...je,props:{id:{default:void 0},address:{default:""},email:{default:""},name:{default:""},openingHoursMondays:{default:""},openingHoursTuesdays:{default:""},openingHoursWednesdays:{default:""},openingHoursThursdays:{default:""},openingHoursFridays:{default:""},openingHoursSaturdays:{default:""},openingHoursSundays:{default:""},lat:{default:void 0},lng:{default:void 0},phone:{default:""},storeId:{default:""},label:{default:""},offerings:{default:()=>[]},link:{default:""},closureStartDate:{default:""},closureEndDate:{default:""},closureReason:{default:""}},setup(n){const t=n,{t:s}=z(),e=E(()=>({name:t.name,address:t.address,offerings:t.offerings,link:t.link})),l=E(()=>t.name&&!t.storeId);return(m,_)=>{const v=Q,h=Ot,w=Ae;return c(),g("div",Ue,[m.storeId?(c(),R(h,Y({key:0},{...t},{title:t.name,size:"small","is-map-visible":!1,"padded-address":!1,"more-opening-hours-on-store-page":!0}),{"below-store-info":$(()=>[p("div",Ve,[L(v,{variant:"primary",size:"small",to:`/butiker/${m.storeId}`},{default:$(()=>[I(u(o(s)("store.go_to_the_store_page")),1)]),_:1},8,["to"])])]),_:1},16,["title"])):o(l)?(c(),R(w,{key:1,retailer:o(e),"show-on-map-button":!1},null,8,["retailer"])):S("",!0)])}}}),Ge=(n,t)=>{const s=`https://maps.googleapis.com/maps/api/js?key=${n.googleApiKey}&libraries=${n.googleMapsLibraries}&callback=handleMapInit&loading=async`;if(document.head.querySelector(`script[src="${s}"]`))t();else{const l=document.createElement("script");l.type="text/javascript",l.src=s,l.defer=!0,l.async=!0,document.head.appendChild(l),window.handleMapInit=function(){t()}}},Ke=x({name:"GoogleMap"}),Xe=x({...Ke,props:{locations:{default:()=>[]},focusedLocation:{default:()=>({lat:0,lng:0})},currentLocation:{default:()=>({lat:0,lng:0})},searchString:{default:""},extendedInfoWindow:{type:Boolean,default:!1}},emits:["set-search-result"],setup(n,{emit:t}){const s=n,e=15,l=5,m={lat:59.34795995833531,lng:17.96478313095946},_="OK",v="ZERO_RESULTS",h=ge(),{$sentry:w,$googleMaps:k}=Le(),{mq:r}=Be(),b=T(null),C=T(null),f=$e(null),M=T([]),A=T(!1),U=T(null),O=T(null),B=T({});P(k==null?void 0:k.hasLoaded,()=>re()),P(()=>s.locations,()=>{f.value&&ne()}),P(()=>s.focusedLocation,()=>{if(f.value)if(s.focusedLocation.lat&&s.focusedLocation.lng){const a=new google.maps.LatLng(s.focusedLocation);le(a,e)}else X()}),P(()=>s.currentLocation,()=>{if(!f.value)return;const a=new google.maps.LatLng(s.currentLocation);q(a)}),P(()=>s.searchString,()=>{var a;if(f.value&&s.searchString){const d=K();if(d.length){const i=d[0],y=new google.maps.LatLng(i.lat,i.lng);q(y);const H=d.reduce((D,V)=>{const j=V.storeId||V.id;return j&&D.push(j),D},[]);t("set-search-result",H),_e(d[0],y)}else(a=U.value)==null||a.geocode({address:s.searchString,componentRestrictions:{country:"SE"}},be)}}),Ie(()=>{Ge(h.public,re)});const K=()=>s.locations.filter(a=>{var d,i;return!!((d=a.name)!=null&&d.length)&&a.name.toLowerCase().includes(s.searchString.toLowerCase())||!!((i=a.address)!=null&&i.length)&&a.address.toLowerCase().includes(s.searchString.toLowerCase())}),_e=(a,d)=>{var H,D;const i=he(d),y=ae(a);(H=O.value)==null||H.setContent(y),(D=O.value)==null||D.open(f.value,i)},he=a=>M.value.find(d=>{const i=d.position;return(i==null?void 0:i.lat)===a.lat()&&(i==null?void 0:i.lng)===a.lng()}),ye=()=>{const a={zoom:e,center:m,disableDefaultUI:!0,clickableIcons:!0,minZoom:l,zoomControl:!0,mapId:h.public.googleMapsId};f.value=new google.maps.Map(b.value,a),U.value=new google.maps.Geocoder,O.value=new google.maps.InfoWindow},ne=()=>{var d,i,y,H;if(ve(),!s.locations.length){(d=f.value)==null||d.setOptions({gestureHandling:"none"});return}(i=f.value)==null||i.setOptions({gestureHandling:"auto"});const a=s.locations.filter(D=>typeof D.lat=="number"&&typeof D.lng=="number"&&!isNaN(D.lat)&&!isNaN(D.lng));M.value=a.map(D=>{const V=D.storeId?{background:"var(--color-primary-700)",borderColor:"var(--color-primary-900)",glyphColor:"var(--color-primary-900)"}:{background:"#b91c1c",borderColor:"#7f1d1d",glyphColor:"#7f1d1d"},j=new google.maps.marker.PinElement(V),De=new google.maps.LatLng(D.lat,D.lng),ie=xe(f.value),N=new google.maps.marker.AdvancedMarkerElement({position:De,map:ie,title:D.text,content:j.element});return N.storeId=D.storeId||D.id,N.addListener("click",()=>{var de,ue,pe;const ke=ae(D);(de=O.value)==null||de.setContent(ke),(ue=O.value)==null||ue.open(ie,N);const ce=N.position;ce&&((pe=f.value)==null||pe.panTo(ce))}),N}),M.value.length>1?X():a.length===1&&((y=f.value)==null||y.setCenter({lat:a[0].lat,lng:a[0].lng}),(H=f.value)==null||H.setZoom(e))},X=()=>{var d;const a=new google.maps.LatLngBounds;M.value.forEach(i=>
1{i.position&&a.extend(i.position)}),(d=f.value)==null||d.fitBounds(a)},ae=a=>{var d,i;return s.extendedInfoWindow?(B.value={...a},(d=O.value)==null||d.setOptions({minWidth:300}),(i=C.value)==null?void 0:i.$el):a.text},ve=()=>{M.value.forEach(a=>{a.map=null,a.position=null}),M.value=[]},re=()=>{k!=null&&k.hasLoaded.value&&!A.value&&b.value&&(ye(),window.mapInstance=f.value,ne(),A.value=!0)},le=(a,d)=>{var i,y,H;(i=O.value)==null||i.close(),(y=f.value)==null||y.panTo(a),(H=f.value)==null||H.setZoom(d)},we=a=>{var i;const d=(i=f.value)==null?void 0:i.getBounds();return M.value.filter(y=>d&&y.position?d.contains(y.position):!1).map(y=>({storeId:y.storeId,distance:google.maps.geometry.spherical.computeDistanceBetween(a,y.position)})).sort((y,H)=>y.distance>H.distance?1:-1).map(y=>y.storeId)},be=(a,d)=>{if(d===_&&a&&a.length){const i=a[0].geometry.location;q(i);const y=we(i);t("set-search-result",y)}else d===v?(X(),t("set-search-result",[])):(w.captureException(d),Ee({statusCode:500,message:"Unknown map error"}))},q=a=>{const d=r.value.xlarge||r.value.xxlarge?11:10;le(a,d)};return(a,d)=>{const i=Ze;return c(),g(F,null,[p("div",Y({ref_key:"mapRef",ref:b},a.$attrs,{class:{"opacity-30":!a.locations.length}}),null,16),L(i,Y(o(B),{ref_key:"infoWindowRef",ref:C}),null,16)],64)}}}),qe=["src"],Ye=x({name:"StaticMap"}),Qe=x({...Ye,props:{location:{}},setup(n){const t=n,s=ge(),e=E(()=>`https://maps.googleapis.com/maps/api/staticmap?key=${s.public.googleApiKey}&size=480x240&scale=2&zoom=15&markers=color:red%7Clabel:Dahl%7C${t.location.lat},${t.location.lon}`);return(l,m)=>(c(),g("img",{class:"max-h-72",src:o(e),alt:"map"},null,8,qe))}}),Je={class:"flex gap-3 mb-1"},et={class:"font-bold"},tt={key:0,class:"grid grid-cols-[min-content_fit-content(100%)] gap-x-4"},st={key:0,class:"col-span-2 mt-1"},ot={key:1},nt=x({name:"StoreOpeningHours"}),at=x({...nt,props:{openingHours:{default:()=>({})},todaysOpeningHoursOnly:{type:Boolean,default:!0},moreOpeningHoursOnStorePage:{type:Boolean,default:!1}},setup(n){const t=n,s=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],{t:e}=z(),l=T(new Date().getDay()),m=E(()=>t.openingHours[s[l.value===0?6:l.value-1]]),_=E(()=>!!m.value);return(v,h)=>(c(),g("div",Je,[p("span",et,u(o(e)("store.opening_hours"))+": ",1),v.todaysOpeningHoursOnly&&o(_)?(c(),g("div",tt,[p("span",null,u(o(e)(s[o(l)===0?6:o(l)-1].toLowerCase())),1),p("span",null,u(o(m)),1),v.moreOpeningHoursOnStorePage?(c(),g("span",st,u(o(e)("store.see_all_opening_hours_on_the_store_page")),1)):S("",!0)])):(c(),g("div",ot,[(c(!0),g(F,null,G(v.openingHours,(w,k)=>(c(),g("div",{key:k,class:"grid grid-cols-2"},[p("span",null,u(o(e)(`${k.toLowerCase()}`)),1),p("span",null,u(w),1)]))),128))]))]))}}),oe=n=>!(n!=null&&n.closureStartDate)||!(n!=null&&n.closureEndDate)?[]:[{storeId:n.storeId,startDate:new Date(n.closureStartDate),endDate:new Date(n.closureEndDate),reason:n.closureReason||"store.closed",affectsPickup:!0,affectsDelivery:!0}],rt=(n,t)=>{const s=oe(n);if(s.length===0)return null;const e=new Date(t);return e.setHours(0,0,0,0),s.find(m=>{const _=new Date(m.startDate);_.setHours(0,0,0,0);const v=new Date(m.endDate);return v.setHours(23,59,59,999),e>=_&&e<=v})||null},zt=(n,t,s,e)=>{const l=rt(e,t);if(!l)return null;const m=[J,ee].includes(s),_=[te,se].includes(s);return l.affectsPickup!==void 0||l.affectsDelivery!==void 0?m&&l.affectsPickup||_&&l.affectsDelivery?l:null:m||_?l:null},lt=n=>{const t=new Date,s=oe(n);if(s.length===0||!n)return null;const e=s.find(v=>{const h=new Date(v.endDate);return h.setHours(23,59,59,999),h>=t});if(!e)return null;const l=new Date(e.endDate),m=new Date<=l,_=[];return e.affectsPickup&&_.push(J,ee),e.affectsDelivery&&_.push(te,se),{storeId:n.storeId,isCurrentlyClosed:m,reason:e.reason,closedFrom:new Date(e.startDate).toISOString(),closedUntil:new Date(e.endDate).toISOString(),affectedDeliveryMethods:_}},Ft=(n,t,s,e)=>{const l=[],m=new Date(t,s,1),_=new Date(t,s+1,0);return oe(n).forEach(h=>{if(e){const r=[J,ee].includes(e),b=[te,se].includes(e),C=h.affectsPickup!==void 0||h.affectsDelivery!==void 0;let f=!1;if(C?(r&&h.affectsPickup&&(f=!0),b&&h.affectsDelivery&&(f=!0)):f=r||b,!f)return}const w=new Date(h.startDate);w.setHours(0,0,0,0);const k=new Date(h.endDate);for(k.setHours(0,0,0,0);w.getTime()<=k.getTime();)w>=m&&w<=_&&l.push(new Date(w)),w.setDate(w.getDate()+1)}),l},it={class:"font-semibold"},ct=p("br",null,null,-1),dt=p("br",null,null,-1),ut=p("br",null,null,-1),pt={class:"flex items-start justify-between gap-4"},ft={class:"flex-1"},gt={class:"mb-2 font-semibold"},mt={class:"mb-4 text-sm"},_t={class:"flex justify-end mt-2"},ht=x({name:"StoreClosureNotice"}),yt=x({...ht,props:{storeDetails:{},expressDeliveriesWithClosure:{default:()=>[]}},emits:["change-delivery"],setup(n){const t=n,{t:s}=z(),e=E(()=>lt(t.storeDetails));return(l,m)=>{const _=Te,v=Me;return c(),g("div",null,[o(e)?(c(),R(_,{key:0,variant:"info",class:"mb-4"},{text:$(()=>
1[p("p",it,[I(u(o(s)("store.closed")),1),ct,I(u(o(s)("store.closed_message")),1),dt,I(" "+u(o(fe)(o(e).closedFrom))+" - "+u(o(fe)(o(e).closedUntil))+" ",1),ut,I(u(o(e).reason),1)])]),_:1})):S("",!0),(c(!0),g(F,null,G(l.expressDeliveriesWithClosure,h=>(c(),g("div",{key:h.deliveryId,class:"mb-4 last:mb-0"},[L(_,{variant:"warning"},{text:$(()=>[p("div",pt,[p("div",ft,[p("p",gt,u(o(s)("store.closed")),1),p("p",mt,u(h.errorMessage),1)])])]),_:2},1024),p("div",_t,[L(v,{variant:"secondary",size:"small",onClick:m[0]||(m[0]=w=>l.$emit("change-delivery"))},{default:$(()=>[I(u(o(s)("checkout.change_delivery_method")||"Change Delivery Method"),1)]),_:1})])]))),128))])}}}),vt=["data-test"],wt={class:"grid"},bt={class:"grid w-full grid-cols-2 grid-row-flow gap-y-4"},Dt={class:"col-span-2"},kt={class:"flex items-center gap-x-2"},Ct={key:1,class:"text-white bg-primary-900 px-1 py-[2px] rounded"},St={key:0},$t={key:1},It={key:2,class:"flex gap-3"},Lt={class:"font-bold"},xt={key:3,class:"flex gap-3"},Et={class:"font-bold"},Mt=["title"],Ht=x({name:"StoreDetailsCard"}),Ot=x({...Ht,props:{location:{default:void 0},paddedAddress:{type:Boolean,default:!0},title:{default:void 0},isMapVisible:{type:Boolean,default:!0},staticMap:{type:Boolean,default:!1},mapHeight:{default:"large"},name:{default:""},renderTwoColumns:{type:Boolean,default:!1},nextToMap:{type:Boolean,default:!1},size:{default:"large"},showOnMapButton:{type:Boolean,default:!1},moreOpeningHoursOnStorePage:{type:Boolean,default:!1}},setup(n){const t=n,{t:s}=z(),e=He(),l=E(()=>({"h-60":t.mapHeight==="large","h-40":t.mapHeight==="small","h-60 md:h-full":t.mapHeight==="full"})),m=E(()=>{var r,b,C,f;return(r=t.location)!=null&&r.lat&&((b=t.location)!=null&&b.lon)?[{lat:(C=t.location)==null?void 0:C.lat,lng:(f=t.location)==null?void 0:f.lon,text:t.name}]:[]}),_=E(()=>{const r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],b={};return r.forEach(C=>{e[`openingHours${C}s`]&&(b[C]=e[`openingHours${C}s`])}),b}),v=E(()=>Object.keys(_.value).length>0),h=E(()=>{var r;return e.phoneNumbers||((r=e.phoneNumbersCollection)==null?void 0:r.items.filter(b=>!!b))||[]}),w=r=>{var b,C;return{role:((b=r.fields)==null?void 0:b.role)||r.role,phone:((C=r.fields)==null?void 0:C.phone)||r.phone}},k=E(()=>e);return(r,b)=>{const C=Xe,f=Qe,M=Oe,A=me,U=Q,O=at;return c(),g("div",{class:W(["grid text-sm text-gray-800",{"md:grid-cols-2":r.nextToMap}]),"data-test":`storecard-${r.name}`},[p("div",wt,[Z(r.$slots,"above-map"),r.isMapVisible&&!r.staticMap&&r.location?(c(),R(C,{key:0,class:W(["pb-6",o(l)]),locations:o(m)},null,8,["locations","class"])):S("",!0),r.isMapVisible&&r.staticMap&&r.location?(c(),R(M,{key:1,to:"/butiker/"+o(e).id},{default:$(()=>[L(f,{location:r.location},null,8,["location"])]),_:1},8,["to"])):S("",!0)]),p("div",{class:W(["flex flex-col",{"px-4 py-6 lg:p-6":r.paddedAddress,"pt-6":r.isMapVisible}])},[p("div",bt,[p("div",Dt,[Z(r.$slots,"above-store-info",{},()=>[p("div",kt,[t.title?(c(),R(A,{key:0,level:2,display:1,class:"xs:text-base"},{default:$(()=>[I(u(t.title),1)]),_:1})):S("",!0),o(e).label?(c(),g("span",Ct,u(o(e).label),1)):S("",!0)])])]),p("div",{class:W(["flex flex-col col-span-2 row-span-2 gap-4",{"2xl:col-auto":r.renderTwoColumns}])},[o(e).address?(c(),g("div",St,[p("address",null,u(o(e).address),1)])):S("",!0),r.size==="large"?(c(),g("div",$t,[L(U,{href:`https://www.google.com/maps/dir/?api=1&destination=${t.title}+${o(e).address}`,target:"_blank",rel:"noopener noreferrer",variant:"dark",size:"small",icon:"location_on","icon-position":"right"},{default:$(()=>[I(u(o(s)("store.find_location")),1)]),_:1},8,["href"])])):S("",!0),o(e).phone&&r.size==="large"?(c(),g("div",It,[p("span",Lt,u(o(s)("telephone"))+": ",1),L(M,{to:"tel:"+o(e).phone},{default:$(()=>[I(u(o(e).phone),1)]),_:1},8,["to"])])):S("",!0),o(e).email&&r.size==="large"?(c(),g("div",xt,[p("span",Et,u(o(s)("email"))+": ",1),L(M,{href:"mailto:"+o(e).email,class:"underline"},{default:$(()=>[I(u(o(e).email),1)]),_:1},8,["href"])])):S("",!0),L(yt,{"store-details":o(k)},null,8,["store-details"]),o(v)?(c(),R(O,{key:4,"opening-hours":o(_),"todays-opening-hours-only":r.size==="small","more-opening-hours-on-store-page":r.size==="small"&&r.moreOpeningHoursOnStorePage},null,8,["opening-hours","todays-opening-hours-only","more-opening-hours-on-store-page"])):S("",!0),Z(r.$slots,"below-store-info")],2),o(h).length?(c(),g("div",{key:0,class:W(["grid grid-cols-1 col-span-2 row-span-2 gap-2 pt-6 xl:gr
1id-cols-2",{"2xl:col-auto 2xl:pt-0":r.renderTwoColumns}])},[(c(!0),g(F,null,G(o(h),(B,K)=>(c(),g("div",{key:K,class:"flex flex-row xl:flex-col"},[p("span",{class:"font-bold truncate",title:w(B).role},u(w(B).role)+": ",9,Mt),L(M,{href:`tel:${w(B).phone}`,class:"pl-2 xl:pl-0"},{default:$(()=>[I(u(w(B).phone),1)]),_:2},1032,["href"])]))),128))],2)):S("",!0)])],2)],10,vt)}}});export{yt as _,Xe as a,Ot as b,Ae as c,Ft as g,zt as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.