PageSourceSearch

https://cdn.apopro.dk/2026-09-17-12-49-50/_next/static/chunks/3524-369f583d9a7ecab3.js

js apopro.dk collected 2026-09-25 02:37:33 UTC 26,473 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3524],{3821:e=>{e.exports={input:"TextInput_input__jSv7P",password:"TextInput_password__JQRhf",label:"TextInput_label__pzTy_",error:"TextInput_error__RRiB4",search:"TextInput_search__zXHP_",icon:"TextInput_icon__9DIRi",phoneInput:"TextInput_phoneInput__vCHHH",combobox:"TextInput_combobox__TpAGV"}},18319:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});let n=(e,t)=>{let[r,n]=e;n?t.onError?.(n):t.onSuccess?.(r)}},18636:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(95155),i=r(29722),a=r(12115),o=r(64826);let s=({children:e,className:t,listClassName:r,font:s="mono",testId:c})=>a.Children.toArray(e).filter(Boolean).length?(0,n.jsx)("ul",{className:(0,i.A)("flex max-w-full list-none flex-row flex-wrap gap-4 gap-y-0.5 overflow-ellipsis text-sm font-medium",{"font-mono":"mono"===s},{"mono3 font-mono":"mono3"===s},{"font-normal":"normal"===s},t),...(0,o.s1)({testId:c}),children:a.Children.map(e,e=>e&&(0,n.jsx)("li",{className:(0,i.A)(r,"relative whitespace-nowrap after:absolute after:-right-2 after:bottom-1 after:top-1 after:border-r after:border-r-green-dark last:after:hidden"),children:e}))}):null},22175:(e,t,r)=>{"use strict";r.d(t,{VoucherModalProvider:()=>p,U:()=>m});var n=r(95155),i=r(12115),a=r(68846),o=r(44117),s=r(77996),c=r(79285),l=r(209);let u=({isOpen:e,setIsOpen:t,onClose:r,notification:i})=>(0,n.jsx)(s.lG,{onOpenChange:t,open:e,children:(0,n.jsx)(c.E,{className:"!h-[600px] md:!h-auto",contentClassName:"md:!w-[560px]",large:!0,testId:"voucher-dialog-content",title:"voucher dialog",children:(0,n.jsxs)("div",{className:"flex h-full flex-col items-center justify-between px-2 md:gap-6 md:px-6 md:pt-12",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-8 md:gap-12",children:[(0,n.jsx)(l.D,{className:"px-2 text-center text-[32px]",level:3,children:i.title}),(0,n.jsx)("span",{className:"subheading3 text-center",children:i.text})]}),(0,n.jsx)(o.$n,{className:"w-full max-w-[320px] justify-center",inverted:!0,onClick:r,variant:o.Ak.Secondary,children:a.u2.ok})]})})}),d=(0,i.createContext)(void 0),m=()=>{let e=(0,i.useContext)(d);if(!e)throw Error("useVoucherModalContext must be used within a VoucherModalProvider");return e},p=({children:e,dialogsSettings:t,voucherFeatureFlags:r})=>{let[a,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(0),[l,m]=(0,i.useState)("coolStorage"),p=r?.coolStorageVoucherModals??!1,g=r?.cprRepresentativeVoucherModals??!1,f=(0,i.useMemo)(()=>"cprRepresentative"===l?{title:t.voucherNotifications.cprRepresentativeVoucherNotification.title,text:t.voucherNotifications.cprRepresentativeVoucherNotification.text}:{title:t.voucherNotifications?.coolStorageVoucherNotification?.title,text:t.voucherNotifications?.coolStorageVoucherNotification?.text},[l,t]);return(0,n.jsxs)(d.Provider,{value:{isOpen:a,coolStorageCount:s,setCoolStorageCount:c,openInformationModal:()=>o(!0),modalType:l,setModalType:m,isCoolStorageVoucherEnabled:p,isCprRepresentativeVoucherEnabled:g},children:[e,a&&(0,n.jsx)(u,{isOpen:a,notification:f,onClose:()=>o(!1),setIsOpen:o})]})}},23722:(e,t,r)=>{"use strict";r.d(t,{s:()=>d});var n=r(95155),i=r(7571),a=r(99695);let o=(0,i.OX)({projectId:a.Lg||"",dataset:a.RT||""});var s=r(64826),c=r(36177);let l=[32,48,64,96,128,156,256,375,425,512,768,1024,1440],u=l[l.length-1],d=({src:e,noPlaceholder:t=!1,testId:r,upstreamWidth:i,...a})=>{let{width:d,height:m,quality:p=75}=a,g=((e,t,r)=>{let n;if(e?.url)return e.url;let i=(e=>{if(e?.asset?._ref)return o?.image(e).auto("format")})(e)?.width((n="number"==typeof t?t:u)?l.find(e=>e>=2*n)??u:u);return"number"==typeof r&&(i=i?.quality(r)),i?.url()})(e,i??d,p),f=e?.alternativeText??e?.alternativeText,h=e?.lqip;return g?(0,n.jsx)(c.E,{...a,alt:f,blurDataURL:t?null:h,height:m,placeholder:h&&!t?"blur":"empty",quality:100,src:g,width:d,...(0,s.s1)({testId:r})}):null}},24378:(e,t,r)=>{"use strict";r.d(t,{M:()=>c});var n=r(95155),i=r(25397),a=r(78410),o=r(3012);let s=({text:e})=>(0,a.Ni)(e)?(0,n.jsx)(o.r,{children:(0,n.jsx)(i.RK,{value:e?.richText})}):(0,n.jsx)(o.r,{richText:e}),c=({content:e})=>e?.length?1===e.length?(0,n.jsx)(s,{text:e[0].content}):(0,n.jsx)("div",{className:"flex h-auto flex-col items-start gap-4 overflow-y-auto md:max-h-[282px]",children:e.map(e=>(0,n.jsxs)("div",{className:"text-base",children:[e.heading&&(0,n.jsx)("h4",{className:"text-base font-semibold",children:e.heading}),(0,n.jsx)(s,{text:e.content})]},e.heading))}):null},28236:(e,t,r)=>{"use strict";r.d(t,{D:()=>o,O:()=>s});var n=r(9339);let i=(0,n.createServerReference)("70b69cf2bc2e2d88914571ab0a9cec4a93311367b9",n.callServer,void 0,n.findSourceMapURL,"getGtmDataForProduct"),a=(0,n.createServerReference)("6072145635ed579c5bad492d777bffe75ce67d4ed7",n.callServer,void 0,n.findSourceMapURL,"getGtmDataForOrder"),o=async(e,t,r)=>
1{try{let[n,a]=await i(e,t,r);if(a)return[];return[{ecommerce:null},n]}catch{return[]}},s=async(e,t)=>{try{let[r,n]=await a(e,t);if(n)return[];return[{ecommerce:null},r]}catch{return[]}}},28463:(e,t,r)=>{"use strict";r.d(t,{g:()=>o});var n=r(95155),i=r(29722),a=r(68846);let o=({amount:e=0,className:t,...r})=>(0,n.jsxs)("span",{className:(0,i.A)(t),translate:"no",...r,children:[a.u2.toLocaleString(e),"\xa0",a.u2.currencyCode]})},28641:(e,t,r)=>{"use strict";r.d(t,{jj:()=>n});let n={Anchor:"anchor",Article:"articleDocument",ArticleFrontpage:"articleFrontpageDocument",ArticleCategory:"articleCategoryDocument",ArticleSubcategory:"articleSubcategoryDocument",BannerNotification:"bannerNotificationDocument",BannerNotificationActiveDocument:"bannerNotificationActiveDocument",Basket:"basketDocument",BasketDialog:"basketDialogDocument",Brands:"brandsDocument",CancelOrderDocument:"cancelOrderDocument",ColorTheme:"colorThemeDocument",CampaignColorTheme:"campaignColorThemeDocument",CampaignBanner:"campaignBannerDocument",MarketingBanner:"marketingBannerDocument",CampaignLabel:"campaignLabelDocument",Checkout:"checkoutDocument",CheckoutGuest:"checkoutGuestDocument",Contact:"contactDocument",CprPage:"cprPageDocument",EditorialTeaser:"editorialTeaserDocument",Home:"homeDocument",HomeActiveDocument:"homeActiveDocument",NewsletterUnsubscribeDocument:"newsletterUnsubscribeDocument",Partner:"partnerDocument",People:"peopleDocument",PdpTemplate:"pdpTemplateDocument",PdpSettings:"pdpSettingsDocument",PlpCategory:"plpCategoryTemplateDocument",PlpSettings:"plpSettingsDocument",PlpFiltersConfiguration:"plpFiltersConfigurationDocument",PlpFacetConfiguration:"plpFacetConfiguration",PlpBrands:"plpBrandsTemplateDocument",Profile:"profileDocument",PowersOfAttorney:"powersOfAttorneyDocument",ReConsent:"reConsentDocument",Membership:"membershipDocument",MobileApp:"mobileAppDocument",PromotionalTeaser:"promotionalTeaserDocument",Settings:"settingsDocument",ShippingOptions:"shippingOptionsDocument",ShippingDocument:"shippingDocument",ShippingActiveDocument:"shippingActiveDocument",Navigation:"navigationDocument",NavigationSection:"navigationSectionDocument",NavigationEditorialFocus:"navigationEditorialFocus",NavigationPromoBox:"navigationPromoBoxDocument",Video:"videoDocument",Voucher:"voucherDocument",EditorialBanner:"editorialBannerDocument",Rx:"rxDocument",PrescriptionRenewal:"prescriptionRenewalDocument",RxLandingPageDocument:"rxLandingPageDocument",AppPageDocument:"appPageDocument",SideEffectsPageDocument:"sideEffectsPageDocument",GreenPrescriptionsDocument:"greenPrescriptionsDocument",Search:"searchDocument",SearchSection:"searchSectionDocument",Redirects:"redirectsDocument",FreeShippingConfiguration:"freeShippingConfigurationDocument",FreeShippingThresholdsSettings:"freeShippingThresholdsSettingsDocument"}},32749:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var n=r(95155),i=r(29722),a=r(12115),o=r(47575),s=r(64826),c=r(26388),l=r(25360),u=r(96990),d=r(28463),m=r(74188),p=r(44117);let g=({testId:e,price:t,buttonText:r,productId:g,className:f,prescriptionId:h,disabled:x,productInfo:v,raptorTrackingModuleName:b,hidePrice:k=!0,hideButtonText:S=!1,iconClassName:I,onTransitionCallback:C,startTransition:D,isRx:y=!1,quantity:j=1,metadata:P})=>{let{addToBasket:_}=(0,o.M)(),[{loading:R},w]=(0,a.useState)({loading:!1}),A=(0,m.D)(),{serverTracking:N}=(0,l.U)(),{canTrack:T}=(0,u.D)(),{dataLayer:M}=(0,c.i)(),E=async()=>{let e,r,n,i,a,o;w(e=>({...e,loading:!0})),await _(g,h,P),w(e=>({...e,loading:!1})),e=(e=>{let t=e?.find(e=>e.isPrimary);if(!t)return{};let r=[],n=t;for(;n&&r.length<5;)r.push(n.name),n=n.children?.find(e=>e.isPrimary);return r.reduce((e,t,r)=>({...e,[0===r?"item_category":`item_category${r+1}`]:t}),{})})(v.categories??[]),r=T({isSensitive:v.disableTracking}),i=(n=y||!r)?y?"RX":"Sensitive":null,a=n?Object.fromEntries(Object.entries(e).map(([e])=>[e,""])):e,o={event:"add_to_cart",ecommerce:{items:[{item_id:i??`${g}`,item_name:i??v.name,currency:"DKK",item_brand:n?"":v?.brand,...a,price:t,quantity:j,trackable:n?"no":"yes",isRx:y?"yes":"no"}]}},M.pushCommerceEvent(o),!y&&T({isSensitive:v.disableTracking})&&(N.pushItemChangedEvent(),N.pushItemClickedEvent({packageId:g,raptorModuleName:b}))},L=async()=>{w(e=>({...e,loading:!0})),A.setLoading(!0),D&&C?(D(()=>{C()}),D(async()=>{await E(),C()})):await E()};return(0,n.jsx)(p.$n,{className:(0,i.A)(f,"z-50 justify-center rounded-bl-sm rounded-tr-sm"),disabled:x,icon:"ShoppingCart",loading:R,onClick:L,subVariant:S?p.mV.IconButton:p.mV.Button,...(0,s.Mm)({testId:e},"mobile"),iconClassName:I,variant:p.Ak.Primary,children:k?r:(0,n.jsxs)(n.Fragment,{children:[r," ",(0,n.jsx)(d.g,{amount:t})]})})}},36177:(e,t,r)=>{"use strict";r.d(t,{E:()=>c});var n=r(95155),i=r(5772),a=r(64826),o=r(44759);let s="true"===r(87358).env.IS_CHROMATIC,c=({id:e,testId:t,alt:r,src:c,blurDataURL:l,placeholder:u,height:d,width:m,fill:p,className:g,imgFit:f="cover",preload:h=!1,qual
1ity:x=75,mobileRoundedCorners:v,mobileRoundedSize:b,roundedCorners:k,roundedSize:S,loading:I,...C})=>(0,n.jsx)(o.o,{className:g,mobileRoundedCorners:v,mobileRoundedSize:b,roundedCorners:k,roundedSize:S,children:(0,n.jsx)(i.default,{...C,...(0,a.s1)({testId:t}),alt:r,blurDataURL:l,fill:p,height:d,id:e,loading:s?"eager":I,placeholder:u,preload:h,quality:x,src:c,style:{width:"100%",height:"100%",objectFit:f,objectPosition:"center"},width:m})})},41070:(e,t,r)=>{"use strict";r.d(t,{i:()=>c});var n=r(95155),i=r(44117),a=r(77996),o=r(24378),s=r(209);let c=({prescriptionId:e,notification:t,onClose:r,isOpen:c})=>(0,n.jsx)(a.lG,{onOpenChange:r,open:c,children:t&&(0,n.jsx)(a.Cf,{branded:!0,testId:`prescription-${e}-disclaimer`,title:t.heading,children:(0,n.jsxs)("div",{className:"flex h-full flex-col items-start gap-6",children:[(0,n.jsx)(s.D,{level:3,children:t.heading}),(0,n.jsx)(o.M,{content:t.content}),(0,n.jsx)(i.$n,{className:"mx-auto mt-auto md:mx-0",onClick:r,testId:"prescription-disclaimer-button",variant:i.Ak.Primary,children:t.action.label})]})})})},44759:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(95155),i=r(29722),a=r(12115);let o=({children:e,roundedCorners:t=[],mobileRoundedCorners:r=t,roundedSize:o="md",mobileRoundedSize:s=o,className:c})=>{let l=t?.map(e=>{let t="base"===o?"":`-${o}`;return`md:rounded-${e}${t}`}),u=r?.map(e=>{let t="base"===s?"":`-${s}`;return`max-md:rounded-${e}${t}`}),d=(0,i.A)("overflow-hidden",l?.join(" "),u?.join(" "),c);return(0,n.jsx)(n.Fragment,{children:a.Children.map(e,e=>(0,a.isValidElement)(e)?(0,a.cloneElement)(e,{className:d}):e)})}},44991:(e,t,r)=>{"use strict";r.d(t,{x:()=>c});var n=r(95155),i=r(68846),a=r(33287),o=r(44117),s=r(77996);let c=({isOpen:e,link:t,onClose:r,text:c})=>(0,n.jsx)(s.lG,{defaultOpen:!0,onOpenChange:r,open:e,children:(0,n.jsx)(s.Cf,{branded:!0,className:"z-dialog",title:i.u2.note,children:(0,n.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,n.jsx)("div",{className:"lg:max-w-[374px]",dangerouslySetInnerHTML:{__html:c}}),t&&(0,n.jsx)("div",{children:(0,n.jsx)(a.default,{...t,className:"!px-0",subVariant:o.mV.Link,children:(0,n.jsx)(o.EE,{label:t.label,mobileLabel:t.mobileLabel})})}),(0,n.jsx)("div",{children:(0,n.jsx)(s.HM,{asChild:!0,children:(0,n.jsx)(o.$n,{variant:o.Ak.Primary,children:"Okay"})})})]})})})},47575:(e,t,r)=>{"use strict";r.d(t,{BasketProvider:()=>w,M:()=>A});var n=r(95155),i=r(12115),a=r(69432),o=r(73321),s=r(11581),c=r(7182),l=r(68846);function u(e){return null!=e&&"success"in e&&!1===e.success}var d=r(52047),m=r(83101),p=r(41070),g=r(13083),f=r(22175);let h=e=>({rxProducts:e.products.rx.filter(e=>e.isRx&&!e.isGreenRx).length,coolStorageProducts:e.products.otc.filter(e=>e.isCoolStorage).length});var x=r(9339);let v=(0,x.createServerReference)("009c8e19fea76c5da4b9a97413f6ed692cf2b14515",x.callServer,void 0,x.findSourceMapURL,"challengeRxAccess"),b=(0,x.createServerReference)("00046ccfa7fbec315f4e8521814a1b5660164b4263",x.callServer,void 0,x.findSourceMapURL,"removeOrderCookie");var k=r(54921);let S=(0,x.createServerReference)("40006361a1c11709b947e768716e5151bd0d9c7c59",x.callServer,void 0,x.findSourceMapURL,"initializeBasket");var I=r(85329),C=r(62950),D=r(28236),y=r(26388),j=r(25360),P=r(96990),_=r(80562);let R=(0,i.createContext)({basket:null,isLoading:!1,addToBasket:()=>Promise.reject(Error("addToBasket not implemented")),changeBasketLineQuantity:()=>Promise.reject(Error("changeBasketLineQuantity not implemented")),handleRemoveFromBasket:()=>Promise.reject(Error("handleRemoveFromBasket not implemented")),clearLastModifiedItem:()=>{},lastModifiedItem:null,freeGiftJustAdded:!1,updateBasket:()=>{}}),w=({children:e,...t})=>{let[r,x]=(0,i.useState)(null),[w,A]=(0,i.useState)(null),[N,T]=(0,i.useState)(!t.basket.orderId),[M,E]=(0,i.useState)(t.basket),L=(e=>{let[t,r]=(0,i.useTransition)(),[n,a]=(0,i.useState)(null),{isMobileApp:s}=(0,C.NC)(),u=(0,k.useSession)(),m=(0,o.usePathname)(),p=(0,i.useRef)(!1),g=e?.orderId??0,f=e?.user?.userId??0,h=e?.user?.isGuest??!1,x=u.data?.user?.id??0;if((0,i.useEffect)(()=>{if(m===c.q.signout()||g>0&&f===x||p.current)return;let e=[];g||!h||s||(e=(0,d.KV)()??[]),p.current=!0,r(async()=>{try{let[t,r]=await S(e);r&&(console.error(`${l.u2.basket}:`,r.message),a(new I.VM(r.name)))}catch(e){console.error("Unexpected error initializing basket:",e),a(new I.VM(l.u2.somethingWentWrongMessage))}finally{p.current=!1}})},[m,g,f,h,x,s]),(0,i.useEffect)(()=>{e?.user?.isGuest||(0,d.nz)()},[e?.user?.isGuest]),n)throw n;return t})(M),B=(e=>{let[t,r]=(0,i.useTransition)(),n=(0,o.usePathname)(),a=(0,i.useMemo)(()=>n?.startsWith(c.q.basket())||n?.endsWith(c.q.basket()),[n]),s=(0,i.useMemo)(()=>n?.includes(c.q.checkout.root()),[n]);return(0,i.useEffect)(()=>{(s||a)&&e?.orderId&&e.products.rx.filter(e=>!e.isGreenRx).length>0&&r(()=>{(async()=>{try{let[,e]=await v();e&&(console.error("RX Access Challenge Failed",e),await b())}catch(e){console.error("Error with RX Access Challenge: ",e)}})()})},[a,s]),t})(M),q=(e=>{let[t,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let n=e?.lines?.find(e=>e.product.packageId.toString()===t?.productId?.toString()&&e.prescriptionId===t?.prescriptionId),i=n?.product?.attributes.isRx?e.products.rx.find(e=>e.itemId===n?.itemId):e.products.otc.find(e=>e.itemId===n?.itemId);i&&r({...i,action:t?.action,prescriptionId:t?.prescriptionId,optimistic:!1})},[e]),{value:t,setValue:t=>{let n=e?.lines?.find(e=>e.product.packageId.toString()===t?.productId?.toString()&&e.prescriptionId===t?.prescriptionId),i=n?.product?.attributes.isRx?e.products.rx.find(e=>e.itemId===n?.itemId):e.products.otc.find(e=>e.itemId===n?.itemId);i?r({...i,action:t.action,prescriptionId:t.prescriptionId,optimistic:!0,quantity:"add"===t.action?n.quantity+1:t?.quantity}):r(t)},clear:()=>r(null)}})(M),V=((e,t)=>{let[r,n]=(0,i.useState)(!1),[a,o]=(0,i.useState)(e?.products.otc.filter(e=>e.isFreeGift).length);return(0,i.useEffect)(()=>{(!t||t?.productId&&t?.action==="add"&&t?.optimistic)&&n(!1)},[t?.productId]),(0,i.useEffect)(()=>{let t=e.products?.otc.filter(e=>e.isFreeGift).length??0;t!==a&&(n(!0),o(t))},[e.itemCount]),r})(M,q.value);(e=>{let{isMobileApp:t,sendNativeEvent:r}=(0,g.useMobileApp)(),n=(0,i.useRef)(null);(0,i.useEffect)(()=>{t&&n.current!==e&&(n.current=e,r({type:"basketItemCount",count:e}))},[t,e,r])})(M.itemCount),(0,i.useEffect)(()=>{E(t.basket),t.basket.orderId&&T(!1)},[t.basket]),(({basket:e})=>{let{openInformationModal:t,setModalType:r,isCoolStorageVoucherEnabled:n,isCprRepresentativeVoucherEnabled:a}=(0,f.U)(),o=(0,i.useRef)(null),s=(0,i.useCallback)(e=>{r(e),t()},[r,t]),c=(0,i.useMemo)(()=>e?h(e):{rxProducts:0,coolStorageProducts:0},[e]),l=(0,i.useCallback)((t,r,i,o)=>{let c=r.rxProducts+r.coolStorageProducts,l=i.rxProducts+i.coolStorageProducts;if(!(o&&0===c&&1===l))return!1;let u=0===r.rxProducts&&1===i.rxProducts,d=0===r.coolStorageProducts&&1===i.coolStorageProducts;return u&&t&&a?(s("cprRepresentative"),!0):!!(d&&n||u&&!t&&n&&e.products.rx.find(e=>e.isRx&&!e.isGreenRx&&e.isCoolStorage))&&(s("coolStorage"),!0)},[s,a,n,e]);(0,i.useEffect)(()=>
1{if(!e)return;let t=o.current;l(e.user.hasCprOfRepresentative,t?h(t):{rxProducts:0,coolStorageProducts:0},c,t),o.current=e},[e,c,l]),(0,i.useEffect)(()=>{e?.orderId||(o.current=null)},[e?.orderId])})({basket:M});let O=(e,t)=>{q.clear(),x({text:e,link:t,onClose:()=>{x(null)},isOpen:!0})},F=(e,t)=>{q.clear(),A({notification:e,prescriptionId:t??0})},{addToBasket:W}=(({onBasketContentChange:e,onError:t,onLoadingChange:r,onOptimisticLastModifiedItemChange:n,onPrescriptionDisclaimer:m})=>{let p=(0,o.useRouter)(),g=(0,a.V)(),f=(0,o.usePathname)(),h=(0,i.useMemo)(()=>f?.startsWith(c.q.basket()),[f]),x=(0,i.useCallback)(()=>{h&&document.querySelector(`#${l.u2.basket}`)?.scrollIntoView({behavior:"smooth"}),requestAnimationFrame(()=>{p.refresh()})},[h,p]);return{addToBasket:async(i,a,o)=>{r(!0),n({...o??{},productId:i,prescriptionId:a??null,optimistic:!0,quantity:1,action:"add"});try{let r=performance.now(),n=await fetch(s.x.basket.add,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({productId:i,prescriptionId:a})}),o=performance.now();if(g){let e={productId:i.toString(),isRx:!!a};g.trackMetric({average:o-r,name:"nextjs_add_to_basket_browser_processing_time",sampleCount:1},e)}let c=null;try{c=await n.json()}catch{t(l.u2.somethingWentWrongMessage);return}if(u(c)){if(c.notification&&m)return void m(c.notification,a);t(c.error,c.helpLink);return}n.ok?(e(c.basket),(0,d.Df)(c.basket),x()):t(l.u2.somethingWentWrongMessage)}catch(e){console.error(e),t(l.u2.somethingWentWrongMessage)}finally{r(!1)}}}})({onBasketContentChange:E,onError:O,onLoadingChange:T,onOptimisticLastModifiedItemChange:q.setValue,onPrescriptionDisclaimer:F}),{changeBasketLineQuantity:G}=(({basket:e,onBasketContentChange:t,onError:r,onLoadingChange:n,onOptimisticLastModifiedItemChange:a,onPrescriptionDisclaimer:c})=>{let{canTrack:m}=(0,P.D)(),{serverTracking:p}=(0,j.U)(),{dataLayer:g}=(0,y.i)(),f=(0,o.useRouter)(),h=(0,i.useCallback)(()=>{requestAnimationFrame(()=>{f.refresh()})},[f]);return{changeBasketLineQuantity:async(i,o)=>{n(!0);let f=e.lines.find(e=>e.itemId===i);if(!f)return void r(l.u2.somethingWentWrongMessage);let x=e.lines.map(e=>e.itemId===i?{...e,quantity:o}:e),v=e.products.otc.map(e=>e.itemId===i?{...e,quantity:o}:e),b=e.products.rx.map(e=>e.itemId===i?{...e,quantity:o}:e);t({...e,lines:x,products:{otc:v,rx:b},itemCount:x.reduce((e,t)=>e+t.quantity,0)}),a({action:"update",productId:f.product.packageId,prescriptionId:f.prescriptionId??null,optimistic:!0,quantity:o});let k=f.product.attributes.isRx?e.products.rx.find(e=>e.itemId===i):e.products.otc.find(e=>e.itemId===i),S=f.quantity>o?"remove_from_cart":"add_to_cart";try{let n=await fetch(s.x.basket.quantity,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orderItemId:i,quantity:o,tracedPackageId:f.product.packageId,isRx:f.product.attributes.isRx&&!f.product.attributes.isGreenRx})}),a=null;try{a=await n.json()}catch{r(l.u2.somethingWentWrongMessage);return}if(!n.ok){let n=u(a)?a?.error:l.u2.somethingWentWrongMessage;t(e),r(n);return}if(n.ok){if(!1===a.success){if(t(e),a.notification&&c)return void c(a.notification,f.prescriptionId??void 0);r(a.error);return}t(a.basket),(0,d.Df)(a.basket),h();let n=await (0,D.D)(k,Math.abs(f.quantity-o),S);g.pushEvents(n),m({isSensitive:k.disableTracking})&&p.pushItemChangedEvent()}}catch{t(e),r(l.u2.somethingWentWrongMessage)}finally{n(!1)}}}})({basket:M,onBasketContentChange:E,onError:O,onLoadingChange:T,onOptimisticLastModifiedItemChange:q.setValue,onPrescriptionDisclaimer:F}),{handleRemoveFromBasket:U}=(({basket:e,onBasketContentChange:t,onError:r,onLoadingChange:n})=>{let{canTrack:a}=(0,P.D)(),{serverTracking:s}=(0,j.U)(),{dataLayer:c}=(0,y.i)(),u=(0,o.useRouter)(),m=(0,i.useCallback)(()=>{requestAnimationFrame(()=>{u.refresh()})},[u]);return{handleRemoveFromBasket:async i=>{n(!0);let o=e.lines.find(e=>e.itemId===i);if(!o)return void r(l.u2.somethingWentWrongMessage);let u=o.product.attributes.isRx?e.products.rx.find(e=>e.itemId===i):e.products.otc.find(e=>e.itemId===i);try{let[,n]=await (0,_.h)(i);if(n)return void r(n.message);let l=e.lines.filter(e=>e.itemId!==i),p=e.products.otc.filter(e=>e.itemId!==i),g=e.products.rx.filter(e=>e.itemId!==i),f={...e,lines:l,products:{otc:p,rx:g},itemCount:l.reduce((e,t)=>
1e+t.quantity,0)};if(t(f),(0,d.Df)(f),m(),u&&!u.isRx){let e=await (0,D.D)(u,o.quantity,"remove_from_cart");c.pushEvents(e),a({isSensitive:u.disableTracking})&&s.pushItemChangedEvent()}}catch(e){console.error("Error removing from basket:",e),r(l.u2.somethingWentWrongMessage)}finally{n(!1)}}}})({basket:M,onBasketContentChange:E,onError:O,onLoadingChange:T,onOptimisticLastModifiedItemChange:q.setValue});return(0,n.jsxs)(R.Provider,{value:{basket:M,isLoading:N||L||B||!M.orderId,addToBasket:W,changeBasketLineQuantity:G,handleRemoveFromBasket:U,lastModifiedItem:q.value,freeGiftJustAdded:V,clearLastModifiedItem:q.clear,updateBasket:E},children:[e,r&&(0,n.jsx)(m.x,{...r}),w&&(0,n.jsx)(p.i,{isOpen:!0,notification:w.notification,onClose:()=>{A(null)},prescriptionId:w.prescriptionId})]})},A=()=>{let e=(0,i.useContext)(R);if(!e)throw Error("useBasket must be used within a BasketProvider");return e}},52047:(e,t,r)=>{"use strict";r.d(t,{nz:()=>s,KV:()=>o,Df:()=>c});let n="apo_persistent_basket",i=()=>{try{let e=localStorage.getItem(n);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.createdAt>2592e5)return localStorage.removeItem(n),null;return t}catch{return localStorage.removeItem(n),null}},a=e=>{localStorage.setItem(n,JSON.stringify(e))},o=()=>{let e=i();return e&&0!==e.items.length?e.items:null},s=()=>{console.log("Clearing persistent basket"),localStorage.removeItem(n)},c=e=>{var t;if(!e)return;if(!e.user.isGuest)return void s();let r=i(),n=(t=e.lines)?t.filter(e=>!e.product.attributes.isRx&&!e.product.attributes.isGreenRx).map(e=>({packageId:e.product.packageId,quantity:e.quantity})):[];if(0===n.length)return void s();if(r){let e;(e=i())&&a({items:n,createdAt:e.createdAt,updatedAt:Date.now()})}else{let e;null!==(e=i())?console.log("Persistent basket already exists, skipping initialization"):(console.log("Initializing persistent basket"),a({items:n??[],createdAt:e?.createdAt??Date.now(),updatedAt:Date.now()}))}}},62879:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(95155),i=r(40093),a=r(29722),o=r(64826);let s=({children:e,testId:t,withPrimitiveArrow:r=!0,className:s,side:c="top",sideOffset:l=5,ariaLabel:u})=>(0,n.jsx)(i.ZL,{...(0,o.Mm)({testId:t},"popover"),children:(0,n.jsxs)(i.UC,{"aria-label":u,className:(0,a.A)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","w-[300px] rounded-bl-sm rounded-tr-sm bg-sand-light p-5 shadow-[0_2px_8px_0px_hsla(206,22%,7%,.33),0_10px_20px_-15px_hsla(206,22%,7%,.2)] will-change-[transform,opacity] md:w-[300px]","z-dialog",s),side:c,sideOffset:l,children:[r&&(0,n.jsx)(i.i3,{className:"fill-sand-light"}),e]})})},68160:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(96158),i=r(7182),a=r(28641);let o=(e,t,r=!1)=>{if(!e||!e.linkVariant)return null;let{label:o,linkVariant:c,mobileLabel:l,url:u,remainingUrl:d,reference:m,openInNewTab:p,allowNoFollow:g=!1,modalLinkContent:f,anchor:h,authCallback:x,authType:v,authVariant:b,prescriptionDestination:k}=e,S="referenceLink"===c&&m,I=S?(e=>{switch(e._type){case a.jj.Home:return i.q.home();case a.jj.Contact:return i.q.contact();case a.jj.AppPageDocument:return i.q.app();case a.jj.SideEffectsPageDocument:return i.q.sideEffects();case a.jj.Article:return i.q.article.bySlug(e.slug);case a.jj.ArticleFrontpage:return i.q.articles.all();case a.jj.PlpBrands:return i.q.products.byBrand(e.slug);case a.jj.PlpCategory:return i.q.products.byCategory(e.slug)}})(m):u;if(S&&d&&(I+=d),h?.slug&&(I+=`#${h.slug}`),"mitId"===e.linkVariant&&(I=i.q.mitIdLogin(i.q.profile.prescriptions())),"prescription"===e.linkVariant){let e="rxLanding"===(k??"rxLanding")?i.q.rx.landing():i.q.mitIdLogin(i.q.handleLogin(i.q.profile.prescriptions()));I=r?i.q.profile.prescriptions():e}"dixaChat"===e.linkVariant&&(I=n.A.openHash),("appStore"===e.linkVariant||"googlePlay"===e.linkVariant)&&(I=u);let C="appStore"===e.linkVariant||"googlePlay"===e.linkVariant||!S&&p,D=e?.voucherReference?._id;return{linkVariant:e.linkVariant,label:o,mobileLabel:l,newTab:C,url:I,rel:s(C,g),voucherId:D,modalLinkContent:f,tracking:t,authCallback:x,authType:v,authVariant:b,prescriptionDestination:k}},s=(e,t)=>t&&e?"noopener noreferrer nofollow":t?"nofollow":e?"noreferrer noopener":void 0},74188:(e,t,r)=>{"use strict";r.d(t,{BasketContextProvider:()=>o,D:()=>s});var n=r(95155),i=r(12115);let a=(0,i.createContext)({loading:!1,setLoading:()=>{}}),o=({children:e})=>{let[t,r]=(0,i.useState)(!1);return(0,n.jsx)(a.Provider,{value:{loading:t,setLoading:r},children:e})},s=()=>(0,i.useContext)(a)},80562:(e,t,r)=>{"use strict";r.d(t,{h:()=>i});var n=r(9339);let i=(0,n.createServerReference)("401a8155580c5905c4f1d018ebb0c1b383e8b4d371",n.callServer,void 0,n.findSourceMapURL,"removeFromBasket")},83101:(e,t,r)=>{"use strict";r.d(t,{x:()=>n.x});var n=r(44991)},96158:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n={scriptUrl:"https://messenger.dixa.io/bootstrap.js",openHash:"#dixa-open"}},99695:(e,t,r)=>{"use strict";r.d(t,{Lg:()=>
1a,RT:()=>i,XV:()=>o});var n=r(87358);let i=s("prod","Missing environment variable: NEXT_PUBLIC_SANITY_DATASET"),a=s("o8efc249","Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID");n.env.SANITY_API_READ_TOKEN;let o="v2025-03-04";function s(e,t){if(void 0===e)throw Error(t);return e}}}]);
2//# sourceMappingURL=3524-369f583d9a7ecab3.js.map

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.