PageSourceSearch

https://www.philips.hu/c-e/shop/checkout/assets/index-DSlA2-3H.js

js philips.hu collected 2026-09-24 22:21:08 UTC 410,617 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["c-e/shop/checkout/assets/recommendation.index-HpBP6c2g.js","c-e/shop/checkout/assets/vendor-CV6ISSGl.js","c-e/shop/checkout/assets/DigitalWalletGoogle-Bwtxsm7b.js","c-e/shop/checkout/assets/adyen-2xVWhjfd.js","c-e/shop/checkout/assets/adyen-DQkrazhu.css","c-e/shop/checkout/assets/walletHelpers-0QzXyuIl.js","c-e/shop/checkout/assets/walletHelpers-iOZ_eUBO.css","c-e/shop/checkout/assets/DigitalWalletGoogle-CsxxlWyr.css","c-e/shop/checkout/assets/DigitalWalletApple-A4gukn_L.js","c-e/shop/checkout/assets/DigitalWalletApple-L7_VyPiy.css","c-e/shop/checkout/assets/CustomCard-jNjX-aFM.js","c-e/shop/checkout/assets/CustomCard-BzwoGgzb.css","c-e/shop/checkout/assets/Ideal-BJBUp5p1.js","c-e/shop/checkout/assets/Ideal-BBlywMg3.css","c-e/shop/checkout/assets/OnlineBanking-C1gcCZYy.js","c-e/shop/checkout/assets/Vipps-DBNDfy--.js","c-e/shop/checkout/assets/Blik-DohcEqax.js","c-e/shop/checkout/assets/PayU-DGYrgByL.js","c-e/shop/checkout/assets/PayU-BaZtijhn.css","c-e/shop/checkout/assets/MBWayPayment-DgED1TTu.js","c-e/shop/checkout/assets/MBWayPayment-BNvVj59k.css","c-e/shop/checkout/assets/ProductSupportSection-5oBcqO43.js","c-e/shop/checkout/assets/ProductSupportSection-CATtLv4O.css"])))=>i.map(i=>d[i]);
2import{a as e,b as t,m as i,d as r,o,e as a,w as n,f as l,t as c,n as d,r as u,h as p,i as m,j as h,k as g,l as y,u as v,p as f,q as b,s as C,v as k,x as _,y as I,z as P,A,B as w,F as S,C as x,D as E,E as T,G as D,H as O,I as L,J as M,K as B,L as $,M as V,N,O as R,P as F,Q as U,R as q,T as H,S as j,U as G,V as W,W as z,X as Q,Y as K,Z as J,_ as Y,$ as Z,a0 as X,a1 as ee,a2 as te}from"./vendor-CV6ISSGl.js";import{_ as ie}from"./adyen-2xVWhjfd.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const i of e)if("childList"===i.type)for(const e of i.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const re="",oe="; path=/",se="",ae="";const ne={getCookie(e,t=!1){let i=decodeURIComponent(document.cookie.replace(new RegExp(`(?:(?:^|.*;)\\s*${encodeURIComponent(e).replaceAll(/[*+.-]/g,"\\$&")}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1"))||null;if(t&&(i=atob(i)),i&&"{"===i.slice(0,1)&&"}"===i.substring(i.length-1,i.length))try{i=JSON.parse(i)}catch{return i}return i},setCookie({key:e,value:t,expireTimes:i,path:r,domain:o,secure:s,encoded:a=!1}){if(!e)throw new Error("cookie name is not find in first argument");if(/^(?:expires|max-age|path|domain|secure)$/i.test(e))throw new Error("cookie key name illegality");t&&t.constructor===Object&&(t=JSON.stringify(t));const n=function(e=re){let t="";switch(e?.constructor){case Number:t=`; max-age=${e}`;break;case String:if(t=`; expires=${e}`,/^\d+(y|m|d|h|min|s)$/i.test(e)){const i=e.replace(/^(\d+)(?:y|m|d|h|min|s)$/i,"$1"),r={m:2592e3,d:86400,h:3600,min:60,s:1,y:31104e3},o=e.replace(/^\d+(y|m|d|h|min|s)$/i,"$1").toLowerCase();t=o?"; max-age="+Number(i)*r[o]:t}break;case Date:t=`; expires=${e.toUTCString()}`}return t}(i),l=o?`; domain=${o}`:se,c=r?`; path=${r}`:oe;let d="";return void 0===s?d=ae:s&&(d="; secure"),a&&(t=btoa(t)),document.cookie=`${encodeURIComponent(e)}=${encodeURIComponent(t)}${n}${l}${c}${d}`,this},removeCookie({key:e,path:t,domain:i}){this.setCookie({key:e,value:"",expireTimes:-1,path:t,domain:i})},getLocalStorage:e=>"undefined"!=typeof localStorage?localStorage.getItem(e):null};var le="30dzj0ILR8844kuS1W3OG30N56VRWEdQ11oMjryR",ce="KtHUo5P9bJ6Wqw6aogBCV4QvszofWiH09sxVFtBc";const de={Accept:"application/json"},ue={},pe=e.create({timeout:3e4});let me=!1,he=[];function ge(){return ui.getters["config/getDefaultConfig"]("endpoint")}function ye(){return ui.getters["config/getDefaultConfig"]("validationEndpoint")}function ve(e,t){if(ue.country=e("country"),ue.siteId=e("siteId"),ue.language=e("language"),t.url.includes("validation-service/address")){const e=ui.getters["delivery/isOptionalValidationFlag"];ue.isOptionalValidations=e}return ue}function fe(e="get"){return function(...t){return be(),pe[e].apply(this,[...t])}}async function be(){await async function(){const e=ne.getCookie("shop-health");if(null!==e)return"true"===e?Promise.resolve():Promise.reject();const{data:{status:t,outOfService:i}={status:"",outOfService:[]}}=await pe.get(`${ui.getters["config/getDefaultConfig"]("endpoint")}/health`).catch(e=>{throw ke(!1),function(e){const{response:{status:t,data:{status:i="",failureType:r=""}}={status:"",data:{}}}=e;503===t&&"FAIL"===i&&"MAINTENANCE"===r&&(console.log("Health check failed with maintenance status. Redirecting to maintenance page.",ui.getters["config/checkoutMaintPage"]||"/"),window.location.href=ui.getters["config/checkoutMaintPage"]||"/")}(e),e}),r=ui.getters["config/getDefaultConfig"];if(i?.length>0)for(const o of i){if(Object.prototype.hasOwnProperty.call(o,r("siteId"))){Ce(o[r("siteId")],r("language"))}}return ke("PASS"===t),"PASS"===t?Promise.resolve():Promise.reject()}().catch(()=>{ui.dispatch("notification/updateErrorNotifications",{text:"cartoverview.maintenance-text",isI18n:!0,isMaintenance:!0},{root:!0})})}function Ce(e,t){if(e&&e.length>0)for(const i of e)i.language===t&&(ke(!1),window.location.href=ui.getters["config/checkoutMaintPage"]||"/")}function ke(e=!1){ne.setCookie({key:"shop-health",value:e,expireTimes:new Date(Date.now()+3e5)})}pe.interceptors.request.use(function(e){const t=ui.getters["config/getDefaultConfig"];if((ui.getters["config/getAccessToken"]||e.url===`${ui.getters["config/getDefaultConfig"]("endpoint")}/config`||`${ui.getters["config/getDefaultConfig"]("endpoint")}/health`)&&(ui.getters["config/getAccessToken"]&&(de.Authorization=`Bearer ${ui.getters["config/getAccessToken"]}`),e.url.includes("profiles/oidc/userinfo")?(de.Authorization=`Bearer ${ui.getters["config/getUDIAccessToken"]}`,de["Api-Key"]&&delete de["Api-Key"],de["Api-Version"]&&delete de["Api-Version"]):(de["Api-Key"]=le,de["Api-Version"]=t("apiVersion")),(e.url.includes("recommendationengine.googleapis.com")||e.url.includes("api.heureka.cz"))&&(delete de["Api-Key"],delete de["Api-Version"],delete de.Authorization),e.url.includes("consumerIdentityService/users")&&(de.Authorization=`Bearer ${ui.getters["config/getUDIAccessToken"]}`),(e.url.includes("validation-service/address")||e.url.includes("validation-service/locations")||e.url.includes("validation-service/geoLocations"))&&(de["Api-Version"]="2"),e.url.includes("config/collectionPoints")&&(de["Api-Version"]="1.1"),e.url.includes("consumerConsentService"))){const e=ui.getters["config/getDefaultConfig"]("pilApiConfig");de["Api-Key"]=ce,de["Api-Version"]=e?.consumerConsentService?.apiVersion}e.url===`${ui.getters["config/getDefaultConfig"]("endpoint")}/health`||e.url.includes("prx")||e.url.includes("recommendationengine.googleapis.com")||(e.params={...ve(t,e),...e.params});e.url.includes("geoLocations")&&delete e.params.siteId;return e.headers={...de,...e.headers},e}),pe.interceptors.response.use(function(e){return e},function(t){if(e.isCancel(t))return Promise.reject(t);const i=t.config.url;if(i.includes("prx")||i.includes("token")||i.includes("health")||i.includes("heureka")||i.includes("consumerConsentService"))return Promise.reject(t);const r=t.config,o=t.response?.status||{},s=r,a=s.params,n=!1===a.retry?a.retry=!1:a.retry=!0;if((401===o||403===o)&&n)return me||(me=!0,ui.dispatch("config/getAccessToken",!0).then(()=>{me=!1,he.map(e=>e()),he=[]}).catch(e=>{throw console.error(e),t})),new Promise(e=>{var t;t=()=>{s.params.retry=!1,ui.getters["config/getAccessToken"]&&(s.headers.Authorization=`Bearer ${ui.getters["config/getAccessToken"]}`),e(pe(s))},he.push(t)});return Promise.reject(t)});const _e={get:fe("get"),post:fe("post"),put:fe("put"),patch:fe("patch"),delete:fe("delete"),maintenanceHealthAPICheck:be,$http:pe},Ie={getShopProductDetails:(e,t)=>_e.get(`${ge()}/product/${e}`,{params:t||{}}),getCartDetails:(e,t,{signal:i}={})=>_e.get(`${ge()}/cart/${e}`,{params:t||{},signal:i}),updateCartItem:({cartId:e,itemId:t,items:i,params:r})=>_e.put(`${ge()}/cart/${e}/${t}`,i,{params:r||{}}),removeBCBSBundle:({cartId:e,itemId:t,items:i})=>_e.put(`${ge()}/cart/${e}/${t}?type=SUBSCRIPTION&quantity=0&subscriptionBundlePartner=SHOP_BCBS`,i),getSellerInfo:e=>_e.get(`${ge()}/seller`,{params:{sellerId:e.sellerId}}),addCartItem:(e,t)=>
2_e.post(`${ge()}/cart/${e}`,{},{params:t||{}}),updateVoucherCode:(e,t,i)=>"remove"===i?_e.delete(`${ge()}/cart/${t}/vouchers/${e}`):_e.post(`${ge()}/cart/${t}/vouchers`,{voucherId:e}),getEstimatedTax:(e,t)=>_e.post(`${ge()}/cart/${e}/estimateTax`,{},{params:t||{}}),updateTaxRelief:(e,t,i={})=>_e.post(`${ge()}/cart/${e}/updateTaxRelief`,{data:t},i),getAddresses:()=>_e.get(`${ge()}/addresses`),getPromotions:(e,t)=>_e.get(`/promotions/B2C/${e}/${t}/listpromotedproducts.v1.cat.().subcat.().ctn.().linkurl().json`),getProductDetails:({ctn:e,sectorId:t,localeId:i,catalogId:r},o)=>_e.$http.get(`/prx/product/${t}/${i}/${r}/listproducts?ctnlist=${e}`,{params:o||{}}),getRecentlyViewedProducts:({ctnList:e,sectorId:t,localeId:i,catalogId:r},o)=>_e.$http.get(`/prx/product/${t}/${i}/${r}/recentlyviewed.ctnlist.(${e}).currentctn.("")`,{params:o||{}}),getBuddyRecommendedProducts:({ctnValue:e})=>_e.$http.get(`https://cart-rec-fgxqjyskta-ew.a.run.app/cart-rec?productCtn=${e}`),getSupportProductDetails:({ctn:e,localeId:t})=>_e.$http.get(`/prx/product/B2C/${t}/CONSUMER/products/${e}.marketing`)};const Pe=[{url:"philips.at",locale:"de_at",currency:"EUR",dir:"ltr"},{url:"philips.com.au",locale:"en_au",currency:"AUD",dir:"ltr"},{url:"philips.be",locale:"nl_be",currency:"EUR",dir:"ltr"},{url:"philips.be/fr",locale:"fr_be",currency:"EUR",dir:"ltr"},{url:"philips.ca",locale:"en_ca",currency:"CAD",dir:"ltr"},{url:"philips.ca/fr",locale:"fr_ca",currency:"CAD",dir:"ltr"},{url:"philips.ch",locale:"de_ch",currency:"CHF",dir:"ltr"},{url:"philips.ch/fr",locale:"fr_ch",currency:"CHF",dir:"ltr"},{url:"philips.cz",locale:"cs_cz",currency:"CZK",dir:"ltr"},{url:"philips.de",locale:"de_de",currency:"EUR",dir:"ltr"},{url:"philips.dk",locale:"da_dk",currency:"DKK",dir:"ltr"},{url:"philips.es",locale:"es_es",currency:"EUR",dir:"ltr"},{url:"philips.fi",locale:"fi_fi",currency:"EUR",dir:"ltr"},{url:"philips.fr",locale:"fr_fr",currency:"EUR",dir:"ltr"},{url:"philips.co.uk",locale:"en_gb",currency:"GBP",dir:"ltr"},{url:"philips.hu",locale:"hu_hu",currency:"HUF",dir:"ltr"},{url:"philips.it",locale:"it_it",currency:"EUR",dir:"ltr"},{url:"philips.nl",locale:"nl_nl",currency:"EUR",dir:"ltr"},{url:"philips.no",locale:"no_no",currency:"NOK",dir:"ltr"},{url:"philips.pl",locale:"pl_pl",currency:"PLN",dir:"ltr"},{url:"philips.pt",locale:"pt_pt",currency:"EUR",dir:"ltr"},{url:"philips.ro",locale:"ro_ro",currency:"RON",dir:"ltr"},{url:"philips.com.sg",locale:"en_sg",currency:"SGD",dir:"ltr"},{url:"philips.se",locale:"sv_se",currency:"SEK",dir:"ltr"},{url:"philips.com.tr",locale:"tr_tr",currency:"TRY",dir:"ltr"},{url:"philips.ua",locale:"uk_ua",currency:"UAH",dir:"ltr"},{url:"philips.ua/ru",locale:"ru_ua",currency:"UAH",dir:"ltr"},{url:"usa.philips.com",locale:"en_us",currency:"USD",dir:"ltr"}],Ae="en_gb",we={SUCCESS:"SUCCESS",FAILURE:"FAILURE"},Se={VERIFICATION:"VERIFICATION",PO_BOX:"PO_BOX",MILITARY:"MILITARY",PO_BOX_CITY:"PO_BOX_CITY",OVERLAY:"OVERLAY",DELIVERY:"DELIVERY",BILLING:"BILLING"},xe={[Se.VERIFICATION]:"cartoverview.google-pay-region-unserviceable-error-message",[Se.MILITARY]:"cartoverview.military-address-error",[Se.DELIVERY]:"cartoverview.shipping-address-error",[Se.BILLING]:"cartoverview.billing-address-error"},Ee={REFUSED:{message:"checkoutoverview.inline-payment-submit-order-refused",code:9050},CANCEL:{message:"checkoutoverview.inline-payment-submit-order-canceled",code:9051},CANCELED:{message:"checkoutoverview.inline-payment-submit-order-canceled",code:9051},CANCELLED:{message:"checkoutoverview.inline-payment-submit-order-canceled",code:9051},FAILURE:{message:"checkoutoverview.inline-payment-submit-order-error",code:9052},ERROR:{message:"checkoutoverview.inline-payment-submit-order-error",code:9052}},Te={STEP_CHECKOUT_OVERVIEW:"details",STEP_ORDER_OVERVIEW:"orderOverview"},De=new Set(Object.keys(Ee).map(e=>e.toLowerCase()));function Oe({commerceAddresses:e,commit:t,rootState:i,dispatch:r,vm:o}){const s=e.filter(e=>e.deliveryAddress&&!e.isCollectionPoint),a=e.filter(e=>e.billingAddress&&!e.isCollectionPoint),n=i.cart.deliveryMode.isCollectionPoint?"billing":"delivery";if(t("delivery/updateCommerceAddresses",e,{root:!0}),t("delivery/updateDeliveryCommerceAddresses",s,{root:!0}
2),t("delivery/updateBillingCommerceAddresses",a,{root:!0}),!De.has(i.payments.paymentStatus?.toLowerCase()))if(1===s.length&&"delivery"===n){const e=Le(s[0]);e.taxNumber&&""!==e?.taxNumber?(t("delivery/updateReceiptOrEInvoice",!0),t("delivery/updateSameAsDelivery",!1)):t("delivery/updateSameAsDelivery",i.delivery.sameAsDelivery,{root:!0}),t("delivery/updateSelectedCommerceDeliveryAddress",e,{root:!0}),t("delivery/updateDeliveryAddress",e,{root:!0}),function({address:e,rootState:t,commit:i,dispatch:r,vm:o}){const s=new Set(["billingAddress","defaultAddress","deliveryAddress","isCollectionPoint","formattedAddress","isoCode","id"]),a=[];if(e.deliveryAddress)for(const n of t.delivery.deliveryFormConfiguration)a.push(n.name);else for(const n of t.delivery.billingFormConfiguration)a.push(n.name);for(const[n]of Object.entries(e))a.includes(n)||!e[n]||s.has(n)||(r("notification/updateErrorNotifications",{text:`${o.i18n("checkoutoverview.addressfields.mismatch-notification")} (9010)`,type:"warning"},{root:!0}),i("delivery/updateIsDeliveryAddressMismatch",!0,{root:!0}))}({rootState:i,commit:t,dispatch:r,vm:o})}else("delivery"===n&&s.length>1||"billing"===n&&a.length>0)&&r("delivery/updateAddressOverlayStatus",{isVisible:!0,type:n},{root:!0})}function Le(e,t=""){const i=JSON.parse(JSON.stringify(e));return i.region=i.region?.isocode||"","string"==typeof i.country||(i.isoCode=i.country?.isocode||"",i.country="dropdown"===t||"selectBox"===t?i.country?.isocode||"":i.country?.name||""),i}function Me(e,t,i){const r=i.length>0&&i.filter(function(t){return t.id===e});let o=!1;if(r.length>0)for(const s of r)JSON.stringify(s.items)===JSON.stringify(t)&&(o=!0);return o}function Be(e,t,i){if(e.bundle.length>0)for(const r of e.bundle)JSON.stringify(r.itemCartOrders)===JSON.stringify(t)&&(r.bundleQuantity++,r.itemQuantity=i?r.itemQuantity+2:r.itemQuantity+1)}function $e(e,t,i){i.push({id:e,items:t})}function Ve(e,t){const i=t.find(function(t){return Number.parseInt(t.id,10)===e});return i.price?i.price.value:i.discountPrice.value}function Ne(e,t){const i=t.find(function(t){return Number.parseInt(t.id,10)===e});return i.discountPrice?i.discountPrice.value:i.price.value}function Re(e,t,i,r,o){const s=[];if(r)s.push(t);else{const t=e.find(e=>e!==Number.parseInt(i,10)),r=o.find(function(e){return Number.parseInt(e.id,10)===t});s.push(r.itemId)}return s}function Fe(e,t){return e.reduce((e,t)=>e.concat(t),[]).filter(e=>JSON.stringify(e.consumedItems)===t).length}async function Ue(e,t){const i=[];for(const r of e)for(const e of r.catalogs)"SHOPPUB"!==e.catalogId||"NORMAL"!==e.status&&"NEW"!==e.status&&"DELETED"===e.status||i.push(r);if(i.length>0){(e=(await Promise.all(i.map(e=>"{}"!==JSON.stringify(e)?function(e){const t=[];return new Promise(i=>{Ie.getShopProductDetails(qe(e.ctn)).then(r=>{const o=je(e,r);o&&(t.push(o),i(t)),i([])}).catch(()=>{i([])})})}(e):{}))).filter(e=>e.length>0)).sort((e,t)=>i.indexOf(e)-i.indexOf(t));for(const i of e)t("updateCoveoRecommendedProducts",i[0])}}function qe(e=""){return e.replace("/","_")}function He(e,t){return new Promise(i=>{Ie.getShopProductDetails(qe(e.ctn)).then(r=>{const o=je(e,r);o&&t("updateRecentlyViewedProducts",o),i(o?{}:null)}).catch(()=>{i(null)})})}function je(e,t){if("OUT_OF_STOCK"===t?.data?.attributes?.availability?.status||!1===t?.data?.attributes?.soldIndividually)return null;let i=[],r=[],o=!1,s={};if(["PROMOTION_PERCENTAGE_DISCOUNT","PROMOTION_PRODUCT_FIXED_PRICE"].includes(t.data.attributes.promotions?.productPromotions?.[0]?.type)){const e=t.data.attributes.promotions.productPromotions[0];i=e.promotionPrice,o=!0,s=e,r=t.data.attributes.discountPrice.value<t.data.attributes.price.value?t.data.attributes.discountPrice:t.data.attributes.price}else t.data.attributes.discountPrice&&(i=t.data.attributes.discountPrice,r=t.data.attributes.price);return{...e,shopPrice:r,discountPrice:i,ispromotionCheck:o,activeCampaigns:t.data.attributes?.activeCampaigns||[],productPromotionData:s,atcCode:t.data.attributes.atcCode||e.ctn}}function Ge(e,t){return new Promise(i=>{const r=t["config/getDefaultConfig"],o=r("sectorId")||"B2C",s=r("localeId")||`${r("language")}_${r("country").toUpperCase()}`,a=r("catalogId")||"CARE";Ie.getProductDetails({ctn:e,sectorId:o,localeId:s,catalogId:a},null).then(e=>{i(e.data.data)}).catch(()=>i({}))})}function We(e,t,i){if(0===t.products.length&&e.length>0){const t=e.map(e=>qe(e.itemId));return Ge([...new Set(t)].toString(),i)}return async function(e,t,i){let r=[];const o=JSON.parse(JSON.stringify(i));let s=[],a=[];"{}"!==JSON.stringify(o)&&(s=e.filter(e=>0===o.filter(t=>t.ctn===e.itemId).length),a=o.filter(t=>0===e.filter(e=>t.ctn===e.itemId).length));if(a.length>0)for(const n of a){const e=o.indexOf(n);e>-1&&o.splice(e,1)}if(s.length>0){const e=s.map(e=>qe(e.itemId)),i=[...new Set(e)].toString();r=await Ge(i,t)}if(r&&r.length>0)return[...o,...r];return o}(e,i,t.products)}function ze(e,t,i,r){if(["[STOCK]","[PRODUCTID]","[ITEMID]"].includes(e?.source?.parameter?.toUpperCase())){const e=t("sectorId")||"B2C",o=t("localeId")||`${t("language")}_${t("country").toUpperCase()}`,s=t("catalogId")||"CARE";Ie.getProductDetails({ctn:r,sectorId:e,localeId:o,catalogId:s},null).then(e=>{i({outOfStockItems:e.data.data})})}}function Qe(e,t,{parameters:i,commit:r}){return["[STOCK]","[PRODUCTID]","[ITEMID]"].includes(e?.response?.data?.errors?.[0]?.source?.parameter?.toUpperCase())?(e.response.data.errors[0].ctn=i.productId,e.response.data.errors[0]):(r("updateErrorDetails",{showError:!0,errorMessageCode:t,fullErrorMessage:e},{root:!0}),e)}function Ke(e,t,i=[]){return e?.attributes?.[t]||i}function Je(e,t){const{commit:i,dispatch:r,rootState:o}=t;!function(e,t){window.checkInterval&&clearInterval(window.checkInterval),window.checkInterval=setInterval(()=>{clearInterval(window.checkInterval),alert(t.cart.alertTextToRefresh),e("getCartItems",{root:!0})},18e5)}(r,o);const s=Ke(e,"items",[]),a=Ke(e,"applicablePaymentMethods"),n=Ke(e,"applicablePaymentMethodsNew"),l=Ke(e,"deliveryMode",{}),c=Ke(e,"ageConsent",!1),d=Ke(e,"ageConsentApplied",!1),u=Ke(e,"taxExemptionEligible",!1),p=Ke(e,"isSubscriptionApplicable",!1),m=Ke(e,"existingSubscriber",!1),h=Ke(e,"pricing",{}),g=Ke(e,"pricing")?.total?.currency||"",y=Ke(e,"appliedVouchers",[]),v=Ke(e,"appliedGiftVouchers",[]),f=Ke(e,"notifications",[]),b=Ke(e,"appliedBundles",[]),C=Ke(e,"promotions",{});i("payments/updateApplicableInlinePaymentMethods",n,{root:!0}),i("cart/updateDeliveryMode",l,{root:!0}),i("consent/updateAgeConsent",c,{root:!0}),i("consent/updateAgeConsentApplied",d,{root:!0}),i("tax/updateTaxExemptionEligible",u,{root:!0}),i("cart/updateIsSubscriptionApplicable",p,{root:!0}),i("cart/updateExistingSubscriber",m,{root:!0}),i("cart/updateCartSummary",{cartSummary:h},{root:!0}),i("cart/updateCurrencyCode",g,{root:!0}),i("cart/updateVouchers",{vouchers:y},{root:!0}),i("cart/updateGiftVouchers",{giftVouchers:v},{root:!0}),i("cart/updateThresholdAmount",f,{root:!0}),i("bundles/updateAppliedBundles",b,{root:!0}),i("promotions/updatePromotions",{promotions:C},{root:!0});let k=Ke(e,"applicableDeliveryModes");p&&(k=k.filter(e=>!e.isCollectionPoint)),i("cart/updateApplicableDeliveryModes",k,{root:!0});let _=s.filter(e=>e.availability.quantity>0);const I=function(e){for(const i of e)i.bundleId&&"object"==typeof i.bundleId&&i.bundleId[0]&&(i.bundleId=i.bundleId[0]);const t=e.filter(e=>e.bundleId).reduce((e,t)=>
2({...e,[t.bundleId]:[...e[t.bundleId]||[],t]}),{});for(const[i]of Object.entries(t)){const e=t[i].length,r=[],o={},s={},a=t[i].reduce((e,t)=>({...e,[t.itemId]:[...e[t.itemId]||[],t]}),{});for(let n,l=0;l<e;++l)n=t[i][l].itemId,o[n]!==s&&(r.push(t[i][l]),o[n]=s);t[i]=r;for(const[n,l]of t[i].entries())l.quantity=a[l.itemId][n].quantity,l.isRenderingReference=0===n,l.isRenderingReference=0===n}return{inStockItems:e,groupByBundleId:t}}(s),P=function(e,t){const i=e,r=[];for(const o of t){o.isSingleItem=!0,o.isBundle=!1,o.totalQuantity=o.quantity,o.bundle=[],o.bundledItems=[],o.originalPrice=o?.price?.value||"";const t=i.promotions&&i.promotions.appliedProductPromotions.filter(function(e){return e.consumedItems.find(function(e){return e.itemCartOrder===Number.parseInt(o.id,10)})});if(t.length>0){o.bundleQuantity=0;let i="";for(const s of t){let a=0,n=0,l=0;if("PROMOTION_PRODUCT_PERFECT_PARTNER"===s.type){let c=!1;o.isSingleItem=!1,i=JSON.stringify(s.consumedItems);const d=s.consumedItems.reduce(function(e,t){return e.push(t.itemCartOrder),e},[]);for(const t of s.consumedItems)n+=Ve(t.itemCartOrder,e.items),a+=t.adjustedUnitPrice.value,l+=Ne(t.itemCartOrder,e.items);d[0]===d[1]?(c=!0,o.bundleQuantity+=2,o.sameBaseAndPartnerProduct=!0):(o.bundleQuantity++,o.sameBaseAndPartnerProduct=!1),Me(s.id,d,r)?(Be(o,d,c),o.bundle.promotionData={type:s.type,totalPrice:a*Fe(t,i),actualPrice:n*Fe(t,i),quantity:Fe(t,i),actualDiscountPrice:l}):(o.isBundle=!0,$e(s.id,d,r),o.bundle.push({itemQuantity:c?2:1,bundleQuantity:o.bundleQuantity,promotion:s,itemCartOrders:d,availability:o.availability||"",descriptor:o.descriptor||"",familyName:o.familyName||"",id:o.id||"",image:o.image||"",price:o.price||"",productUrl:o.productUrl||"",quantity:o.quantity||"",totalPrice:o.totalPrice||"",discountPrice:o.discountPrice||"",sellerName:o.sellerName||"",sellerId:o.sellerId||"",label:s.label||"",itemId:o.itemId||"",partnerProducts:Re(d,o.itemId,o.id,c,e.items)||"",promotionData:{type:s.type,totalPrice:a*Fe(t,i),actualPrice:n*Fe(t,i),quantity:Fe(t,i),actualDiscountPrice:l}})),o.bundleQuantity<o.quantity&&(o.isSingleItem=!0)}}}}}(e.attributes,s);if(i("bundles/updateBundleList",I.groupByBundleId,{root:!0}),P&&(_=P.inStockItems),I&&(_=I.inStockItems),i("cart/updateCartItems",{items:_},{root:!0}),Object.keys(n).length>0&&n.providers){const e=function(e,t){const i=[],r={};let o={};for(const s of e.providers){if(s.paymentMethods)for(const e of s.paymentMethods)i.push({...e,isInline:s.inline});"adyen"===s.provider&&t("payments/updateAdyen",{clientKey:s.clientKey,environment:s.environment,enableStoredCards:s.enableStoredCards},{root:!0}),o={...o,...s.digitalWalletConfig}}return r.digitalWalletConfigList=o,r.inlinePaymentMethodsList=i,r}(n,i);void 0!==e.digitalWalletConfigList&&i("cart/updateDigitalWalletConfiguration",e.digitalWalletConfigList,{root:!0}),i("payments/updateApplicablePaymentMethods",e.inlinePaymentMethodsList,{root:!0})}else{i("payments/updateApplicablePaymentMethods",a,{root:!0});const t=Ke(e,"digitalWalletConfig");void 0!==t&&i("cart/updateDigitalWalletConfiguration",t,{root:!0})}}function Ye(e,t){return e.reduce((e,i)=>{const r=i[t]||"Philips";return e[r]||=[],e[r].push(i),e},{})}const Ze={namespaced:!0,state:{items:[],outOfStockItems:[],mismatchQuantityItems:[],cartSummary:{},cartId:"current",products:[],vouchers:[],giftVouchers:[],isVoucherInvalid:!1,isAdditionalVoucherAdded:!1,applicableDeliveryModes:[],digitalWalletConfig:{},existingSubscriber:!1,deliveryMode:{},thresholdAmountExceeded:{},loggedInFirstName:"",loggedInLastName:"",isAnyAPIPending:!1,isSubscriptionApplicable:!1,hasHealthProduct:!1,currencyCode:"",sellerInfo:{},isSellerProduct:!1,sellerGroupItems:{},actualCartId:"",isBCBSBundleAvailable:!1,alertTextToRefresh:"",checkoutStep:Te.STEP_CHECKOUT_OVERVIEW},getters:{getProductByCtn:e=>t=>e.products.length>0&&e.products.find(e=>qe(t)===qe(e.ctn||""))||{},getCartItemsLength:e=>e.items.length,isQuantityMismatch:e=>t=>{const i=e.mismatchQuantityItems.find(e=>e.itemId===t);return Boolean(i)},isButtonDisabled:(e,t,i)=>e.thresholdAmountExceeded.orderBlocking||i.payments.isPayButtonDisabled||e.isAnyAPIPending},mutations:{updateCartItems(e,{items:t}){e.items=t},updateOutOfStockItems(e,{outOfStockItems:t}){e.outOfStockItems=t},updateMismatchQuantityItems(e,{mismatchQuantityItems:t}){e.mismatchQuantityItems=t},updateCartSummary(e,{cartSummary:t}){e.cartSummary=t},updateProducts(e,t){e.products=t},updateVouchers(e,{vouchers:t}){e.vouchers=t},updateGiftVouchers(e,{giftVouchers:t}){e.giftVouchers=t},updateIsVoucherInvalid(e,t){e.isVoucherInvalid=t},updateIsAdditionalVoucherAdded(e,t){e.isAdditionalVoucherAdded=t},updateApplicableDeliveryModes(e,t){e.applicableDeliveryModes=t},updateDigitalWalletConfiguration(e,t){e.digitalWalletConfig=t},updateDeliveryMode(e,t){e.deliveryMode=t},updateLoggedInFirstName(e,t){e.loggedInFirstName=t},updateLoggedInLastName(e,t){e.loggedInLastName=t},updateThresholdAmount(e,t){e.thresholdAmountExceeded={};const i=t?.find(e=>"thresholdExceeded"===e.id||"maxOrderQuantityExceeded"===e.id);i&&(e.thresholdAmountExceeded={message:i.message||"",orderBlocking:i.orderBlocking})},updateIsAnyAPIPending(e,t){e.isAnyAPIPending=t},updateIsSubscriptionApplicable(e,t){e.isSubscriptionApplicable=t},updateExistingSubscriber(e,t){e.existingSubscriber=t},updateCurrencyCode(e,t){e.currencyCode=t,window.philips?.context?.locale&&(window.philips.context.locale.currency=t)},updateSellerInfo(e,t){e.sellerInfo=t},updateIsSellerProduct(e,t){e.isSellerProduct=t},updateBCBSBundleAvailable(e,t){e.isBCBSBundleAvailable=t},updateIsSellerGroupItems(e,t){e.sellerGroupItems=t},updateActualCartId(e,t){e.actualCartId=t},updateAlertTextToRefresh(e,t){e.alertTextToRefresh=t},updateHasHealthProduct(e,t){e.hasHealthProduct=t},updateHealthConsentAPICheck(e,t){e.healthConsentAPICheck=t},updateCheckoutStep(e,t){e.checkoutStep=t}},actions:{updateAlertTextToRefresh({commit:e},t){e("updateAlertTextToRefresh",t)},async updateCartDetails({dispatch:e,commit:t,state:i,rootGetters:r,rootState:o},{data:s,cartAction:a="",voucherCode:n=""}){Je(s,{commit:t,dispatch:e,rootState:o});const l=Ke(s,"items"),c=Ke(s,"isSubscriptionApplicable",!1),d=Ke(s,"cartMerged",!1),u=Ke(s,"appliedVouchers"),p=Ke(s,"email",""),m=Ke(s,"paymentMethod",""),h=Ke(s,"marketingOptinApplied",!1),g=l.filter(e=>e.availability.quantity<1),y=Ke(s,"billingAddress",{}),v=Ke(s,"profile",{}),f=v.firstName||"",b=v.lastName||"",C=Ke(s,"appliedBundles"),k=Ke(s,"deliveryMode",{});let _=Ke(s,"deliveryAddress",{});const I=l.filter(e=>e.availability.quantity>0).filter(e=>e.quantity>e.availability.quantity),P=C.filter(e=>"SHOP_BCBS"===e.subscriptionBundlePartner),A=!1!==_.billingAddress;if(l){t("updateHasHealthProduct",l.some(e=>"PH"===e?.businessClassification&&e?.isHealthProduct)),this.state.cart.hasHealthProduct&&e("consent/updateConsentConfiguration",{consentType:"health",configuration:this.state.consent?.healthConsentConfiguration},{root:!0})}if("voucher"===a){const i=Ke(s,"appliedVouchers"),r=Ke(s,"appliedGiftVouchers");if(i?.length>1&&n)return e("updateVoucher",{voucherCode:n,action:"remove"}),t("updateIsAdditionalVoucherAdded",!0),void t("updateIsVoucherInvalid",!0);if(i?.length>0)for(const o of i)0===o.voucherDiscount.value&&o.id?(e("updateVoucher",{voucherCode:o.id,action:"remove"}),t("updateIsVoucherInvalid",!0)):t("updateVouchers",{vouchers:u});if(r?.length>0)for(const o of r)0===o.redeemedAmount.value&&o.id?(e("updateVoucher",{voucherCode:o.id,action:"remove"}),t("updateIsVoucherInvalid",!0)):t("updateGiftVouchers",{appliedGiftVouchers:r})}o.config.isLoggedIn&&(t("delivery/updateSelectedDeliveryModeId",k.id,{root:!0}),t("updateLoggedInFirstName",f),t("updateLoggedInLastName",b)),function({commit:e,rootState:t},{deliveryAddress:i,billingAddress:r,sameAsDelivery:o}){const s=(t,o)=>{const s=i[t]||o||"",a=r[t]||o||"";e("delivery/updateDeliveryAddress",{[t]:s},{root:!0}),e("delivery/updateBillingAddress",{[t]:a},{root:!0})};t.config.isLoggedIn&&(t.cart.loggedInFirstName&&s("firstName",t.cart.loggedInFirstName),t.cart.loggedInLastName&&s("lastName",t.cart.loggedInLastName));const a=t.payments.paymentStatus?.toLowerCase();if(De.has(a)){if(t.cart.deliveryMode.isCollectionPoint)return void e("delivery/updateBillingAddress",Le(r),{root:!0});e("delivery/updateDeliveryAddress",Le(i),{root:!0}),e("delivery/updateBillingAddress",Le(r),{root:!0}),e("delivery/updateSameAsDelivery",o,{root:!0})}}({commit:t,rootState:o},{deliveryAddress:_,billingAddress:y,sameAsDelivery:A}),(_.taxNumber||y.taxNumber)&&(t("delivery/updateReceiptOrEInvoice",!0,{root:!0}),t("delivery/updateSameAsDelivery",!1,{root:!0}));const w=await We(l,i,r);(g?.length>0||I?.length>0)&&await e("realignCartItemsQuantity",{mismatchQuantityItems:I,outOfStockItems:g});const S=l.filter(e=>e.sellerName&&e.sellerId),x=Ye(l,"sellerName");if((c&&1===Object.keys(x).length||Object.keys(x).length>1)&&e("notification/updateErrorNotifications",{text:"checkoutoverview.seller-products.notification-text",type:"success",isI18n:!0},{root:!0}),t("updateIsSellerProduct",S?.length>0),t("updateBCBSBundleAvailable",P?.length>0),t("updateIsSellerGroupItems",x),t("updateActualCartId",s.id),t("updateProducts",w),d&&e("notification/updateErrorNotifications",{text:"cartoverview.cart-merge",type:"success",isI18n:!0},{root:!0}),""!==p&&t("delivery/updateEmail",p,{root:!0}),r["config/isGuestCheckout"]){t("consent/updateIsMarketingConsentAccepted",o?.consent?.isMarketingConsentAccepted||h,{root:!0})}if((o.payments.paymentStatus||o.config.isLoginRedirect)&&t("consent/updateIsMarketingConsentVisible",!0,{root:!0}),e("consent/getIsAgeConsent","",{root:!0}),_.deliveryAddress||"estimatedTax"!==a||(_={..._,...o.delivery.deliveryAddress,postalCode:_.postalCode,region:_.region.isocode||_.regi
2on},_.isCollectionPoint?t("delivery/updateSelectedCollectionPoint",{attributes:{address:_},type:"collectionPoint"},{root:!0}):t("delivery/updateDeliveryAddress",_,{root:!0})),o.payments.link2PayEnabled){const e=Ke(s,"shopperEmail",""),i=Ke(s,"orderStatus","");t("delivery/updateBillingAddress",y,{root:!0}),t("delivery/updateEmail",e,{root:!0}),["open","payment_progress"].includes((i||"").toLowerCase())||t("payments/updateIsPayButtonDisabled",!0,{root:!0})}if(r["payments/isCancelledPayment"]&&t("delivery/updateSelectedDeliveryModeId",k.id,{root:!0}),m&&!o.payments.selectedPaymentMethodId){t("payments/updateSelectedPaymentMethodId",(o.payments.applicablePaymentMethods.find(e=>e.id===m)||"").id,{root:!0})}},async getPayByLinkCollectionPoints({dispatch:t,commit:i},{orderId:r,signal:o}={}){await function({orderId:e,signal:t}={}){return _e.post(`${ge()}/payByLinkCollectionPoint?orderId=${e}`,null,{signal:t})}({orderId:r,signal:o}).then(async e=>{const r=e.data.data;await t("updateCartDetails",{data:r,cartAction:"getCart"}).catch(e=>console.error(e)),i("updateDeliveryMode",r.attributes.applicableDeliveryModes[0])}).catch((t={})=>e.isCancel(t)?null:(i("updateErrorDetails",{showError:!0,errorMessageCode:"2050",fullErrorMessage:t},{root:!0}),console.error(t)))},async getCartItems({dispatch:t,commit:i,state:r},{signal:o}={}){i("updateIsAnyAPIPending",!0),await Ie.getCartDetails(r.cartId,null,{signal:o}).then(async e=>{const i=e.data.data;await t("updateCartDetails",{data:i,cartAction:"getCart"}).catch(e=>console.error(e))}).catch((t={})=>e.isCancel(t)?null:(i("updateErrorDetails",{showError:!0,errorMessageCode:"2050",fullErrorMessage:t},{root:!0}),console.error(t))).finally(()=>{i("updateIsAnyAPIPending",!1)})},updateCartItem({dispatch:e,commit:t,state:i,rootGetters:r},{itemId:o,bundleId:s,bundleType:a,quantity:n=0,updateCart:l=!0,items:c={},parentProductId:d,isBundledItem:u=!1}){let p=s?{bundleId:s,type:a,quantity:n}:{quantity:n};return u&&(p=""),d&&(p.parentProductId=d),t("updateIsAnyAPIPending",!0),Ie.updateCartItem({cartId:i.cartId,itemId:o,items:c,params:p}).then(t=>{const i=t.data.data;ne.setCookie({key:`${r["config/getDefaultConfig"]("siteId")}-cartstatus-com`,value:i?.attributes?.units}),l&&e("updateCartDetails",{data:i,cartAction:"updateCart"}).then(t=>(e("resetCheckoutState"),t))}).catch(e=>Qe(e,2040,{parameters:p,commit:t})).finally(()=>{t("updateIsAnyAPIPending",!1)})},addCartItem({dispatch:e,commit:t,state:i},{itemId:r,bundleId:o,bundleType:s,quantity:a=1,parentProductId:n}){let l={};return r?l={productId:r,quantity:a,parentProductId:n}:o&&(l={bundleId:o,type:s,quantity:a}),t("updateIsAnyAPIPending",!0),Ie.addCartItem(i.cartId,l).then(t=>{const i=t.data.data;e("updateCartDetails",{data:i}).then(t=>(e("resetCheckoutState"),t))}).catch(e=>Qe(e,2030,{parameters:l,commit:t})).finally(()=>{t("updateIsAnyAPIPending",!1)})},async realignCartItemsQuantity({dispatch:e,state:t},{mismatchQuantityItems:i,outOfStockItems:r}){const o=structuredClone(i);if(i.length>0){const i=o.filter(e=>!t.mismatchQuantityItems.some(t=>e.itemId===t.itemId));i.length>0&&await e("checkMismatchQuantityItems",{items:i})}if(r.length>0){const i=r.filter(e=>!t.outOfStockItems.some(t=>e.itemId===t.itemId));i.length>0&&await e("checkOutOfStockItems",{items:i})}},async checkMismatchQuantityItems({dispatch:e,commit:t,state:i},{items:r}){for(const s of r)s.quantityMismatchMsg=!0,s.quantity=s.availability.quantity;t("updateMismatchQuantityItems",{mismatchQuantityItems:[...i.mismatchQuantityItems,...r]});for(const s of r){const i=s.id;try{s.bundleId||await e("updateCartItem",{itemId:i,quantity:s.availability.quantity})}catch(o){t("updateErrorDetails",{showError:!0,errorMessageCode:"2020",fullErrorMessage:o},{root:!0})}}},async checkOutOfStockItems({dispatch:e,commit:t,state:i},{items:r}){const o=r.sort((e,t)=>t.id-e.id);for(const a of o){const i=a.id;try{a.bundleId||await e("updateCartItem",{itemId:i,quantity:0})}catch(s){t("updateErrorDetails",{showError:!0,errorMessageCode:"2010",fullErrorMessage:s},{root:!0})}}t("updateOutOfStockItems",{outOfStockItems:[...i.outOfStockItems,...r]})},removeOutOfStockItems({state:e},{outOfStockItems:t}){for(const i of t)Ie.updateCartItem(e.cartId,i.id,0)},updateVoucher:({dispatch:e,commit:t,state:i},r)=>new Promise((o,s)=>{t("updateIsAnyAPIPending",!0),Ie.updateVoucherCode(r.voucherCode,i.cartId,r.action).then(t=>{if(200===t.status){const i=t.data.data;e("updateCartDetails",{data:i,cartAction:"voucher",voucherCode:r.voucherCode}).then(()=>{o()})}else s()}).catch(e=>{s(e.response)}).finally(()=>{t("updateIsAnyAPIPending",!1)})}),getAddresses:({commit:e,rootState:t,rootGetters:i,dispatch:r},o=null)=>new Promise((i,s)=>{Ie.getAddresses().then(a=>
2{if(200===a.status){const s=a.data.commerceAddresses.map(e=>e.attributes);s.length>0&&Oe({commerceAddresses:s,commit:e,rootState:t,dispatch:r,vm:o}),i()}else s(a)}).catch(e=>{s(e)})}),async getSellerInfo({commit:e},t){await Ie.getSellerInfo({sellerId:t||""}).then(t=>{e("updateSellerInfo",t.data.data)})},getBCBSCartItems:({dispatch:e,commit:t,state:i},{itemId:r,items:o={}})=>new Promise((s,a)=>{t("updateIsAnyAPIPending",!0),Ie.removeBCBSBundle({cartId:i.cartId,itemId:r,items:o}).then(t=>{if(200===t.status){const i=t.data.data;e("updateCartDetails",{data:i,cartAction:"getCart"}).then(t=>{e("resetCheckoutState"),s(t)})}else a(t)}).catch(e=>{a(e.response)}).finally(()=>{t("updateIsAnyAPIPending",!1)})}),updateCheckoutStep({commit:e},t){e("updateCheckoutStep",t)},resetCheckoutState({commit:e}){e("config/updateSelectedCheckoutMethodId","",{root:!0}),e("delivery/updateEmail","",{root:!0}),e("delivery/updateSelectedDeliveryModeId","",{root:!0}),e("delivery/resetAddress","deliveryAddress",{root:!0}),e("delivery/resetAddress","billingAddress",{root:!0}),e("delivery/updateSelectedCollectionPoint",{},{root:!0}),e("payments/updateSelectedPaymentMethodId","",{root:!0})}}},Xe={getAccessToken:(e={},t={},i=i)=>_e.$http.post(`${i}/token`,e,{params:t}),revokeAccessToken:(e={},t={},i=i)=>_e.$http.post(`${i}/token/revoke`,e,{params:t}),getUserDetails:(e={},t={},i=i)=>_e.post(`${i}`,e,{params:t})};function et(e){return _e.get(`${ye()}/validation-service/geoLocations`,{params:e||{}})}function tt(e){return _e.post(`${ye()}/validation-service/address`,{data:e||{}})}function it(e={}){return _e.get(`${ui.getters["config/getDefaultConfig"]("pilApiConfig")?.consumerConsentService?.apiUrl}/consentLanguageVersions?name=${e.consentName}&locale=${e.consentLocale}`,{data:{apiIdentifier:"getConsentLanguageVersion",apiType:"consents"}})}let rt=0;const ot={namespaced:!0,state:{config:{translations:{},checkoutConfig:{},deliveryForm:{},billingForm:{}},accessToken:null,UDIAccessToken:null,userDetails:null,isLoggedIn:!1,isLoginRedirect:!1,selectedCheckoutMethodId:"",deliveryFormConfiguration:{},billingFormConfiguration:{},maxOrderQuantity:Number.POSITIVE_INFINITY,net:!1,isBusinessFlagEnabled:!1,isAddressError:!1,fieldConfigByAPI:!1,characterCounter:!1,collectionPointMap:!1,validationSchema:{},payButtonWasClicked:!1,showPHSellerInfo:!1,showAccountError:!1,isMicrositeId:!1},getters:{getDefaultConfig:e=>t=>e.config.checkoutConfig[t],locale:e=>`${e.config.checkoutConfig.language}-${e.config.checkoutConfig.country.toLowerCase()}`,getAccessToken:e=>e.accessToken,getUDIAccessToken:e=>e.UDIAccessToken,getUserDetails:e=>e.userDetails,isGuestCheckout:e=>"guest-checkout"===e.selectedCheckoutMethodId},mutations:{updateConfig(e,t){e.config=t},updateAccessToken(e,t){e.accessToken=t},updateUDIAccessToken(e,t){e.UDIAccessToken=t},updateUserDetails(e,t){e.userDetails=t},updateUserLogInStatus(e,t){e.isLoggedIn=t},updateLoginRedirect(e,t){e.isLoginRedirect=t},updateSelectedCheckoutMethodId(e,t){e.selectedCheckoutMethodId=t},updateMaxOrderQuantity(e,t){e.maxOrderQuantity=t},updateNetConfiguration(e,t){e.net=t},updateIsBusinessFlagEnabled(e,t){e.isBusinessFlagEnabled=t},updateIsAddressError(e,t){e.isAddressError=t},updatefieldConfigByAPI(e,t){e.fieldConfigByAPI=t},updateCharacterCounter(e,t){e.characterCounter=t},updateCollectionPointMap(e,t){e.collectionPointMap=t},updateValidationSchema(e,t){e.validationSchema={...e.validationSchema,...t}},updatePayButtonWasClicked(e,t){e.payButtonWasClicked=t},updateShowPHSellerInfo(e,t){e.showPHSellerInfo=t},updateShowAccountError(e,t){e.showAccountError=t},updateSiteId:(e,t)=>{e.config.checkoutConfig.siteId=t},updateIsMicrositeId:(e,t)=>{e.isMicrositeId=t},updateOrderConfirmationUrl:(e,t)=>{e.config.checkoutConfig.orderConfirmationUrl=t},updateCheckoutUrl:(e,t)=>{e.config.checkoutConfig.checkoutUrl=t}},actions:{updateConfig({commit:e},t){e("updateConfig",t)},updateSelectedCheckoutMethodId({commit:e},t){e("updateSelectedCheckoutMethodId",t)},updateIsAddressError({commit:e},t){e("updateIsAddressError",t)},updateUserLogInStatus({commit:e,state:t}){const i=document.cookie.match(new RegExp(`(?:^|; )${"ws-active-udi".replaceAll(/([$()*.?[{|}]\/+^])/g,"$1")}=([^;]*)`)),r=Boolean(i&&"TRUE"===decodeURIComponent(i[1]).toUpperCase()&&"true"===t.config.checkoutConfig.isLoginEnabled);window.philips?.context?.user&&(window.philips.context.user.loginStatus=r?"logged_in":"not_logged_in"),e("updateUserLogInStatus",r)},updateLoginRedirect({commit:e}){const t=new URLSearchParams(window.location.search).get("loggedin")||null;e("updateLoginRedirect",["TRUE"].includes(t?.toUpperCase()))},getConfigAPI({commit:e,state:t,dispatch:i}){"{}"===JSON.stringify(t.deliveryFormConfiguration)&&"{}"===JSON.stringify(t.billingFormConfiguration)&&function(e={}){return _e.get(`${ge()}/config`,{params:e})}().then(t=>{t.data.featureToggles?.multipleProductsInCart||(t.data.featureToggles.maxOrderQuantity=1),i("delivery/updateFormFields",t.data,{root:!0}),i("updateShowPHSellerInfo");const r=t.data.featureToggles||{},o=r.maxOrderQuantity||Number.POSITIVE_INFINITY,s=r.net||!1,a=r.isBusinessFlagEnabled||!1,n=r.fieldConfigByAPI||!1,l=r.characterCounter||!1,c=r.collectionPointMap||!1;for(const d of t.data.consentInputFields)switch(d.name){case"marketingOptIn":i("consent/updateConsentConfiguration",{consentType:"marketing",configuration:[d]},{root:!0});break;case"ageConsent":e("consent/updateAgeConsentConfiguration",[d],{root:!0});break;case"healthOptIn":i("consent/updateConsentConfiguration",{consentType:"health",configuration:[d]},{root:!0})}e("updateMaxOrderQuantity",o),e("updateNetConfiguration",s),e("updateIsBusinessFlagEnabled",a),e("updatefieldConfigByAPI",n),e("updateCharacterCounter",l),e("updateCollectionPointMap",c)}).catch(t=>(e("updateErrorDetails",{showError:!0,errorMessageCode:"1010",fullErrorMessage:t},{root:!0}),console.error(t)))},async getAccessToken({commit:e,dispatch:t,state:i},r){try{const o={type:"SHOP"},s=i.config.checkoutConfig.sessionUrl;r&&(o.forceRefresh=r),await Xe.getAccessToken({},o,s).then(i=>{const{data:{access_token:r,expires_in:o}
2={accessToken:"",expiresIn:""}}=i;e("updateAccessToken",r),(({dispatch:e,expiresIn:t})=>{clearInterval(rt),t=1e3*(t-300),rt=setInterval(()=>e("getAccessToken"),t)})({dispatch:t,expiresIn:o})})}catch(o){return e("updateErrorDetails",{showError:!0,errorMessageCode:"1040",fullErrorMessage:o},{root:!0}),Promise.reject(o)}return Promise.resolve()},async getUDIAccessToken({commit:e,dispatch:t,state:i}){try{const t={type:"UDI"},r=i.config.checkoutConfig.sessionUrl;await Xe.getAccessToken({},t,r).then(t=>{const{data:{access_token:i}={accessToken:""}}=t;e("updateUDIAccessToken",i)})}catch(r){return t("notification/updateErrorNotifications",{title:"checkoutoverview.user-account-error",text:this.state.cart.isSubscriptionApplicable?"checkoutoverview.user-account-error-refresh":"checkoutoverview.user-account-error-checkout",isI18n:!0},{root:!0}),Promise.reject(r)}return Promise.resolve()},async getUserDetails({commit:e,dispatch:t,state:i}){try{await t("getUDIAccessToken");const r=i.config.checkoutConfig.userInfoUrl;await Xe.getUserDetails({},"",r).then(i=>{const r=i.data;e("updateUserDetails",r),t("consent/updateUserConsentsVisibility",{userDetails:r,hasHealthProduct:this.state.cart.hasHealthProduct||!1},{root:!0})})}catch(r){const e=this.state.cart.isSubscriptionApplicable?"checkoutoverview.user-account-error-refresh":"checkoutoverview.user-account-error-checkout";return t("notification/updateErrorNotifications",{title:"checkoutoverview.user-account-error",text:e,isI18n:!0},{root:!0}),Promise.reject(r)}return Promise.resolve()},updateShowPHSellerInfo({commit:e,rootGetters:t}){let i=!1;const r=t["config/getDefaultConfig"]("PHSellerName"),o=t["config/getDefaultConfig"]("PHSellerLink"),s=t["config/getDefaultConfig"]("localeId");["ro_RO"].includes(s)&&r&&o&&(i=!0),e("updateShowPHSellerInfo",i)},updateValidationSchema({commit:e},t){e("updateValidationSchema",t)},updateShowAccountError({commit:e},t){e("updateShowAccountError",t)},updateSiteId({commit:e},t){e("updateSiteId",t)},updateIsMicrositeId({commit:e},t){e("updateIsMicrositeId",t)},updateOrderConfirmationUrl({commit:e},t){e("updateOrderConfirmationUrl",t)},updateCheckoutUrl({commit:e},t){e("updateCheckoutUrl",t)}}};const st={marketing:"DIRECT_MARKETING",health:"HEALTH_PH"},at="marketing",nt="health";const lt={namespaced:!0,state:{isMarketingConsentAccepted:!1,isMarketingConsentVisible:!1,isMarketingConsentHasChecked:!1,isHealthConsentHasChecked:!1,isHealthConsentAccepted:!1,isHealthConsentVisible:!1,isAgeConsent:!1,marketingConsentConfiguration:{},healthConsentConfiguration:{},ageConsentConfiguration:{},showAgeConsent:!1,ageConsent:!1,ageConsentApplied:!1,isAgeConsentAccepted:!1,marketingConsentVersion:"",healthConsentVersion:"",marketingConsentLanguageVersionAPICheckForLoggedInUsers:!1,healthConsentLanguageVersionAPICheckForLoggedInUsers:!1,marketingConsentCheckboxLabel:"",healthConsentCheckboxLabel:""},mutations:{updateAgeConsent(e,t){e.ageConsent=t},updateAgeConsentApplied(e,t){e.ageConsentApplied=t},updateIsAgeConsentAccepted(e,t){e.isAgeConsentAccepted=t},updateIsMarketingConsentAccepted(e,t){e.isMarketingConsentAccepted=t,!1===e.isMarketingConsentAccepted&&(e.isHealthConsentAccepted=!1)},updateIsHealthConsentAccepted(e,t){e.isHealthConsentAccepted=t},updateIsMarketingConsentVisible(e,t){e.isMarketingConsentVisible=t},updateIsHealthConsentVisible(e,t){e.isHealthConsentVisible=t},updateIsAgeConsent(e,t){e.isAgeConsent=t},updateConsentConfiguration(e,{consentType:t,configuration:i}){e[`${t}ConsentConfiguration`]=i,e[`${t}ConsentCheckboxLabel`]&&(e[`${t}ConsentConfiguration`][0].label=e[`${t}ConsentCheckboxLabel`])},updateConsent(e,{consentType:t,consentData:i}){e[`${t}ConsentVersion`]=i.version,e[`${t}ConsentCheckboxLabel`]=i.label},updateAgeConsentConfiguration(e,t){e.ageConsentConfiguration=t},updateShowAgeConsent(e,t){e.showAgeConsent=t},updateMarketingConsentLanguageVersionAPICheckForLoggedInUsers(e,t){e.marketingConsentLanguageVersionAPICheckForLoggedInUsers=t},updateHealthConsentLanguageVersionAPICheckForLoggedInUsers(e,t){e.healthConsentLanguageVersionAPICheckForLoggedInUsers=t},updateIsMarketingConsentHasChecked(e,t){e.isMarketingConsentHasChecked=t}},actions:{updateIsMarketingConsentAccepted({commit:e},t){e("updateIsMarketingConsentAccepted",t)},updateIsHealthConsentAccepted({commit:e},t){e("updateIsHealthConsentAccepted",t)},updateIsMarketingConsentVisible({commit:e},t){e("updateIsMarketingConsentVisible",t)},updateIsAgeConsent({commit:e},t){e("updateIsAgeConsent",t)},getIsAgeConsent({commit:e,state:t}){e("updateIsAgeConsent",t.ageConsentApplied||t.isAgeConsent)},updateConsentConfiguration({commit:e},{consentType:t,configuration:i}){if(function(e,t){const i=e.config.config?.checkoutConfig?.isProofOfConsent,r=e.config.isLoggedIn,o={[at]:!r||e.consent.marketingConsentLanguageVersionAPICheckForLoggedInUsers,[nt]:e.cart?.hasHealthProduct&&(!r||e.consent.healthConsentLanguageVersionAPICheckForLoggedInUsers)};return""===e.consent[`${t}ConsentVersion`]&&i&&o[t]}(this.state,t)){const{language:r,country:o}=this.state.config?.config?.checkoutConfig||{};it({consentName:st[t],consentLocale:`${r}-${o}`}).then(r=>{const o=function(e){const t={label:"",version:""},i=`${e.optInDescription}<a href="${e.optInDetailsLink}">${e.optInDetailsText}</a>`;return t.label=i,t.version=e.version,t}(r.data.data.attributes.consentLanguageVersions[0]);e("updateConsent",{consentType:t,consentData:{label:o.label,version:o.version}}),e("updateConsentConfiguration",{consentType:t,configuration:i})})}else e("updateConsentConfiguration",{consentType:t,configuration:i})},updateUserConsent({state:e,rootState:t,dispatch:i}){const{language:r,country:o}=this.state.config?.config?.checkoutConfig||{},s={data:{type:"user",attributes:{locale:`${r}-${o}`}}
2};return e.isMarketingConsentHasChecked||(s.data.attributes.consentEmailMarketing={optedIn:Boolean(e.isMarketingConsentAccepted)},t.config.config?.checkoutConfig?.isProofOfConsent&&e.marketingConsentVersion&&(s.data.attributes.consentEmailMarketing.version=e.marketingConsentVersion)),e.isHealthConsentVisible&&e.isHealthConsentAccepted&&(s.data.attributes.consentPHHealth={optedIn:Boolean(e.isHealthConsentAccepted)},t.config.config?.checkoutConfig?.isProofOfConsent&&(s.data.attributes.consentPHHealth.version=e.healthConsentVersion)),function(e){const t=window.location.hostname.startsWith("www")?"www":"stg";return _e.patch(`https://${t}.eu-west-1.api.philips.com/consumerIdentityService/users`,e)}(s).then(e=>e).catch(e=>{i("notification/updateErrorNotifications",{text:e.message},{root:!0})})},updateUserConsentsVisibility({state:e,dispatch:t,commit:i},{userDetails:r,hasHealthProduct:o}){const s=r?.consents?.find(e=>e.consentId===st.marketing),a=r?.consents?.find(e=>e.consentId===st.health);i("updateIsMarketingConsentHasChecked",Boolean(s?.optInProvided)),i("updateIsMarketingConsentVisible",!s?.optInProvided),i("updateIsMarketingConsentAccepted",Boolean(s?.optInProvided)),i("updateIsHealthConsentVisible",!a?.optInProvided&&o),s?.optInProvided&&!a?.optInProvided&&(i("updateIsMarketingConsentVisible",!0),i("updateIsMarketingConsentAccepted",s?.optInProvided),i("updateIsHealthConsentVisible",!0),i("updateIsHealthConsentAccepted",a?.optInProvided)),e.isMarketingConsentAccepted||(i("updateMarketingConsentLanguageVersionAPICheckForLoggedInUsers",!0),t("updateConsentConfiguration",{consentType:"marketing",configuration:e.marketingConsentConfiguration})),e.isHealthConsentAccepted||a?.optInProvided||(i("updateHealthConsentLanguageVersionAPICheckForLoggedInUsers",!0),t("updateConsentConfiguration",{consentType:"health",configuration:e.healthConsentConfiguration}))}}},ct=e=>{const t=`${e}=`,i=document.cookie.split(";");for(let r of i){for(;" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},dt=(e,t,i)=>{let r="";if(i){const e=new Date;e.setTime(e.getTime()+24*i*60*60*1e3),r=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${t||""}${r}; path=/`},ut=(e,t)=>{const i={};if(e&&e.length>0)for(const r of e){const e=t?`${t}-${r.name}`:r.name;r.mandatory&&(i[e]={required:r.mandatoryError}),r.format&&""!==r.format&&(r.mandatory?i[e].regex=[r.format,r.formatError||""]:i[e]={regex:[r.format,r.formatError||""]})}return i},pt=(e,t)=>e.reduce((e,t)=>{const[i]=Object.keys(t),r=`${t[i].open}-${t[i].close}`,o=e.find(e=>e.time===r);return o?o.days.push(i):e.push({days:[i],time:r}),e},[]).map(({days:e,time:i})=>{const r=`generic.dayoftheweek.${e[0]}`,o=t(r);let s="";if(e.length>1){const i=`generic.dayoftheweek.${e.at(-1)}`;s=` - ${t(i)}`}return`${o}${s}: ${i}`}).join(", "),mt=(e,t=300)=>{let i;const r=function(){clearTimeout(i);const r=arguments;i=setTimeout(()=>{e.apply(this,r)},t)};return r.cancel=function(){clearTimeout(i),i=null},r};function ht(){return{getCookie:ct,setCookie:dt,getValidationSchema:ut,groupOpeningHours:pt,debounce:mt}}let gt="";function yt(){return gt}function vt(){try{const{getCookie:e,setCookie:t}=ht(),i="https://cdn-scripts.signifyd.com/api/script-tag.js",r="signifyd_id_1142733",o=document.createElement("script");gt=e(r),gt||(gt="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,e=>{const t=Math.trunc(16*Math.random());return("x"===e?t:3&t|8).toString(16)}),t(r,gt)),o.setAttribute("src",i),o.setAttribute("defer","defer"),o.setAttribute("id","sig-api"),o.dataset.orderSessionId=gt,o.addEventListener("error",e=>{console.error("Failed to load Signifyd script from network:",e)}),o.addEventListener("load",()=>{console.log("Signifyd script loaded successfully")}),document.head.append(o)}catch(e){console.error("Error loading Signifyd script:",e)}}const ft="BLIK-SSL",bt="VISA-SSL",Ct="ECMC-SSL",kt="MAESTRO-SSL",_t="adyen",It="checkoutoverview.blik-code-payment-error",Pt="checkoutoverview.card-number-payment-error",At="checkoutoverview.expiry-date-payment-error",wt="checkoutoverview.security-code-payment-error",St="checkoutoverview.holder
2-name-payment-error",xt="PAYMENT";class Et extends Error{constructor(e=[],t=xt,i={}){super("FrontendPaymentError"),this.name="FrontendPaymentError",this.errors=e,this.type=t,this.data=i}}class Tt extends Error{constructor({data:e={}}){super("SubmitApiError"),this.name="SubmitApiError",this.data=e}}const Dt=(e,t,i)=>{const r=[];if(e===_t)switch(t.id){case ft:i.blikCode||r.push(It);break;case bt:case Ct:case kt:r.push(...(e=>{const t=[];return e.encryptedCardNumber||t.push(Pt),e.encryptedExpiryMonth&&e.encryptedExpiryYear||t.push(At),e.encryptedSecurityCode||t.push(wt),e.holderName||t.push(St),t})(i));break;default:return[]}return r},Ot=(e,t)=>{const i=void 0===e.order?100:e.order,r=void 0===t.order?100:t.order;let o=0;return i>r?o=1:i<r&&(o=-1),o},Lt=e=>{const t={};for(const[i,r]of e.entries()){let o="checkbox"===r.type?[]:"";Bt(r)&&(o="checkbox"===r.type?[$t(r)]:$t(r)),r.mandatory&&(e[i].label=`${r.label}*`),"country"===r.name&&"selectBox"!==e[i].type&&"dropdown"!==e[i].type&&(e[i].disabled=!0,t.isoCode=r.isoCode),"title"===r.name&&(r.name="titleCode"),"radio"===r.type&&"confirmation"===r.name&&(e[i].options=[{key:"confirm",value:e[i].label}],o=""),t[r.name]=o}return[e,t]},Mt=(e,t,i,r)=>{const o=(s=t,a=i,e.map(e=>({...s.find(t=>t[a]===e[a]&&t),...e})));var s,a;return r||o.sort(Ot),Lt(o)},Bt=e=>"object"==typeof e?.defaultValue?e.defaultValue[0]:"string"==typeof e?.defaultValue,$t=e=>"object"==typeof e?.defaultValue?e.defaultValue[1]:"string"==typeof e?.defaultValue?e.defaultValue:"",Vt=(e,t,i)=>("dropdown"===i||"selectBox"===i?(e.isoCode=e.country.isocode,e.country=e.country.isocode):(e.isoCode=t.deliveryAddress.isoCode,e.country=t.deliveryAddress.country),"object"==typeof e.region?e.region=e.region.isocode:void 0===e.region&&(e.region=""),e),Nt=({state:e,getters:t,commit:i,rootState:r,rootGetters:o})=>{let s="";const a={type:r.payments.link2PayEnabled?"commercePayBylinkSubmit":"commerceCartSubmit",attributes:{paymentMethod:{id:r.cart.isSubscriptionApplicable||r.cart.cartSummary?.totalPriceWithTax?.value>0||r.cart.cartSummary?.total?.value>0?r.payments.selectedPaymentMethodId:"GIFTCARD"},email:e.email,callBackUrl:o["config/getDefaultConfig"]("orderConfirmationUrl"),consentInputFields:{ageConsent:Boolean(r.consent.isAgeConsent)}}};if(o["config/isGuestCheckout"]&&(a.attributes.consentInputFields.marketingOptIn=Boolean(r.consent.isMarketingConsentAccepted),r.consent.marketingConsentVersion&&(a.attributes.consentInputFields.marketingVersion=r.consent.marketingConsentVersion),r.cart.hasHealthProduct&&(a.attributes.consentInputFields.healthOptIn=Boolean(r.consent.isHealthConsentAccepted),r.consent.healthConsentVersion&&(a.attributes.consentInputFields.healthOptInVersion=r.consent.healthConsentVersion))),a.attributes.orderChannel="WEB",a.attributes.orderSessionId=yt(),t.selectedDeliveryMode.isCollectionPoint?Rt(a,i,e):Ft(a,e,r),"tr_TR"===r.config?.config?.checkoutConfig?.localeId&&"iyzico_ewallet_payU"===r.payments?.selectedPaymentMethodId&&(a.attributes.paymentMethod.buyerIdentityNumber="11111111110"),e.sameAsDelivery?a.attributes.deliveryAddress.billingAddress=!0:Ht(a,e,r,t),Ut(a,e,t),qt(a,e,r,t),!1===e.isBusinessFlagEnabled&&(delete a.attributes.deliveryAddress.invoice,a.attributes.billingAddress&&delete a.attributes.billingAddress.invoice),!1===e.receiptOrEInvoice&&(delete a.attributes.deliveryAddress.companyName,a.attributes.billingAddress&&(delete a.attributes.billingAddress.companyName,delete a.attributes.billingAddress.taxNumber)),r.config.isLoggedIn&&jt({orderData:a,state:e,getters:t}),s=Gt(a,e,t),a.attributes.billingAddress&&(s=Wt(a,e)),!0===r.cart.isBCBSBundleAvailable&&0===r.cart.cartSummary?.total?.value&&(a.attributes.paymentMethod.id="",delete a.attributes.billingAddress,a.attributes.deliveryAddress.billingAddress=!0),o["payments/selectedPaymentDetails"]?.isInline){const e=a.attributes.paymentMethod,t=r.payments.bankCardDetails,i=r.payments.applicablePaymentMethods.find(t=>t.id===e.id);if(!i.isApm){["encryptedCardNumber","encryptedSecurityCode","encryptedExpiryYear","encryptedExpiryMonth","holderName"].map(i=>(""!==t[i]&&void 0!==t[i]&&(e[i]=t[i]),e))}void 0!==t.storePaymentMethod&&""!==t.storePaymentMethod&&(e.storePaymentMethod=t.storePaymentMethod),e.type=t.type||i.pspPaymentMethod,void 0!==t.issuer&&""!==t.issuer&&(e.issuer=t.issuer),void 0!==t.telephoneNumber&&""!==t.telephoneNumber&&(e.telephoneNumber=t.telephoneNumber),void 0!==t.blikCode&&""!==t.blikCode&&(e.blikCode=t.blikCode),"mbway"!==i?.pspPaymentMethod&&(a.attributes.browserInfo=r.payments.browserInfo,a.attributes.additionalData=r.payments.additionalData)}else"WORLDPAY"===o["payments/selectedPaymentDetails"]?.provider?.toUpperCase()&&(a.attributes.browserInfo=r.payments.browserInfo);return{data:s}},Rt=(e,t,i)=>{t("updateSameAsDelivery",!1),e.attributes.deliveryAddress={...i.selectedCollectionPoint.attributes.address,deliveryAddress:!0,invoice:i.receiptOrEInvoice,defaultAddress:!0,isCollectionPoint:!0,country:{isocode:i.deliveryAddress.isoCode},region:{isocode:"object"==typeof i.selectedCollectionPoint.attributes.address.region?i.selectedCollectionPoint.attributes.address.region.isocode:i.selectedCollectionPoint.attributes.address.region}},i.selectedCollectionPoint.attributes.address?.additionalData&&(e.attributes.deliveryAddress.additionalData=i.selectedCollectionPoint.attributes.address?.additionalData),e.attributes.deliveryAddress.phone=i.billingAddress.phone},Ft=(e,t,i)=>{e.attributes.deliveryAddress={...t.deliveryAddress,country:{isocode:t.deliveryAddress.isoCode||i.config?.config?.checkoutConfig?.country||""},region:{isocode:t.deliveryAddress.region},deliveryAddress:!0,defaultAddress:!0,invoice:t.receiptOrEInvoice,companyName:t.deliveryAddress.companyName,isCollectionPoint:!1},t.deliveryAddress.titleCode?e.attributes.deliveryAddress.titleCode=t.deliveryAddress.titleCode:delete e.attributes.deliveryAddress.titleCode},Ut=(e,t,i)=>{t.deliveryAddress.postalCode&&(e.attributes.deliveryAddress.postalCode=i.selectedDeliveryMode.isCollectionPoint?e.attributes.deliveryAddress.postalCode.toUpperCase():t.deliveryAddress.postalCode.toUpperCase()),t.billingAddress.postalCode&&e.attributes.billingAddress&&(e.attributes.billingAddress.postalCode=t.billingAddress.postalCode.toUpperCase())},qt=(e,t,i,r)=>{delete e.attributes.deliveryAddress.isoCode,delete e.attributes.deliveryAddress.formattedAddress,i.config.isLoggedIn?delete e.attributes.email:(delete e.attributes.deliveryAddress?.id,delete e.attributes.billingAddress?.id),(!t.deliveryAddress.region&&!r.selectedDeliveryMode.isCollectionPoint||r.selectedDeliveryMode.isCollectionPoint&&!t.selectedCollectionPoint.attributes.address.region)&&delete e.attributes.deliveryAddress.region},Ht=(e,t,i,r)=>{const o=i.delivery?.billingFormConfiguration?.find(e=>"country"===e.name),s=r.selectedDeliveryMode.isCollectionPoint;e.attributes.billingAddress={...t.billingAddress,country:{isocode:"dropdown"===o.type||"selectBox"===o.type?t.billingAddress.country:t.billingAddress.isoCode},region:{isocode:t.billingAddress.region},billingAddress:!0,defaultAddress:!0,invoice:t.receiptOrEInvoice,companyName:t.billingAddress.companyName,taxNumber:t.billingAddress.taxNumber},i.payments.link2PayEnabled&&(e.attributes.billingAddress.country={isocode:t.billingAddress.country.isocode}),s&&t.billingAddress.phone?e.attributes.billingAddress.phone=t.billingAddress.phone:!s&&t.deliveryAddress.phone&&(e.attributes.billingAddress.phone=t.deliveryAddress.phone),t.billingAddress.titleCode?e.attributes.billingAddress.titleCode=t.billingAddress.titleCode:delete e.attributes.billingAddress.titleCode,s||delete e.attributes.billingAddress.deliveryAddress,delete e.attributes.deliveryAddress.billingAddress,delete e.attributes.billingAddress.isoCode,delete e.attributes.billingAddress.formattedAddress,t.billingAddress.region||delete e.attributes.billingAddress.region},jt=({orderData:e,state:t,getters:i})=>{"{}"===JSON.stringify(t.selectedCommerceDeliveryAddress)||Qt(e.attributes.deliveryAddress,t.selectedCommerceDeliveryAddress)||t.isDeliveryAddressMismatch||i.selectedDeliveryMode.isCollectionPoint||delete e.attributes.deliveryAddress.id,!e.attributes.billingAddress||"{}"===JSON.stringify(t.selectedCommerceBillingAddress)||Qt(e.attributes.billingAddress,t.selectedCommerceBillingAddress)||t.isBillingAddressMismatch||delete e.attributes.billingAddress.id},Gt=(e,t,i)=>{const r=[],o=new Set(["billingAddress","defaultAddress","deliveryAddress","isCollectionPoint","additionalData","id","invoice"]);for(const s of t.deliveryFormConfiguration)r.push(s.name);i.selectedDeliveryMode.isCollectionPoint&&!r.includes("houseNumber")&&e.attributes.deliveryAddress?.houseNumber&&!e.attributes.deliveryAddress?.line1.includes(e.attributes.deliveryAddress?.houseNumber)&&(e.attributes.deliveryAddress.line1=[e.attributes.deliveryAddress.line1,e.attributes.deliveryAddress.houseNumber].join(" "));for(const[s]of Object.entries(e.attributes.deliveryAddress))r.includes(s)||o.has(s)||delete e.attributes.deliveryAddress[s];return e},Wt=(e,t)=>{const i=[],r=new Set(["billingAddress","defaultAddress","deliveryAddress","isCollectionPoint","id","invoice"]);for(const o of t.billingFormConfiguration)i.push(o.name);for(const[o]of Object.entries(e.attributes.billingAddress))i.includes(o)||r.has(o)||delete e.attributes.billingAddress[o];return e},zt=(e,t)=>({companyName:e.companyName||"",taxNumber:e.taxNumber||"",titleCode:e.titleCode||"",firstName:e.firstName||"",lastName:e.lastName||"",line1:e.line1||"",houseNumber:e.houseNumber||"",line2:e.line2||"",postalCode:e.postalCode||"",town:e.town||"",phone:e.phone||"",country:t||""}),Qt=(e,t)=>
2{const i=zt(e,e.country.isocode),r=zt(t,t.isoCode);return t.region&&!t.isCollectionPoint&&(r.region=t.region),e.region&&!e.isCollectionPoint&&(i.region=e.region.isocode),e.isCollectionPoint&&(delete i.titleCode,delete r.titleCode),JSON.stringify(i)===JSON.stringify(r)},Kt={namespaced:!0,state:{email:"",commerceAddressType:"",deliveryAddress:{},billingAddress:{},commerceAddresses:[],deliveryCommerceAddresses:[],billingCommerceAddresses:[],selectedCommerceDeliveryAddress:{},selectedCommerceBillingAddress:{},sameAsDelivery:!0,emailConfiguration:{},receiptOrEInvoice:!1,deliveryFormConfiguration:{},billingFormConfiguration:{},postalCodeError:null,voucherCodeError:null,taxReliefConfirmError:null,taxReliefDeclineError:null,totalTaxError:null,deliveryAddressError:null,billingAddressError:null,signifydError:null,cartExceptionError:null,thresholdAmountExceeded:{},collectionPoints:[],pupDeliveryMode:"",showPUPOverlay:!1,showAddressOverlay:!1,showPUPErrorMessage:!1,showPermissionDeniedError:!1,showPositionUnavailableError:!1,showTimeOutError:!1,selectedCollectionPoint:{},showMorePup:!1,showLogoutOverlay:!1,selectedDeliveryModeId:null,activePUPIndex:null,overlayLoading:!1,isDeliveryAddressMismatch:!1,isBillingAddressMismatch:!1,suggestedAddress:{},typeAheadSelected:!1,isOptionalValidationFlag:!0,serverAddressErrors:{}}
2,getters:{isOptionalValidationFlag:e=>e.isOptionalValidationFlag,isCollectionPointSelected:e=>Object.keys(e.selectedCollectionPoint).length>0,isNovaPoshtaLimitNoticeVisible:(e,t,i)=>i.cart.cartSummary.totalPriceWithTax.value>15e3&&"NOVA_POSHTA_COLLECTION_POINT"===e.selectedDeliveryModeId,isBillingAddressHidden:(e,t,i,r)=>"UA"===r["config/getDefaultConfig"]("country")?"cod-multi"===i.payments.selectedPaymentMethodId&&"NOVA_POSHTA_COLLECTION_POINT"!==e.selectedDeliveryModeId||i.payments.link2PayEnabled:"cod-multi"===i.payments.selectedPaymentMethodId||i.payments.link2PayEnabled||!0===i.cart.isBCBSBundleAvailable&&0===i.cart.cartSummary.total.value,selectedDeliveryMode:(e,t,i)=>i.cart.applicableDeliveryModes.find(t=>t.id===e.selectedDeliveryModeId)||{},addressType:(e,t)=>t.selectedDeliveryMode?.isCollectionPoint?"billing":"delivery"},mutations:{updateCommerceAddressType(e,t){e.commerceAddressType=t},updateIsDeliveryAddressMismatch(e,t){e.isDeliveryAddressMismatch=t},updateIsBillingAddressMismatch(e,t){e.isBillingAddressMismatch=t},updateDeliveryAddress(e,t){e.deliveryAddress={...e.deliveryAddress,...t}},resetAddress(e,t){e[t]=Object.entries(e[t]).reduce((e,[t,i])=>(e[t]=["country","isoCode"].includes(t)?i:"",e),{})},updateSuggestedAddress(e,t){e.suggestedAddress=t},updateTypeAheadSelected(e,t){e.typeAheadSelected=t},updateSelectedCommerceDeliveryAddress(e,t){e.selectedCommerceDeliveryAddress=Vt(t,e)},updateSelectedCommerceBillingAddress(e,t){const i=e.billingFormConfiguration?.find(e=>"country"===e.name)||{};e.selectedCommerceBillingAddress=Vt(t,e,i.type)},updateCommerceAddresses(e,t){e.commerceAddresses=t},updateDeliveryCommerceAddresses(e,t){e.deliveryCommerceAddresses=t},updateBillingCommerceAddresses(e,t){e.billingCommerceAddresses=t},updateSelectedDeliveryModeId(e,t){e.selectedDeliveryModeId=t},updateBillingAddress(e,t){e.billingAddress={...e.billingAddress,...t}},updateSameAsDelivery(e,t){e.sameAsDelivery=t},updateEmail(e,t){e.email=t},updateEmailConfiguration(e,t){e.emailConfiguration=t},updateDeliveryFormConfiguration(e,t){e.deliveryFormConfiguration=t},updateBillingFormConfiguration(e,t){e.billingFormConfiguration=t},updateReceiptOrEInvoice(e,t){e.receiptOrEInvoice=t},updatePostalCodeError(e,t){e.postalCodeError=t},updateDeliveryAddressError(e,t){e.deliveryAddressError=t},updateBillingAddressError(e,t){e.billingAddressError=t},updateSignifydError(e,t){e.signifydError=t},updateCartExceptionError(e,t){e.cartExceptionError=t},updateVoucherCodeError(e,t){e.voucherCodeError=t},updateTaxReliefConfirmError(e,t){e.taxReliefConfirmError=t},updateTaxReliefDeclineError(e,t){e.taxReliefDeclineError=t},updateTotalTaxError(e,t){e.totalTaxError=t},updateCollectionPoints(e,t){e.collectionPoints=t},updatePupOverlayStatus(e,t){e.showPUPOverlay=t},updateAddressOverlayStatus(e,t){e.showAddressOverlay=t},updatePupErrorMessageStatus(e,t){e.showPUPErrorMessage=t},updatePermissionDeniedErrorMessageStatus(e,t){e.showPermissionDeniedError=t},updatePositionUnavailableErrorMessageStatus(e,t){e.showPositionUnavailableError=t},updateTimeOutErrorMessageStatus(e,t){e.showTimeOutError=t},updatePupDeliveryMode(e,t){e.pupDeliveryMode=t},updateSelectedCollectionPoint(e,t){e.selectedCollectionPoint=t},updateShowMorePup(e,t){e.showMorePup=t},updateActivePUPIndex(e,t){e.activePUPIndex=t},updateOverlayLoading(e,t){e.overlayLoading=t},updateLogoutOverlayStatus(e,t){e.showLogoutOverlay=t},updateIsOptionalValidationFlag(e,t){e.isOptionalValidationFlag=t},updateServerAddressErrors(e,t){e.serverAddressErrors={...e.serverAddressErrors,...t}}},actions:{updateDeliveryMode:({state:t,commit:i,rootState:r,dispatch:o},{deliveryMode:s,signal:a})=>new Promise((n,l)=>{const c=r.cart.cartId;c?(i("payments/updateIsPayButtonDisabled",!0,{root:!0}),function(e,t,{signal:i}={}){return _e.post(`${ge()}/cart/${e}/deliverymodes`,{deliveryMode:t},{signal:i})}(c,s,{signal:a}).then(e=>{i("payments/updateIsPayButtonDisabled",!1,{root:!0});Je(e.data.data,{commit:i,dispatch:o,rootState:r}),t.selectedDeliveryModeId&&i("updateSelectedDeliveryModeId",s),n(e)}).catch(t=>{e.isCancel(t)?n():(i("payments/updateIsPayButtonDisabled",!0,{root:!0}),i("updateErrorDetails",{showError:!0,errorMessageCode:"5010",fullErrorMessage:t},{root:!0}),console.error(t),l(t))})):l()}),updateDeliveryAddress({commit:e},t){e("updateDeliveryAddress",t)},updateSuggestedAddress({commit:e},t){e("updateSuggestedAddress",t)},updateIsDeliveryAddressMismatch({commit:e},t){e("updateIsDeliveryAddressMismatch",t)},updateTypeAheadSelected({commit:e},t){e("updateTypeAheadSelected",t)},updateIsBillingAddressMismatch({commit:e},t){e("updateIsBillingAddressMismatch",t)},updateSelectedCommerceDeliveryAddress({commit:e},t){e("updateSelectedCommerceDeliveryAddress",t),e("updateDeliveryAddress",t)},updateSelectedCommerceBillingAddress({commit:e},t){e("updateSelectedCommerceBillingAddress",t),e("updateBillingAddress",t)},updateBillingAddress({commit:e},t){e("updateBillingAddress",t)},updateSameAsDelivery({commit:e},t){e("updateSameAsDelivery",t)},updateReceiptOrEInvoice({commit:e},t){e("updateReceiptOrEInvoice",t)},updateFormFields({commit:e,rootState:t,state:i,dispatch:r},o){const s=Mt(o.deliveryAddressFields,t.config.config.checkoutFieldConfig.delivery,"name",o.featureToggles.fieldConfigByAPI),a=Mt(o.billingAddressFields,t.config.config.checkoutFieldConfig.billing,"name",o.featureToggles.fieldConfigByAPI),n=o.emailInputField,l=Mt([n],t.config.config.checkoutFieldConfig.userConfig,"name");if("{}"===JSON.stringify(i.deliveryAddress)&&"{}"===JSON.stringify(i.billingAddress)&&(e("updateDeliveryAddress",s[1]),e("updateBillingAddress",a[1])),e("updateEmailConfiguration",l[0]),e("updateDeliveryFormConfiguration",s[0]),e("updateBillingFormConfiguration",a[0]),void 0!==o.taxReliefFields&&o.taxReliefFields.length>0){r("tax/updateTaxReliefData",Lt(o.taxReliefFields),{root:!0})}r("tax/updateTaxRegionConfigOptions",s[0],{root:!0})},updateEmail({commit:e},{email:t}){e("updateEmail",t)},submitOrderWrapper:({rootState:e,dispatch:t},{deliveryMode:i,consentStateObject:r,isLoggedIn:o})=>e.payments.link2PayEnabled?t("payByLinkSubmitOrder"):o?t("updateDeliveryMode",{deliveryMode:i}
2).then(()=>{const{isMarketingConsentVisible:e,isMarketingConsentAccepted:i,isMarketingConsentHasChecked:o,isHealthConsentHasChecked:s,isHealthConsentAccepted:a}=r;return e&&i&&!o||e&&o&&!s&&a?t("consent/updateUserConsent",null,{root:!0}).then(()=>t("submitOrder").catch(e=>{throw e})):t("submitOrder").catch(e=>{throw e})}).catch(e=>{throw e}):t("submitOrder"),submitOrder({state:e,getters:t,commit:i,dispatch:r,rootState:o,rootGetters:s},a=""){const n=a||Nt({state:e,getters:t,commit:i,rootState:o,rootGetters:s}),l=o.cart.cartId,c=n.data?.data?.attributes?.deliveryAddress?.country?.isocode?.toUpperCase();switch(c){case"DEUTSCHLAND":n.data.data.attributes.deliveryAddress.country.isocode="DE";break;case"SVERIGE":n.data.data.attributes.deliveryAddress.country.isocode="SE";break;case"FRANCE":n.data.data.attributes.deliveryAddress.country.isocode="FR"}const d=n.data.attributes.paymentMethod,u=((e,{id:t}={})=>{const{applicablePaymentMethods:i=[]}=e.payments||{};return((e,t)=>e.find(({id:e})=>e===t)?.provider||null)(i,t)||null})(o,d),p=o.payments.bankCardDetails,m=Dt(u,d,p);return m.length>0?Promise.reject(new Et(m,xt,{paymentMethod:d})):function(e,t,i={}){return _e.post(`${ge()}/cart/${e}/submit`,t,{params:i})}(l,n).then(e=>e?.data?.data||Promise.reject(new Tt({data:{}}))).catch(e=>{const{response:t,response:{data:{errors:o=[]}}}=e,s=o.find(({status:e,title:t,source:{parameter:i=""}={}})=>("400"===e&&i.includes("postalCode")&&r("notification/updateErrorNotifications",{text:t},{root:!0}),"400"===e&&i.includes("postalCode"))),a=o.find(({status:e,source:{parameter:t=""}={},title:i=""})=>("400"===e&&t.includes("InvalidVoucher")&&r("notification/updateErrorNotifications",{text:i},{root:!0}),"400"===e&&t.includes("InvalidVoucher"))),n=o.find(({status:e,source:{parameter:t=""}={},title:i="cartoverview.tax-relief-error"})=>("400"===e&&t.includes("application")&&r("notification/updateErrorNotifications",{text:i,isI18n:!0},{root:!0}),"400"===e&&t.includes("application"))),l=o.find(({status:e,source:{parameter:t=""}={},title:i="cartoverview.tax-relief-error"})=>("400"===e&&t.includes("application")&&r("notification/updateErrorNotifications",{text:i,isI18n:!0},{root:!0}),"400"===e&&t.includes("application"))),c=o.find(({status:e,source:{parameter:t=""}={}})=>"400"===e&&t.includes("totalTax")),d=o.find(({status:e,source:{parameter:t=""}={}})=>"400"===e&&(t.includes("deliveryAddress.")||t.includes("line1")||t.includes("titleCode"))),u=o.find(({status:e,source:{parameter:t=""}={}})=>"400"===e&&t.includes("billingAddress.")),p=o.find(({status:e,source:{parameter:t=""}={}})=>("400"===e&&t.includes("signifyd_status")&&r("notification/updateErrorNotifications",{text:"checkoutoverview.signifyd-error-message",isI18n:!0},{root:!0}),"400"===e&&t.includes("signifyd_status"))),m=o.find(({status:e,source:{parameter:t=""}={},title:i=""})=>("400"===e&&t.includes("CartException")&&r("notification/updateErrorNotifications",{text:i},{root:!0}),"400"===e&&t.includes("CartException")));throw i("updatePostalCodeError",s),i("updateVoucherCodeError",a),i("updateTaxReliefConfirmError",l),i("updateTaxReliefDeclineError",n),i("updateTotalTaxError",c),i("updateDeliveryAddressError",d),i("updateBillingAddressError",u),i("updateSignifydError",p),i("updateCartExceptionError",m),new Tt(t)})},payByLinkSubmitOrder({state:e,getters:t,rootState:i,commit:r,rootGetters:o}){const s=Nt({state:e,commit:r,getters:t,rootState:i,rootGetters:o});return(a=i.order.orderId,n=s,_e.post(`${ge()}/payByLinkSubmit?orderId=${a}`,n)).then(e=>e?.data?.data||Promise.reject(new Tt({data:{}}))).catch(e=>{const{response:t}=e;throw new Tt(t)});var a,n},async getCollectionPoints({state:e,rootState:t,commit:i,rootGetters:r},o){const s=r["config/getDefaultConfig"]("distanceUnit");"NOVA_POSHTA_COLLECTION_POINT"===e.pupDeliveryMode&&(o={...o,totalPrice:t.cart.cartSummary.totalPriceWithTax.value}),await function(e,t,i){return _e.get(`${ge()}/config/collectionPoints`,{params:{deliveryMode:e,unit:t,...i}})}(e.pupDeliveryMode,s,o).then(e=>{i("updateCollectionPoints",e.data.collectionPoints)})},resetCollectionPoints({commit:e}){e("updateCollectionPoints","")},updatePupOverlayStatus({commit:e},t){e("updatePupOverlayStatus",t)},updatePupErrorMessageStatus({commit:e},t){e("updatePupErrorMessageStatus",t)},updatePermissionDeniedErrorMessageStatus({commit:e},t){e("updatePermissionDeniedErrorMessageStatus",t)},updatePositionUnavailableErrorMessageStatus({commit:e},t){e("updatePositionUnavailableErrorMessageStatus",t)},updateTimeOutErrorMessageStatus({commit:e},t){e("updateTimeOutErrorMessageStatus",t)},updateSelectedDeliveryModeId({commit:e},t){e("updateSelectedDeliveryModeId",t)},updatePupDeliveryMode({commit:e},t){e("updatePupDeliveryMode",t)},updateSelectedCollectionPoint({commit:e,rootState:t,state:i}
2,r){"NOVA_POSHTA_COLLECTION_POINT"===i.pupDeliveryMode&&r?.attributes?.address&&!r.attributes.address.postalCode?r.attributes.address.postalCode="01000":"ro_RO"===t.config?.config?.checkoutConfig?.localeId&&r?.attributes?.address&&!r.attributes.address.region&&(r.attributes.address.region="RO-AA"),e("updateSelectedCollectionPoint",r)},updateShowMorePup({commit:e},t){e("updateShowMorePup",t)},updateActivePUPIndex({commit:e},t){e("updateActivePUPIndex",t)},updateOverlayLoading({commit:e},t){e("updateOverlayLoading",t)},updateLogoutOverlayStatus({commit:e},t){e("updateLogoutOverlayStatus",t)},updateIsOptionalValidationFlag({commit:e},t){e("updateIsOptionalValidationFlag",t)},updateServerAddressErrors({commit:e},t){e("updateServerAddressErrors",t)},updateAddressOverlayStatus({commit:e},{isVisible:t=!1,type:i=""}){e("updateAddressOverlayStatus",t),e("updateCommerceAddressType",i)},clearPupErrorMessages({commit:e}){e("updatePupErrorMessageStatus",!1),e("updatePermissionDeniedErrorMessageStatus",!1),e("updatePositionUnavailableErrorMessageStatus",!1),e("updateTimeOutErrorMessageStatus",!1),e("updatePupOverlayStatus",!1)}}},Jt={validatePayment:(e={},t={})=>_e.post(`${ge()}/cart/validatePayment`,e,{params:t}),validatePayByLinkPayment:e=>_e.post(`${ge()}/cart/validatePayByLinkPayment`,{data:e||{}})},Yt=async({commit:e,rootGetters:t,dispatch:i,rootState:r},o)=>{Je(o,{commit:e,dispatch:i,rootState:r});const s=Ke(o,"orderId",""),a=Ke(o,"email",""),n=Ke(o,"deliveryAddress",{}),l=Ke(o,"billingAddress",{}),c=Ke(o,"paymentMethod",""),d=Ke(o,"items");e("updatedOrderId",s),e("payments/updatePaymentMethod",c,{root:!0}),e("delivery/updateEmail",a,{root:!0}),e("delivery/updateDeliveryAddress",n,{root:!0}),e("delivery/updateBillingAddress",l,{root:!0});const u=d.filter(e=>e.sellerName&&e.sellerId),p=Ye(d,"sellerName");e("cart/updateIsSellerProduct",u.length>0,{root:!0}),e("cart/updateIsSellerGroupItems",p,{root:!0});const m=d.map(e=>qe(e.itemId)),h=[...new Set(m)].toString();e("cart/updateProducts",await Ge(h,t),{root:!0})},Zt={namespaced:!0,state:{orderId:""},mutations:{updatedOrderId(e,t){e.orderId=t}},actions:{async validatePayByLinkPayment({commit:e,rootGetters:t,dispatch:i,rootState:r},{paymentDetailsObject:o}){const s=await Jt.validatePayByLinkPayment(o).catch(e=>Promise.reject(e)),a=s?.data?.data||{};return"IN_PROGRESS"===a.attributes?.validationStatus||(await Yt({commit:e,rootGetters:t,dispatch:i,rootState:r},a).then(()=>Promise.resolve()).catch(e=>(console.error(e),Promise.reject(e))),ne.removeCookie({key:`${t["config/getDefaultConfig"]("siteId")}-cartstatus-com`}),ne.removeCookie({key:"ageConsent-opt-in"}),r.config.isLoggedIn||i("revokeAccessToken")),Promise.resolve(a)},async validatePayment({commit:e,rootGetters:t,dispatch:i,rootState:r},{validatePaymentParameters:o,isFirstTime:s}){const a=await Jt.validatePayment(o,{isFirstTime:s}).catch(e=>Promise.reject(e)),n=a?.data?.data||{};return["SUCCESS","PENDING"].includes(n.attributes?.validationStatus)?(await Yt({commit:e,rootGetters:t,dispatch:i,rootState:r},n).then(()=>Promise.resolve()).catch(e=>(console.error(e),Promise.reject(e))),ne.removeCookie({key:`${t["config/getDefaultConfig"]("siteId")}-cartstatus-com`}),ne.removeCookie({key:"ageConsent-opt-in"}),r.config.isLoggedIn||i("revokeAccessToken"),Promise.resolve(n)):Promise.reject(n)},async revokeAccessToken({commit:e,rootGetters:t}){await Xe.revokeAccessToken({},{type:"SHOP"},t["config/getDefaultConfig"]("sessionUrl")),e("config/updateAccessToken","",{root:!0})}}},Xt={namespaced:!0,state:{promotions:[],appliedProductPromotions:[],appliedPromotions:[],potentialProductPromotions:[],potentialPromotions:[]},getters:{getPerfectPartnerBundleAdjustedPriceForItem:e=>t=>{let i=0;for(const r of e.appliedProductPromotions)if("PROMOTION_PRODUCT_PERFECT_PARTNER"===r.type)for(const e of r.consumedItems)e.itemCartOrder===Number.parseInt(t.id,10)&&(i+=e.quantity*e.adjustedUnitPrice.value);return i},getFixedOrPercentPromotionPriceByItemCartOrder:(e,t)=>e=>{const i=t.getFixedOrPercentPromotionByItemCartOrder(e.id)[0];let r=0;if(["PROMOTION_PERCENTAGE_DISCOUNT","PROMOTION_PRODUCT_FIXED_PRICE","PROMOTION_PRODUCT_FIXED_DISCOUNT"].includes(i?.type))for(const t of i.consumedItems)t.itemCartOrder===Number.parseInt(e.id,10)&&(r+=t.quantity*t.adjustedUnitPrice.value);return r},getBundledPromotionPriceByItemCartOrder:(e,t)=>e=>{const i=t.getBundledPromotionsByItemCartOrder(e.id);let r=0;for(const t of i){r+=t.consumedItems.find(t=>t.itemCartOrder===Number.parseInt(e.id,10)).adjustedUnitPrice.value}return r},getFixedOrPercentPromotionByItemCartOrder:e=>t=>e.appliedProductPromotions.filter(e=>e.consumedItems.filter(i=>i.itemCartOrder===Number.parseInt(t,10)&&"PROMOTION_PRODUCT_PERFECT_PARTNER_BUNDLE"!==e.type&&"PROMOTION_PRODUCT_PERFECT_PARTNER"!==e.type).length),getBundledPromotionsByItemCartOrder:e=>t=>e.appliedProductPromotions.filter(e=>e.consumedItems.filter(i=>i.itemCartOrder===Number.parseInt(t,10)&&("PROMOTION_PRODUCT_PERFECT_PARTNER_BUNDLE"===e.type||"PROMOTION_PRODUCT_PERFECT_PARTNER"===e.type)).length),checkForSameBaseAndPartnerProduct:e=>t=>{let i=!1,r=0;if(e.appliedProductPromotions)for(const o of e.appliedProductPromotions){r=0;for(const e of o.consumedItems)e.itemCartOrder===Number.parseInt(t,10)&&r++;o.consumedItems.length===r&&(i=!0)}return i},getBundledPromotionsPartnerItems:e=>t=>e.appliedProductPromotions.filter(e=>("PROMOTION_PRODUCT_PERFECT_PARTNER_BUNDLE"===e.type||"PROMOTION_PRODUCT_PERFECT_PARTNER"===e.type)&&e.partnerProducts&&e.partnerProducts.includes(t)),maxBundleQuantity:()=>e=>e.bundleQuantity||0,getPromotionData:(e,t)=>e=>{const i={active:!1,label:!1},r=t.getFixedOrPercentPromotionByItemCartOrder(e.id)[0];return r&&(i.consumedItems=r?.consumedItems,i.active=!0,"PROMOTION_PERCENTAGE_DISCOUNT"===r.type&&(i.label=!0,i.labelType="percentage-discount",i.labelData=Math.round(r.percentageDiscount)),"PROMOTION_PRODUCT_FIXED_DISCOUNT"===r.type&&(i.label=!0,i.labelType="fixed-discount",i.labelData=r.promotionDiscount.formattedValue),"PROMOTION_PRODUCT_FIXED_PRICE"===r.type&&(i.label=!0,i.labelType="fixed-price",i.labelData=r.promotionDiscount.formattedValue)),i},getQuantity:(e,t,i,r)=>e=>{const t=e.bundleQuantity||0;return r["cart/isQuantityMismatch"](e.itemId)?e.availability.quantity-t:e.quantity-t}
2,getPrice:(e,t)=>e=>{let i=0;const r=t.getPromotionData(e);if(!r.active||void 0!==e.bundleQuantity&&0!==e.bundleQuantity)if(r.active&&void 0!==e.bundleQuantity&&e.bundleQuantity>0)i=Number(e.totalPrice.value)-t.getPerfectPartnerBundleAdjustedPriceForItem(e);else{const r=Number(t.getBundledPromotionPriceByItemCartOrder(e));0===r?i=Number(e.totalPrice.value):r!==Number(e.totalPrice.value)&&r<Number(e.totalPrice.value)&&(i=Number(e.discountPrice.value)*t.getQuantity(e))}else{const r=Number(t.getFixedOrPercentPromotionPriceByItemCartOrder(e));i=Math.min(r,Number(e.totalPrice.value))}return i}},mutations:{setPromotions(e,t){e.promotions=t},updatePromotions(e,t){e.appliedProductPromotions=t.promotions.appliedProductPromotions,e.appliedPromotions=t.promotions.appliedPromotions,e.potentialProductPromotions=t.promotions.potentialProductPromotions,e.potentialPromotions=t.promotions.potentialPromotions}},actions:{getPromotions({commit:e,rootState:t}){const{country:i,language:r}=t.config.config.checkoutConfig;return Ie.getPromotions(i,r).then(t=>{e("setPromotions",t.data.data.promotedProducts)}).catch(e=>{console.error(e)})},updatePromotions({commit:e},t){e("updatePromotions",t)}}},ei={namespaced:!0,state:{recentlyViewedProducts:[]},mutations:{updateRecentlyViewedProducts(e,t){e.recentlyViewedProducts.push(t)},resetRecentlyViewedProducts(e){e.recentlyViewedProducts=[]}},actions:{checkRecentlyViewedProducts({dispatch:e}){const t=ne.getCookie("T01-recentlyViewedProducts");let i=[];if(t)for(const r of t.split("|")){const e=r.split(",")[0];void 0!==e&&i.push(e)}if(i=[...new Set(i)].slice(0,5),i.length>0){e("getRecentlyViewedProducts",{ctn:i.join(",")})}},getRecentlyViewedProducts({commit:e,rootGetters:t},{ctn:i}){e("resetRecentlyViewedProducts");const r=t["config/getDefaultConfig"],o=r("sectorId")||"B2C",s=r("localeId")||`${r("language")}_${r("country").toUpperCase()}`,a=r("catalogId")||"CARE";return new Promise((t,r)=>{Ie.getProductDetails({ctn:i,sectorId:o,localeId:s,catalogId:a}).then(i=>{if(200===i.status){!async function({recentViewedProducts:e,commit:t}){const i=[];for(const r of e)for(const e of r.catalogs)"SHOPPUB"!==e.catalogId||"NORMAL"!==e.status&&"NEW"!==e.status&&"DELETED"===e.status||i.push(r);if(i.length>0)for(const r of i)"{}"!==JSON.stringify(r)&&await He(r,t)}({recentViewedProducts:i.data.data,commit:e})}t()}).catch(e=>{r(e)})})}}},ti=()=>ie(()=>import("./recommendation.index-HpBP6c2g.js"),__vite__mapDeps([0,1]));let ii="";const ri={namespaced:!0,state:{coveoRecommendedProducts:[],coveoAnalyticsList:[]},mutations:{updateCoveoRecommendedProducts(e,t){e.coveoRecommendedProducts.push(t)},updateCoveoAnalyticsList(e,t){t.length>0&&e.coveoAnalyticsList.push(t)},resetCoveoRecommendedProducts(e){e.coveoRecommendedProducts=[]}},actions:{async loadRecommendationClickAnalyticsActions(e,t){if(!ii)return;const{loadClickAnalyticsActions:i}=await ti(),{logRecommendationOpen:r}=i(ii);ii.dispatch(r(t))},async getCoveoRecommendedProducts({rootGetters:e,commit:t,rootState:i},r){const{language:o,country:s}=i.config?.config?.checkoutConfig||{},a=`${o}-${s}`,n="koninklijkephilipsnvproduction2k8xfrmr",l="1"===r?"cartGlobal":"frequentBoughtGlobal",c=i.cart.items,d=[];if(0===c.length)return void t("resetCoveoRecommendedProducts");if("1"===r)for(const g of c)d.push(g.itemId?.toLowerCase());else"2"===r&&d.push(c[0].itemId?.toLowerCase());const{buildRecommendationEngine:u,buildRecommendationList:p,getOrganizationEndpoint:m}=await ti();ii=u({configuration:{accessToken:"xx0d641857-e140-4e94-af32-ea8fe1063ce8",organizationId:n,locale:a,organizationEndpoints:m(n),preprocessRequest:(e,t,i)=>{if("recommendations"===i?.method){const t=JSON.parse(e.body);t.mlParameters={itemIds:d},e.body=JSON.stringify(t)}return e}}});const h=p(ii,{options:{numberOfRecommendations:10,id:l}});h.refresh(),h.subscribe(()=>{const i=h.state;if(t("updateCoveoAnalyticsList",i.recommendations),!i.isLoading&&i.recommendations.length>0){const r=i.recommendations.map(e=>e?.raw?.ps_productid?.[0]?.toUpperCase()?.replace("/","_")||""),a=e["config/getDefaultConfig"],n=a("sectorId")||"B2C",l=`${o}_${s}`,c=a("catalogId")||"CONSUMER";return new Promise((e,i)=>{Ie.getProductDetails({ctn:r,sectorId:n,localeId:l,catalogId:c}).then(e=>{if(200===e.status){const i=e.data.data;t("resetCoveoRecommendedProducts"),i?.length>0&&Ue(i,t)}}).catch(e=>{i(e)})})}t("resetCoveoRecommendedProducts")})}}};const oi={namespaced:!0,state:{taxExemptionEligible:!1,taxExemptionEligibleApplied:!1,taxReliefForm
2Configuration:{},taxRegionConfigOptions:{},taxReliefAddress:{}},mutations:{updateTaxExemptionEligible(e,t){e.taxExemptionEligible=t},updateTaxExemptionEligibleApplied(e,t){e.taxExemptionEligibleApplied=t},updateTaxReliefFormConfiguration(e,t){e.taxReliefFormConfiguration=t},updateTaxReliefAddress(e,t){e.taxReliefAddress=t},updateTaxRegionConfigOptions(e,t){const i=t?.find(e=>"region"===e.name);if(i){const t=JSON.parse(JSON.stringify(i));for(const e of t.options)e.key=e.value=e.key.split("-")[1];t.options=(r=t.options,o="value",r.sort((e,t)=>e[o]<t[o]?-1:e[o]>t[o]?1:0)),e.taxRegionConfigOptions=t}var r,o}},actions:{updateTaxRelief:({dispatch:e,rootState:t,commit:i},r)=>new Promise((o,s)=>{Ie.updateTaxRelief(t.cart.cartId,r).then(a=>{if(200===a.status){const s=a.data.data;e("cart/updateCartDetails",{data:s},{root:!0}).then(()=>{ne.setCookie({key:"checkout-tax-relief-patient-info",value:r.relief?JSON.stringify(t.delivery.taxReliefAddress):"",encoded:!0}),ne.setCookie({key:"checkout-is-tax-relief-applied",value:!!r.relief||""}),i("updateTaxExemptionEligibleApplied",Boolean(r.relief)),o()})}else s(a)}).catch(e=>{s(e)})}),checkStorageForTaxReliefInfo({commit:e}){const t=ne.getCookie("checkout-tax-relief-patient-info",!0),i=ne.getCookie("checkout-is-tax-relief-applied");e("updateTaxReliefAddress",structuredClone(t)),e("updateTaxExemptionEligibleApplied","true"===i)},updateTaxReliefData({commit:e},t){e("updateTaxReliefFormConfiguration",t[0]),e("updateTaxReliefAddress",t[1])},updateTaxRegionConfigOptions({commit:e},t){e("updateTaxRegionConfigOptions",t)},getEstimatedTax:({dispatch:e,rootState:t},i)=>new Promise((r,o)=>{Ie.getEstimatedTax(t.cart.cartId,i).then(t=>{if(200===t.status){const i=t.data.data;e("cart/updateCartDetails",{data:i,cartAction:"estimatedTax"},{root:!0}).then(()=>{r()})}else o(t)}).catch(e=>{o(e)})})}},si={namespaced:!0,state:{bundleList:{},appliedBundles:[]},getters:{getBundleWithId:e=>t=>e.bundleList[t],getAppliedBundles:e=>t=>e.appliedBundles.find(e=>t===(e.id||""))||{}},mutations:{updateBundleList(e,t){e.bundleList=t},updateAppliedBundles(e,t){for(const i of t)/^4[AB]/.test(i?.archeType?.trim().toUpperCase())&&(i.subscriptionBundleType="ACCESS");e.appliedBundles=t}}},ai={namespaced:!0,state:{errorNotifications:[]},mutations:{updateErrorNotifications(e,t){Array.isArray(t)||(t=[t]),e.errorNotifications.push(...t)},removeErrorNotifications(e,t){null!==t?e.errorNotifications.splice(t,1):e.errorNotifications.length=0}},getters:{findIndexByText:e=>t=>{e.errorNotifications.findIndex(e=>e.text===t)},getAddressNotifications:e=>e.errorNotifications.filter(e=>"AddressForm"===e.location),getGenericNotifications:e=>e.errorNotifications.filter(e=>void 0===e.location)},actions:{updateErrorNotifications({commit:e,state:t},i){Array.isArray(i)||(i=[i]);const r=i.map(e=>(e.type||="error",e)).filter(e=>!t.errorNotifications.some(t=>t.text===e.text));r.length>0&&e("updateErrorNotifications",r)},removeByText:({commit:e,state:t},i)=>{e("removeErrorNotifications",t.errorNotifications.findIndex(e=>e.text===i))}}},ni={encryptedCardNumber:"",encryptedExpiryMonth:"",encryptedExpiryYear:"",encryptedSecurityCode:"",blikCode:"",holderName:"",type:""},li=new Date,ci=ne.getCookie("allow3DS2"),di="false"!==ci?.toLowerCase(),ui=t({strict:!1,state:{error:{showError:!1,errorMessageCode:"",fullErrorMessage:""}},modules:{cart:Ze,config:ot,delivery:Kt,order:Zt,promotions:Xt,consent:lt,recentlyViewedProducts:ei,recommendedProducts:ri,bundles:si,notification:ai,tax:oi,payments:{namespaced:!0,state:{isAdyenWebComponentValidated:!1,otherPaymentSelected:!1,applicablePaymentMethods:[],applicableInlinePaymentMethods:{},bankCardDetails:ni,paymentStatus:"",paymentMethod:"",selectedPaymentMethodId:"",isPayButtonDisabled:!1,isPayButtonPartialDisabled:!1,adyen:{clientKey:"",environment:"test",storedCards:!1},browserInfo:{colorDepth:screen?.colorDepth||24,language:navigator?.language||"",javaEnabled:navigator?.javaEnabled()||!1,screenHeight:screen?.height||0,screenWidth:screen?.width||0,timeZoneOffset:li.getTimezoneOffset(),userAgent:navigator?.userAgent||""},additionalData:{allow3DS2:di},link2PayEnabled:!1},getters:{selectedPaymentDetails(e){for(const t of e.applicablePaymentMethods)if(t.id===e.selectedPaymentMethodId)return t;return{}},isCancelledPayment:e=>["cancelled","cancel","refused"].includes(e.paymentStatus.toLowerCase())},mutations:{updateAdyenWebComponentValidated(e,t){e.isAdyenWebComponentValidated=t},updateOtherPaymentSelected(e,t){e.otherPaymentSelected=t},updateApplicablePaymentMethods(e,t){e.applicablePaymentMethods=t},updateApplicableInlinePaymentMethods(e,t){e.applicableInlinePaymentMethods=t}
2,resetBankCardDetails(e){e.bankCardDetails=ni},updateSelectedPaymentMethodId(e,t){e.selectedPaymentMethodId=t},updatePaymentStatus(e,t){e.paymentStatus=t},updatePaymentMethod(e,t){e.paymentMethod=t},updateAdyen(e,{clientKey:t,environment:i,storedCards:r}){e.adyen={clientKey:t,environment:i,storedCards:r}},updateBankCardDetails(e,t){e.bankCardDetails={...e.bankCardDetails,...t}},updateBrowserInfo(e,t){e.browserInfo=t},updateIsPayButtonDisabled(e,t){e.isPayButtonDisabled=t},updateIsPayButtonPartialDisabled(e,t){e.isPayButtonPartialDisabled=t},updateLink2PayEnabled(e,t){e.link2PayEnabled=t}},actions:{resetBankCardDetails({commit:e}){e("resetBankCardDetails")},updateAdyenWebComponentValidated({commit:e},t){e("updateAdyenWebComponentValidated",t)},updateOtherPaymentSelected({commit:e},t){e("updateOtherPaymentSelected",t)},updateApplicablePaymentMethods({commit:e},t){e("updateApplicablePaymentMethods",t)},updateApplicableInlinePaymentMethods({commit:e},t){e("updateApplicableInlinePaymentMethods",t)},updateSelectedPaymentMethodId({commit:e},t){e("resetBankCardDetails"),e("updateSelectedPaymentMethodId",t)},updatePaymentMethod({commit:e},t){e("updatePaymentMethod",t)},updateAdyen({commit:e},t){e("updateAdyen",t)},updateIsPayButtonDisabled({commit:e},t){e("updateIsPayButtonDisabled",t)},updateIsPayButtonPartialDisabled({commit:e},t){e("updateIsPayButtonPartialDisabled",t)},updatePaymentStatus({commit:e,dispatch:t}){const i=new URLSearchParams(window.location.search),r=i.get("authResult")?.toUpperCase()||i.get("callbackType")?.toUpperCase();if(new Set(["CANCEL","REFUSED","FAILURE","CANCELLED"]).has(r)&&e("updatePaymentStatus",r),void 0!==r&&"SUCCESS"!==r){t("notification/updateErrorNotifications",{text:`checkoutoverview.payment.${"FAILURE"===r?"failed":"cancel"}.text`,title:`checkoutoverview.payment.${"FAILURE"===r?"failed":"cancel"}.title`,isI18n:!0},{root:!0})}},updateLink2PayEnabled({commit:e},t){e("updateLink2PayEnabled",t)}}}},mutations:{updateErrorDetails(e,t){let i={};if(e.error.showError=t.showError,e.error.errorMessageCode=t.errorMessageCode||e.error.errorMessageCode,t.fullErrorMessage){const e=t.fullErrorMessage;i=e.response?.data||e}else i=e.error.fullErrorMessage;if("string"==typeof i&&i==i.toString()||(i.debug={locale:e.config?.config?.checkoutConfig?.localeId,siteId:e.config?.config?.checkoutConfig?.siteId,isLoggedIn:e.config?.isLoggedIn}),e.error.fullErrorMessage="{}"===JSON.stringify(i)?i.toString():JSON.stringify(i),e.error.fullErrorMessage?.toLowerCase().includes("integration_")||e.error.fullErrorMessage?.toLowerCase().includes("timed out")){const t={1010:"8010",1040:"8020",2030:"8030",2040:"8030",2050:"8030",4010:"8040",4011:"8040",5010:"8050"};e.error.errorMessageCode=t[e.error.errorMessageCode]||e.error.errorMessageCode}}},actions:{updateErrorDetails({commit:e},t){e("updateErrorDetails",t)}}}),pi=async()=>(ui.getters["config/getAccessToken"]||await ui.dispatch("config/getAccessToken").catch(e=>Promise.reject(e)),Promise.resolve()),mi=async(e,t)=>("cart"!==t&&ui.getters["cart/getCartItemsLength"]||e||await ui.dispatch("cart/getCartItems").catch(e=>Promise.reject(e)),Promise.resolve()),hi={AT:{"at-loyaltyshop":"AT_Loyaltyshop","at-zahnarztempfehlung":"AT_Zahnarztempfehlung","at-da-partnershop":"AT_Partnershop",dentistrecommended:"AT_Dentist_Recommended",hebammenshop:"AT_Avent_Hebammenshop","hm-member":"AT_HM_member","philips-avent-loyaltyshop":"AT_Philips_Avent_loyaltyshop"},BE:{"be-voordeelvandeexpert":"BE_voordeelvandeexpert","corporate-benefits":"BE_Corporate_Benefits",esteelauder:"BE_Estee_Lauder","hm-member":"BE_HM_member",loyaltyshop:"BE_loyaltyshop","philips-avent-loyaltyshop":"BE_Philips_Avent_loyaltyshop","saeco-be-exclusive":"BE_Saeco_exclusive","veepee-deals":"BE_Veepee_Deals"},CH:{adent:"CH_Adent",adentph:"CH_Adentph","ch-da-partnershop":"CH_Partnershop","ch-sanitas":"CH_Sanitas",dentistrecommended:"CH_Dentist_Recommended",giveaway:"CH_Giveaway","groupe-mutuel":"CH_Groupe_Mutuel",helsana:"CH_Helsana","hm-member":"CH_HM_member",kpt:"CH_KPT",loyaltyshop:"CH_Loyaltyshop","philips-avent-loyaltyshop":"CH_Philips_Avent_loyaltyshop","private-sale":"CH_private_sale",reimbursedbreastpump:"CH_Groupe_Mutuel_Breastpump"},CZ:{"cz-50offemployee":"CZ_50offemployee","cz-studenti":"CZ_studenti","partner-program":"CZ_partner_program"},DE:{ICS:"DE_ICS","allianz-aok":"DE_allianz_aok","corporate-benefits":"DE_Corporate_Benefits","de-zahnarztempfehlung":"DE_Zahnarztempfehlung","de-loyaltyshop":"DE_Campaign_L
2oyaltyshop",dentistrecommended:"DE_Dentist_Recommended",giveaway:"DE_Giveaway",hebammenshop:"DE_Avent_Hebammenshop","hm-member":"DE_HM_member",klarna:"DE_Klarna","philips-avent-loyaltyshop":"DE_Philips_Avent_loyaltyshop","premium-deal-corporate-benefits":"DE_Premium_Deal_Corporate_Benefits","pregnancy-plus-premium-gift":"DE_Pregnancy_plus_premium_gift","private-sale":"DE_private_sale","veepee-deals":"DE_Veepee_deals",vodafone:"DE_vodafone"},DK:{"dk-loyaltyshop":"DK_Loyaltyshop","private-sale":"DK_private_sale"},ES:{"corporate-benefits":"ES_Corporate_Benefits",dentistrecommended:"ES_Dentist_Recommended","es-loyaltyshop":"ES_Loyaltyshop","hm-member":"ES_hm_member",klarna:"ES_klarna","philips-avent-loyaltyshop":"ES_Philips_Avent_loyaltyshop","private-sale":"ES_private_sale","ventas-a-los-empleados":"ES_Ventas_a_los_Empleados",vodafone:"ES_Vodafone"},FI:{"private-sale":"FI_private_sale"},FR:{basicfit:"FR_Basicfit",dentistrecommended:"FR_Dentist_Recommended","fr-loyaltyshop":"FR_Loyaltyshop","hm-member":"FR_hm_member",klarna:"FR_klarna","private-sale":"FR_private_sale"},GB:{klarna:"UK_Klarna",portmandentex:"UK_Portmandentex","private-sale":"UK_private_sale","uk-loyaltyshop":"UK_Loyaltyshop","uk-mastercard":"UK_Mastercard",vodafone:"UK_Vodafone"},HU:{anyafalva:"HU_Anyafalva","avent-kedvezmenyek":"HU_avent_kedvezmenyek",ccc:"HU_CCC",cinema:"HU_Cinema_loyalty","hu-hellohmmember":"HU_HelloHMMember","hu-philipshuseg":"HU_philipshuseg",kedvezmeny:"HU_kedvezmeny",moments:"HU_Moments",preghello:"HU_preghello",raiffeisen:"HU_Raiffeisen",yettel:"HU_Yettel"},IT:{"avent-loyaltyshop":"IT_Philips_Avent_loyaltyshop","corporate-benefits":"IT_Corporate_Benefits",dentistrecommended:"IT_Dentist_Recommended","hm-member":"IT_HM_member","it-loyaltyshop":"IT_Loyaltyshop",klarna:"IT_klarna","private-sale":"IT_private_sale",verovolley:"IT_VeroVolley",vodafone:"IT_Vodafone"},NL:{ICS:"NL_ICS","corporate-benefits":"NL_Corporate_Benefits",dentistrecommended:"NL_Dentist_Recommended","hm-member":"NL_HM_member",klarna:"NL_Klarna","nl-eurosparen":"NL_fc_eurosparen","nl-ing":"NL_ing","nl-kraampakket":"NL_kraampakket","nl-loyaltyshop":"NL_loyaltyshop","nl-micrositetest":"NL_micrositetest","nl-zkborstkolven":"NL_zkborstkolven",nl_voordeelvandeexpert:"NL_voordeelvandeexpert",onvz:"NL_ONVZ_brushheads","onvz-tandenborstel":"NL_ONVZ_Tandenborstel","philips-avent-loyaltyshop":"NL_Philips_Avent_Loyaltyshop","private-sale":"NL_private_sale",psv:"NL_PSV","saeco-nl-exclusive":"NL_Saeco_exclusive",vodafone:"NL_Vodafone"},NO:{"no-loyaltyshop":"NO_Loyaltyshop","private-sale":"NO_private_sale"},PT:{"corporate-benefits":"PT_Corporate_Benefits","hm-member":"PT_HM_member","pt-loyaltyshop":"PT_Loyaltyshop",vodafone:"PT_Vodafone"},SE:{klarna:"SE_Klarna","se-loyaltyshop":"SE_Loyaltyshop","private-sale":"SE_private_sale"},TR:{"philips-personel-sales-2020":"TR_Philips_Personel_Satisi_2020"},US:{"digital-dispense-brush-head":"US_Digital_Dispense_Brush_Head","sonicare-ddfifty":"US_Sonicare_ddfifty","sonicare-ddtwenty":"US_Sonicare20"}},gi={data:()=>({trackingECommerceDataAdd:{currencyCode:"",add:{products:[]},cart:{id:"",products:[]}},trackingECommerceDataRemove:{currencyCode:"",remove:{products:[]},cart:{id:"",products:[]}}}),computed:{...i("cart",["currencyCode","actualCartId","vouchers","thresholdAmountExceeded"]),...i("payments",["isPayButtonDisabled","isPayButtonPartialDisabled"]),...r("config",["getDefaultConfig"]),...i({cartSummary(e){const t=e.cart.cartSummary;let i="";return t?.totalPriceWithTax?i=this.getFormattedPrice(t.totalPriceWithTax):t?.total&&(i=this.getFormattedPrice(t.total)),this.tax=t?.tax?this.getFormattedPrice(t.tax):"",this.total=i,this.getCartSummary(t)},isTotal(e){const t=e.cart.cartSummary;return t?.totalPriceWithTax?.value>0||t?.total?.value>0},isGiftCardApplied:e=>e.cart.giftVouchers.length>0,taxExemptionEligible:e=>e.tax.taxExemptionEligible}),payButtonClasses(){const e="button";return this.isPayButtonDisabled?`${e} button--disabled`:e},isButtonDisabled(){return this.thresholdAmountExceeded.orderBlocking||this.isPayButtonDisabled||this.isPayButtonPartialDisabled}},methods:{onAddedToCart(){this.$store.dispatch("cart/getCartItems")},payerCustomerScope(){return this.vouchers.filter(e=>!!e.id&&"PYR1"===e.id.slice(0,4)).length>0},productClickHandler(e,{itemId:t,from:i}){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:`product:${t}:${i}`})},getCartSummary(e){let t,i,r,o;e?.totalDelivery&&(t=e.totalDelivery.value>0?this.getFormattedPrice(e.totalDelivery):this.i18n("generic.free")),e?.orderDiscountNoDelivery&&(i=e.orderDiscountNoDelivery.value>0?this.getFormattedPrice(e.orderDiscountNoDelivery):0),e?.totalG
2iftCardDiscount&&(o=e.totalGiftCardDiscount.value>0?this.getFormattedPrice(e.totalGiftCardDiscount):0),e?.totalVoucherDiscount&&(r=e.totalVoucherDiscount.value>0?this.getFormattedPrice(e.totalVoucherDiscount):0);const s={subtotal:e?.subTotal&&e.subTotal.value>0?this.getFormattedPrice(e.subTotal):"",shipping:t,discount:i,voucher:r,giftcard:o};return this.net&&(s.tax=e?.tax?this.getFormattedPrice(e.tax):""),s},quantityClickHandler(e,t=!1){let i={};if(!this.isRemoving){let r=this.item.quantity;"plus"===e?(++r,this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:`${this.item.itemId}:quantity:increase`})):"minus"===e&&(--r,this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:`${this.item.itemId}:quantity:decrease`})),i=t?{itemId:this.item.id,quantity:r,parentProductId:this.item.itemId}:{itemId:this.item.id,quantity:r},this.$store.dispatch("cart/updateCartItem",i).then(()=>{const t=this.generateGAdataForAddRemove(this.item);"plus"===e?(this.trackingECommerceDataAdd.add.products=[],this.trackingECommerceDataAdd.add.products.push(t.productObj),this.trackingECommerceDataAdd.cart.products=t.cartItems,this.trackingECommerceDataAdd.cart.id=this.actualCartId,this.trackingECommerceDataAdd.currencyCode=this.currencyCode,this.trackGoogleAnalytics(this.trackingECommerceDataAdd,"ecommerce.cart.add")):(this.trackingECommerceDataRemove.remove.products=[],this.trackingECommerceDataRemove.remove.products.push(t.productObj),this.trackingECommerceDataRemove.cart.products=t.cartItems,this.trackingECommerceDataRemove.cart.id=this.actualCartId,this.trackingECommerceDataRemove.currencyCode=this.currencyCode,this.trackGoogleAnalytics(this.trackingECommerceDataRemove,"ecommerce.cart.remove"))})}},removeCartItem(){this.isRemoving=!0,this.trackAjax({events:"scRemove",pagename:this.$route.meta.pagename,products:this.item.itemId,type:"o"});const e=this.getProductByCtn(this.item.itemId);this.$store.dispatch("cart/updateCartItem",{itemId:this.item.id,quantity:this.maxBundleQuantity(this.item)}).then(()=>{this.isRemoving=!1;const t=this.generateGAdataForAddRemove(this.item,1,e);this.trackingECommerceDataRemove.remove.products=[],this.trackingECommerceDataRemove.remove.products.push(t.productObj),this.trackingECommerceDataRemove.cart.products=t.cartItems,this.trackingECommerceDataRemove.cart.id=this.actualCartId,this.trackingECommerceDataRemove.currencyCode=this.currencyCode,this.trackGoogleAnalytics(this.trackingECommerceDataRemove,"ecommerce.cart.remove")})},isDiscountedPrice:e=>!(!e?.price?.value||!e?.discountPrice?.value)&&e.discountPrice.value!==e.price.value,checkToShowRecycleMsg(e,t,i){const r=this.getDefaultConfig("excludedCategoriesList")||[],o=this.getDefaultConfig("excludedSubCategoriesList")||[],s=this.getDefaultConfig("excludedCtnsList")||[];return e&&!r.includes(e)&&t&&!o.includes(t)&&i&&!s.includes(i)}}},yi=(e,t)=>{const i=e.__vccOpts||e;for(const[r,o]of t)i[r]=o;return i},vi={class:"p-visuallyhidden"};const fi=yi({props:{tag:{type:String,required:!1,default:"span"},iconName:{type:String,required:!0},className:{type:[String,Object],required:!1,default:""},readerText:{type:String,required:!1,default:void 0},title:{type:String,required:!1,default:void 0}}},[["render",function(e,t,i,r,s,p){return i.readerText?(o(),a(u(i.tag),{key:0,class:"p-ec01-base-icon",type:"button"===i.tag?"button":null},{default:n(()=>[l("span",vi,c(i.readerText),1),l("span",{class:d([`p-icon-${i.iconName}`,i.className]),"aria-hidden":"true"},null,2)]),_:1},8,["type"])):(o(),a(u(i.tag),{key:1,class:d([`p-icon-${i.iconName}`,i.className]),title:i.title,type:"button"===i.tag?"button":null},null,8,["class","title","type"]))}]]),bi={class:"p-ec01-tooltip"},Ci=["id"],ki={class:"p-ec01-tooltip__content"},_i=yi({__name:"Tooltip",props:{tooltipIconName:{type:String,required:!1,default:"question-explanation"},tooltipText:{type:String,required:!0}},setup(e){let t=null;const i=btoa(String(Math.random())).slice(-10,-2),r=C("center"),s=C("top"),a=C(null),n=C(null),c=()=>{const e=document.documentElement.clientWidth,t=.25*e,i=a.value.$el.getBoundingClientRect(),o=i.left,s=e-i.right;if(e<=767)return r.value="left",void(n.value={left:`-${o}px`});n.value={},r.value=o<t?"left":s<t?"right":"center"},u=e=>{for(const t of e){const e=t.boundingClientRect;s.value=e.top>150?"top":"bottom"}};return p(()=>{t=new IntersectionObserver(u,{root:null,rootMargin:"-100px 0px -100px 0px",threshold:1}),t.observe(a.value.$el),window.addEventListener("resize",c),c()}),m(()=>{t.unobserve(a.value.$el),t.disconnect(),window.removeEventListener("resize",c)}),(t,c)=>{const u=h("safe-html");return o(),g("div",bi,[l("div",{class:d(`p-ec01-tooltip__icon-wrapper ${r.value} ${s.value}`)},[y(fi,{ref_key:"tooltipIcon",ref:a,"class-name":"p-form__combine-box-button p-ec01-tooltip__icon",tag:"button","icon-name":e.tooltipIconName,"aria-labelledby":`notifications-label-${v(i)}`},null,8,["icon-name","aria-labelledby"])],2),l("div",{id:`notifications-label-${v(i)}`,role:"tooltip",class:d(`p-ec01-tooltip__content-wrapper ${r.value} ${s.value}`),style:b(n.value)},[f(l("div",ki,null,512),[[u,e.tooltipText]])],14,Ci)])}}},[["__scopeId","data-v-262e4f3d"]]);function Ii(){const e=_(),t=k(()=>e.state.config?.config?.translations||{});return{i18n:(e,i)=>{let r=t.value[e];if(void 0!==r){if(i&&i.length>0)for(const[e,t]of i.entries())r=r.split(`{${e}}`).join(t);return r}return e}}}const Pi={key:0,class:"p-ec01-cart_recycle-msg-wrapper"},Ai={class:"text-s"},wi={__name:"ElectronicDeviceRecycle",props:{category:{type:String,required:!1,default:""},subcategory:{type:String,required:!1,default:""},ctn:{type:String,required:!1,default:""},avoidExclusionCheck:{type:Boolean,required:!1}},setup(e){const{i18n:t}=Ii(),i=_(),r=e,s=(e,t=null)=>k(()=>i.getters["config/getDefaultConfig"](e)||t),a=s("isElectronicMessage",!1),n=s("excludedCategoriesList",[]),c=s("excludedSubCategoriesList",[]),d=s("excludedCtnsList",[]),u=k(()=>r.category&&!n.value.includes(r.category)&&r.subcategory&&!c.value.includes(r.subcategory)&&r.ctn&&!d.value.includes(r.ctn)),p=k(()=>a.value&&(!r.avoidExclusionCheck&&u.value||r.avoidExclusionCheck));return(e,i)=>{const r=h("safe-html");return p.value?(o(),g("div",Pi,[f(l("span",Ai,null,512),[[r,v(t)("cartoverview.recycle-label")]]),y(_i,{"tooltip-icon-name":"information-circle","tooltip-text":v(t)("cartoverview.recycle-tooltip-text")},null,8,["tooltip-text"])])):I("",!0)}}};const Si=yi({inheritAttrs:!1,props:{tag:{type:String,default:"div"},wrap:{type:Boolean}}},[["render",function(e,t,i,r,s,l){return o(),g("div",null,[i.wrap?(o(),a(u(i.tag),A(w({key:0},e.$attrs)),{default:n(()=>[P(e.$slots,"default")]),_:3},16)):P(e.$slots,"default",{key:1})])}]]),xi={props:{url:{type:String,required:!0},alt:{type:String,required:!0},sizeXS:{type:String,required:!1,default:"160,160"},sizeS:{type:String,required:!1,default:"160,160"},sizeM:{type:String,required:!1,default:"120,120"},sizeL:{type:String,required:!1,default:"120,120"},lowQualityOnly:{type:Boolean,required:!1},format:{type:String,required:!1,default:"jpg"},priority:{type:String,required:!1,default:"lazy"}},computed:{fallbackImage(){return this.createSimpleLink(this.sizeM)},images(){return[{src:this.createFullLink(this.sizeL),query:"(min-width: 980px)"},{src:this.createFullLink(this.sizeM),query:"(min-width: 768px)"},{src:this.createFullLink(this.sizeS),query:"(min-width: 375px)"},{src:this.createFullLink(this.sizeXS)}]}},methods:{createFullLink(e){let t=this.createSimpleLink(e);if(!this.lowQualityOnly){const i=`${2*e.split(",")[0]},${2*e.split(",")[1]}`;t+=`, ${this.createSimpleLink(i)} 2x`}return t},createSimpleLink(e){let t="large",i=this.url;const r=e.split(",")[0],o=e.split(",")[1];return i+=`?wid=${r}&hei=${o}`,r<=100&&o<=100&&(t="small"),i+=`&$${this.format}${t}$`,i}}},Ei=["srcset","media"],Ti=["src","alt","loading","fetchpriority"];const Di=yi(xi,[["render",function(e,t,i,r,s,a){return o(),g("picture",null,[(o(!0),g(S,null,x(a.images,(e,t)=>(o(),g("source",{key:t,srcset:e.src,media:e.query},null,8,Ei))),128)),l("img",{src:a.fallbackImage,alt:i.alt,loading:i.priority,fetchpriority:"eager"===i.priority?"high":void 0},null,8,Ti)])}]]),Oi={class:"p-ec01-overlay"},Li={class:"p-ec01-overlay__title p-heading-02-small p-heading-medium p-margin-none"},Mi={class:"p-ec01-overlay__close"},Bi={class:"p-ec01-overlay__content"},$i={key:0,class:"p-ec01-overlay__description"},Vi={__name:"Overlay",props:{title:{type:String,default:""},showHeader:{type:Boolean},hideCloseIcon:{type:Boolean},overlayType:{type:String,default:""}},emits:["close-overlay"],setup(e,{emit:t}){const i=t,{i18n:r}=Ii(),s=e=>{"Escape"===e.key&&i("close-overlay")};return p(()=>{document.querySelector("html").classList.add("p-overlay-open"),document.addEventListener("keydown",s)}),E(()=>{document.querySelector("html").classList.remove("p-overlay-open"),document.removeEventListener("keydown",s)}),(t,s)=>(o(),g("section",Oi,[l("div",{class:"p-ec01-overlay__mask",tabindex:"0",role:"button",onClick:s[1]||(s[1]=T(e=>i("close-overlay"),["self"]))},[l("div",{class:d(["p-ec01-overlay__wrapper",`p-ec01-overlay__wrapper--${e.overlayType}`])},[e.showHeader?(o(),g(S,{key:0}
2,[l("h2",Li,c(e.title),1),l("div",Mi,[e.hideCloseIcon?I("",!0):(o(),a(fi,{key:0,tag:"button","class-name":"p-square","icon-name":"close","reader-text":v(r)("generic.close"),onClick:s[0]||(s[0]=e=>i("close-overlay"))},null,8,["reader-text"]))])],64)):I("",!0),l("div",Bi,[t.$slots.description?(o(),g("div",$i,[P(t.$slots,"description")])):I("",!0)])],2)])]))}},Ni={components:{Overlay:Vi},emits:["close-seller-overlay"],data:()=>({showSellerInfoOverlay:!0,sellerTermsLink:""}),computed:{...i({sellerInfoObj:e=>e.cart.sellerInfo.attributes}),sellerOverlay(){return[{showLink:this.sellerTerms,link:this.sellerTermsLink,label:this.sellerInfoObj.sellerTermsLinkLabel||this.i18n("generic.terms")},{showLink:()=>this.sellerInfoObj?.sellerPrivacyNoticeLink,link:this.sellerInfoObj.sellerPrivacyNoticeLink||"",label:this.sellerInfoObj.sellerPrivacyNoticeLabel||this.i18n("generic.privacy")},{showLink:()=>this.sellerInfoObj?.sellerSupportUrl,link:this.sellerInfoObj.sellerSupportUrl,label:this.sellerInfoObj.sellerSupportUrlLabel||this.i18n("generic.support")},{showLink:()=>this.sellerInfoObj?.sellerOtherLink&&this.sellerInfoObj?.sellerOtherLabel,link:this.sellerInfoObj.sellerOtherLink,label:this.sellerInfoObj.sellerOtherLabel}]}},methods:{onSellerInfoOverlayClose(){this.showSellerInfoOverlay=!1,this.$emit("close-seller-overlay")},sellerTerms(){if(this.sellerInfoObj.sellerTermsLink)this.sellerTermsLink=this.sellerInfoObj.sellerTermsLink;else if(this.sellerInfoObj.sellerDocuments&&this.sellerInfoObj.sellerDocuments.length>0){const e=this.sellerInfoObj.sellerDocuments.find(e=>e&&"terms"===e.code);this.sellerTermsLink=e?e.url:""}return this.sellerTermsLink}}},Ri={class:"p-ec01-overlay__wrapper--seller"},Fi={class:"p-ec01-overlay__wrapper--seller-info"},Ui={class:"p-body-copy-01 p-ec01-overlay__seller-text p-spacing-bottom-b"},qi={key:0,class:"p-spacing-bottom-b"},Hi={class:"p-heading-03-large"},ji={class:"p-heading-03-large"},Gi={class:"p-ec01-overlay__seller-link-list"},Wi={key:0,class:""},zi=["href"];const Qi={class:"p-ec01-seller-info"},Ki={class:"p-body-copy-02 p-heading-light"},Ji={class:"p-ec01-seller-info__seller p-bold"};const Yi=yi({components:{SellerInfoOverlay:yi(Ni,[["render",function(e,t,i,r,s,d){const u=D("overlay");return o(),g("section",Ri,[s.showSellerInfoOverlay?(o(),a(u,{key:0,"overlay-type":"sellerInfo","show-header":"",title:e.sellerInfoObj.sellerDisplayName,onCloseOverlay:t[0]||(t[0]=e=>d.onSellerInfoOverlayClose())},{description:n(()=>[l("div",Fi,[l("p",Ui,c(e.sanitize(e.sellerInfoObj.sellerDetails)),1),e.sellerInfoObj.sellerExpectationList&&e.sellerInfoObj.sellerExpectationList.length>0?(o(),g("div",qi,[l("h2",Hi,c(e.i18n("generic.seller-how-text")),1),(o(!0),g(S,null,x(e.sellerInfoObj.sellerExpectationList,t=>(o(),g("ul",{key:t,class:"p-bullets"},[l("li",null,c(e.sanitize(t.replace(/^- /,""))),1)]))),128))])):I("",!0),l("h2",ji,c(e.i18n("generic.about"))+" "+c(e.sellerInfoObj.sellerDisplayName),1),l("ul",Gi,[(o(!0),g(S,null,x(d.sellerOverlay,e=>(o(),g(S,{key:e},[e.showLink()?(o(),g("li",Wi,[l("a",{href:e.link,class:"p-link-more",target:"_blank"},c(e.label),9,zi)])):I("",!0)],64))),128))])])]),_:1},8,["title"])):I("",!0)])}]])},props:{sellerName:{type:String,required:!0},sellerId:{type:String,required:!0}},data:()=>({showSellerInfoOverlay:!1}),methods:{openSellerInfoOverlay(e){this.$store.dispatch("cart/getSellerInfo",e).then(()=>{this.showSellerInfoOverlay=!0}).catch(e=>{console.log(e),this.closeSellerOverlay()})},closeSellerOverlay(){this.showSellerInfoOverlay=!1}}},[["render",function(e,t,i,r,s,n){const d=D("seller-info-overlay");return o(),g("section",Qi,[l("div",Ki,[l("button",{type:"button",class:"p-link-more p-ec01-seller-info__name",onClick:t[0]||(t[0]=e=>n.openSellerInfoOverlay(i.sellerId))},[O(c(e.i18n("generic.sold-by"))+" ",1),l("span",Ji,c(i.sellerName),1)])]),s.showSellerInfoOverlay?(o(),a(d,{key:0,onCloseSellerOverlay:t[1]||(t[1]=e=>n.closeSellerOverlay())})):I("",!0)])}]]),Zi={class:"p-ec01-cart-item p-ec01-cart-item--bundled"},Xi={class:"p-ec01-cart-item__product"},er={class:"p-ec01-cart-item__image"},tr={class:"p-ec01-cart-item__body"},ir={class:"p-ec01-cart-item__top"},rr={class:"p-ec01-cart-item__title"},or={key:0,class:"p-ec01-cart-item__family-name"},sr={class:"p-ec01-cart-item__descriptor"},ar={key:1,class:"p-ec01-cart-item__qty-mismatch-msg"},nr={class:"p-ec01-cart-item__image"},lr={class:"p-ec01-cart-item__body"},cr={class:"p-ec01-cart-item__top"},dr={class:"p-ec01-cart-item__title"},ur={key:0,class:"p-ec01-cart-item__family-name"},pr={class:"p-ec01-cart-item__descriptor"},mr={key:1,class:"p-ec01-cart-item__qty-mismatch-msg"},hr={class:"p-ec01-cart-item__price"},gr={class:"p-ec01-cart-item__price-was-value"},yr={class:"p-ec01-cart-item__price-current"},vr={key:0,class:"p-ec01-cart-item__footer"},fr={class:"p-ec01-cart-item__ribbon-wrapper"},br={class:"p-ec01-cart-item__ribbon"},Cr={class:"p-ec01-cart-item__quantity-value"},kr={class:"p-ec01-cart-item__total"},_r={class:"p-ec01-cart-item__total-label"},Ir={class:"p-ec01-cart-item__total-price"},Pr={mixins:[gi]},Ar=Object.assign(Pr,{__name:"BundledItem",props:{item:{type:Object,required:!0}},setup(e){const t=e,{proxy:i}=L(),r=_(),{i18n:s}=Ii(),u=C(!1),p=k(()=>r.getters["config/getDefaultConfig"]("isBundlePromotionPayload")||!1),m=M({currencyCode:"",add:{products:[]},cart:{id:"",products:[]}}),h=M({currencyCode:"",remove:{products:[]},cart:{id:"",products:[]}}),f=e=>r.getters["cart/getProductByCtn"](e),b=e=>r.getters["cart/isQuantityMismatch"](e),P=k(()=>r.state.cart.items),A=k(()=>r.state.cart.isAnyAPIPending),w=k(()=>r.state.cart.currencyCode),E=k(()=>r.state.cart.actualCartId),T=k(()=>r.state.config.maxOrderQuantity),D=k(()=>r.state.config.isMicrositeId),B=k(()=>{const e=[t.item.availability.quantity];for(const t of N.value)e.push(t.availability.quantity);return e}),$=k(()=>T.value?Math.min(...B.value,T.value):Math.min(...B.value,Number.POSITIVE_INFINITY)),V=k(()=>Math.min(...B.value,t.item.promotionData.quantity)),N=k(()=>{const e=[];for(const i of t.item.partnerProducts){const t=U(i);t&&e.push(t)}return e}),R=k(()=>{let e=t.item.totalPrice.value;for(const i of t.item.partnerProducts){const t=U(i);t&&(e+=t.totalPrice.value)}return e}),F=k(()=>{const e=[];e.push(f(t.item.itemId));for(const t of N.value)e.push(f(t.itemId));return e.some(e=>i.checkToShowRecycleMsg(e.catCode,e.subcatCode,e.ctn))}),U=e=>P.value.find(t=>t.itemId===e),q=(e,i)=>{const r=i.sameBaseAndPartnerProduct;switch(e){case"plus":return Number(i.quantity)+(r?2:1);case"minus":return Number(i.quantity)-(r?2:1);case"remove":return Number(i.quantity)-(r?2*t.item.promotionData.quantity:t.item.promotionData.quantity);default:return 0}},H=(e,t,i,r)=>{const o={product:{code:t.atcCode||t.itemId},quantity:q(e,t)};return p.value&&(o.baseProduct=r,o.bundleId=i),o},j=e=>{const i=[];if(p.value){const r=t.item,o=t.item.promotion?.id;i.push(H(e,r,o,!0)),z(e,r);for(const t of N.value)i.push(H(e,t,o,!1)),z(e,t);return i}const r=U(t.item.itemId);if(!t.item.partnerProducts.includes(t.item.itemId))for(const t of N.value)i.push(H(e,t)),z(e,t);return i.push(H(e,r)),z(e,r),i},G=e=>{m.add.products=[],h.remove.products=[],W(e,!0),r.dispatch("cart/updateCartItem",{itemId:-1,isBundledItem:!0,updateCart:!0,items:{data:j(e)}}).then(()=>{Q(e),W(e,!1)})},W=(e,t)=>{"remove"===e&&(u.value=t)},z=(e,r)=>{const o=i.generateGAdataForAddRemove(r,"plus"===e||"minus"===e?1:t.item.promotionData.quantity);"plus"===e?(m.add.products.push(o.productObj),m.cart.products=o.cartItems,m.cart.id=E.value,m.currencyCode=w.value):"minus"!==e&&"remove"!==e||(h.remove.products.push(o.productObj),h.cart.products=o.cartItems,h.cart.id=E.value,h.currencyCode=w.value)},Q=e=>{"plus"===e?i.trackGoogleAnalytics(m,"ecommerce.cart.add"):"minus"!==e&&"remove"!==e||i.trackGoogleAnalytics(h,"ecommerce.cart.remove")};return(t,i)=>(o(),g("section",Zi,[l("div",Xi,[l("div",er,[y(Si,{wrap:Boolean(f(e.item.itemId).productURL)&&!D.value,tag:"a",href:f(e.item.itemId).productURL,onClick:i[0]||(i[0]=i=>t.productClickHandler(i,{itemId:e.item.itemId,from:"image"}))},{default:n(()=>[y(Di,{url:e.item.image,alt:f(e.item.itemId).productTitle||e.item.itemId,priority:"eager","size-l":"160,160",class:"p-picture"},null,8,["url","alt"])]),_:1},8,["wrap","href"])]),l("div",tr,[l("div",ir,[l("h2",rr,[y(Si,{wrap:Boolean(f(e.item.itemId).productURL)&&!D.value,tag:"a",class:"p-ec01-cart-item__title-link",href:f(e.item.itemId).productURL,onClick:i[1]||(i[1]=i=>t.productClickHandler(i,{itemId:e.item.itemId,from:"title"}))},{default:n(()=>[f(e.item.itemId).familyName?(o(),g("div",or,c(f(e.item.itemId).familyName),1)):I("",!0),l("div",sr,c(f(e.item.itemId).descriptor||e.
2item.itemId),1)]),_:1},8,["wrap","href"]),e.item.sellerName&&e.item.sellerId?(o(),a(Yi,{key:0,"seller-name":e.item.sellerName,"seller-id":e.item.sellerId},null,8,["seller-name","seller-id"])):I("",!0),b(e.item.itemId)?(o(),g("div",ar,c(v(s)("cartoverview.product-quantity-changed")),1)):I("",!0)])])])]),(o(!0),g(S,null,x(N.value,i=>(o(),g("div",{key:i.itemId,class:"p-ec01-cart-item__product"},[l("div",nr,[y(Si,{wrap:Boolean(f(i.itemId).productURL)&&!D.value,tag:"a",href:f(i.itemId).productURL,onClick:e=>t.productClickHandler(e,{itemId:i.itemId,from:"image"})},{default:n(()=>[y(Di,{url:i.image,alt:f(i.itemId).productTitle||i.itemId,priority:"eager",class:"p-picture"},null,8,["url","alt"])]),_:2},1032,["wrap","href","onClick"])]),l("div",lr,[l("div",cr,[l("h2",dr,[y(Si,{wrap:Boolean(f(i.itemId).productURL)&&!D.value,tag:"a",class:"p-ec01-cart-item__title-link",href:f(i.itemId).productURL,onClick:e=>t.productClickHandler(e,{itemId:i.itemId,from:"title"})},{default:n(()=>[f(i.itemId).familyName?(o(),g("div",ur,c(f(i.itemId).familyName),1)):I("",!0),l("div",pr,c(f(i.itemId).descriptor||i.itemId),1)]),_:2},1032,["wrap","href","onClick"]),i.sellerName&&i.sellerId?(o(),a(Yi,{key:0,"seller-name":i.sellerName,"seller-id":i.sellerId},null,8,["seller-name","seller-id"])):I("",!0),b(i.itemId)?(o(),g("div",mr,c(v(s)("cartoverview.product-quantity-changed")),1)):I("",!0)]),l("div",hr,[l("p",gr,c(t.getFormattedPrice({value:e.item.promotionData.actualDiscountPrice})),1),l("p",yr,[l("span",null,c(V.value)+"x ",1),O(" "+c(t.getFormattedPrice({value:e.item.promotionData.totalPrice/V.value})),1)])])])])]))),128)),e.item.availability.quantity>0?(o(),g("div",vr,[l("div",fr,[l("div",br,c(v(s)("generic.bundled-item")),1)]),l("div",{class:d(["p-ec01-cart-item__action-wrapper",{"p-ec01-cart-item__action-wrapper--pending":u.value||A.value}])},[y(fi,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":!A.value&&!u.value},disabled:A.value||u.value,"icon-name":"trashbin","reader-text":v(s)("generic.remove"),onClick:i[2]||(i[2]=e=>G("remove"))},{default:n(()=>[O(c(v(s)("generic.remove")),1)]),_:1},8,["class-name","disabled","reader-text"]),T.value>1?(o(),g(S,{key:0},[V.value>1?(o(),a(fi,{key:0,tag:"button","class-name":"p-ec01-cart-item__quantity-btn p-ec01-cart-item__quantity-btn--active","icon-name":"minus-2","reader-text":v(s)("cartoverview.quantity-decrease"),onClick:i[3]||(i[3]=e=>G("minus"))},null,8,["reader-text"])):I("",!0),l("div",Cr,c(V.value),1),y(fi,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":V.value<$.value&&!A.value},disabled:V.value>=$.value||A.value,"icon-name":"plus","reader-text":v(s)("cartoverview.quantity-increase"),onClick:i[4]||(i[4]=e=>G("plus"))},null,8,["class-name","disabled","reader-text"])],64)):I("",!0)],2),l("div",kr,[l("span",_r,c(v(s)("cartoverview.total")),1),l("p",Ir,c(t.getFormattedPrice({value:Math.min(e.item.promotionData.totalPrice,R.value)})),1)])])):I("",!0),F.value?(o(),a(wi,{key:1,"avoid-exclusion-check":""})):I("",!0)]))}}),wr={components:{Scene7Image:Di,Wrapper:Si,SellerInfo:Yi},mixins:[gi],props:{item:{type:Object,required:!0}},data(){return{totalPromoPrice:this.item.totalPrice.value}},computed:{...r("cart",["getProductByCtn"]),...i("cart",["items"]),...i("config",["isMicrositeId"]),partnerProducts(){const e=this.item.partnerProducts,t=[];for(const i of e){const e=this.findItem(i);e&&t.push(e)}return t}},mounted(){for(const e of this.item.partnerProducts){const t=this.findItem(e);t&&(this.totalPromoPrice+=t.totalPrice.value)}},methods:{findItem(e){return this.items.find(t=>t.itemId===e)}}},Sr={class:"p-ec01-order-summary__item-wrapper p-ec01-order-summary__bundle"},xr={class:"p-ec01-order-summary__bundle-content"},Er={class:"p-ec01-order-summary__item-left-wrapper"},Tr={class:"p-ec01-cart-item__ribbon"},Dr={class:"p-ec01-order-summary__item"},Or={class:"p-ec01-order-summary__item-thumbnail"},Lr={class:"p-ec01-order-summary__item-details-wrapper"},Mr={class:"p-ec01-order-summary__item-details"},Br={class:"p-ec01-order-summary__item-thumbnail"},$r={class:"p-ec01-order-summary__item-details-wrapper"},Vr={class:"p-ec01-order-summary__item-details"},Nr={key:0,class:"p-heading-04 p-ec01-order-summary__item-qty"},Rr={class:"p-heading-book"},Fr={class:"p-ec01-order-summary__item-price"},Ur={class:"p-ec01-order-summary__item-price-current"};
2const qr=yi({components:{BundledItem:Ar,BundledItemSummary:yi(wr,[["render",function(e,t,i,r,s,u){const p=D("scene7-image"),m=D("wrapper"),h=D("seller-info");return o(),g("section",Sr,[l("div",xr,[l("div",Er,[l("span",Tr,c(i.item.label||e.i18n("generic.bundled-item")),1),l("div",Dr,[l("div",Or,[y(m,{wrap:Boolean(e.getProductByCtn(i.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",href:e.getProductByCtn(i.item.itemId).productURL,class:"p-ec01-order-summary__item-link",onClick:t[0]||(t[0]=t=>e.productClickHandler(t,{itemId:i.item.itemId,from:"image"}))},{default:n(()=>[y(p,{url:i.item.image,alt:e.getProductByCtn(i.item.itemId).productTitle||i.item.itemId,class:"p-picture"},null,8,["url","alt"])]),_:1},8,["wrap","href"])]),l("div",Lr,[l("h2",Mr,[y(m,{wrap:Boolean(e.getProductByCtn(i.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-order-summary__item-details-title-link",href:e.getProductByCtn(i.item.itemId).productURL,onClick:t[1]||(t[1]=t=>e.productClickHandler(t,{itemId:i.item.itemId,from:"title"}))},{default:n(()=>[l("p",{class:d(["p-heading-04 p-heading-book",{"p-margin-none":i.item.sellerId&&i.item.sellerName}])},c(e.getProductByCtn(i.item.itemId).descriptor||e.getProductByCtn(i.item.itemId).familyName||i.item.itemId),3)]),_:1},8,["wrap","href"]),i.item.sellerName&&i.item.sellerId?(o(),a(h,{key:0,"seller-name":i.item.sellerName,"seller-id":i.item.sellerId},null,8,["seller-name","seller-id"])):I("",!0)])])]),(o(!0),g(S,null,x(u.partnerProducts,t=>(o(),g("div",{key:`bundled-sub-item-${t.itemId}`,class:"p-ec01-order-summary__item"},[l("div",Br,[y(m,{wrap:Boolean(e.getProductByCtn(t.itemId).productURL)&&!e.isMicrositeId,tag:"a",href:e.getProductByCtn(t.itemId).productURL,class:"p-ec01-cart-item__link",onClick:i=>e.productClickHandler(i,{itemId:t.itemId,from:"image"})},{default:n(()=>[y(p,{url:t.image,alt:e.getProductByCtn(t.itemId).productTitle||t.itemId,class:"p-picture"},null,8,["url","alt"])]),_:2},1032,["wrap","href","onClick"])]),l("div",$r,[l("h2",Vr,[y(m,{wrap:Boolean(e.getProductByCtn(t.itemId).productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-order-summary__item-details-title-link",href:e.getProductByCtn(t.itemId).productURL,onClick:i=>e.productClickHandler(i,{itemId:t.itemId,from:"title"})},{default:n(()=>[l("p",{class:d(["p-heading-04 p-heading-book",{"p-margin-none":t.sellerId&&t.sellerName}])},c(e.getProductByCtn(t.itemId).descriptor||e.getProductByCtn(t.itemId).familyName||t.itemId),3)]),_:2},1032,["wrap","href","onClick"]),t.sellerName&&t.sellerId?(o(),a(h,{key:0,"seller-name":t.sellerName,"seller-id":t.sellerId},null,8,["seller-name","seller-id"])):I("",!0)])])]))),128))])]),l("div",{class:d(["p-ec01-order-summary__item p-ec01-order-summary__item--bundle-summary",{"p-ec01-order-summary__item--noqty":i.item.promotionData.quantity<=1}])},[i.item.promotionData.quantity>1?(o(),g("p",Nr,[O(c(e.i18n("cartsummary.quantity-short"))+": ",1),l("span",Rr,c(i.item.promotionData.quantity),1)])):I("",!0),l("div",Fr,[l("p",Ur,c(e.getFormattedPrice({value:Math.min(i.item.promotionData.totalPrice,s.totalPromoPrice)})),1)])],2)])}]])},props:{items:{type:Array,required:!0},isOrderSummary:{type:Boolean,required:!1}}},[["render",function(e,t,i,r,s,n){const l=D("bundled-item"),c=D("bundled-item-summary");return i.isOrderSummary?(o(!0),g(S,{key:1},x(i.items,(e,t)=>(o(),a(c,{key:`bundled-item-${e.itemId}-${t}`,item:e},null,8,["item"]))),128)):(o(!0),g(S,{key:0},x(i.items,(e,t)=>(o(),a(l,{key:`bundled-item-${e.itemId}-${t}`,item:e},null,8,["item"]))),128))}]]),Hr={props:{items:{type:Array,required:!0},bundleId:{type:String,required:!0,default:""}},data:()=>({trackingECommerceDataAdd:{currencyCode:"",add:{products:[]}},trackingECommerceDataRemove:{currencyCode:"",remove:{products:[]}},subscriptionBundleTypes:["BUNDLED","REPLENISHMENT","TRYANDBUY","TRY&BUY","ACCESS"]}),computed:{...r("cart",["getProductByCtn"]),...r("bundles",["getAppliedBundles"]),...r("config",["getDefaultConfig"]),...i("cart",["currencyCode","isBCBSBundleAvailable","isAnyAPIPending","isSubscriptionApplicable"]),...i({productItems:e=>e.cart.items}),localeId(){return this.getDefaultConfig("localeId")},quantity(){return this.bundle.quantity},product:()=>function(e){return this.getProductByCtn(e)},item(){return this.getBaseProductDetails("Yes")},subItem(){return this.getBaseProductDetails("No")},bundle(){return this.getAppliedBundles(this.bundleId)}},methods:{updateCartItems(e){this.trackingECommerceDataAdd.add.products=[],this.trackingECommerceDataRemove.remove.products=[];const t=this.i18n("checkoutoverview.subscription-existing-customer-alert");"plus"===e?this.$store.dispatch("cart/addCartItem",{bundleId:this.bundleId,bundleType:this.bundle.type,quantity:this.getQuantity(e)}).then(()=>{this.triggerAnalytics(e)}):"remove"===e&&!0===this.isBCBSBundleAvailable?(this.$store.dispatch("notification/removeByText",t,{root:!0}),this.setIsRemoving(e,!0),this.$store.dispatch("cart/getBCBSCartItems",{itemId:-1,quantity:this.getQuantity(e),updateCart:!0}).then(()=>{this.triggerAnalytics(e)})):(this.setIsRemoving(e,!0),this.$store.dispatch("notification/removeByText",t,{root:!0}),this.$store.dispatch("cart/updateCartItem",{itemId:-1,quantity:this.getQuantity(e),bundleId:this.bundleId,bundleType:this.bundle.type,updateCart:!0}).then(()=>{this.setIsRemoving(e,!1),this.triggerAnalytics(e)}))},getQuantity(e){return"plus"===e?1:"minus"===e?this.quantity-1:0},setIsRemoving(e,t){"remove"===e&&(this.isRemoving=t)},getDate(e){const t=new Date;return t.setMonth(t.getMonth()+e),new Intl.DateTimeFormat(this.localeId.replace("_","-"),{year:"numeric",month:"long",day:"numeric"}).format(t)},getBaseProductDetails(e){const t=this.bundle.subscriptionRatePlan.find(t=>t.baseProduct===e);return void 0!==t&&"{}"!==JSON.stringify(t)?this.items.find(e=>e.itemId===t.productId):{}},displayTitle(e,t){switch(e.subscriptionBundleType){case"BUNDLED":return this.i18n("cartoverview.subscription-buy-title");case"REPLENISHMENT":return this.i18n("cartoverview.subscription-title");case"ACCESS":return"MCC_BREAST_PUMPS_SU"===t?this.i18n("cartoverview.subscription-rental-title"):this.i18n("cartoverview.subscription-access-title");case"TRYANDBUY":case"TRY&BUY":return this.i18n("cartoverview.subscription-try-title")}return""},getProductItems(e){for(const t of this.productItems)t.bundleId&&this.setAnalytics(e,t)},setAnalytics(e,t){const i=this.getProductByCtn(t.itemId),r={quantity:"remove"===e?t.quantity:1,locale:this.localeId,price:this.getCorrectPrice(t),id:t.itemId,subcatCode:i.subcatCode,catCode:i.catCode,grpCode:i.grpCode,bundleId:t.bundleId,bundleType:t.bundleType,BCBSBundle:t.subscriptionBundlePartner};if(t.sellerName&&(r.marketPlaceParticipant=t.sellerName),this.isSubscriptionApplicable&&"SUBSCRIPTION"===t.bundleType){const e=this.getAppliedBundles(t.bundleId);r.isSubscription=this.isSubscriptionApplicable,r.subscriptionFee=e.recurringCharge.value,r.subscriptionLockDuration=e.billingPeriodInMonths}"plus"===e?(this.trackingECommerceDataAdd.add.products.push(r),this.trackingECommerceDataAdd.currencyCode=this.currencyCode):"minus"!==e&&"remove"!==e||(this.trackingECommerceDataRemove.remove.products.push(r),this.trackingECommerceDataRemove.currencyCode=this.currencyCode)},triggerAnalytics(e){this.getProductItems(e),"plus"===e?this.trackGoogleAnalytics(this.trackingECommerceDataAdd,"ecommerce.cart.add"):"minus"!==e&&"remove"!==e||this.trackGoogleAnalytics(this.trackingECommerceDataRemove,"ecommerce.cart.remove")},isSubscriptionBundle(e){return this.subscriptionBundleTypes.includes(e.subscriptionBundleType)}}};function jr(e){const t={initialPrice:"",recurringPrice:"",strikeInitialPrice:"",strikeRecurringPrice:""};return"SHOP_BCBS"===e?.subscriptionBundlePartner?.toUpperCase()?(t.initialPrice=e?.discountedInitialCharge?.value,t.recurringPrice=e?.discountedRecurringCharge?.value):(e?.discountedRecurringCharge?.value&&0!==e.discountedRecurringCharge.value&&e.discountedRecurringCharge.value<e.recurringCharge.value?(t.recurringPrice=e.discountedRecurringCharge.value,t.strikeRecurringPrice=e.recurringCharge.value):t.recurringPrice=e.recurringCharge.value,e?.discountedInitialCharge?.value&&0!==e.discountedInitialCharge.value&&e.discountedInitialCharge.value<e.initialCharge.value?(t.initialPrice=e.discountedInitialCharge.value,t.strikeInitialPrice=e.initialCharge.value):t.initialPrice=e.initialCharge.value),t}const Gr={components:{BaseIcon:fi},props:{subscriptionBundleType:{type:String,default:void 0},bundleId:{type:String,default:void 0}},data:()=>({subscriptionOverlayData:{}
2,tncLinkDetails:{},checkSubscriptionData:!1,columns:[{icon:"shoppingcart",titleKey:"checkoutoverview.subscription.overlay.column1-title"},{icon:"checklist",titleKey:"checkoutoverview.subscription.overlay.column2-title"},{icon:"returns",titleKey:"checkoutoverview.subscription.overlay.column3-title"},{icon:"payment",titleKey:"checkoutoverview.subscription.overlay.column4-title"}]}),computed:{...r("config",["getDefaultConfig"]),footerLink(){return this.i18n("checkoutoverview.subscription.overlay-footer",[`<a href='${this.tncLinkDetails.linkUrl||""}' target='${this.tncLinkDetails.linkTarget||""}'>${this.tncLinkDetails.linkText||""}</a>`])}},mounted(){this.loadOverlayData()},methods:{async loadOverlayData(){let e="";await function(e={}){return _e.get(`/content/B2C/${e.locale}/_jcr_content.subscription.json`,e)}({locale:this.getDefaultConfig("localeId")}).then(t=>{e=t.data?.subscriptionApiEndpoint?.replace("{bundleName}",this.bundleId);const i=t.data?.checkoutSubscriptionAnnouncementData;this.tncLinkDetails=t.data?.tncLinkDetail
2s||{},i&&i.map(e=>(e.archetypeName.toUpperCase()===this.subscriptionBundleType&&(this.subscriptionOverlayData.checkoutSubscriptionAnnouncementData=e),this.subscriptionOverlayData))}),this.subPRXSubscriptionData(e,this.subscriptionOverlayData)},async subPRXSubscriptionData(e){var t;await(t=e,_e.get(t)).then(e=>{const t=this.createEachDescription(e.data.data.subscriptionData[0].uniqueSellingPoints);this.subscriptionOverlayData.prxSubData=t,this.columns[0].textKey=this.subscriptionOverlayData.prxSubData,this.columns[1].textKey=this.subscriptionOverlayData?.checkoutSubscriptionAnnouncementData?.announcements?.termsAndConditionsText,this.columns[2].textKey=this.subscriptionOverlayData?.checkoutSubscriptionAnnouncementData?.announcements?.returnAndCancellationText,this.columns[3].textKey=this.subscriptionOverlayData?.checkoutSubscriptionAnnouncementData?.announcements?.standardPaymentText,this.checkSubscriptionData=!0})},createEachDescription(e){let t="";for(const i of e)t+=`<li>${i}</li>`;return t}}},Wr={class:"p-ec01-subscription-overlay"},zr={class:"p-ec01-subscription-overlay__icon"},Qr={class:"p-ec01-subscription-overlay__content"},Kr={class:"p-heading-04-large"},Jr={class:"text-xs p-ec01-subscription-overlay__footer"};const Yr=yi(Gr,[["render",function(e,t,i,r,s,a){const n=D("base-icon"),d=h("safe-html");return f((o(),g("section",Wr,[(o(!0),g(S,null,x(s.columns,(t,i)=>(o(),g("div",{key:i,class:"p-ec01-subscription-overlay__column"},[l("div",zr,[y(n,{"class-name":"p-subscription-icon","icon-name":t.icon},null,8,["icon-name"])]),l("div",Qr,[l("h2",Kr,c(e.i18n(t.titleKey)),1),f(l("p",null,null,512),[[d,t.textKey]])])]))),128)),f(l("p",Jr,null,512),[[d,a.footerLink]])],512)),[[B,s.checkSubscriptionData]])}]]),Zr={key:0,class:"p-ec01-cart-item__ribbon"},Xr={__name:"CartItemRibbon",props:{product:{type:Object,required:!0},bundleRibbon:{type:String,default:""}},setup(e){const t=e,{i18n:i}=Ii(),r=k(()=>0===t.product?.catalogs?.length?"":t.product?.catalogs?.find(e=>"SHOPPUB"===e.catalogId)?.clearance),s=k(()=>"refurbished"===t.product?.productType?.toLowerCase()?"refurbished":t.bundleRibbon?"bundle-ribbon":"new"===t.product?.productStatus?.toLowerCase()?"new":r.value?"clearance":""),a=k(()=>({refurbished:t.product?.productType,"bundle-ribbon":t.bundleRibbon,new:t.product?.productStatus,clearance:i("cartoverview.clearance")}[s.value]??""));return(e,t)=>a.value?(o(),g("div",Zr,c(a.value),1)):I("",!0)}},eo={components:{BaseIcon:fi},mixins:[gi,Hr],props:{bundle:{type:Object,required:!0},subscriptionBundledItem:{type:Object,required:!0},quantity:{type:Number,required:!0},isReadOnly:{type:Boolean}},emits:["show-overlay"]},to={class:"p-ec01-cart-item__subscription-layout"},io={class:"p-ec01-cart-item-subitems"},ro={class:"p-ec01-cart-item__title text-bold"},oo={class:"p-ec01-cart-item__recurring-payment"},so={key:0,class:"p-ec01-line-through text-bold"},ao={class:"text-bold"},no={class:"p-ec01__payment-date text-s"},lo={key:0,class:"p-ec01-cart-item-subitems"},co={class:"p-body-copy-01 p-heading-light text-s"},uo={class:"p-body-copy-02 p-ec01__payment-date text-s"},po={key:1,class:"p-ec01-cart-item-subitems"},mo={class:"p-body-copy-01 p-heading-light text-s"},ho={class:"p-body-copy-02 p-ec01__payment-date text-s"};const go={components:{CartItemRibbon:Xr,SubscriptionLayout:yi(eo,[["render",function(e,t,i,r,s,a){const n=D("base-icon");return o(),g("div",to,[l("div",io,[l("h2",ro,[O(c(e.i18n("cartoverview.subscription-recurring-payment-text"))+" ",1),i.isReadOnly?I("",!0):(o(),g("button",{key:0,type:"button",class:"p-ec01-cart-item__tooltip",onClick:t[0]||(t[0]=t=>e.$emit("show-overlay"))},[y(n,{"icon-name":"information-circle"})]))]),l("div",oo,[i.subscriptionBundledItem.strikeRecurringPrice?(o(),g("p",so,c(e.getFormattedPrice({value:i.subscriptionBundledItem.strikeRecurringPrice})),1)):I("",!0),l("p",ao,c(1===i.quantity?e.getFormattedPrice({value:i.subscriptionBundledItem.recurringPrice}):`${i.quantity}* ${e.getFormattedPrice({value:i.subscriptionBundledItem.recurringPrice})}`),1),l("p",no,c(1===i.bundle.billingPeriodInMonths?e.i18n("cartoverview.subscription-frequency-text-medium-one-month"):e.i18n("c
2artoverview.subscription-frequency-text-medium",[i.bundle.billingPeriodInMonths])),1)])]),"SHOP_BCBS"===i.bundle?.subscriptionBundlePartner?.toUpperCase()||"BUNDLED"!==i.bundle.subscriptionBundleType&&"REPLENISHMENT"!==i.bundle.subscriptionBundleType?I("",!0):(o(),g("div",lo,[l("div",co,c(e.i18n("cartoverview.subscription-next-payment-date")),1),l("p",uo,c(e.i18n(e.getDate(i.bundle.billingPeriodInMonths||0))),1)])),"BUNDLED"===i.bundle.subscriptionBundleType||"REPLENISHMENT"===i.bundle.subscriptionBundleType?(o(),g("div",po,[l("div",mo,c(e.i18n("cartoverview.subscription-shipment-frequency-text")),1),l("p",ho,c(1===i.bundle.deliveryPeriodInMonths?e.i18n("cartoverview.subscription-frequency-text-medium-one-month"):e.i18n("cartoverview.subscription-frequency-text-medium",[i.bundle.deliveryPeriodInMonths])),1)])):I("",!0)])}]]),Scene7Image:Di,BaseIcon:fi,Overlay:Vi,SubscriptionOverlay:Yr,Wrapper:Si,ElectronicDeviceRecycle:wi},mixins:[gi,Hr],props:{isReadOnly:{type:Boolean}},data:()=>({isRemoving:!1,isShowSubscriptionOverlay:!1}),computed:{...r("cart",["isQuantityMismatch"]),...i("config",["maxOrderQuantity","isMicrositeId"]),maxQuantity(){return this.maxOrderQuantity?Math.min(...this.maxBundleQuantity,this.maxOrderQuantity):Math.min(...this.maxBundleQuantity,Number.POSITIVE_INFINITY)},maxBundleQuantity(){return this.items.map(e=>e.availability.quantity)},subscriptionBundledItem(){return jr(this.bundle)},showStrikeThrough(){return!this.getDefaultConfig("removeStrikethroughFromPrice")}},methods:{showOverlay(){this.isShowSubscriptionOverlay=!0},onPupOverlayClose(){this.isShowSubscriptionOverlay=!1}}},yo={key:0,class:"p-ec01-cart-item p-ec01-cart-item--bundled p-ec01-cart-item--subscription"},vo={class:"p-ec01-cart-item__product"},fo={class:"p-ec01-cart-item__image"},bo={class:"p-ec01-cart-item__body"},Co={key:0,class:"p-ec01-cart-item__ribbon"},ko={class:"p-ec01-cart-item__top"},_o={class:"p-ec01-cart-item__title"},Io={key:0,class:"p-ec01-cart-item__family-name"},Po={class:"p-ec01-cart-item__descriptor"},Ao={key:0,class:"p-ec01-cart-item__qty-mismatch-msg"},wo={class:"p-ec01-cart-item__price"},So={class:"p-ec01-cart-item__price-current"},xo={key:0,class:"p-ec01-cart-item__product"},Eo={class:"p-ec01-cart-item__image"},To={class:"p-ec01-cart-item__body"},Do={class:"p-ec01-cart-item__top"},Oo={class:"p-ec01-cart-item__title"},Lo={class:"p-ec01-cart-item__family-name"},Mo={class:"p-ec01-cart-item__descriptor"},Bo={class:"p-ec01-cart-item__footer"},$o={class:"p-ec01-cart-item__quantity-value"},Vo={class:"p-ec01-cart-item__total"},No={class:"p-ec01-cart-item__total-label"},Ro={class:"p-ec01-cart-item__total-price"};const Fo=yi(go,[["render",function(e,t,i,r,s,u){const p=D("scene7-image"),m=D("wrapper"),h=D("cart-item-ribbon"),v=D("subscription-layout"),f=D("base-icon"),b=D("electronic-device-recycle"),C=D("subscription-overlay"),k=D("overlay");return o(),g(S,null,[e.isSubscriptionBundle(e.bundle)?(o(),g("section",yo,[l("div",vo,[l("div",fo,[y(m,{wrap:Boolean(e.product(e.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",href:e.product(e.item.itemId).productURL,onClick:t[0]||(t[0]=t=>e.productClickHandler(t,{itemId:e.item.itemId,from:"image"}))},{default:n(()=>[y(p,{url:e.item.image,alt:e.product(e.item.itemId).productTitle||e.item.itemId,priority:"eager","size-l":"160,160",class:"p-picture"},null,8,["url","alt"])]),_:1},8,["wrap","href"])]),l("div",bo,[e.displayTitle(e.bundle,e.product(e.item.itemId).subcatCode)?(o(),g("span",Co,c(e.displayTitle(e.bundle,e.product(e.item.itemId).subcatCode)),1)):(o(),a(h,{key:1,product:e.product(e.item.itemId),"bundle-ribbon":e.displayTitle(e.bundle,e.product(e.item.itemId).subcatCode)},null,8,["product","bundle-ribbon"])),l("div",ko,[l("h2",_o,[y(m,{wrap:Boolean(e.product(e.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-cart-item__title-link",href:e.product(e.item.itemId).productURL,onClick:t[1]||(t[1]=t=>e.productClickHandler(t,{itemId:e.item.itemId,from:"title"}))},{default:n(()=>[e.product(e.item.itemId).familyName?(o(),g("div",Io,[e.quantity>1&&i.isReadOnly?(o(),g(S,{key:0},[O(c(e.quantity)+"x ",1)],64)):I("",!0),O(" "+c(e.product(e.item.itemId).familyName),1)])):I("",!0),l("div",Po,c(e.product(e.item.itemId).descriptor||e.
2item.itemId),1)]),_:1},8,["wrap","href"]),e.isQuantityMismatch(e.item.itemId)?(o(),g("div",Ao,c(e.i18n("cartoverview.product-quantity-changed")),1)):I("",!0)]),l("div",wo,[u.subscriptionBundledItem.strikeInitialPrice?(o(),g(S,{key:0},[l("p",{class:d({"p-ec01-cart-item__price-was-value":u.showStrikeThrough})},c(e.getFormattedPrice({value:u.subscriptionBundledItem.strikeInitialPrice})),3),l("p",So,[l("span",null,c(e.quantity)+"x ",1),O(" "+c(0===u.subscriptionBundledItem.initialPrice?e.i18n("cartoverview.free-shipping"):e.getFormattedPrice({value:i.isReadOnly?u.subscriptionBundledItem.initialPrice*e.quantity:u.subscriptionBundledItem.initialPrice})),1)])],64)):I("",!0)])])]),"BUNDLED"!==e.bundle.subscriptionBundleType?(o(),a(v,{key:0,bundle:e.bundle,"subscription-bundled-item":u.subscriptionBundledItem,quantity:e.quantity,"is-read-only":i.isReadOnly,onShowOverlay:t[2]||(t[2]=e=>u.showOverlay())},null,8,["bundle","subscription-bundled-item","quantity","is-read-only"])):I("",!0)]),"BUNDLED"===e.bundle.subscriptionBundleType?(o(),g("div",xo,[l("div",Eo,[y(p,{url:e.product(e.subItem.itemId).imageURL,alt:e.product(e.subItem.itemId).imageURL,priority:"eager","size-l":"160,160",class:"p-picture"},null,8,["url","alt"])]),l("div",To,[l("div",Do,[l("h2",Oo,[y(m,{wrap:Boolean(e.product(e.subItem.itemId).productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-cart-item__title-link",href:e.product(e.subItem.itemId).productURL,onClick:t[3]||(t[3]=t=>e.productClickHandler(t,{itemId:e.subItem.itemId,from:"title"}))},{default:n(()=>[l("p",Lo,c(e.product(e.subItem.itemId).familyName),1),l("p",Mo,c(e.product(e.subItem.itemId).descriptor||e.subItem.itemId),1)]),_:1},8,["wrap","href"])])])]),y(v,{bundle:e.bundle,"subscription-bundled-item":u.subscriptionBundledItem,quantity:e.quantity,"is-read-only":i.isReadOnly,onShowOverlay:t[4]||(t[4]=e=>u.showOverlay())},null,8,["bundle","subscription-bundled-item","quantity","is-read-only"])])):I("",!0),l("div",Bo,[l("div",{class:d(["p-ec01-cart-item__action-wrapper",{"p-ec01-cart-item__action-wrapper--pending":s.isRemoving||e.isAnyAPIPending}])},[i.isReadOnly?I("",!0):(o(),g(S,{key:0},[y(f,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":!e.isAnyAPIPending&&!s.isRemoving},disabled:e.isAnyAPIPending||s.isRemoving,"icon-name":"trashbin","reader-text":e.i18n("generic.remove"),onClick:t[5]||(t[5]=t=>e.updateCartItems("remove"))},{default:n(()=>[O(c(e.i18n("generic.delete")),1)]),_:1},8,["class-name","disabled","reader-text"]),e.maxOrderQuantity>1&&"SHOP_BCBS"!==e.bundle?.subscriptionBundlePartner?.toUpperCase()?(o(),g(S,{key:0},[e.quantity>1?(o(),a(f,{key:0,tag:"button","class-name":"p-ec01-cart-item__quantity-btn p-ec01-cart-item__quantity-btn--active","icon-name":"minus-2","reader-text":e.i18n("cartoverview.quantity-decrease"),onClick:t[6]||(t[6]=t=>e.updateCartItems("minus"))},null,8,["reader-text"])):I("",!0),l("div",$o,c(e.quantity),1),y(f,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":e.quantity<u.maxQuantity&&!e.isAnyAPIPending},disabled:e.quantity>=u.maxQuantity||e.isAnyAPIPending,"icon-name":"plus","reader-text":e.i18n("cartoverview.quantity-increase"),onClick:t[7]||(t[7]=t=>e.updateCartItems("plus"))},null,8,["class-name","disabled","reader-text"])],64)):I("",!0)],64))],2),l("div",Vo,[l("span",No,c(e.i18n("cartoverview.subscription-first-payment"))+"/"+c(e.i18n("cartoverview.total")),1),l("p",Ro,c(e.getFormattedPrice({value:u.subscriptionBundledItem.initialPrice*e.quantity})),1)])]),e.isSubscriptionBundle(e.bundle)?(o(),a(b,{key:1,category:e.product(e.item.itemId).catCode,subcategory:e.product(e.item.itemId).subcatCode,ctn:e.product(e.item.itemId).ctn},null,8,["category","subcategory","ctn"])):(o(),a(b,{key:2,category:e.product(e.subItem.itemId).catCode,subcategory:e.product(e.subItem.itemId).subcatCode,ctn:e.product(e.subItem.itemId).ctn},null,8,["category","subcategory","ctn"]))])):I("",!0),s.isShowSubscriptionOverlay?(o(),a(k,{key:1,"show-header":"","overlay-type":"subscription",title:e.displayTitle(e.bundle,e.product(e.item.itemId).subcatCode),onCloseOverlay:t[8]||(t[8]=e=>u.onPupOverlayClose())},{description:n(()=>[y(C,{"subscription-bundle-type":e.bundle.subscriptionBundleType,"bundle-id":e.bundleId},null,8,["subscription-bundle-type","bundle-id"])]),_:1},8,["title"])):I("",!0)],64)}]]),Uo={computed:{...i("config",["showPHSellerInfo"]),...r("config",["getDefaultConfig"]),PHSellerName(){return this.getDefaultConfig("PHSellerName")},redirectToSeller(){return this.getDefaultConfig("PHSellerLink")}}},qo={key:0,class:"p-ec01-seller-info"},Ho={class:"p-body-copy-03 p-heading-light"},jo=["href"],Go={class:"p-ec01-seller-info__seller p-bold"};const Wo=yi(Uo,[["render",function(e,t,i,r,s,a){return e.showPHSellerInfo?(o(),g("section",qo,[l("div",Ho,[O(c(e.i18n("generic.sold-by"))+" ",1),l("a",{class:"p-link-more p-ec01-seller-info__name",href:a.redirectToSeller,target:"_blank"}
2,[l("span",Go,c(a.PHSellerName),1)],8,jo)])])):I("",!0)}]]),zo={components:{CartItemRibbon:Xr,Scene7Image:Di,BaseIcon:fi,Wrapper:Si,SellerInfo:Yi,Tooltip:_i,PhSellerInfo:Wo,ElectronicDeviceRecycle:wi},mixins:[gi],props:{item:{type:Object,required:!0}},data:()=>({isRemoving:!1}),computed:{...r("cart",["getProductByCtn","isQuantityMismatch"]),...r("promotions",["getPrice","getQuantity","maxBundleQuantity"]),...i("config",["maxOrderQuantity","isMicrositeId"]),...i("cart",["isAnyAPIPending"]),quantity(){return this.getQuantity(this.item)},maxQuantity(){const e=this.item.availability.quantity-this.maxBundleQuantity(this.item);return Math.min(e,this.maxOrderQuantity)},product(){return this.getProductByCtn(this.item.itemId)},productPrice(){return this.getPriceObject(this.item)},showStrikeThrough(){return!this.getDefaultConfig("removeStrikethroughFromPrice")}}},Qo={class:"p-ec01-cart-item"},Ko={class:"p-ec01-cart-item__product"},Jo={class:"p-ec01-cart-item__image"},Yo={class:"p-ec01-cart-item__body"},Zo={class:"p-ec01-cart-item__top"},Xo={class:"p-ec01-cart-item__title"},es={key:0,class:"p-ec01-cart-item__family-name"},ts={class:"p-ec01-cart-item__descriptor"},is={key:2,class:"p-ec01-cart-item__qty-mismatch-msg"},rs={class:"p-ec01-cart-item__price"},os={key:0,class:"p-ec01-promo-label"},ss={class:"p-ec01-cart-item__extras"},as={key:0,class:"p-ec01-cart-item__refurbished-text"},ns={class:"p-ec01-cart-item__footer"},ls={class:"p-ec01-cart-item__quantity-value"},cs={class:"p-ec01-cart-item__total"},ds={class:"p-ec01-cart-item__total-label"},us={class:"p-ec01-cart-item__total-price"};const ps=yi(zo,[["render",function(e,t,i,r,s,u){const p=D("scene7-image"),m=D("wrapper"),h=D("cart-item-ribbon"),v=D("seller-info"),f=D("ph-seller-info"),b=D("tooltip"),C=D("electronic-device-recycle"),k=D("base-icon");return o(),g("section",Qo,[l("div",Ko,[l("div",Jo,[y(m,{wrap:Boolean(u.product.productURL)&&!e.isMicrositeId,tag:"a",href:u.product.productURL,class:"p-ec01-cart-item__image-link",onClick:t[0]||(t[0]=t=>e.productClickHandler(t,{itemId:i.item.itemId,from:"image"}))},{default:n(()=>[y(p,{url:i.item.image,alt:u.product.productTitle||i.item.itemId,priority:"eager","size-l":"160,160",class:"p-picture"},null,8,["url","alt"])]),_:1},8,["wrap","href"])]),l("div",Yo,[y(h,{product:u.product},null,8,["product"]),l("div",Zo,[l("h2",Xo,[y(m,{wrap:Boolean(u.product.productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-cart-item__title-link",href:u.product.productURL,onClick:t[1]||(t[1]=t=>e.productClickHandler(t,{itemId:i.item.itemId,from:"title"}))},{default:n(()=>[u.product.familyName?(o(),g("p",es,c(u.product.familyName),1)):I("",!0),l("p",ts,c(u.product.descriptor||i.item.itemId),1)]),_:1},8,["wrap","href"]),i.item.sellerName&&i.item.sellerId?(o(),a(v,{key:0,"seller-name":i.item.sellerName,"seller-id":i.item.sellerId},null,8,["seller-name","seller-id"])):(o(),a(f,{key:1})),e.isQuantityMismatch(i.item.itemId)?(o(),g("div",is,c(e.i18n("cartoverview.product-quantity-changed")),1)):I("",!0)]),l("div",rs,[u.productPrice.fromPrice?.value?(o(),g("div",{key:0,class:d({"p-ec01-cart-item__price-was--tooltip":u.productPrice.hasTooltipText})},[l("p",{class:d({"p-ec01-cart-item__price-was-value":u.showStrikeThrough})},c(e.getFormattedPrice(u.productPrice.fromPrice)),3),u.productPrice.hasTooltipText?(o(),a(b,{key:0,"tooltip-icon-name":"information-circle","tooltip-text":u.productPrice.hasTooltipText},null,8,["tooltip-text"])):I("",!0)],2)):I("",!0),l("p",{class:d(["p-ec01-cart-item__price-current",{"p-ec01-cart-item__price-current--discount":u.productPrice.fromPrice?.value}])},[l("span",null,c(u.quantity)+"x ",1),O(" "+c(e.getFormattedPrice(u.productPrice.toPrice))+" ",1),u.productPrice.discount?(o(),g("span",os,c(`- ${u.productPrice.discount}`),1)):I("",!0)],2)])])]),l("div",ss,["Refurbished"===u.product?.productType?(o(),g("p",as,[l("strong",null,c(e.i18n("cartoverview.refurbished-text-banner-line1")),1),O(" "+c(e.i18n("cartoverview.refurbished-text-banner-line2")),1)])):I("",!0),y(C,{category:u.product.catCode,subcategory:u.product.subcatCode,ctn:u.product.ctn},null,8,["category","subcategory","ctn"])])]),l("div",ns,[l("div",{class:d(["p-ec01-cart-item__action-wrapper",{"p-ec01-cart-item__action-wrapper--pending":s.isRemoving||e.isAnyAPIPending}])},[y(k,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":!e.isAnyAPIPending&&!s.isRemoving},disabled:e.isAnyAPIPending||s.isRemoving,"icon-name":"trashbin","reader-text":e.i18n("generic.remove"),onClick:t[2]||(t[2]=t=>e.removeCartItem("remove"))},{default:n(()=>[O(c(e.i18n("generic.remove")),1)]),_:1},8,["class-name","disabled","reader-text"]),u.quantity>1?(o(),a(k,{key:0,tag:"button","class-name":"p-ec01-cart-item__quantity-btn p-ec01-cart-item__quantity-btn--active","icon-name":"minus-2","reader-text":e.i18n("c
2artoverview.quantity-decrease"),onClick:t[3]||(t[3]=t=>e.quantityClickHandler("minus"))},null,8,["reader-text"])):I("",!0),l("div",ls,c(u.quantity),1),y(k,{tag:"button","class-name":{"p-ec01-cart-item__quantity-btn":!0,"p-ec01-cart-item__quantity-btn--active":u.quantity<u.maxQuantity&&!e.isAnyAPIPending},disabled:u.quantity>=u.maxQuantity||e.isAnyAPIPending,"icon-name":"plus","reader-text":e.i18n("cartoverview.quantity-increase"),onClick:t[4]||(t[4]=t=>e.quantityClickHandler("plus"))},null,8,["class-name","disabled","reader-text"])],2),l("div",cs,[l("span",ds,c(e.i18n("cartoverview.total")),1),l("p",us,c(e.getFormattedPrice({value:e.getPrice(i.item)})),1)])])])}]]),ms={components:{Scene7Image:Di},props:{item:{type:Object,required:!0}},computed:{...r("cart",["getProductByCtn"]),product(){return this.getProductByCtn(this.item.itemId)}},mounted(){this.analyticsOnLoad()},methods:{analyticsOnLoad(){const e={trigger:"ec01__out-of-stock.view",event:"systemEvent",interaction:{goal:"ec01__out-of-stock.view",interactive:!1},product:{id:this.item.itemId},component:{name:"ec01-checkout",type:"widget"}};this.trackGoogleAnalyticsSimple(e)}}},hs={class:"p-ec01-cart-item"},gs={class:"p-ec01-cart-item__product"},ys={class:"p-ec01-cart-item__image"},vs={class:"p-ec01-cart-item__body"},fs={class:"p-ec01-cart-item__top"},bs={class:"p-ec01-cart-item__title"},Cs={key:0,class:"p-ec01-cart-item__family-name"},ks={class:"p-ec01-cart-item__descriptor"};const _s={components:{BaseIcon:fi,CartItem:ps,BundledItems:qr,CartItemOutOfStock:yi(ms,[["render",function(e,t,i,r,s,a){const n=D("scene7-image");return o(),g("section",hs,[l("div",gs,[l("div",ys,[y(n,{url:i.item.image||i.item.imageURL,alt:a.product.productTitle||i.item.itemId||i.item.ctn,priority:"eager","size-l":"160,160",class:"p-picture"},null,8,["url","alt"])]),l("div",vs,[l("div",fs,[l("h2",bs,[a.product.familyName||i.item.familyName?(o(),g("p",Cs,c(a.product.familyName||i.item.familyName),1)):I("",!0),l("p",ks,c(a.product.descriptor||i.item.itemId||i.item.ctn),1)])])])])])}]]),SubscriptionBundledItem:Fo},mixins:[gi],computed:{...r("bundles",["getBundleWithId"]),...i("cart",["outOfStockItems","items","isAnyAPIPending"]),outOfStockTitle(){return 1===this.outOfStockItems.length?this.i18n("cartoverview.out-of-stock-single-title"):this.i18n("cartoverview.out-of-stock-multiple-title",[this.outOfStockItems.length])}},methods:{...$("cart",["updateOutOfStockItems"]),removeOutOfStockItems(){this.updateOutOfStockItems({outOfStockItems:[]})}}},Is={key:0,class:"p-ec01-cart__items-out-of-stock"},Ps={class:"p-ec01-cart__items-out-of-stock-title p-body-copy-01 p-heading-light"};const As=yi(_s,[["render",function(e,t,i,r,s,n){const c=D("base-icon"),u=D("cart-item-out-of-stock"),p=D("subscription-bundled-item"),m=D("bundled-items"),v=D("cart-item"),b=h("safe-html");return o(),g("section",{class:d(["p-ec01-cart__items",{"p-ec01--api-pending":e.isAnyAPIPending}])},[e.outOfStockItems.length>0?(o(),g("div",Is,[y(c,{tag:"button",class:"p-ec01-cart__items-out-of-stock-close-btn","icon-name":"cross","reader-text":e.i18n("generic.close"),onClick:t[0]||(t[0]=e=>n.removeOutOfStockItems())},null,8,["reader-text"]),f(l("h3",Ps,null,512),[[b,n.outOfStockTitle]]),(o(!0),g(S,null,x(e.outOfStockItems,e=>(o(),a(u,{key:e.itemId,item:e},null,8,["item"]))),128))])):I("",!0),e.items.length>0?(o(!0),g(S,{key:1},x(e.items,t=>(o(),g(S,{key:t.bundleId},[t.bundleId&&"SUBSCRIPTION"===t.bundleType&&t.isRenderingReference?(o(),a(p,{key:0,"bundle-id":t.bundleId,items:e.getBundleWithId(t.bundleId)},null,8,["bundle-id","items"])):t.bundleId?I("",!0):(o(),g(S,{key:1},[t.isBundle?(o(),a(m,{key:0,items:t.bundle},null,8,["items"])):I("",!0),t.isSingleItem?(o(),a(v,{key:1,item:t},null,8,["item"])):I("",!0)],64))],64))),128)):I("",!0)],2)}]]),ws={name:"BaseInputSet",components:{Field:V},props:{id:{type:String,required:!0},customClass:{type:String,required:!1,default:""},isCombineInput:{type:Boolean,required:!1},isFloatLabel:{type:Boolean,required:!1},isInProgress:{type:Boolean,required:!1},shouldBeUppercase:{type:Boolean,required:!1},autocomplete:{type:String,required:!1,default:void 0},disabled:{type:Boolean,required:!1},inputmode:{type:String,required:!1,default:void 0},type:{type:String,required:!1,default:"text"},modelValue:{type:String,required:!1,default:""},placeholder:{type:String,required:!1,default:""},labelPosition:{type:String,required:!1,default:"before"},labelText:{type:String,required:!1,default:void 0},maxLength:{type:Number,required:!1,default:void 0},handlers:{type:Object,required:!1,default:()=>({})}},emits:["update:modelValue","blur","focus"],data:()=>({charactersLength:0}),computed:{...i("config",["characterCounter"]),inputValue:{get(){return this.modelValue},set(e){this.isCharacterCounterVisible&&(this.charactersLength=e?.length),this.$emit("update:modelValue",e)}},isCharacterCounterVisible(){return Boolean(this.characterCounter&&this.maxLength)},characterCounterValue(){return this.isCharacterCounterVisible?this.i18nv2("generic.characters","{0}/{1} characters",[this.charactersLength,this.maxLength]):""}},methods:{emitInputEvent(){void 0!==this.handlers["update:modelValue"]&&this.handlers["update:modelValue"]()},emitBlurEvent(e){void 0!==this.handlers.blur&&this.handlers.blur(),this.$emit("blur",e.target.value)},emitFocusEvent(e){void 0!==this.handlers.focus&&this.handlers.focus(e),this.isCharacterCounterVisible&&e.target.value&&(this.charactersLength=e.target.value?.length),this.$emit("focus")},emitKeyupEvent(e){void 0!==this.handlers.keyup&&this.handlers.keyup(e)}}},Ss=["for"],xs=["for"],Es={key:2,class:"p-body-copy-03 p-ec01-form__note-msg p-field-counter"};const Ts=yi(ws,[["render",function(e,t,i,r,s,a){const n=D("field");return o(),g("section",{class:d(["p-ec01-base-input-set",{"p-float-label-wrapper":i.isFloatLabel,"p-input--in-progress":i.isInProgress&&!i.isCombineInput,"p-input--text-transform":i.shouldBeUppercase}])},["before"!==i.labelPosition||i.isFloatLabel?I("",!0):(o(),g("label",{key:0,for:i.id},c(i.labelText),9,Ss)),y(n,{id:i.id,modelValue:a.inputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>a.inputValue=e),modelModifiers:{trim:!0},name:i.id,class:d([i.customClass,{"p-input--text-transform":i.shouldBeUppercase,"p-input--filled":a.inputValue?.length>0}]),type:i.type,autocomplete:i.autocomplete,disabled:i.disabled,inputmode:i.inputmode,maxlength:i.maxLength,placeholder:i.placeholder||" ",autocapitalize:i.shouldBeUppercase?"characters":null,autocorrect:"off",spellcheck:"false","validate-on-input":"",onInput:t[1]||(t[1]=e=>a.emitInputEvent(e)),onBlur:t[2]||(t[2]=e=>a.emitBlurEvent(e)),onFocus:t[3]||(t[3]=e=>a.emitFocusEvent(e)),onKeyup:t[4]||(t[4]=e=>a.emitKeyupEvent(e))},null,8,["id","modelValue","name","class","type","autocomplete","disabled","inputmode","maxlength","placeholder","autocapitalize"]),"after"===i.labelPosition||i.isFloatLabel?(o(),g("label",{key:1,for:i.id,class:d({"p-float-label":i.isFloatLabel})},c(i.labelText),11,xs)):I("",!0),a.isCharacterCounterVisible?(o(),g("p",Es,c(a.characterCounterValue),1)):I("",!0)],2)}]]),Ds={name:"InputExtended",components:{BaseInputSet:Ts,BaseIcon:fi,Tooltip:_i,Wrapper:Si},props:{...Ts.props,isTextButton:{type:Boolean,required:!1},isIconButton:{type:Boolean,required:!1},isIconDesktop:{type:Boolean,required:!1},invalidState:{type:Boolean,required:!1},textButtonTxt:{type:String,required:!1,default:""},textButtonType:{type:String,required:!1,default:"submit"},iconName:{type:String,required:!1,default:"arrow-right"},readerText:{type:String,required:!1,default:void 0},tooltipText:{type:String,required:!1,default:""},noteMsg:{type:String,required:!1,default:""},validateOnButton:{type:[Function,Object],required:!1,default:void 0},modelValue:{type:String,required:!1,default:""},error:{type:String,required:!1,default:""}},emits:["update:modelValue","blur"],data:()=>({isFocused:!1}),computed:{inputValue:{get(){return this.modelValue},set(e){this.clearServerError(),this.$emit("update:modelValue",e)}},errorMessage(){return this.invalidState?this.error:!this.isFocused&&this.error?this.error||null:""}},methods:{emitBlurEvent(e){this.$emit("blur",e),this.isFocused=!1},clearServerError(){(this.id.includes("delivery")||this.id.includes("billing"))&&(this.$store.dispatch("delivery/updateServerAddressErrors",{[this.id]:""}),this.$store.dispatch("payments/updateIsPayButtonDisabled",!1))}}},Os={class:"p-ec01-input-extended"},Ls=["type","disabled"],Ms={key:0,class:"p-ec01-form__error-msg"},Bs={key:1,class:"p-body-copy-03 p-ec01-form__note-msg"};const $s=yi(Ds,[["render",function(e,t,i,r,s,l){const u=D("base-input-set"),p=D("base-icon"),m=D("tooltip"),h=D("wrapper");return o(),g("div",Os,[y(h,{wrap:e.isCombineInput,class:d({"p-form__combine-box":e.isCombineInput,"p-form__combine-box--in-progress":e.isCombineInput&&e.isInProgress,"p-form__combine-box--disabled":e.isCombineInput&&e.disabled,"p-form__combine-box--filled":e.isCombineInput&&l.inputValue.length>0,"p-form__combine-box--error":l.errorMessage})},{default:n(()=>[y(u,{id:e.id,modelValue:l.inputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>l.inputValue=e),class:d({"p-ec01-checkout-input--error":l.errorMessage,"p-form__combine-box-input-block":e.isCombineInput}),type:e.type,autocomplete:e.autocomplete,disabled:e.disabled,inputmode:e.inputmode,placeholder:e.placeholder,"should-be-uppercase":"inputSearchOverlay"===e.id||"inputSearch"===e.id||"delivery-postalCode"===e.id||"billing-postalCode"===e.id,"label-position":e.labelPosition,"label-text":e.labelText,"is-combine-input":e.isCombineInput,"is-float-label":!!e.isCombineInput||e.isFloatLabel,"is-in-progress":e.isInProgress,"max-length":e.maxLength,handlers:e.handlers,onBlur:t[1]||(t[1]=e=>l.emitBlurEvent()),onFocus:t[2]||(t[2]=e=>s.isFocused=!0)},null,8,["id","modelValue","class","type","autocomplete","disabled","inputmode","placeholder","should-be-uppercase","label-position","label-text","is-combine-input","is-float-label","is-in-progress","max-length","handlers"]),e.isCombineInput&&i.isTextButton?(o(),g("button",w({ke
2y:0,type:i.textButtonType,class:["p-form__combine-box-button p-form__combine-box-button--text p-heading-04 p-heading-medium",{"p-form__combine-box-button--active":i.modelValue&&!e.isInProgress}],disabled:!i.modelValue||e.isInProgress},N(i.validateOnButton?{click:i.validateOnButton}:void 0,!0)),c(i.textButtonTxt),17,Ls)):e.isCombineInput&&i.isIconButton?(o(),a(p,{key:1,class:d({"p-m-hidden p-l-hidden":!i.isIconDesktop,"p-form__combine-box-button":!0,"p-form__combine-box-button--active":i.modelValue}),disabled:!i.modelValue,tag:"button","icon-name":i.iconName,"reader-text":i.readerText,onClick:t[3]||(t[3]=e=>i.validateOnButton?i.validateOnButton():void 0)},null,8,["class","disabled","icon-name","reader-text"])):e.isCombineInput&&i.tooltipText?(o(),a(m,{key:2,"tooltip-text":i.tooltipText},null,8,["tooltip-text"])):I("",!0)]),_:1},8,["wrap","class"]),P(e.$slots,"dropDownOverride"),l.errorMessage?(o(),g("p",Ms,c(l.errorMessage),1)):i.noteMsg?(o(),g("p",Bs,c(i.noteMsg),1)):I("",!0)])}]]),Vs=["id","name"];const Ns=yi({name:"BaseHidden",props:{id:{type:String,required:!0},name:{type:String,required:!1,default:void 0}}},[["render",function(e,t,i,r,s,a){return o(),g("input",{id:i.id,type:"hidden",name:i.name},null,8,Vs)}]]),Rs={emits:["update:modelValue"],props:{id:{type:String,required:!0},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},value:{type:[String,Array,Boolean],required:!1,default:""},error:{ype:String,required:!1,default:void 0},name:{type:String,required:!1,default:void 0},labelPosition:{type:String,required:!1,default:"after"},labelText:{type:String,required:!1,default:void 0},inputValue:{type:[String,Array,Boolean],required:!0},modelValue:{type:[String,Array,Boolean],required:!1}},computed:{selectedValue:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}}},Fs={class:"p-ec01-form__label"},Us={key:0,class:"p-ec01-form__label-text"},qs={key:1,class:"p-ec01-form__label-text"},Hs={key:0,class:"p-ec01-form__error-msg p-margin-none"};const js=yi({name:"BaseCheckboxSet",components:{Field:V},mixins:[Rs],props:{refProp:{type:String,required:!1,default:""}},emits:["update:modelValue"],computed:{selectedValue:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e||"")}}}},[["render",function(e,t,i,r,s,a){const n=D("field");return o(),g("section",{class:d(["p-ec01-base-checkbox-set",{"p-input--disabled":e.disabled}])},[l("label",Fs,["before"===e.labelPosition?(o(),g("div",Us,[e.labelText?(o(),g(S,{key:0},[O(c(e.labelText),1)],64)):P(e.$slots,"default",{key:1})])):I("",!0),l("div",{class:d(["p-checkbox","after"===e.labelPosition?"p-ec01-form__label-right":"p-ec01-form__label-left"])},[y(n,{id:e.id,ref:i.refProp,modelValue:a.selectedValue,"onUpdate:modelValue":t[0]||(t[0]=e=>a.selectedValue=e),type:"checkbox",value:e.inputValue,disabled:e.disabled,name:e.name,class:d({"p-ec01-checkout-checkbox--error p-ec01-checkout-input--error":e.error}),"validate-on-input":""},null,8,["id","modelValue","value","disabled","name","class"])],2),"after"===e.labelPosition?(o(),g("div",qs,[e.labelText?(o(),g(S,{key:0},[O(c(e.labelText),1)],64)):P(e.$slots,"default",{key:1})])):I("",!0)]),e.error?(o(),g("p",Hs,c(e.error),1)):I("",!0)],2)}]]);function Gs(e,t){const{data:{errors:i=[{}]}}=e,r=["postalCode","InvalidVoucher","totalTax","deliveryAddress.","line1","titleCode","billingAddress.","thresholdExceeded","signifyd_status","CartException"];if("[stockException]"===i[0].source?.parameter)this.$router.push({name:"cart",params:this.$route.params});else if("400"===i[0].status&&i.some(({source:{parameter:e=""}={}})=>r.find(t=>e.includes(t))))t&&(this.isFormOverlayVisible=!0),Ws.call(this);else{const e="[payment_service]"===i[0].source?.parameter?"4011":"4010";this.$store.dispatch("updateErrorDetails",{showError:!0,errorMessageCode:e,fullErrorMessage:i[0]},{root:!0})}}function Ws(){this.$nextTick().then(()=>{document.querySelector(".p-ec01-checkout-input--error")?.scrollIntoView({behavior:"smooth",block:"center"})})}const zs={components:{BaseCheckboxSet:js,InputExtended:$s,VeeForm:R,BaseHidden:Ns},emits:["close-overlay"],data(){return{columns:[{titleKey:"cartoverview.tax-relief-overlay-title1",textKey:"cartoverview.tax-relief-overlay-text1"},{titleKey:"cartoverview.tax-relief-overlay-title2",textKey:"cartoverview.tax-relief-overlay-text2"},{titleKey:"cartoverview.tax-relief-overlay-title3",textKey:"cartoverview.tax-relief-overlay-text3"}],inputHandlers:{blur:this.updateStateAddress},taxReliefApiError:""}},computed:{...i("delivery",["taxReliefConfirmError","taxReliefDeclineError"]),...i({formConfig:e=>
2e.tax.taxReliefFormConfiguration,taxReliefAddress:e=>({...e.tax.taxReliefAddress}),schemaValidationObjData(e){const t=this.getValidationSchema(JSON.parse(JSON.stringify(e.tax.taxReliefFormConfiguration)),"taxrelief");return this.$store.dispatch("config/updateValidationSchema",t),t}}),taxReliefConfirmationVal:{get(){return this.taxReliefAddress?.confirmation||""},set:e=>e}},mounted(){this.$store.dispatch("tax/checkStorageForTaxReliefInfo"),this.errorNotifications()},methods:{...$({updateTaxReliefAddress:"tax/updateTaxReliefAddress"}),updateConfirmation(e,t){this.taxReliefAddress[t]=e,this.updateStateAddress()},updateStateAddress(){return this.updateTaxReliefAddress(this.taxReliefAddress)},taxReliefConfirmHandler(e){e?this.$store.dispatch("tax/updateTaxRelief",{relief:!0}).then(()=>{this.closeOverlay()}).catch(e=>{this.taxReliefApiError="";const{data:{errors:t=[{}]}}=e,i=t.find(({status:e,source:{parameter:t=""}={}})=>"400"===e&&t.includes("application"));this.trackGoogleAnalyticsError(t,"updateTaxRelief"),i&&"{}"!==JSON.stringify(i)&&i.title&&(this.taxReliefApiError=i.title),this.taxReliefConfirmError||Ws.call(this)}):this.$refs.taxReliefObserver.validate().then(()=>{Ws.call(this)})},taxReliefDeclineHandler(){this.$store.dispatch("tax/updateTaxRelief",{relief:!1}).then(()=>{this.closeOverlay()}).catch(e=>{const{data:{errors:t=[{}]}}=e,i=t.find(({status:e,source:{parameter:t=""}={}})=>"400"===e&&t.includes("application"));this.trackGoogleAnalyticsError(t,"updateTaxRelief"),i&&"{}"!==JSON.stringify(i)&&i.title&&(this.taxReliefApiError=i.title),i||Ws.call(this)})},closeOverlay(){this.$emit("close-overlay")},errorNotifications(){(this.taxReliefConfirmError||this.taxReliefDeclineError)&&this.$store.dispatch("notification/updateErrorNotifications",{text:`${this.taxReliefApiError||this.i18n("cartoverview.tax-relief-error")} (9020)`},{root:!0})}}},Qs={class:"p-ec01-overlay-tax-relief"},Ks={class:"p-heading-04-large p-ec01-overlay-tax-relief__content-title"},Js={class:"p-body-copy-02"},Ys={class:"p-form p-grid"},Zs={class:"p-grid"},Xs={class:"p-ec01-overlay-tax-relief__button-wrapper p-text-center p-spacing-top-c"},ea=["onClick"],ta={class:"p-text-center p-body-copy-03 p-spacing-top-a"};const ia={components:{BaseIcon:fi,Overlay:Vi,TaxReliefOverlayContent:yi(zs,[["render",function(e,t,i,r,s,u){const p=D("base-hidden"),m=D("base-checkbox-set"),h=D("input-extended"),y=D("vee-form");return o(),a(y,{ref:"taxReliefObserver","validation-schema":e.schemaValidationObjData},{default:n(({meta:i,errors:r})=>[l("section",Qs,[(o(!0),g(S,null,x(s.columns,t=>(o(),g("div",{key:t.icon,class:"p-ec01-overlay-tax-relief__row"},[l("h2",Ks,c(e.i18n(t.titleKey)),1),l("p",Js,c(e.i18n(t.textKey)),1)]))),128)),l("div",Ys,[(o(!0),g(S,null,x(e.formConfig,i=>(o(),g("div",{key:i.order,class:d(["p-grid-item",e.getClasses([8,8,5,5])])},["disabilitySicknessDescription"===i.name?(o(),a(p,{key:0,id:`taxrelief-${i.name}`,value:"Not-applicable"},null,8,["id"])):"radio"===i.type&&"confirmation"===i.name?(o(),a(m,{key:1,id:`taxrelief-${i.name}`,modelValue:u.taxReliefConfirmationVal,"onUpdate:modelValue":[t[0]||(t[0]=e=>u.taxReliefConfirmationVal=e),e=>u.updateConfirmation(e,i.name)],"label-position":"after",name:`taxrelief-${i.name}`,"input-value":`taxrelief-${i.name}`,error:r[`taxrelief-${i.name}`],"label-text":i.label},null,8,["id","modelValue","name","input-value","error","label-text","onUpdate:modelValue"])):(o(),a(h,{key:2,id:`taxrelief-${i.name}`,modelValue:e.taxReliefAddress[i.name],"onUpdate:modelValue":t=>e.taxReliefAddress[i.name]=t,name:`taxrelief-${i.name}`,disabled:i.disabled,"is-float-label":"",autocomplete:i.autocomplete,required:i.mandatory,"label-text":i.label,type:i.type,handlers:s.inputHandlers,"validate-on-input":"",error:r?.[`taxrelief-${i.name}`],"max-length":i.maxLength},null,8,["id","modelValue","onUpdate:modelValue","name","disabled","autocomplete","required","label-text","type","handlers","error","max-length"]))],2))),128))]),l("div",Zs,[l("div",{class:d(["p-ec01-required-fields",["p-grid-item",e.getClasses([8,8,5,5])]])}," * "+c(e.i18n("generic.required-fields")),3)]),l("div",Xs,[l("button",{class:"p-ec01-button--xlarge p-button p-grid-item p-m-one-quarter p-button-secondary",type:"button",onClick:t[1]||(t[1]=e=>u.taxReliefDeclineHandler())}
2,c(e.i18n("cartoverview.tax-relief-overlay-decline-button-lable")),1),l("button",{class:"p-ec01-button--xlarge p-button p-grid-item p-m-one-quarter p-button-primary",type:"button",onClick:e=>u.taxReliefConfirmHandler(i.valid)},c(e.i18n("cartoverview.tax-relief-overlay-confirm-button-lable")),9,ea)]),l("div",ta,c(e.i18n("cartoverview.tax-relief-overlay-note-message")),1)])]),_:1},8,["validation-schema"])}]])},props:{},data:()=>({showTaxReliefOverlay:!1}),computed:{...i("tax",["taxExemptionEligibleApplied"]),getTaxReliefLabel(){return this.taxExemptionEligibleApplied?this.i18n("cartoverview.tax-relief-eligible-applied-link-lable"):this.i18n("cartoverview.tax-relief-eligible-link-lable")}},mounted(){this.$store.dispatch("tax/checkStorageForTaxReliefInfo")},methods:{onTaxReliefOverlayClose(){this.showTaxReliefOverlay=!1},openTaxReliefOverlay(){this.showTaxReliefOverlay=!0}}};const ra={components:{BaseIcon:fi,TaxRelief:yi(ia,[["render",function(e,t,i,r,s,u){const p=D("base-icon"),m=D("tax-relief-overlay-content"),h=D("overlay");return o(),g("section",{class:d(["p-ec01-tax-relief",{"p-ec01-tax-relief--applied":e.taxExemptionEligibleApplied}])},[l("button",{class:"p-ec01-tax-relief__link text-xs",type:"button",onClick:t[0]||(t[0]=e=>u.openTaxReliefOverlay())},[l("span",null,c(u.getTaxReliefLabel),1),y(p,{tag:"span","icon-name":"arrow-right"})]),s.showTaxReliefOverlay?(o(),a(h,{key:0,"overlay-type":"taxrelief","show-header":"",title:e.i18n("cartoverview.tax-relief-overlay-title"),onCloseOverlay:t[2]||(t[2]=e=>u.onTaxReliefOverlayClose())},{description:n(()=>[y(m,{onCloseOverlay:t[1]||(t[1]=e=>u.onTaxReliefOverlayClose())})]),_:1},8,["title"])):I("",!0)],2)}]])},mixins:[gi],data:()=>({total:""}),computed:{...i("config",["net"]),...i({deliveryCostStatus:e=>e.promotions.potentialPromotions?.[0]?.message||"",zipcode:e=>"{}"!==JSON.stringify(e.delivery.deliveryAddress)&&e.delivery.deliveryAddress.region?e.delivery.deliveryAddress.postalCode:"",state:e=>e.delivery.deliveryAddress.region?e.delivery.deliveryAddress.region.split("-")[1]:""})},methods:{isAccentValue(e,t){return["discount","voucher","giftcard"].includes(e)||["delivery","shipping"].includes(e)&&t===this.i18n("generic.free")}}},oa={class:"p-ec01-cart-summary"},sa={key:0,class:"p-ec01-cart-summary__item"},aa={key:1,class:"p-ec01-cart-summary__item"},na={key:0,class:"p-ec01-cart-summary__dynamic-tax"},la={class:"p-ec01-cart-summary__item p-ec01-cart-summary__item--total"},ca={class:"p-ec01-cart-summary__item-label"},da={class:"p-ec01-cart-summary__item-value"},ua={key:0,class:"text-m"},pa={key:2,class:"text-accent p-ec01-cart-summary__promotion"};const ma=yi(ra,[["render",function(e,t,i,r,s,n){const u=D("tax-relief"),p=D("base-icon"),m=h("safe-html");return o(),g("section",oa,[(o(!0),g(S,null,x(e.cartSummary,(t,i)=>(o(),g(S,{key:i},[!t||"tax"===i&&e.net?t||"tax"===i&&e.net?(o(),g("div",aa,[e.zipcode&&e.state?(o(),g("div",na,[l("span",null,c(e.i18n("cartoverview.estimated-tax-short-label"))+" ("+c(`${e.zipcode} ${e.state}`)+") ",1),l("span",null,c(t),1)])):(o(),g(S,{key:1},[O(c(e.i18nv2("cartoverview.estimated-tax-not-calculated","No Tax has been calculated")),1)],64))])):I("",!0):(o(),g("div",sa,[l("div",{class:d(["p-ec01-cart-summary__item-label",{"p-bold":"subtotal"===i}])},c(e.i18n(`cartoverview.${i}`)),3),l("div",{class:d(["p-ec01-cart-summary__item-value",{"text-accent text-bold":n.isAccentValue(i,t)}])},c(t),3)]))],64))),128)),l("div",la,[l("div",ca,c(e.i18n("cartoverview.total")),1),l("div",da,c(s.total),1)]),e.net?I("",!0):(o(),g("div",ua,c(e.i18n("cartoverview.estimated-tax-include-all-prices")),1)),e.taxExemptionEligible?(o(),a(u,{key:1})):I("",!0),e.deliveryCostStatus?(o(),g("div",pa,[y(p,{"icon-name":"transport-truck"}),f(l("span",null,null,512),[[m,e.deliveryCostStatus]])])):I("",!0)])}]]),ha={components:{Scene7Image:Di,Tooltip:_i,Wrapper:Si},mixins:[gi],props:{product:{type:Object,required:!0},itemWidth:{type:Number,required:!0},parentComponent:{type:String,required:!1,default:"recently-viewed-products"},abTestVariant:{type:String,required:!1,default:"0"}},computed:{...r("config",["getDefaultConfig"]),...i("cart",["currencyCode","actualCartId"]),...i("config",["isMicrositeId"]),enableDiscountPriceToolTip(){return this.getDefaultConfig("enableDiscountPriceToolTip")},removeStrikethroughFromShopPrice(){return this.getDefaultConfig("removeStrikethroughFromShopPrice")},discountDisplayLabel(){const e=this.getDefaultConfig("campaignLabel");return this.getDiscountDisplayLabel(e)}},methods:{addToCart(){this.$store.dispatch("cart/addCartItem",{itemId:this.product.atcCode}).then(()=>{"recommended-products"===this.parentComponent&&this.$store.dispatch("recommendedProducts/getCoveoRecommendedProducts",this.abTestVariant),this.handleAnalytics()})},getDiscountDisplayLabel(e){let t="";
2const i=this.product.shopPrice.value-(this.product.discountPrice?.value||0);return this.product.ispromotionCheck?t="PROMOTION_PERCENTAGE_DISCOUNT"===this.product.productPromotionData.type?`${this.product.productPromotionData.percentageDiscount} %`:this.getFormattedPrice({value:this.product.productPromotionData.promotionDiscount.value}):this.product.activeCampaigns?.length>0&&e?.enabled&&(t="percentageDiscount"===e?.type?`${Math.round(i/this.product.shopPrice.value*100)} %`:this.getFormattedPrice({value:i})),t},handleAnalytics(){const e=this.product;void 0===e.price?(e.totalPrice=e.shopPrice||{},e.totalPrice.value=e.shopPrice?.value||{}):(e.totalPrice=e.price,e.totalPrice.value=e.price.productPrice),e.itemId=e.ctn,e.quantity=1;const t=this.generateGAdataForAddRemove(e);this.trackGoogleAnalytics({currencyCode:this.currencyCode,add:{products:t.productObj},cart:{id:this.actualCartId,products:t.cartItems}},"ecommerce.cart.add")}}},ga=["data-ctn"],ya={class:"p-ec01-product-card__thumbnail p-spacing-bottom-a"},va={key:0},fa={class:"p-ec01-product-card__discount-percentage p-heading-bold"},ba={key:1},Ca={class:"p-price-shop-label p-heading-bold"},ka={class:"p-ec01-product-card__price-details p-body-copy-01"},_a={class:"p-ec01-product-card__details"},Ia={class:"p-ec01-product-card__title p-heading-04-large"},Pa={class:"p-ec01-product-card__description p-body-copy-02 p-heading-light"},Aa={class:"p-body-copy-02 p-heading-light"},wa={key:2,class:"p-ec01-star-ratings-wrapper"},Sa={class:"p-ec01-star-ratings"},xa={class:"p-ec01-star-rating-count p-body-copy-02 p-heading-light"};const Ea=yi(ha,[["render",function(e,t,i,r,s,u){const p=D("scene7-image"),m=D("wrapper"),h=D("tooltip");return o(),g("section",{class:"p-ec01-product-card",style:b({width:`${i.itemWidth}px`}),"data-ctn":i.product.ctn},[y(m,{wrap:Boolean(i.product.productURL)&&!e.isMicrositeId,tag:"a",href:i.product.productURL,class:"p-ec01-product-card__link",onClick:t[0]||(t[0]=t=>e.productClickHandler(t,{itemId:i.product.ctn,from:"image"}))},{default:n(()=>[l("div",ya,[y(p,{url:i.product.imageURL,alt:i.product.productTitle||i.product.ctn,class:"p-picture","size-x-s":"120,120","size-s":"120,120"},null,8,["url","alt"])])]),_:1},8,["wrap","href"]),u.discountDisplayLabel?(o(),g("div",va,[l("span",fa," -"+c(u.discountDisplayLabel),1)])):I("",!0),u.enableDiscountPriceToolTip&&(i.product.ispromotionCheck||i.product.activeCampaigns&&e.campaignData?.enabled)?(o(),g("div",ba,[l("p",Ca,c(e.i18n("b2c.price.was.label")),1)])):I("",!0),l("div",ka,[l("p",{class:d(["p-ec01-product-card__price-current p-bold",{"p-ec01-product-card__price-discounted":i.product.discountPrice&&!Array.isArray(i.product.discountPrice)&&i.product.discountPrice.value!==i.product.shopPrice.value}])},c(e.getFormattedPrice({value:i.product.discountPrice&&!Array.isArray(i.product.discountPrice)?i.product.discountPrice?.value:i.product.shopPrice?.value})),3),i.product.discountPrice&&!Array.isArray(i.product.discountPrice)&&i.product.discountPrice.value!==i.product.shopPrice.value?(o(),g("p",{key:0,class:d(["p-ec01-product-card__price-previous",{"p-ec01-product-card__price-previous-strike":!u.removeStrikethroughFromShopPrice}])},c(e.getFormattedPrice({value:i.product.shopPrice.value})),3)):I("",!0),i.product.ispromotionCheck&&u.enableDiscountPriceToolTip&&i.product.discountPrice&&!Array.isArray(i.product.discountPrice)&&i.product.discountPrice.value!==i.product.shopPrice.value?(o(),a(h,{key:1,"tooltip-icon-name":"information-circle","tooltip-text":e.i18n("b2c.discount.price.tooltip.text")},null,8,["tooltip-text"])):I("",!0)]),l("div",_a,[i.product.familyName?(o(),a(m,{key:0,wrap:Boolean(i.product.productURL)&&!e.isMicrositeId,tag:"a",href:i.product.productURL,class:"p-ec01-product-card__link",onClick:t[1]||(t[1]=t=>e.productClickHandler(t,{itemId:i.product.ctn,from:"title"}))},{default:n(()=>[l("p",Ia,c(i.product.familyName),1)]),_:1},8,["wrap","href"])):I("",!0),l("p",Pa,c(i.product.descriptor),1),l("p",Aa,c(i.product.ctn),1)]),i.product.reviewStatistics&&i.product.reviewStatistics.averageOverallRating&&i.product.reviewStatistics.totalReviewCount?(o(),g("div",wa,[l("div",Sa,[l("div",{class:"p-ec01-stars-fill",style:b({width:i.product.reviewStatistics.averageOverallRating/5*100+"%"})}," ★★★★★ ",4),t[3]||(t[3]=l("div",{class:"p-ec01-stars-empty"},"★★★★★",-1))]),l("span",xa," ("+c(i.product.reviewStatistics.totalReviewCount)+") ",1)])):I("",!0),l("button",{class:"p-button p-button-conversion p-full p-xlarge p-ec01-product-card__add-to-cart-button",type:"button",onClick:t[2]||(t[2]=e=>u.addToCart())}
2,c(e.i18n("cartoverview.recommended-products-add-to-cart-button")),1)],12,ga)}]]),Ta=(e,{immediate:t=!1}={})=>{window.eddlEvents||=[],t?window.eddlEvents.push(e):setTimeout(()=>{window.eddlEvents.push(e)},0)},Da=e=>{setTimeout(()=>{window.philips?.analytics&&window.philips.analytics.trackConversion(e)},0)},Oa=(e,t="shown",i)=>{Ta({trigger:"experiment.event",event:"userEvent",interaction:{goal:"experiment",status:3745029,description:`tt_3745029_PR_v${i}_${e.ctn}_${t}`},component:{name:"ec01-checkout",type:"Checkout"}})},La=(e,t)=>{Da({name:"interaction",description:`radio_button:checkout_method:guest_checkout:${e}`}),Da({name:"interaction",description:`radio_button:checkout_method:checkout_with_account:${t}`})},Ma=e=>{Da({name:"interaction",description:`link:checkout_method:${e}`})},Ba=()=>{Da({name:"interaction",description:"link:terms_and_conditions"})},$a=()=>{Da({name:"interaction",description:"link:privacy_notice"})},Va=()=>{Ta({trigger:"event.ec01-checkout.typeaheadStartTyping",event:"userEvent",interaction:{goal:"typeahead start typing",description:"typeahead",status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},Na=(e,t)=>{Da({name:"interaction",pagename:e,description:"billing_address:same_as_delivery_address:"+(t?"checked":"unchecked")})},Ra=()=>{Ta({trigger:"event.ec01-checkout.typeaheadSuggestionSelection",event:"userEvent",interaction:{goal:"typeahead suggestion selection",description:"typeahead",status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},Fa=()=>{Ta({trigger:"event.ec01-checkout.typeaheadSuggestionLoadEvent",event:"userEvent",interaction:{goal:"typeahead suggestion load event",description:"typeahead",status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},Ua=()=>{Ta({trigger:"event.ec01-checkout.typeaheadOnLocationEmptyResponseEvent",event:"userEvent",interaction:{goal:"typeahead on location empty response event",description:"typeahead",status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},qa=()=>{Da({name:"interaction",description:"input_field:guest_checkout_with_email_address"})},Ha=(e,t)=>{Da({name:"interaction",pagename:e,description:`payment_method:${t}`})},ja=(e,t)=>{Da({name:"interaction",pagename:e,description:`delivery_method:${t}`})},Ga=e=>{Ta({trigger:"event.ec01-checkout.addressVerificationFailedEvent",event:"userEvent",interaction:{goal:"addressverification failed event",description:e,status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},Wa=e=>{Ta({trigger:"event.ec01-checkout.preciselyError",event:"systemEvent",interaction:{goal:"precisely error",description:e,status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}})},za=(e,t)=>{const i=t.attributes.distance?`pup_layover:location_${t.attributes.address.town}:distance_${t.attributes.distance.value}${t.attributes.distance.unit}`:`pup_layover:location_${t.attributes.address.town}`;Da({name:"interaction",pagename:e,description:i})},Qa=(e,t,i)=>{Da({name:"interaction",description:`language_switch:${i}
2:not_set:${e}_to_${t}`})},Ka=e=>{Ta({trigger:"event.ec01-checkout.continueShopping",event:"userEvent",interaction:{goal:"continue shopping user event",description:e,status:"success",interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}},{immediate:!0})},Ja=(e,t)=>{!e&&t&&Da({name:"interaction",description:`checkbox:src_age_consent:${t}`}),Da({name:"interaction",description:"checkbox:src_age_consent:"+(e?"checked":"unchecked")})},Ya=e=>{Ta({trigger:"udiUserIds.ready",event:"systemEvent",component:{name:"ec01-checkout",type:"response"},userid:{sha256email:F.sha256(e.email),uuidHash:F.sha256(e.sub)}})},Za=({country:e,ctn:t,ctaType:i})=>{const r=(new Date).toISOString();Ta({trigger:"experiment.event",event:"userEvent",interaction:{goal:"experiment",description:`Market: ${e}; CTN: ${t}; Page: Order Confirmation Page; CTA Type: ${i}; Timestamp: ${r}`},component:{name:"ec01-checkout",type:"Checkout"}})};function Xa(){return{pushEddlEvent:Ta,trackConversion:Da,trackProductRecommendation:Oa,trackUserReady:Ya,trackCheckoutMethodConversion:La,trackCheckoutMethodLink:Ma,trackEmailInput:qa,trackTermsLink:Ba,trackPrivacyLink:$a,trackTypeaheadStartTyping:Va,trackBillingAddressToggle:Na,trackTypeaheadSuggestionSelection:Ra,trackTypeaheadSuggestionLoad:Fa,trackTypeaheadEmptyResponse:Ua,trackPaymentMethodSelection:Ha,trackDeliveryMethodSelection:ja,trackAddressVerificationError:Ga,trackPreciselyError:Wa,trackCollectionPointSelection:za,trackAgeConsentInteraction:Ja,trackLanguageSwitch:Qa,trackContinueShopping:Ka,trackSupportCtaClick:Za}}function en(){const e=_(),{getCookie:t,setCookie:i}=ht(),{pushEddlEvent:r}=Xa(),o=k(()=>e.getters["config/getDefaultConfig"]);return{getVariantUS3745029:k(()=>["en_US","nl_NL","en_GB","de_DE"].includes(o.value("localeId"))?(e=>{const s=o.value("featureToggles")||{},a=o.value("siteId")||"";if(void 0===s[e]||!a.includes("Pub"))return 0;const n=s[e].variants,l=s[e].days,c=`eddl_abt_${e}`;let d="";if(l){const e=t(c);e&&""!==e&&(d=e)}if(!d){const e=Math.random(),t=Array.isArray(n)?n.length:n;let r=0;for(let i=0;i<t;i++)if(r+=Array.isArray(n)?n[i]:1/t,e<r){d=String(i);break}l&&i(c,d,2*l)}return l&&r({trigger:"eddl.exp.apply",event:"systemEvent",activityId:e,experienceId:d,platform:"aem",type:"abt"}),d})("us3745029"):"0")}}const tn={key:0,class:"p-grid p-spacing-bottom-a p-m-spacing-bottom-b p-l-spacing-bottom-b"},rn={class:"p-grid-item p-one-whole p-l-two-thirds"},on={class:"p-ec01-recommended-products"},sn={class:"p-heading-03 p-xs-spacing-top-a p-s-spacing-top-a p-m-spacing-top-c p-l-spacing-top-c"},an={class:"p-ec01-recommended-products__carousel-slider"},nn={class:"p-ec01-recommended-products__inner-slider"},ln={__name:"ProductRecommendationsTest",setup(e){const t=_(),{i18n:i}=Ii(),{getVariantUS3745029:r}
2=en(),{trackProductRecommendation:s}=Xa(),n=C(0),d=C(0),u=C(8),m=C(3),h=C(0),f=k(()=>t.state.cart.items),P=k(()=>t.state.recommendedProducts.coveoRecommendedProducts),A=k(()=>t.state.recommendedProducts.coveoAnalyticsList),w=k(()=>r.value),E=k(()=>"1"===w.value?i("cartoverview.recommended-products-cart-global-title"):i("cartoverview.recommended-products-frequent-bought-title")),T=k(()=>P.value.slice(0,6)),D=k(()=>T.value.length),O=k(()=>f.value.length),L=k(()=>Math.floor(D.value/m.value)),M=k(()=>Math.floor(D.value/m.value)===Math.ceil(D.value/m.value)),B=()=>{t.dispatch("recommendedProducts/getCoveoRecommendedProducts",w.value)},$=e=>{d.value=document.querySelectorAll(".p-ec01-recommended-products .p-ec01-product-card")[0].getClientRects()[0].width,n.value=e,h.value=e<L.value?-d.value*m.value*n.value-n.value*u.value*m.value*2:-(D.value-m.value)*d.value-(D.value-m.value)*u.value*2};return U(T,e=>{for(const t of e)s(t,"shown",w.value)}),U(O,()=>{B()}),p(()=>{B()}),(e,r)=>D.value>0?(o(),g("section",tn,[l("div",rn,[l("div",on,[l("h2",sn,c(E.value),1),l("div",an,[l("div",nn,[l("div",{class:"p-ec01-recommended-products__carousel-slider-list",style:b({transform:`translateX(${h.value}px)`})},[(o(!0),g(S,null,x(T.value,(e,i)=>(o(),a(Ea,{key:`coveo-recommended-products-${e.ctn}-${i}`,product:e,"item-width":d.value,"ab-test-variant":w.value,"parent-component":"recommended-products",onClick:i=>(e=>{const i=[];A.value[0]?.length>0&&A.value[0].map(t=>t.raw?.ps_dtn===e?.ctn?i.push(t):i),i.length>0&&t.dispatch("recommendedProducts/loadRecommendationClickAnalyticsActions",i[0]),s(e,"clicked",w.value)})(e)},null,8,["product","item-width","ab-test-variant","onClick"]))),128))],4)]),D.value>m.value?(o(),g(S,{key:0},[y(fi,{tag:"button","class-name":{"p-ec01-recommended-products__carousel-button p-ec01-recommended-products__carousel-button-previous":!0,"p-ec01-recommended-products__carousel-button--active":0!==n.value},"icon-name":"arrow-left",disabled:0===n.value,"reader-text":v(i)("cartoverview.quantity-decrease"),onClick:r[0]||(r[0]=e=>$(n.value-1))},null,8,["class-name","disabled","reader-text"]),y(fi,{tag:"button","class-name":{"p-ec01-recommended-products__carousel-button p-ec01-recommended-products__carousel-button-next":!0,"p-ec01-recommended-products__carousel-button--active":M.value?n.value<L.value-1:n.value<L.value},"icon-name":"arrow-right","reader-text":v(i)("cartoverview.quantity-decrease"),disabled:M.value?n.value===L.value-1:n.value===L.value,onClick:r[1]||(r[1]=e=>$(n.value+1))},null,8,["class-name","reader-text","disabled"])],64)):I("",!0)])])])])):I("",!0)}},cn={data:()=>({subscriptionsTitlesArray:[]}),computed:{...i("cart",["items"]),...i("bundles",["appliedBundles"]),appliedBundledItems(){const e=this.items.map(e=>e.bundleId),t=this.appliedBundles.map(e=>{const t={...e};return"SUBSCRIPTION"===t.type?.toUpperCase()&&(t.subscriptionBundledItemObject=jr(t)),t});return this.sortedAppliedBundles(t,[...new Set(e)])},subScriptionProductNames(){0===this.subscriptionsTitlesArray.length&&this.items.map(e=>(e.bundleId&&"SUBSCRIPTION"===e.bundleType&&e.isRenderingReference&&e.title&&this.subscriptionsTitlesArray.push(e.title),this.subscriptionsTitlesArray));const e=new Intl.ListFormat(this.language,{style:"long",type:"conjunction"});return this.subscriptionsTitlesArray.length>0?this.i18n("checkoutoverview.subscription.recurring-payments-for",[e.format(this.subscriptionsTitlesArray)]):""}},methods:{sortedAppliedBundles:(e,t)=>e.sort((e,i)=>t.indexOf(e.id)-t.indexOf(i.id))}},dn={class:"p-ec01-subscription-info"},un={class:"p-ec01-subscription-info__recurring-payments"},pn={class:"text-m text-bold"},mn={class:"text-s"};const hn=yi(cn,[["render",function(e,t,i,r,s,a){return o(),g("section",dn,[l("div",un,[l("h3",pn,c(e.i18n("cartoverview.subscription-recurring-payment-text")),1),l("div",null,[(o(!0),g(S,null,x(a.appliedBundledItems,t=>(o(),g("p",{key:`subscriptions-bundled-item-${t.itemId}-${t.id}-${t.bundleId}`,class:d("SHOP_BCBS"===t.subscriptionBundlePartner?.toUpperCase()?"p-ec01-subscription-info__price-previous text-m text-bold":"p-ec01-subscription-info__price-current text-m text-bold")},["SUBSCRIPTION"===t.type?(o(),g(S,{key:0},[O(c(1===t.quantity?e.getFormattedPrice({value:t.subscriptionBundledItemObject?.recurringPrice||0}):`${t.quantity}* ${e.getFormattedPrice({value:t.subscriptionBundledItemObject?.recurringPrice||0})}`),1)],64)):I("",!0)],2))),128))])]),l("p",mn,c(a.subScriptionProductNames),1)])}]]),gn={class:"p-heading-04-large p-heading-book p-ec01-valid-voucher__code"},yn={key:0,class:"p-ec01-valid-voucher__code-row"},vn={class:"p-ec01-valid-voucher__code-price"},fn={class:"p-ec01-valid-voucher__code-label"},bn={class:"p-ec01-valid-voucher__code-row"},Cn={class:"p-ec01-valid-voucher__code-price"},kn={class:"p-ec01-valid-voucher__code-label"},_n={key:0,class:"p-ec01-valid-voucher__code-row"},In={class:"p-ec01-valid-voucher__code-price p-ec01-valid-voucher__code-price--available"},Pn={class:"p-ec01-valid-voucher__code-label p-ec01-valid-voucher__code-label--available"},An={key:0,class:"p-ec01-valid-voucher__removing-text"};const wn={name:"Voucher",components:{InputExtended:$s,ValidVouchers:yi({name:"ValidVouchers",components:{BaseIcon:fi},mixins:[gi],props:{validVoucher:{type:Object,required:!0},voucherType:{type:String,required:!0}},emits:["remove-valid-voucher"],data:()=>({isRemoving:!1}),computed:{isBCBSVoucher(){return"PYR1"===this.validVoucher?.id?.slice(0,4)}},methods:{onVoucherRemoveClick(e){this.isRemoving=!0,this.$emit("remove-valid-voucher",e)}}},[["render",function(e,t,i,r,s,a){const n=D("base-icon");return o(),g("section",{class:d(["p-ec01-valid-voucher__wrapper",{"p-ec01-valid-voucher__remove--removing":s.isRemoving}])},[y(n,{tag:"div","class-name":"p-heading-04-large p-heading-light p-ec01-valid-voucher__checkmark-icon","icon-name":"checkmark"}),l("h3",gn,["voucher"===i.voucherType?(o(),g("span",yn,[l("span",vn,c(a.isBCBSVoucher?e.i18n("generic.free"):e.getFormattedPrice({value:i.validVoucher.value.value}
2)),1),l("span",fn,c(e.i18n("cartoverview.voucher-valid-label")),1)])):"giftvoucher"===i.voucherType?(o(),g(S,{key:1},[l("span",bn,[l("span",Cn,c(e.getFormattedPrice({value:i.validVoucher.redeemedAmount.value})),1),l("span",kn,c(e.i18n("cartoverview.giftcard-valid-label")),1)]),0!==i.validVoucher.availableAmount.value?(o(),g("span",_n,[l("span",In,c(e.getFormattedPrice({value:i.validVoucher.availableAmount.value})),1),l("span",Pn,c(e.i18n("cartoverview.giftcard-valid-remaining-label")),1)])):I("",!0)],64)):I("",!0)]),s.isRemoving?(o(),g("div",An,c(e.i18n("cartoverview.removing-voucher")),1)):a.isBCBSVoucher?I("",!0):(o(),g("button",{key:1,class:"p-heading-04 p-link-style p-ec01-valid-voucher__remove-btn",type:"button",onClick:t[0]||(t[0]=e=>a.onVoucherRemoveClick(i.validVoucher))},[y(n,{tag:"span","icon-name":"trashbin","reader-text":e.i18n("generic.remove")},null,8,["reader-text"])]))],2)}]]),BaseIcon:fi},mixins:[gi],props:{isCheckoutOptionsDisabled:{type:Boolean}},data:()=>({inputVoucher:"",addNew:!0,addNewForm:!1,voucherInvalid:!1,voucherValid:!1,isInProgress:!1,isRemoving:!1,genericErrorMessage:""}),computed:{...r("config",["getDefaultConfig"]),...i("cart",["vouchers","giftVouchers","isVoucherInvalid","isAdditionalVoucherAdded","isSubscriptionApplicable"]),voucherTitle(){return this.vouchers?.length>0||this.giftVouchers?.length>0?this.i18n("cartoverview.voucher-another-title"):this.i18n("cartoverview.voucher-title")},isVoucherFormVisible(){return!((this.vouchers?.length>0||this.giftVouchers?.length>0)&&this.getDefaultConfig("featureToggles").hideAdditionalDiscount)}},methods:{voucherFocus(){this.voucherInvalid&&=!1,this.$store.commit("cart/updateIsVoucherInvalid",!1),this.$store.commit("cart/updateIsAdditionalVoucherAdded",!1)},...$({updateVoucherCodeError:"delivery/updateVoucherCodeError"}),triggerGoogleAnalytics(e){this.trackGoogleAnalyticsSimple({trigger:"experiment.event",event:"userEvent",interaction:{goal:"experiment",status:"3508010",description:`tt_3508010_apply_voucher_${e}`},component:{name:"ec01-checkout",type:"Checkout"}})},openVoucherForm(){this.vouchers?.length>0||this.giftVouchers?.length>0?this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"discount_voucher_code:add"}):this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"discount_voucher:open"}),this.addNew=!1,this.addNewForm=!0,this.voucherValid=!1,this.voucherInvalid=!1,this.setInputVoucherFocus()},closeVoucherForm(){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"discount_voucher:close"}),this.addNew=!0,this.addNewForm=!1},setInputVoucherFocus(){this.$nextTick().then(()=>{this.$refs.inputVoucherWrapper.querySelectorAll("input")[0].focus()})},validateVoucher(){""===this.inputVoucher||this.isInProgress||(this.isInProgress=!0,this.voucherInvalid=!1,this.voucherValid=!0,this.$store.dispatch("cart/updateVoucher",{voucherCode:this.sanitize(this.inputVoucher)}).then(()=>{this.trackConversion({name:"checkout_voucher",description:"success",pagename:this.$route.meta.pagename,vouchercode:this.sanitize(this.inputVoucher)}),this.triggerGoogleAnalytics("success"),this.isInProgress=!1,this.voucherInvalid=!1,this.voucherValid=!0,this.inputVoucher="",this.closeVoucherForm(),setTimeout(function(){this.hideMessage()}.bind(this),3e3)}).catch(e=>{const{data:{errors:t=[{}]}}=e;this.genericErrorMessage="400"===t[0].status?t[0].source.parameter.replaceAll(/['[\]]+/g,""):t[0].title,this.trackConversion({name:"checkout_voucher",description:"failed",pagename:this.$route.meta.pagename,vouchercode:this.sanitize(this.inputVoucher)}),this.triggerGoogleAnalytics("failed"),this.isInProgress=!1,this.voucherInvalid=!0}))},showErrorMessage(){return this.isAdditionalVoucherAdded?this.i18n("cartoverview.voucher-warning-message"):this.genericErrorMessage&&"VOUCHERID"!==this.genericErrorMessage.toUpperCase()?this.genericErrorMessage:this.i18n("cartoverview.voucher-error-message")},hideMessage(){this.voucherValid=!1},removeValidVoucher(e){this.isRemoving=!0,this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"discount_voucher_code:remove"}),this.$store.dispatch("cart/updateVoucher",{voucherCode:e.id,action:"remove"}).then(()=>{this.isRemoving=!1,this.voucherInvalid=!1,this.voucherValid=!1,0===this.vouchers.length&&this.updateVoucherCodeError()}).catch(e=>{console.log(e)})}}},Sn=["aria-expanded"],xn={class:"p-valid-voucher"};const En=yi(wn,[["render",function(e,t,i,r,s,n){const u=D("base-icon"),p=D("input-extended"),m=D("valid-vouchers");return o(),g("section",{ref:"inputVoucherWrapper",class:d(["p-ec01-voucher",{"p-ec01-voucher--api-pending":s.isInProgress||s.isRemoving}])},[e.isTotal&&n.isVoucherFormVisible?(o(),g("button",{key:0,class:d(["p-ec01-voucher__label",{"p-ec01-voucher__label--disabled":i.isCheckoutOptionsDisabled}]),"aria-expanded":s.addNew?"false":"true","aria-controls":"p-ec01-add-voucher",type:"button",onClick:t[0]||(t[0]=e=>s.addNew?n.openVoucherForm():n.closeVoucherForm())},[O(c(n.voucherTitle)+" ",1),y(u,{tag:"span","icon-name":s.addNew?"plus":"minus-2"},null,8,["icon-name"])],10,Sn)):I("",!0),f(l("form",{id:"p-ec01-add-voucher",class:"p-ec01-voucher__add-form p-form",onSubmit:t[2]||(t[2]=T(()=>{},["prevent"]))},[y(p,{id:"inputVoucher",modelValue:s.inputVoucher,"onUpdate:modelValue":t[1]||(t[1]=e=>s.inputVoucher=e),"label-text":e.isSubscriptionApplicable?e.i18n("c
2artoverview.voucher-input-label-subscription"):e.i18n("cartoverview.voucher-input-label"),"is-float-label":"","is-combine-input":"","is-text-button":"","text-button-txt":e.i18n("cartoverview.voucher-apply"),"validate-on-button":n.validateVoucher,"is-in-progress":s.isInProgress,error:s.voucherInvalid||e.isVoucherInvalid?n.showErrorMessage():"","note-msg":e.isSubscriptionApplicable?e.i18n("cartoverview.voucher-help-text-subscription"):e.i18n("cartoverview.voucher-help-text"),autocomplete:"off",handlers:{focus:n.voucherFocus}},null,8,["modelValue","label-text","text-button-txt","validate-on-button","is-in-progress","error","note-msg","handlers"])],544),[[B,s.addNewForm]]),f(l("div",xn,[(o(!0),g(S,null,x(e.vouchers,e=>(o(),a(m,{key:e.id,"voucher-type":"voucher","valid-voucher":e,onRemoveValidVoucher:t[3]||(t[3]=e=>n.removeValidVoucher(e))},null,8,["valid-voucher"]))),128)),(o(!0),g(S,null,x(e.giftVouchers,e=>(o(),a(m,{key:e.id,"voucher-type":"giftvoucher","valid-voucher":e,onRemoveValidVoucher:t[4]||(t[4]=e=>n.removeValidVoucher(e))},null,8,["valid-voucher"]))),128))],512),[[B,e.vouchers?.length>0||e.giftVouchers?.length>0]])],2)}]]),Tn={ref:"notification",class:"p-xs-spacing-bottom-a p-s-spacing-bottom-a p-m-spacing-bottom-d p-l-spacing-bottom-d"},Dn={class:"p-text"},On={key:0,class:"p-bold"},Ln={key:0},Mn=["href"],Bn=["onClick"];const $n=yi({props:{errorNotifications:{type:Array,required:!0}},mounted(){this.scrollToNotification()},updated(){this.scrollToNotification()},methods:{className(e){switch(e){case"success":return"p-navigation";case"warning":return"p-warning";case"error":return"p-error";default:return""}},closeBarFunction(e){this.$store.commit("notification/removeErrorNotifications",e,{root:!0})},scrollToNotification(){this.$refs.notification.scrollIntoView({behavior:"smooth",block:"start"})}}},[["render",function(e,t,i,r,s,a){return o(),g("section",Tn,[(o(!0),g(S,null,x(i.errorNotifications,(t,i)=>(o(),g("div",{key:i,class:"p-ec01-notification"},[t.isMaintenance?I("",!0):(o(),g("div",{key:0,class:d(["p-notification-bar",a.className(t.type)])},[l("span",Dn,[t.isI18n?(o(),g(S,{key:0},[t.title?(o(),g("p",On,c(e.i18n(t.title)),1)):I("",!0),O(" "+c(e.i18n(t.text)),1)],64)):(o(),g(S,{key:1},[t.title?(o(),g("p",Ln,c(t.title),1)):I("",!0),O(" "+c(t.text),1)],64)),t.notificationLink&&t.notificationLinkText?(o(),g("a",{key:2,href:t.notificationLink,target:"_blank"},c(t.notificationLinkText),9,Mn)):I("",!0)]),l("button",{class:"p-close p-square p-inverted p-icon-close p-small",type:"button",onClick:e=>a.closeBarFunction(i)},null,8,Bn)],2))]))),128))],512)}]]),Vn={class:"p-ec01-consent"},Nn={key:1,class:"p-ec01-form__error-msg p-ec01-form-checkbox__error-msg"},Rn=["src","title"],Fn={__name:"Consent",props:{contentClassName:{type:String,default:"p-body-copy-03"},mandatoryError:{type:String,required:!1,default:""},showError:{type:Boolean,required:!1},selectedValue:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},consentConfiguration:{type:Object,required:!0}},emits:["toggle-consent"],setup(e,{emit:t}){const i=e,r=t,s=C(!1),u=C(""),p=k({get:()=>i.selectedValue||!1,set(e){r("toggle-consent",Boolean(e))}});return(t,i)=>{const r=h("safe-html");return o(),g("section",Vn,[e.consentConfiguration.label?(o(),a(js,{key:0,id:`consent-${e.consentConfiguration.name}`,modelValue:p.value,"onUpdate:modelValue":i[1]||(i[1]=e=>p.value=e),"input-value":!0,name:`consent-${e.consentConfiguration.name}`,disabled:e.disabled},{default:n(()=>[f(l("p",{class:d(e.contentClassName),onClick:i[0]||(i[0]=e=>(e=>{const t=e?.target?.closest?.("a");t&&(e.preventDefault(),u.value=t.href,s.value=!0)})(e))},null,2),[[r,e.consentConfiguration.label]])]),_:1},8,["id","modelValue","name","disabled"])):I("",!0),e.showError?(o(),g("p",Nn,c(e.mandatoryError),1)):I("",!0),s.value?(o(),a(Vi,{key:2,"show-header":"","overlay-type":"iframe",onCloseOverlay:i[2]||(i[2]=e=>s.value=!1)},{description:n(()=>[l("iframe",{src:u.value,title:u.value,width:"100%",height:"100%",allowfullscreen:""},null,8,Rn)]),_:1})):I("",!0)])}}},Un={class:"p-ec01-cart-overview__age-circle p-push-m-two-fifths p-push-xs-one-third"},qn={class:"p-heading-03"},Hn={class:"p-ec01-cart-overview__confirm p-text-center"},jn=["disabled"],Gn={__name:"OverlayAgeConsent",setup(e){const t=_(),i=k(()=>t.state.consent.isAgeConsent),r=k(()=>t.state.consent.ageConsentConfiguration),s=k(()=>r.value[0]||""),u=()=>{t.commit("consent/updateShowAgeConsent",!1)};return(e,r)=>(o(),a(Vi,{"overlay-type":"consent","show-header":"",title:e.i18n("c
2artoverview.age-consent-overlay-title"),onCloseOverlay:r[2]||(r[2]=e=>u())},{description:n(()=>[l("p",Un,c(e.i18n("cartoverview.age-consent-overlay-sub-title-18")),1),l("p",qn,c(e.i18n("cartoverview.age-consent-overlay-sub-title")),1),y(Fn,{"content-class-name":"p-body-copy-01","selected-value":i.value,"consent-configuration":s.value,"mandatory-error":e.i18n("cartoverview.age-consent-required-error-message"),onToggleConsent:r[0]||(r[0]=e=>{return i=e,void t.dispatch("consent/updateIsAgeConsent",i);var i})},null,8,["selected-value","consent-configuration","mandatory-error"]),l("div",Hn,[l("button",{class:d(["p-button p-xs-s-full p-ec01-button--xlarge p-m-one-half",{"p-ec01-button--disabled":!i.value}]),disabled:!i.value,type:"button",onClick:r[1]||(r[1]=e=>(ne.setCookie({key:"ageConsent-opt-in",value:"accepted"}),t.commit("consent/updateIsAgeConsentAccepted",!0),void u()))},c(e.i18n("cartoverview.age-consent-overlay-confirm")),11,jn)])]),_:1},8,["title"]))}},Wn={__name:"AgeConsent",props:{ageConsentAnalytics:{type:Boolean,required:!1}},setup(e){const t=e,i=_(),{trackAgeConsentInteraction:r}=Xa(),{i18n:s}=Ii(),n=k(()=>i.state.consent.showAgeConsent),l=k(()=>i.state.consent.isAgeConsent),c=k(()=>i.state.consent.ageConsent),d=k(()=>i.state.consent.ageConsentConfiguration);return U(()=>t.ageConsentAnalytics,()=>{if(c.value){const e=l.value?null:s("cartoverview.age-consent-required-error-message");r(l.value,e)}}),(e,t)=>n.value&&c.value&&"{}"!==JSON.stringify(d.value)?(o(),a(Gn,{key:0})):I("",!0)}},zn={ref:"maintenanceNotification",class:"p-ec01-maintenance-notification p-xs-spacing-bottom-a p-s-spacing-bottom-a p-m-spacing-bottom-d p-l-spacing-bottom-d"},Qn={class:"p-text"};const Kn=yi({props:{errorNotifications:{type:Array,required:!0}},data:()=>({minute:0,second:10,timer:"",intervalId:0}),mounted(){this.setTimer(),this.scrollToNotification()},updated(){this.scrollToNotification()},beforeUnmount(){clearInterval(this.intervalId)},methods:{setClassName(e){switch(e){case"success":return"p-navigation";case"warning":return"p-warning";case"error":return"p-error";default:return""}},setTimer(){this.intervalId=setInterval(()=>{0===this.minute&&1===this.second?(clearInterval(this.intervalId),this.$store.commit("notification/removeErrorNotifications",null,{root:!0}),_e.maintenanceHealthAPICheck()):(this.second--,0===this.second&&(this.minute--,this.second=60),this.timer=`00:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`)},1e3)},scrollToNotification(){this.$refs.maintenanceNotification.scrollIntoView({behavior:"smooth",block:"start"})}}},[["render",function(e,t,i,r,s,a){return o(),g("section",zn,[(o(!0),g(S,null,x(i.errorNotifications,(e,t)=>(o(),g(S,{key:t},[e.isMaintenance?(o(),g("div",{key:0,class:d(["p-notification-bar",a.setClassName(e.type)])},[l("p",Qn,c(e.text)+" "+c(s.timer),1)],2)):I("",!0)],64))),128))],512)}]]),Jn={name:"ThresholdAmount",components:{BaseIcon:fi},props:{showLink:{type:Boolean,required:!1}},computed:{...i("cart",["thresholdAmountExceeded"])},methods:{...$({updatePaymentStatus:"payments/updatePaymentStatus",updateLoginRedirect:"config/updateLoginRedirect"}),editCartClickHandler(){this.updatePaymentStatus(),this.updateLoginRedirect(!1),this.trackConversion({name:"interaction",description:"link:edit_shopping_cart",pagename:"checkout"})}}},Yn={key:0,class:"p-body-copy-03 p-text-accent p-threshold-exceeded p-spacing-bottom-a"},Zn={class:"p-threshold-exceeded__msg"};const Xn=yi(Jn,[["render",function(e,t,i,r,s,d){const u=D("base-icon"),p=D("router-link"),m=h("safe-html");return e.thresholdAmountExceeded.message?(o(),g("section",Yn,[O(c(e.trackConversion({name:"interaction",description:"button:next:order_value_exceeded"}))+" ",1),y(u,{"icon-name":"alert"}),l("span",Zn,[f(l("span",null,null,512),[[m,e.thresholdAmountExceeded.message]]),t[1]||(t[1]=O("  ",-1)),i.showLink?(o(),a(p,{key:0,to:{name:"cart",params:e.$route.params},onClick:t[0]||(t[0]=e=>d.editCartClickHandler())},{default:n(()=>[O(c(e.i18n("checkoutoverview.edit-cart")),1)]),_:1},8,["to"])):I("",!0)])])):I("",!0)}]]);const el=yi({data:()=>({klarnaExpressButtonEnabled:!1,label:"default",shape:"default",theme:"default",url:"https://x.klarnacdn.net/express-button/v1/lib.js",id:""}),computed:{...r("config",["getDefaultConfig"]),...r("cart",["isButtonDisabled"]),...i("cart",["cartSummary","isSubscriptionApplicable"]),...i("config",["isLoggedIn"]),...i("delivery",["deliveryFormConfiguration","deliveryAddress"]),...i("payments",["applicablePaymentMethods"]),isTotal(){return this.cartSummary?.totalPriceWithTax?.value>0||this.cartSummary?.total?.value>0}},mounted(){document.querySelector(`script[src='${this.url}']`)||this.fetchKlarnaData()},unmounted(){document.querySelector(`script[src='${this.url}']`)&&document.querySelector(`script[src='${this.url}']`).remove(),window.Klarna={}},methods:{fetchKlarnaData(){const e=this.applicablePaymentMethods.find(e=>e.id.includes("KLARNA"));if(void 0!==e&&(this.klarnaExpressButtonEnabled=e.klarnaExpress,this.klarnaExpressButtonEnabled)){const t=document.createElement("script");this.id=e.klarnaMid,t.src=this.url,t.setAttribute("data-id",this.id),t.setAttribute("data-environment",e.klarnaExpressEnvironment),document.body.append(t),this.updateCheckout()}},updateCheckout(){window.klarnaExpressButtonAsyncCallback=()=>{Klarna.ExpressButton.on("user-authenticated",e=>{const t={phone:e.phone,firstName:e.first_name,lastName:e.last_name,line1:e.address.street_address,line2:e.address.street_address2||"",postalCode:e.address.postal_code,town:e.address.city,region:e.address.region||""};if(this.deliveryFormConfiguration.some(e=>"houseNumber"===e.name)){const i=e.address.street_address,r=i.lastIndexOf(" ");t.line1=i.slice(0,r),t.houseNumber=i.slice(r+1)}const i={...this.deliveryAddress,...t};this.$store.dispatch("delivery/updateDeliveryAddress",i,{root:!0}),this.isSubscriptionApplicable||this.isLoggedIn||this.$store.dispatch("delivery/updateEmail",{email:e.email});const r=this.applicablePaymentMethods.find(e=>e.id.toUpperCase().includes("KLARNA"));this.$store.dispatch("payments/updateSelectedPaymentMethodId",r.id),this.$router.push({name:"details",params:this.$route.params})})}}}},[["render",function(e,t,i,r,s,n){return s.klarnaExpressButtonEnabled?f((o(),a(u("klarna-express-button"),{key:0,"data-label":s.label,"data-locale":e.getDefaultConfig("localeId").replace("_","-"),"data-shape":s.shape,"data-theme":s.theme,class:d({"p-ec01-input-list-option--disabled":e.isButtonDisabled})},null,8,["data-label","data-locale","data-shape","data-theme","class"])),[[B,n.isTotal]]):I("",!0)}]]),tl={computed:{...r("cart",["getProductByCtn"]),...r("promotions",["getQuantity","getPrice"]),...r("config",["getDefaultConfig"]),...i("cart",["items","deliveryMode","digitalWalletConfig"]),...i("config",["isLoggedIn","net"]),...i("consent",["isAgeConsent","isMarketingConsentAccepted"]),...i("delivery",["deliveryFormConfiguration","deliveryAddress"]),...i("payments",["browserInfo","additionalData"]),...i({cartTotal:e=>{const t=e.cart.cartSummary;return t?.totalPriceWithTax?t.totalPriceWithTax.value:t?.total?t.total.value:""},currencyCode:e=>e.cart.currencyCode,applicableDeliveryModes(e){const t=e.cart.applicableDeliveryModes,i=[];for(const r of t)if(!r.isCollectionPoint){const e=r.deliveryCost.value>0?`${this.getFormattedPrice({value:r.deliveryCost.value})}: ${r.label}`:`${this.i18n("generic.free")}: ${r.label}`;i.push({id:r.id,label:e,description:r.description,price:r.deliveryCost.value})}return i},cartSummaryWallet(e){const t=e.cart.cartSummary;return this.tax=t?.tax?t.tax.value:"",this.getCartSummaryWallet(t)},orderConfirmationUrl(){return this.getDefaultConfig("orderConfirmationUrl")},getGpayPaymentType:e=>e.cart?.digitalWalletConfig?.googlePayConfigData?.type||"",getGooglePayConfiguration(e){const t=e.cart?.digitalWalletConfig?.googlePayConfigData;return void 0!==t?{environment:t.environment.toUpperCase(),apiVersion:Number(t.apiVersion),apiVersionMinor:Number(t.apiVersionMinor),gateway:t.gateWay,gatewayMerchantId:t.merchantId,allowedAuthMethods:t.allowedAuthMethods,allowedCardNetworks:t.allowedCardNetworks,defaultSelectedOptionId:Number(t.defaultSelectedOptionId),merchantId:t.gpayMerchantId,merchantName:t.gpayMerchantName}:"{}"},getApplePayConfiguration(e){const t=e.cart?.digitalWalletConfig?.applePayConfigData;return void 0!==t?{type:t.type,merchantCapabilities:t.merchantCapabilities,merchantName:t.merchantName,supportedNetworks:t.supportedNetworks,version:Number(t.version),merchantIdentifier:t.merchantId}:"{}"}}),isPhoneMandatory(){const e=this.deliveryFormConfiguration;let t=!1;if("{}"!==JSON.stringify(e))for(const i of e)"phone"===i.name&&(t=i.mandatory);return t},walletOrderData(){const e={displayItems:[],total:{label:"Philips",amount:{currency:this.currencyCode,value:this.cartTotal}}};for(const t of this.items)if(t.isSingleItem&&e.displayItems.push({label:`${this.getQuantity(t)} X ${t.descriptor||t.title}`,type:"LINE_ITEM",price:this.getPrice(t).toFixed(2)}),t.isBundle){const i=t.bundle;
2for(const t of i)e.displayItems.push({label:`${t.quantity} X ${t.label||this.i18n("generic.bundled-item")}`,type:"LINE_ITEM",price:this.getPrice(t).toFixed(2)})}return this.cartSummaryWallet?.subtotal>0&&e.displayItems.push({label:this.i18n("cartoverview.subtotal"),type:"LINE_ITEM",price:this.cartSummaryWallet.subtotal.toFixed(2)}),e.displayItems.push({label:this.i18n("cartoverview.shipping"),type:"LINE_ITEM",status:"FINAL",price:this.cartSummaryWallet.totalDelivery?.toFixed(2)||"0.00"}),this.cartSummaryWallet?.voucher>0&&e.displayItems.push({label:this.i18n("cartoverview.voucher"),type:"LINE_ITEM",price:`-${this.cartSummaryWallet.voucher.toFixed(2)}`}),this.net&&this.cartSummaryWallet?.tax>0&&e.displayItems.push({label:this.i18n("cartoverview.tax"),type:"LINE_ITEM",price:this.cartSummaryWallet.tax.toFixed(2)}),this.cartSummaryWallet?.giftcard>0&&e.displayItems.push({label:this.i18n("cartoverview.giftcard"),type:"LINE_ITEM",price:`-${this.cartSummaryWallet.giftcard.toFixed(2)}`}),this.cartSummaryWallet?.discount>0&&e.displayItems.push({label:this.i18n("cartoverview.discount"),type:"LINE_ITEM",price:`-${this.cartSummaryWallet.discount.toFixed(2)}`}),e},walletOrderDataExtended(){const e=structuredClone(this.walletOrderData);for(const t of e.displayItems)t.amount={currency:this.currencyCode,value:t.price};return e}},methods:{getCartSummaryWallet(e){let t,i,r,o,s;e?.totalDelivery&&(t=e.totalDelivery.value>0?e.totalDelivery.value:this.i18n("generic.free"),s=e.totalDelivery.value),e?.orderDiscountNoDelivery&&(i=e.orderDiscountNoDelivery.value>0?e.orderDiscountNoDelivery.value:0),e?.totalGiftCardDiscount&&(o=e.totalGiftCardDiscount.value>0?e.totalGiftCardDiscount.value:0),e?.totalVoucherDiscount&&(r=e.totalVoucherDiscount.value>0?e.totalVoucherDiscount.value:0);const a={subtotal:e?.subTotal?.value>0?e.subTotal.value:"",shipping:t,discount:i,voucher:r,giftcard:o,totalDelivery:s};return this.net&&(a.tax=e?.tax?e.tax.value:""),a},getWalletShippingName(e){const t={firstName:"",lastName:""},i=e.split(" "),r=i.length-1;if(0!==r){const e=Math.round(r/2);t.firstName=i.slice(0,e).join(" "),t.lastName=i.slice(e,r+1).join(" ")}else t.firstName=i[r],t.lastName="";return t},generateSubmitOrderData(e,t){const i={type:"commerceCartSubmit",attributes:{callBackUrl:this.getDefaultConfig("orderConfirmationUrl"),consentInputFields:{ageConsent:Boolean(this.isAgeConsent),marketingOptIn:Boolean(this.isMarketingConsentAccepted)}}};return"GooglePay"===t?this.generateSubmitOrderDataForGooglePay(e,i):"ApplePay"===t&&this.generateSubmitOrderDataForApplePay(e,i),i.attributes.orderChannel="WEB",i.attributes.orderSessionId=yt(),this.isLoggedIn||(i.attributes.email="ApplePay"===t?e.shippingContact.emailAddress:e.email),{data:i}},generateSubmitOrderDataForGooglePay(e,t){const i=JSON.parse(e.paymentMethodData.tokenizationData.token);t.attributes.browserInfo=this.browserInfo,t.attributes.additionalData=this.additionalData,t.attributes.paymentMethod={id:this.getGpayPaymentType},t.attributes.digitalWallet={type:this.getGpayPaymentType,signature:i.signature,protocolVersion:i.protocolVersion,signedMessage:i.signedMessage},t.attributes.deliveryAddress={deliveryAddress:!0,billingAddress:!0,defaultAddress:!0,isCollectionPoint:!1,country:{isocode:e.shippingAddress.country.isocode,name:this.deliveryAddress.country},firstName:e.shippingAddress.firstName,houseNumber:"",lastName:e.shippingAddress.lastName,line1:e.shippingAddress.address1,line2:e.shippingAddress.address2,phone:e.shippingAddress.phoneNumber?.split(" ").join("")||"",postalCode:e.shippingAddress.postalCode,titleCode:"",town:e.shippingAddress.locality,shippingMethod:e.shippingOptionData.id};const r=this.getDefaultConfig("country"),o=this.deliveryFormConfiguration.find(e=>"region"===e.name);if(e.shippingAddress.administrativeArea&&o)if("RO"===r){const i=o?.options.find(t=>!t.value.localeCompare(e.shippingAddress?.administrativeArea,"ro"));t.attributes.deliveryAddress.region={isocode:i?.key||""}}else t.attributes.deliveryAddress.region={isocode:`${e.shippingAddress.countryCode}-${e.shippingAddress.administrativeArea}`}},generateSubmitOrderDataForApplePay(e,t){t.attributes.browserInfo=this.browserInfo,t.attributes.additionalData=this.additionalData,t.attributes.paymentMethod={id:this.digitalWalletConfig?.applePayConfigData?.type||"APPLEPAY-SSL"},t.attributes.digitalWallet={type:this.digitalWalletConfig?.applePayConfigData?.type||"APPLEPAY-SSL",applePayPaymentData:e.token},t.attributes.deliveryAddress={deliveryAddress:!0,billingAddress:!0,defaultAddress:!0,isCollectionPoint:!1,country:{isocode:e.shippingContact.countryCode,name:this.deliveryAddress.country},town:e.shippingContact.locality,titleCode:"",firstName:e.shippingContact.givenName,lastName:e.shippingContact.familyName,line1:e.shippingContact.addressLines[0],line2:e.shippingContact.addressLines[1]||"",houseNumber:"",ph
2one:e.shippingContact.phoneNumber,postalCode:e.shippingContact.postalCode};const i=this.deliveryFormConfiguration.find(e=>"region"===e.name);e.shippingContact.administrativeArea&&i&&(t.attributes.deliveryAddress.region={isocode:`${e.shippingContact.countryCode}-${e.shippingContact.administrativeArea}`})}}},il={components:{DigitalWalletGoogle:q(()=>ie(()=>import("./DigitalWalletGoogle-Bwtxsm7b.js"),__vite__mapDeps([2,3,1,4,5,6,7]))),DigitalWalletApple:q(()=>ie(()=>import("./DigitalWalletApple-A4gukn_L.js"),__vite__mapDeps([8,3,1,4,5,6,9])))},mixins:[tl,gi],computed:{...r("cart",["isButtonDisabled"]),...r("config",["getDefaultConfig"]),...i("consent",["isAgeConsent"]),...i("payments",["isPayButtonDisabled"]),...i("cart",["ageConsent","cartSummary","giftVouchers","isSubscriptionApplicable"]),isApplePayAvailable(){try{return Boolean(globalThis.ApplePaySession?.canMakePayments())}catch{return!1}},appleSupported(){return this.isApplePayAvailable&&"{}"!==this.getApplePayConfiguration&&this.shippingData.shippingOptions.length>0&&!this.isSubscriptionApplicable},googleSupported(){return"{}"!==this.getGooglePayConfiguration&&this.checkBrowserCompatibility&&this.shippingData.shippingOptions.length>0&&!this.isSubscriptionApplicable},checkBrowserCompatibility(){const e=navigator.userAgent;return!e.includes("Mobi")||e.includes("Android")&&e.includes("Chrome")&&!e.includes("Edg")},configData(){return{language:this.getDefaultConfig("language"),countryCode:this.getDefaultConfig("country"),orderConfirmationUrl:this.orderConfirmationUrl,phoneRequired:this.isPhoneMandatory,net:this.net,shippingFormConfiguration:this.deliveryFormConfiguration,google:this.getGooglePayConfiguration,apple:this.getApplePayConfiguration}},shippingData(){return{shippingOptions:this.applicableDeliveryModes}},isTotal(){return this.cartSummary?.totalPriceWithTax?.value>0||this.cartSummary?.total?.value>0},isDisabled(){return this.ageConsent&&!this.isAgeConsent||this.isButtonDisabled||this.giftVouchers.length>0&&!this.isTotal||this.isPayButtonDisabled}}};const rl={components:{ThresholdAmount:Xn,KlarnaExpressButtonWrapper:el,DigitalWallet:yi(il,[["render",function(e,t,i,r,s,n){const l=D("digital-wallet-apple"),c=D("digital-wallet-google");return o(),g(S,null,[n.appleSupported?(o(),a(l,{key:0,class:d({"digital-wallet--disabled":n.isDisabled}),"config-data":n.configData,"order-data":e.walletOrderData,"shipping-data":n.shippingData},null,8,["class","config-data","order-data","shipping-data"])):I("",!0),n.googleSupported?(o(),a(c,{key:1,class:d({"digital-wallet--disabled":n.isDisabled}),"config-data":n.configData,"order-data":e.walletOrderData,"shipping-data":n.shippingData},null,8,["class","config-data","order-data","shipping-data"])):I("",!0)],64)}]])},mixins:[gi,tl],emits:["age-consent-analytics"],computed:{...r("cart",["isButtonDisabled"]),...i("cart",["items","sellerGroupItems"])},mounted(){this.analyticsOnLoad()},methods:{analyticsOnLoad(){if(this.items.length>0&&this.trackAjax({pagename:"shoppingcart",events:"scView",products:this.productListForTracking()}),this.generateGoogleAnalyticsData("ecommerce.checkout.cartview","cartview",this.items,"complete-order"),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[e,t]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.cartview","cartview",t,e)},productListForTracking(){const e=[],t=this.items;if(t.length>0)for(const i of t){const t=`;${i.itemId};${i.quantity};${i?.price?.value}`;e.push(t)}return e.join(",")},checkout(){this.$emit("age-consent-analytics"),this.analyticsOnLeave(),this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"button:next"}),this.$router.push({name:"details",params:this.$route.params})},analyticsOnLeave(){if(this.generateGoogleAnalyticsData("ecommerce.checkout.step","login",this.items,"complete-order"),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[e,t]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.step","login",t,e);this.trackAjax({pagename:"shopping_cart",events:"scCheckout",products:this.productListForTracking()})}}},ol={class:"p-ec01-cart-cta"},sl=["disabled"];function al(){return{hostname:window.location.hostname,pathname:window.location.pathname}}function nl(){const{hostname:e,pathname:t}=al(),i=new Set(Pe.map(e=>
2e.url.split("/")[1]).filter(Boolean)),r=t.split("/")[1]||"",o=i.has(r)?r:"";return Pe.find(t=>{const[i,r=""]=t.url.split("/");return e.endsWith(i)&&o===r})}function ll(){const e=nl();if(e){const t=e.url.split("/")[1];if(t)return`/${t}/`}return"/"}const cl={components:{CartCta:yi(rl,[["render",function(e,t,i,r,s,a){const n=D("threshold-amount"),u=D("klarna-express-button-wrapper"),p=D("digital-wallet");return o(),g("section",ol,[y(n),l("button",{class:d(["button button--full",{"button--disabled":e.isButtonDisabled}]),disabled:e.isButtonDisabled,type:"button",onClick:t[0]||(t[0]=e=>a.checkout())},c(e.i18n("cartoverview.next-button")),11,sl),y(u),y(p)])}]]),CartItems:As,ContinueShoppingButton:yi({__name:"ContinueShoppingButton",props:{linkVariant:{type:Boolean}},setup(e){const{i18n:t}=Ii(),i=_(),{trackContinueShopping:r}=Xa(),s=k(()=>i.getters["config/getDefaultConfig"]("localeId")||""),a=k(()=>i.getters["config/getDefaultConfig"]("siteId")||""),n=k(()=>i.state.config.isMicrositeId),d=ll(),u=()=>{const e=document.referrer||"",t=n.value?a.value:"",i=["action:continue_shopping_click","pageType:checkout",e?`referrerSource:${e}`:null,`market:${a.value}`,`locale:${s.value}`,t?`campaignId:${t}`:null].filter(Boolean).join("|");r(i),window.history.state.back?.endsWith("/details")||!e?window.location.href=d:window.history.back()};return(i,r)=>e.linkVariant?(o(),g("a",{key:0,href:"#",onClick:r[0]||(r[0]=T(e=>u(),["prevent"]))},c(v(t)("cartoverview.continue-shopping")),1)):(o(),g("button",{key:1,type:"button",class:"p-ec01-continue-shopping p-button p-ec01-button--xlarge p-button-secondary-greyscale p-button-secondary",onClick:r[1]||(r[1]=e=>u())},[r[2]||(r[2]=l("svg",{width:"19",height:"13",viewBox:"0 0 19 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.10333 5.41406L7.10333 1.41406L5.68926 0L0.512507 5.17676C-0.170836 5.86016 -0.170835 6.96796 0.512507 7.65137L5.68926 12.8281L7.10333 11.4141L3.10333 7.41406L18.6893 7.41406V5.41406L3.10333 5.41406Z",fill:"currentColor"})],-1)),O(" "+c(v(t)("cartoverview.continue-shopping")),1)]))}},[["__scopeId","data-v-023fc193"]]),Voucher:En,CartSummary:ma,ProductRecommendationsTest:ln,AgeConsent:Wn,MaintenanceNotificationBar:Kn,SubscriptionBundledItemsInformationVue:hn,NotificationBar:$n},mixins:[gi],data:()=>({screenWidth:window.innerWidth,ageConsentAnalytics:!1}),computed:{...r("config",["getDefaultConfig"]),...r("notification",["getGenericNotifications"]),...i("cart",["items","outOfStockItems","isAnyAPIPending","isSubscriptionApplicable"]),...i("bundles",["appliedBundles"]),...i("payments",["applicablePaymentMethods"]),siteId(){return this.getDefaultConfig("siteId")},isRecommendedProductsVisible(){return!this.payerCustomerScope()&&this.siteId.includes("_Pub")&&0!==Number(this.getVariantUS3745029)},isMobile(){return this.screenWidth<=767},isDesktop(){return this.screenWidth>=768}},async mounted(){setTimeout(()=>{for(const e of this.applicablePaymentMethods)if(e.icon&&!document.querySelector(`link[href='${e.icon}']`)){const t=document.createElement("link");t.rel="prefetch",t.as="image",t.href=e.icon,document.querySelector("head").append(t)}},1e3);const e=ne.getCookie("ageConsent-opt-in");if(ne.removeCookie({key:"isFirstTime"}),"accepted"===e?(this.$store.commit("consent/updateShowAgeConsent",!1),this.$store.commit("consent/updateIsAgeConsentAccepted",!0)):(this.$store.commit("consent/updateShowAgeConsent",!0),this.$store.commit("consent/updateIsAgeConsentAccepted",!1)),""!==window.location.search){const e=new URLSearchParams(window.location.search),t=Boolean(e.get("append")),i=Boolean(e.get("subids")),r=e.get("ctns")||e.get("subids");if(r){const e=r.split(",").map(e=>e.split("|")),o=i?this.appliedBundles.map(e=>[e.id,e.quantity]):this.items.map(e=>[e.itemId,e.quantity]);for(const r of e){let e=0,s=!1,a=-1;r[1]||=1;for(const[t,i]of o.entries())r[0]===i[0]&&Number.parseInt(r[1],10)!==i[1]?(e=Number.parseInt(r[1],10)-i[1],a=t):r[0]===i[0]&&Number.parseInt(r[1],10)===i[1]?(e=0,s=!1):s=!0;e>0?await this.addCartItemFromUrl(r[0],e,i):e<0?await this.updateCartItemFromUrl(a,Number(r[1]),i):(!0===s&&0===e&&r[1]>0&&t||0===o.length)&&await this.addCartItemFromUrl(r[0],Number(r[1]),i)}}}},created(){document.title=this.i18n("cartoverview.page-title"),document.querySelector("html").classList.add("p-has-sticky--bottom"),window.addEventListener("resize",this.updateScreenWidth)},unmounted(){document.querySelector("html").classList.remove("p-has-sticky--bottom"),window.removeEventListener("resize",this.updateScreenWidth)},methods:{...$("cart",["updateOutOfStockItems"]),async addCartItemFromUrl(e,t,i){const r=i?{bundleId:e,bundleType:"SUBSCRIPTION",quantity:t}:{itemId:e,quantity:t};await this.$store.dispatch("cart/addCartItem",r).then(t=>{ze(t,this.getDefaultConfig,this.updateOutOfStockItems,e)})},async updateCartItemFromUrl(e,t,i){const r=i?{bundleId:e,bundleType:"SUBSCRIPTION",quantity:t}:{itemId:e,quantity:t};await this.$store.dispatch("cart/updateCartItem",r).then(t=>{ze(t,this.getDefaultConfig,this.updateOutOfStockItems,e)})},updateScreenWidth(){this.screenWidth=window.innerWidth},triggerAgeConsentAnalytics(){this.ageConsentAnalytics=!0},checkIsMaintenance(e){let t=!1;return e.map(e=>(e.isMaintenance&&(t=!0),t))[0]},checkIsContainCancelText(e){let t=!1;return e.map(e=>(e.title?.toLowerCase()===this.i18n("checkoutoverview.payment.cancel.title").toLowerCase()&&(t=!0),t))[0]}}},dl={class:"p-layout-inner"},ul={class:"p-heading-02 p-heading-light"},pl={key:3,class:"p-grid"},ml={class:"p-grid-item p-one-whole p-m-seven-twelfths p-l-two-thirds"},hl={class:"p-ec01-cart-overview__sticky p-grid-item p-one-whole p-m-five-twelfths p-l-one-third"},gl={class:"p-heading-02 p-heading-light"},yl={class:"p-ec01-cart__empty-message p-heading-03"};const vl=yi(cl,[["render",function(e,t,i,r,s,n){const u=D("continue-shopping-button"),p=D("maintenance-notification-bar"),m=D("notification-bar"),h=D("cart-items"),v=D("c
2art-summary"),f=D("subscription-bundled-items-information-vue"),b=D("voucher"),C=D("cart-cta"),k=D("product-recommendations-test"),_=D("age-consent");return o(),g("div",dl,[l("section",{class:d(["p-ec01-cart-overview p-xs-spacing-top-b p-s-spacing-top-b p-m-spacing-top-c p-l-spacing-top-c p-row-gutter",{"p-ec01-cart-overview--api-pending":e.isAnyAPIPending}])},[e.items.length>0?(o(),g(S,{key:0},[y(u,{class:"p-ec01-cart-overview__continue-shopping"}),l("h1",ul,c(e.i18n("cartoverview.page-title")),1)],64)):I("",!0),e.getGenericNotifications.length>0&&n.checkIsMaintenance(e.getGenericNotifications)?(o(),a(p,{key:1,"error-notifications":e.getGenericNotifications},null,8,["error-notifications"])):I("",!0),e.getGenericNotifications.length>0&&n.checkIsContainCancelText(e.getGenericNotifications)?(o(),a(m,{key:2,"error-notifications":e.getGenericNotifications},null,8,["error-notifications"])):I("",!0),e.items.length>0||e.outOfStockItems.length>0?(o(),g("div",pl,[l("div",ml,[y(h)]),l("aside",hl,[e.items.length>0?(o(),g(S,{key:0},[y(v),e.isSubscriptionApplicable?(o(),a(f,{key:0})):I("",!0),y(b),n.isDesktop?(o(),a(C,{key:1,onAgeConsentAnalytics:t[0]||(t[0]=e=>n.triggerAgeConsentAnalytics())})):I("",!0)],64)):I("",!0)])])):I("",!0),e.items.length>0&&n.isMobile?(o(),a(C,{key:4,onAgeConsentAnalytics:t[1]||(t[1]=e=>n.triggerAgeConsentAnalytics())})):I("",!0),n.isRecommendedProductsVisible?(o(),a(k,{key:5})):I("",!0),y(_,{"consent-type":"age",onAgeConsentAnalytics:t[2]||(t[2]=e=>n.triggerAgeConsentAnalytics())}),0!==e.items.length||e.isAnyAPIPending?I("",!0):(o(),g(S,{key:6},[l("h1",gl,c(e.i18n("cartoverview.page-title")),1),l("div",yl,[O(c(e.trackAjax({pagename:"checkout_emptycart"}))+" "+c(e.i18n("cartoverview.empty-cart-message"))+" ",1),y(u,{class:"p-ec01-cart-overview__continue-shopping","link-variant":""})])],64))],2)])}]]),fl={class:"p-ec01-loader__title p-heading-02-small p-heading-light p-margin-none"},bl={key:0,class:"p-ec01-loader__description p-heading-04-large p-heading-book p-spacing-top-a"};const Cl=yi({components:{BaseIcon:fi,Overlay:Vi},props:{title:{type:String,default:""}}},[["render",function(e,t,i,r,s,d){const u=D("base-icon"),p=D("overlay");return o(),a(p,{"overlay-type":"loader",title:e.i18n("checkoutoverview.overlay-title")},{description:n(()=>[l("h2",fl,[y(u,{"class-name":"p-heading-02-small p-heading-light p-ec01-loader--animation p-ec01-base-icon__rotate-cw",tag:"span","icon-name":"rotate-cw"}),O(" "+c(i.title||e.i18n("generic.loading-message")),1)]),e.$slots.description?(o(),g("div",bl,[P(e.$slots,"description")])):I("",!0)]),_:3},8,["title"])}]]);const kl=yi({name:"OverlaySubmitLoader",components:{OverlayLoader:Cl}},[["render",function(e,t,i,r,s,d){const u=D("overlay-loader");return o(),a(H,{to:"body"},[y(u,{class:"p-ec01-submit-overlay",title:e.i18n("checkoutoverview.order-submit-loader-title")},{description:n(()=>[l("p",null,c(e.i18n("checkoutoverview.order-submit-loader-description")),1)]),_:1},8,["title"])])}]]),_l={mixins:[gi],data:()=>({showLoader:!1}),computed:{...r("config",["isGuestCheckout"]),...r("delivery",["selectedDeliveryMode"]),...i("consent",["isMarketingConsentVisible","isMarketingConsentAccepted","isHealthConsentAccepted","isMarketingConsentHasChecked","isHealthConsentHasChecked","isMarketingConsentAccepted","marketingConsentConfiguration","ageConsent"]),...i("cart",["deliveryMode","cartSummary","checkoutStep"]),...i("config",["isLoggedIn","isAddressError"]),...i("payments",["isAdyenWebComponentValidated","otherPaymentSelected","selectedPaymentMethodId","bankCardDetails","link2PayEnabled"]),...i("delivery",["selectedCollectionPoint","showPUPErrorMessage","deliveryAddress","suggestedAddress","typeAheadSelected"]),orderConfirmationUrl(){return this.$store.getters["config/getDefaultConfig"]("orderConfirmationUrl")},buttonText(){return this.checkoutStep===Te.STEP_ORDER_OVERVIEW?this.i18n("cartoverview.order-pay-button"):this.checkoutStep===Te.STEP_CHECKOUT_OVERVIEW?this.i18n("cartoverview.next-button"):0!==this.cartSummary.total.value?this.i18n("checkoutoverview.summary-pay-button"):this.i18n("cartoverview.next-button")}},methods:{marketingConsent(){return this.isMarketingConsentAccepted?"checked":"unchecked"},marketingConsentConfig(){return this.marketingConsentConfiguration[0]||{}},ageConsentError(){const e=ne.getCookie("ageConsent-opt-in");return Boolean(this.ageConsent&&"accepted"!==e)}
2,idealPaymentValidationCheck(){return!("IDEAL-SSL"===this.selectedPaymentMethodId.toUpperCase()&&"ideal"!==this.bankCardDetails?.type)},onlineBankingValidationCheck(){return!("ONLINEBANKING_CZ-SSL"===this.selectedPaymentMethodId.toUpperCase()&&"onlineBanking_CZ"!==this.bankCardDetails?.type||"ONLINEBANKING_PL-SSL"===this.selectedPaymentMethodId.toUpperCase()&&"onlineBanking_PL"!==this.bankCardDetails?.type)},isCheckoutValid(e){return e&&!this.showPUPErrorMessage&&!this.ageConsentError()&&this.idealPaymentValidationCheck()&&this.onlineBankingValidationCheck()&&!this.isCheckoutError&&!this.isAddressError&&(this.otherPaymentSelected||this.isAdyenWebComponentValidated)},handleValidationCheck(e){return this.isCheckoutValid(e)},handleValidationError(e){this.isGuestCheckout?this.$store.dispatch("config/updateShowAccountError",!1):this.$store.dispatch("config/updateShowAccountError",!0),e()?.then(({errors:e})=>{const t=this.getAnalyticsFieldsErrors(e);this.trackPageAnalyticsErrors(t,this.$route.meta.pagename),Ws.call(this)})},notificationAlert(e){this.$store.dispatch("notification/updateErrorNotifications",{title:this.i18n("checkoutoverview.payment.cancel.title"),text:e})},removeNotifications(){this.$store.dispatch("notification/removeByText",`${this.i18n("checkoutoverview.inline-payment-submit-order-refused")} (9050)`),this.$store.dispatch("notification/removeByText",`${this.i18n("checkoutoverview.inline-payment-submit-order-canceled")} (9051)`),this.$store.dispatch("notification/removeByText",`${this.i18n("checkoutoverview.inline-payment-submit-order-error")} (9052)`)},prerenderOrderConfirmationPage(){const e=this.orderConfirmationUrl;if(!e||document.querySelector(`link[href='${e}']`))return;const t=document.createElement("link");t.relList?.supports("prerender")?t.rel="prerender":(t.rel="prefetch",t.as="document"),t.href=e,document.querySelector("head").append(t)},analyticsHandler(){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"checkout:button:pay"}),this.marketingConsentConfig().label&&(this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:`checkbox:marketing_optin:${this.marketingConsent()}`}),this.trackGoogleAnalyticsSimple({trigger:"event.checkoutOptins",event:"userEvent",interaction:{goal:"newsletter opt-in",description:this.isGuestCheckout?"guest-checkout":"account-checkout",value:this.marketingConsent(),interactive:!0},component:{name:"ec01-checkout",type:"Checkout"}}))},handleSideEffectsBeforeValidation(){this.removeNotifications(),this.$store.commit("config/updatePayButtonWasClicked",!0),this.prerenderOrderConfirmationPage(),this.analyticsHandler(),this.ageConsentError()&&(this.$store.commit("consent/updateShowAgeConsent",!0),this.$store.commit("consent/updateIsAgeConsentAccepted",!1)),this.selectedDeliveryMode?.isCollectionPoint&&"{}"===JSON.stringify(this.selectedCollectionPoint)&&this.$store.dispatch("delivery/updatePupErrorMessageStatus",!0),this.isCheckoutError=!this.link2PayEnabled&&Boolean(!this.isGuestCheckout&&!this.isLoggedIn)},compareSuggestedAddress(){const e={line1:this.deliveryAddress.line1||"",postalCode:this.deliveryAddress.postalCode||"",town:this.deliveryAddress.town||"",region:this.deliveryAddress.region||""},t={line1:this.suggestedAddress.line1||"",postalCode:this.suggestedAddress.postalCode||"",town:this.suggestedAddress.town||"",region:this.suggestedAddress.region||""};return JSON.stringify(e)===JSON.stringify(t)},generateFormSubmit(e){if("POST"!==e.attributes.actionType.toUpperCase())return void(window.location.href=e.attributes.hppUrl);const t=e.attributes.providerData,i=document.createElement("form");i.method="POST",i.action=e.attributes.hppUrl;for(const r of t){const e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",r.key),e.setAttribute("value",r.value??""),i.append(e)}document.body.append(i),i.submit()},scrollToActivePaymentMethod(){const e=document.querySelector(".p-ec01-payment-method .p-ec01-input-list-option--selected");null!==e&&e.scrollIntoView({behavior:"smooth",block:"center"})},handleInlinePayment(e,t,i){if("UNAUTHORIZED"===t||"UNAUTHORISED"===t){if(this.showLoader=!1,Ee[i]){const{message:e,code:t}=Ee[i];this.notificationAlert(`${this.i18n(e)} (${t})`)}}else if("PENDING"===t||"IN_PROGRESS"===t||"PENDING"===i){const t=e?.action||{};if("POST"!==t.method?.toUpperCase()&&"threeDS2"!==t.type&&"mbway"!==t.paymentMethodType&&"blik"!==t.paymentMethodType)return void(window.location.href=t.url);this.showLoader=!1,this.scrollToActivePaymentMethod(),this._emit("disablePaymentMethods",!0),this.$store.dispatch("payments/updateIsPayButtonDisabled",!0),"mbway"===t?.paymentMethodType&&"await"===t?.type?this._emit("adyenmbwaycall",t):"blik"===t?.paymentMethodType&&"await"===t?.type?this._emit("adyenblikcall",t):this._emit("adyen3dscall",t)}else"AUTHORIZED"===t||"AUTHORISED"===t?window.location.href=`${this.orderConfirmationUrl}?callbackType=success&authResult=${e.resultCode}&merchantReference=${e.merchantReference}&pspReference=${e.pspReference}`:console.warn("No order ID is provided in the response")},handleSubmitResponse(e){if("Pending"===e.attributes.inlinePaymentResponse?.result?.status&&"PayUIyzico"===e.attributes.inlinePaymentResponse?.providerData?.providerName)return void(window.location.href=e.attributes.inlinePaymentResponse.redirection.url);if(e.attributes.hppUrl)return void this.generateFormSubmit(e);const t=e.attributes.inlinePaymentResponse||{},i=t.resultCodeGroup?.toUpperCase(),r=t.resultCode?.toUpperCase();"LIQPAY-SSL"===e.attributes?.paymentMethod&&t?.action?.url?this.generateFormSubmit({attributes:{actionType:t.action?.method||"POST",hppUrl:t.action?.url,providerData:[{key:"data",value:t.action?.data||""},{key:"signature",value:t.action?.signature||""}]}}):"POINTSPAY-SSL"===e.attributes?.paymentMethod&&t?.action?.url?this.generateFormSubmit({attributes:{actionType:t.action?.method||"GET",hppUrl:t.action?.url}}):void 0===i&&"PENDING"!==r&&e.attributes.orderId?window.location.href=`${this.orderConfirmationUrl}?callbackType=success&orderKey=${e.attributes.orderId}`:this.handleInlinePayment(t,i,r)},handleSubmit(){this.showLoader=!0;const e={isMarketingConsentVisible:this.isMarketingConsentVisible,isMarketingConsentAccepted:this.isMarketingConsentAccepted,isHealthConsentAccepted:this.isHealthConsentAccepted,isMarketingConsentHasChecked:this.isMarketingConsentHasChecked,isHealthConsentHasChecked:this.isHealthConsentHasChecked};this.$store.dispatch("delivery/submitOrderWrapper",{deliveryMode:this.deliveryMode.id,consentStateObject:e,isLoggedIn:this.isLoggedIn}).then(e=>{!this.compareSuggestedAddress()&&this.typeAheadSelected&&this.trackTypeAhead(),this.handleSubmitResponse(e)}).catch(e=>{if(this.$emit("toggled",!1),e instanceof Et){if(e.type===xt&&(this._emit("reset-payment-component-data"),this.$store.dispatch("payments/resetBankCardDetail
2s")),e.errors?.length){const t=e.errors.map(e=>this.i18n(e));this.$store.dispatch("notification/updateErrorNotifications",t.map(e=>({text:e})))}}else Gs.call(this,e,!1)}).finally(()=>{this.showLoader=!1,this.$store.dispatch("cart/updateCheckoutStep",Te.STEP_CHECKOUT_OVERVIEW)})},checkoutSubmitHandler(e,t){this.handleSideEffectsBeforeValidation(),this.handleValidationCheck(t)?this.link2PayEnabled?this.handleSubmit():(this.$store.dispatch("cart/updateCheckoutStep",Te.STEP_ORDER_OVERVIEW),window.scrollTo(0,0)):this.handleValidationError(e)},handleButtonClick(e,t){this.checkoutStep===Te.STEP_ORDER_OVERVIEW?this.handleSubmit():this.checkoutSubmitHandler(e,t)},triggerGoogleAnalyticsSimple(e){const[t,i]=e.split("#");this.trackGoogleAnalyticsSimple({trigger:"experiment.event",event:"userEvent",interaction:{goal:"experiment",status:3508010,description:`tt_3508010_edit_${i}`},component:{name:"ec01-checkout",type:"Checkout"}})},backToEditCheckout(e){this.$store.dispatch("cart/updateCheckoutStep",Te.STEP_CHECKOUT_OVERVIEW),this.triggerGoogleAnalyticsSimple(e),"#items"!==e?this.$nextTick(()=>{const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth",block:"start"})}):this.$router.push({name:"cart",params:this.$route.params})}}},Il={class:"p-ec01-order__section"},Pl={class:"p-ec01-order__top"},Al={class:"p-heading-03"};const wl=yi({mixins:[_l],props:{title:{type:String,required:!0},sectionId:{type:String,required:!0}}},[["render",function(e,t,i,r,s,a){return o(),g("section",Il,[l("div",Pl,[l("h3",Al,c(i.title),1),l("button",{type:"button",onClick:t[0]||(t[0]=t=>e.backToEditCheckout(i.sectionId))},c(e.i18n("generic.edit")),1)]),P(e.$slots,"default")])}]]),Sl=["disabled"];const xl=yi({compatConfig:{ATTR_FALSE_VALUE:!1},name:"PayButton",mixins:[gi],props:{buttonText:{type:String,default:void 0}},emits:["click"]},[["render",function(e,t,i,r,s,a){return o(),g("button",{class:d(["button--full",e.payButtonClasses]),disabled:e.isButtonDisabled,type:"button",onClick:t[0]||(t[0]=t=>e.$emit("click"))},c(i.buttonText),11,Sl)}]]),El={class:"p-ec01-pay-button-wrapper"},Tl={class:"p-ec01-form__error-msg p-ec01-pay-button-wrapper__age-consent-error-msg"},Dl={__name:"PayButtonWrapper",props:{buttonText:{type:String,default:void 0}},emits:["pay-button-click"],setup(e){const t=_(),{trackTermsLink:i,trackPrivacyLink:r}=Xa(),{i18n:s}=Ii(),a=e=>t.getters["config/getDefaultConfig"](e),n=k(()=>t.state.consent.isAgeConsentAccepted),d=k(()=>t.state.consent.ageConsentData),u=k(()=>t.state.cart.items),p=k(()=>a("termsLink")),m=k(()=>a("privacyPolicyLink")),b=k(()=>s("checkoutoverview.terms-conditions",[`<a href="${p.value}" target="_blank" rel="noopener noreferrer" class="p-ec01-terms">`,"</a>"])),C=k(()=>{const e=u.value.some(e=>"PH"===e.businessClassification&&e.isHealthProduct);return a("isHealthConsent")&&e}),P=k(()=>s("checkoutoverview.privacy-policy",[`<a href="${m.value}" target="_blank" rel="noopener noreferrer" class="p-ec01-privacy">`,"</a>"])),A=k(()=>{const e=ne.getCookie("ageConsentData-opt-in");return Boolean(d.value&&"accepted"!==e)});return(a,d)=>{const u=h("safe-html");return o(),g("section",El,[y(Wn,{"consent-type":"age"}),y(Xn,{"show-link":""}),A.value&&!n.value?(o(),g("button",{key:0,type:"button",class:"p-ec01-pay-button-wrapper__age-consent-wrapper p-spacing-top-a p-spacing-bottom-a",onClick:d[0]||(d[0]=e=>(t.commit("consent/updateShowAgeConsent",!0),void t.commit("consent/updateIsAgeConsentAccepted",!1)))},[y(fi,{"icon-name":"alert",class:"p-ec01-form__error-msg","reader-text":v(s)("cartoverview.age-consent-required-error-message")},null,8,["reader-text"]),l("span",Tl,c(v(s)("cartoverview.age-consent-required-error-message")),1)])):I("",!0),y(xl,{"button-text":e.buttonText,onClick:d[1]||(d[1]=e=>a.$emit("pay-button-click"))},null,8,["button-text"]),f(l("div",{tabindex:"0",role:"button",class:"p-ec01-pay-button-wrapper__terms p-text-center p-body-copy-03",onClick:d[2]||(d[2]=e=>(e=>{const t=e?.target?.closest?.(".p-ec01-terms");t&&i()})(e))},null,512),[[u,b.value]]),C.value?f((o(),g("div",{key:1,tabindex:"0",role:"button",class:"p-ec01-pay-button-wrapper__terms p-text-center p-body-copy-03",onClick:d[3]||(d[3]=e=>(e=>{const t=e?.target?.closest?.(".p-ec01-privacy");t&&r()})(e))},null,512)),[[u,P.value]]):I("",!0)])}}},Ol={components:{OverlaySubmitLoader:kl,OrderOverviewSection:wl,Voucher:En,CartItems:As,CartSummary:ma,PayButtonWrapper:Dl},mixins:[gi,_l],computed:{...r("delivery",["isBillingAddressHidden","addressType","selectedDeliveryMode"]),...r("payments",["selectedPaymentDetails"]),...i("cart",["deliveryMode"]),...i("payments",["otherPaymentSelected"]),...i("delivery",["email","deliveryAddress","billingAddress","sameAsDelivery","receiptOrEInvoice"]),...i({selectedCollectionPoint:e=>e.delivery.selectedCollectionPoint?.attributes?.address||{}}),deliveryInfo(){const{label:e="",deliveryCost:t={}}=this.selectedDeliveryMode||{};return`${e} ${t.formattedValue||""}`}},created(){document.title=this.i18n("checkoutoverview.page-title")}},Ll={class:"p-layout-inner"},Ml={class:"p-ec01-checkout-overview p-ec01-order p-xs-spacing-top-b p-s-spacing-top-b p-m-sp
2acing-top-c p-l-spacing-top-c p-row-gutter"},Bl={class:"p-heading-02 p-heading-light p-m-spacing-bottom-b"},$l={class:"p-ec01-order__info p-ec01-input-list-option"},Vl={class:"p-ec01-order__info p-ec01-input-list-option"},Nl={class:"p-heading-03 p-heading-03_delivery p-ec01__title"},Rl={class:"p-ec01-order-row p-ec01-order-row__address"},Fl={key:0},Ul={class:"p-heading-04"},ql={key:0},Hl={key:1},jl={class:"p-heading-04"},Gl={key:0},Wl={key:1},zl={key:2},Ql={key:2},Kl={class:"p-heading-04"},Jl={key:0},Yl={key:1},Zl={key:2},Xl={key:3},ec={class:"p-ec01-order__info p-ec01-input-list-option"},tc={class:"p-heading-03 p-heading-03_delivery"},ic={key:0},rc={class:"p-ec01-order-pay"};const oc=yi(Ol,[["render",function(e,t,i,r,s,d){const u=D("order-overview-section"),p=D("cart-items"),m=D("voucher"),h=D("cart-summary"),v=D("pay-button-wrapper"),f=D("overlay-submit-loader");return o(),g("div",Ll,[l("section",Ml,[l("h1",Bl,c(e.i18n("cartoverview.order-title")),1),y(u,{title:e.i18n("cartoverview.order-user-information"),"section-id":"#user-info"},{default:n(()=>[l("div",$l,[l("b",null,c(e.email),1)])]),_:1},8,["title"]),y(u,{title:e.i18n("cartoverview.shipping"),"section-id":"#delivery"},{default:n(()=>[l("div",Vl,[l("h3",Nl,c(d.deliveryInfo),1),l("div",Rl,[e.deliveryMode.isCollectionPoint?(o(),g("div",Fl,[l("h4",Ul,c(e.i18n("checkoutoverview.shipping-address-title")),1),l("ul",null,[l("li",null,c(e.selectedCollectionPoint.firstName),1),l("li",null,c(`${e.selectedCollectionPoint.line1}${e.selectedCollectionPoint.houseNumber?` ${e.selectedCollectionPoint.houseNumber}`:""}`),1),e.selectedCollectionPoint.region?(o(),g("li",ql,c(e.selectedCollectionPoint.region),1)):I("",!0),l("li",null,c(e.selectedCollectionPoint.postalCode)+" "+c(e.selectedCollectionPoint.town),1)])])):(o(),g("div",Hl,[l("h4",jl,c(e.i18n("checkoutoverview.shipping-address-title")),1),l("ul",null,[e.deliveryAddress.companyName&&e.receiptOrEInvoice?(o(),g("li",Gl,c(e.deliveryAddress.companyName),1)):I("",!0),l("li",null,c(e.deliveryAddress.firstName)+" "+c(e.deliveryAddress.lastName),1),l("li",null,c(`${e.deliveryAddress.line1}${e.deliveryAddress.houseNumber?` ${e.deliveryAddress.houseNumber}`:""}`),1),e.deliveryAddress.line2?(o(),g("li",Wl,c(e.deliveryAddress.line2),1)):I("",!0),e.deliveryAddress.region?(o(),g("li",zl,c(e.deliveryAddress.region),1)):I("",!0),l("li",null,c(e.deliveryAddress.postalCode)+" "+c(e.deliveryAddress.town),1),l("li",null,c(e.deliveryAddress.phone),1),l("li",null,c(e.deliveryAddress.country),1)])])),e.isBillingAddressHidden||"billing"!==e.addressType&&e.sameAsDelivery?I("",!0):(o(),g("div",Ql,[l("h4",Kl,c(e.i18n("checkoutoverview.billing-address-title")),1),l("ul",null,[e.billingAddress.companyName&&e.receiptOrEInvoice?(o(),g("li",Jl,c(e.billingAddress.companyName),1)):I("",!0),e.billingAddress.taxNumber&&e.receiptOrEInvoice?(o(),g("li",Yl,c(e.billingAddress.taxNumber),1)):I("",!0),l("li",null,c(e.billingAddress.firstName)+" "+c(e.billingAddress.lastName),1),l("li",null,c(`${e.billingAddress.line1}${e.billingAddress.houseNumber?` ${e.billingAddress.houseNumber}`:""}`),1),e.billingAddress.line2?(o(),g("li",Zl,c(e.billingAddress.line2),1)):I("",!0),e.billingAddress.region?(o(),g("li",Xl,c(e.billingAddress.region),1)):I("",!0),l("li",null,c(e.billingAddress.postalCode)+" "+c(e.billingAddress.town),1),l("li",null,c(e.billingAddress.phone),1),l("li",null,c(e.billingAddress.country),1)])]))])])]),_:1},8,["title"]),e.isTotal?(o(),a(u,{key:0,title:e.i18n("cartoverview.order-payment"),"section-id":"#payment"},{default:n(()=>[l("div",ec,[l("h4",tc,c(e.selectedPaymentDetails.label),1),e.otherPaymentSelected?I("",!0):(o(),g("p",ic,c(e.i18n("cartoverview.order-cart-ending"))+" ****",1))])]),_:1},8,["title"])):I("",!0),y(u,{title:e.i18n("cartoverview.order-items"),"section-id":"#items"},{default:n(()=>[y(p)]),_:1},8,["title"]),y(m),y(h),l("div",rc,[y(v,{"button-text":e.buttonText,onPayButtonClick:t[0]||(t[0]=t=>e.handleButtonClick())},null,8,["button-text"])]),e.showLoader?(o(),a(f,{key:1})):I("",!0)])])}]]),sc={class:"p-grid p-form"},ac={class:"p-grid-item p-one-whole p-ec01-consent-marketing"},nc={__name:"MarketingConsent",props:{disabled:{type:Boolean,required:!1}},setup(e){const t=_(),i=k(()=>t.state.consent.marketingConsentConfiguration),r=k(()=>t.state.consent.isMarketingConsentAccepted),s=k(()=>i.value[0]||{});return(i,a)=>(o(),g("section",sc,[l("div",ac,[y(Fn,{"consent-configuration":s.value,disabled:e.disabled,"selected-value":r.value,onToggleConsent:a[0]||(a[0]=e=>{return i=e,void t.dispatch("consent/updateIsMarketingConsentAccepted",i);var i})},null,8,["consent-configuration","disabled","selected-value"])])]))}},lc={class:"p-grid p-form"},cc={class:"p-grid-item p-one-whole p-ec01-consent-health"},dc={__name:"HealthConsent",props:{disabled:{type:Boolean,required:!1}},setup(e){const t=_(),i=k(()=>t.state.consent.healthConsentConfiguration),r=k(()=>t.state.consent.isHealthConsentAccepted),s=k(()=>i.value[0]||{});return(i,a)=>(o(),g("section",lc,[l("div",cc,[y(Fn,{"consent-configuration":s.value,disabled:e.disabled,"selected-value":r.value,onToggleConsent:a[0]||(a[0]=e=>{return i=e,void t.dispatch("consent/updateIsHealthConsentAccepted",i);var i})},null,8,["consent-configuration","disabled","selected-value"])])]))}},uc={components:{Field:V},props:{name:{type:String,required:!0},modelValue:{type:String,default:""},value:{type:String,required:!0},title:{type:String,default:""},subtitle:{type:String,default:""},disabled:{type:Boolean,required:!1}},emits:["update:modelValue","change"],computed:{isSelected(){return this.modelValue===this.value&&!this.disabled},selectedValue:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}}},pc={class:"p-ec01-input-list-option__label"},mc={class:"p-radio p-ec01-input-list-option__radio p-xs-visuallyhidden p-s-visuallyhidden"},hc={class:"p-ec01-input-list-option__label-text"},gc={key:0,class:"p-body-copy-01 p-bold"},yc={key:1,class:"p-ec01-input-list-option__subtitle p-body-copy-02"},vc={class:"p-ec01-input-list-option__aside"},fc={key:0,class:"p-ec01-input-list-option__inline-content"},bc={key:1,class:"p-ec01-input-list-option__checkoutmethod"};const Cc=yi(uc,[["render",function(e,t,i,r,s,a){const n=D("field");return o(),g("section",{class:d(["p-ec01-input-list-option",{"p-ec01-input-list-option--selected":a.isSelected,"p-ec01-input-list-option--disabled":i.disabled}])},[l("label",pc,[l("div",mc,[y(n,{modelValue:a.selectedValue,"onUpdate:modelValue":t[0]||(t[0]=e=>a.selectedValue=e),type:"radio",name:i.name,value:i.value,disabled:i.disabled,onChange:t[1]||(t[1]=t=>e.$emit("change"))},null,8,["modelValue","name","value","disabled"])]),l("div",hc,[e.$slots.header?e.$slots.header?P(e.$slots,"header",{key:1}):I("",!0):(o(),g(S,{key:0},[i.title?(o(),g("p",gc,c(i.title),1)):I("",!0),i.subtitle?(o(),g("p",yc,c(i.subtitle),
21)):I("",!0)],64))]),l("div",vc,[P(e.$slots,"aside")])]),a.isSelected&&e.$slots.inlineContent?(o(),g("div",fc,[P(e.$slots,"inlineContent")])):I("",!0),a.isSelected&&e.$slots.checkoutMethods?(o(),g("div",bc,[P(e.$slots,"checkoutMethods")])):I("",!0)],2)}]]),kc={computed:{...r("config",["getDefaultConfig"]),...r("cart",["getProductByCtn"]),...r("bundles",["getAppliedBundles"]),...i("config",["isLoggedIn"]),...i("config",{analyticsValidationSchema:"validationSchema"}),...i("cart",["currencyCode","actualCartId","sellerGroupItems","isSubscriptionApplicable","vouchers"]),...i("cart",["currencyCode","actualCartId","sellerGroupItems"]),...i({cartItems:e=>e.cart.items}),localeId(){return this.getDefaultConfig("localeId")},catalogId(){return this.getDefaultConfig("catalogId")}},methods:{trackAjax(e){setTimeout(()=>{window.eddlEvents||=[],window.eddlEvents.push({trigger:"adobe.analytics.track.ajax",payload:e})},0)},trackConversion(e){setTimeout(()=>{window.philips?.analytics&&window.philips.analytics.trackConversion(e)},0)},trackBuddyRecommendations(e){const t=e.length>0?"2039874:recs_1":"2039874:recs_0",i=this.cartItems.map(e=>e.itemId).join(",");window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push({trigger:"experiment.event",event:"userEvent",payload:e,interaction:{goal:t,description:i,interactive:!1},component:{name:"aem",type:"experiment"}})},0)},trackGoogleAnalytics(e,t,i){window.eddlEvents||=[],i?setTimeout(()=>{window.eddlEvents.push({trigger:t,event:"ecommerceEvent",marketPlaceParticipant:i,ecommerce:e,cart:{id:this.actualCartId}})},0):setTimeout(()=>{window.eddlEvents.push({trigger:t,event:"ecommerceEvent",ecommerce:e,cart:{id:this.actualCartId}})},0)},trackGoogleAnalyticsSimple(e){window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push(e)},0)},generateGAdataForAddRemove(e,t,i={}){const r={productObj:{},cartItems:[]},o=[];let s=this.getProductByCtn(e.itemId),a={quantity:t||1,locale:this.localeId,price:this.getCorrectPrice(e),id:e.itemId,subcatCode:s&&"{}"!==JSON.stringify(s)?s.subcatCode:i.subcatCode||"",catCode:s&&"{}"!==JSON.stringify(s)?s.catCode:i.catCode||"",grpCode:s&&"{}"!==JSON.stringify(s)?s.grpCode:i.grpCode||"",catalogType:this.catalogId,originalPrice:e.price?.value||"",marketPlaceParticipant:e.sellerName||"Philips"};if(e.bundleId&&(a.bundleId=e.bundleId,a.bundleType=e.bundleType,this.isSubscriptionApplicable&&"SUBSCRIPTION"===e.bundleType)){const t=this.getAppliedBundles(e.bundleId);a.isSubscription=this.isSubscriptionApplicable,a.subscriptionFee=t.recurringCharge.value,a.subscriptionLockDuration=t.billingPeriodInMonths}if(this.cartItems?.length>0)for(const n of this.cartItems){if(s=this.getProductByCtn(n.itemId),a={quantity:n.quantity,locale:this.localeId,price:n.bundleId?n.totalPrice.value:this.getCorrectPrice(n),id:n.itemId,subcatCode:s.subcatCode,catCode:s.catCode,grpCode:s.grpCode,catalogType:this.catalogId,originalPrice:n?.price?.value||"",marketPlaceParticipant:n.sellerName||"Philips"},n.bundleId&&(a.bundleId=n.bundleId,a.bundleType=n.bundleType,this.isSubscriptionApplicable&&"SUBSCRIPTION"===n.bundleType)){const e=this.getAppliedBundles(n.bundleId);a.isSubscription=this.isSubscriptionApplicable,a.subscriptionFee=e.recurringCharge.value,a.subscriptionLockDuration=e.billingPeriodInMonths}o.push(a)}return r.productObj=a,r.cartItems=o,r},generateGoogleAnalyticsData(e,t,i,r,o,s=!1,a,n){let l="";if(l=s?{currencyCode:"",purchase:{actionField:{id:a.id,revenue:a.revenue,tax:a.tax,shipping:a.shipping,discount:a.discount,coupon:a.coupon,revenueWithoutTax:a.revenueWithoutTax,appliedCoupon:this.vouchers?.[0]?.id||"",customerType:this.isLoggedIn?"returning":"new"},products:[]}}:o?{currencyCode:"",checkout_option:{actionField:{step:t,option:o},products:[]}}:{currencyCode:"",checkout:{actionField:{step:t},products:[]}},i?.length>0)for(const[c,d]of i.entries()){const e=this.getProductByCtn(d.itemId),t=n?.appliedProductPromotions.filter(e=>e.consumedItems.find(e=>e.itemCartOrder===Number.parseInt(d.id,10))),i={quantity:d.quantity,locale:this.localeId,price:d.bundleId?d.totalPrice.value:this.getCorrectPrice(d),discount:t?.[0]?.consumedItems[0]?.adjustedUnitPrice.value||0,id:d.itemId,coupon:t?.[0]?.id||"",subcatCode:e.subcatCode,catCode:e.catCode,grpCode:e.grpCode,catalogType:this.catalogId,originalPrice
2:d?.price?.value||"",marketPlaceParticipant:d.sellerName||"Philips"};if(d.bundleId&&(i.bundleId=d.bundleId,i.bundleType=d.bundleType,this.isSubscriptionApplicable&&"SUBSCRIPTION"===d.bundleType||s&&"SUBSCRIPTION"===d.bundleType)){const e=this.getAppliedBundles(d.bundleId);i.isSubscription=this.isSubscriptionApplicable||!0,i.subscriptionFee=e.recurringCharge.value,i.subscriptionLockDuration=e.billingPeriodInMonths,i.bundleArcheType=e.archeType,i.subscriptionBundleType=e.subscriptionBundleType,i.subscriptionBillingPeriod=e.billingPeriod}0===c&&(l.currencyCode=this.currencyCode),s?l.purchase.products.push(i):o?l.checkout_option.products.push(i):l.checkout.products.push(i)}this.trackGoogleAnalytics(l,e,r)},trackGoogleAnalyticsError(e,t=""){void 0!==e[0]&&(e=e[0]),e.url=t,e.debug={locale:this.localeId},this.trackGoogleAnalyticsSimple({trigger:"event.errors",event:"systemEvent",interaction:{goal:"errorCode",url:t,description:JSON.stringify(e),status:"9999",interactive:!1},component:{name:"ec01-checkout",type:"error"}})},getAnalyticsFieldsErrors(e){return Object.entries(e).map(([e,t])=>t===this.analyticsValidationSchema[e].required?{type:"validation_error_empty",field:e}:t===this.analyticsValidationSchema[e].regex?.[1]?{type:"validation_error_format",field:e}:{type:"validation_error_unknown",field:e})},trackPageAnalyticsErrors(e,t){const i=e.reduce((e,{type:t,field:i})=>(e[t]=e[t]?`${e[t]}|${i}`:i,e),{});for(const r of Object.keys(i))this.trackConversion({name:"validation_error",pagename:t,description:`${r}|${i[r]}`})},orderConfirmationAnalytics(e){const t=e.attributes,i=t.items,r=t.promotions,o={id:t.orderId,revenue:t.pricing?.total?.value||0,tax:t.pricing?.tax?.value||0,shipping:t.pricing?.totalDelivery?.value||0,discount:t.pricing?.totalDiscount?.value||0,revenueWithoutTax:t.pricing?.revenueWithoutTax?.value||0,coupon:t.promotions?.appliedPromotions&&t.promotions?.appliedPromotions.length>0?t.promotions?.appliedPromotions[0]?.code:""};if(this.generateGoogleAnalyticsData("ecommerce.checkout.purchase","",i,"complete-order","",!0,o,r),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[s,a]of Object.entries(this.sellerGroupItems)){let e="";e=t.marketplaceTotals?"PHILIPS"===s?.toUpperCase()?{id:t.orderId,revenue:t.marketplaceTotals.operatorTotalPriceWithTax?.value||0,tax:t.marketplaceTotals.operatorTaxPrice?.value||0,shipping:t.marketplaceTotals.operatorDeliveryPrice?.value||0,discount:t.marketplaceTotals.operatorOrderDiscount?.value||0,coupon:t.promotions?.appliedPromotions&&t.promotions?.appliedPromotions.length>0?t.promotions?.appliedPromotions[0]?.code:""}:{id:t.orderId,revenue:t.marketplaceTotals.sellerTotalPriceWithTax?.value||0,tax:t.marketplaceTotals.sellerTaxPrice?.value||0,shipping:t.marketplaceTotals.sellerDeliveryPrice?.value||0,discount:t.marketplaceTotals.sellerOrderDiscount?.value||0,coupon:t.promotions?.appliedPromotions&&t.promotions?.appliedPromotions.length>0?t.promotions?.appliedPromotions[0]?.code:""}:o,this.generateGoogleAnalyticsData("ecommerce.checkout.purchase","",a,s,"",!0,e,r)}}}};const _c={toFixed:(e,t)=>Number(e).toFixed(t),getFormatter(e){let t=e;t=t.replaceAll(/({c.*?})/gi,"!"),t=t.replaceAll(/({n.*?})/gi,"^"),t=t.replaceAll(/({[do|].*?})/gi,"."),t=t.replaceAll(/({.*?})/gi,",");const i=function(e){let t;const i={},r=/({([cdnot])(.*?)})/gi;for(;null!==(t=r.exec(e));)switch(t.index===r.lastIndex&&r.lastIndex++,t[2].toLowerCase()){case"c":i.symbol=t[3];break;case"n":i.negative=t[3];break;case"d":i.decimal=t[3];break;case"o":i.decimal=t[3],i.isDecimalOptional=!0;break;case"t":i.group=t[3]}return i}(e),r=function(e){const t=e.trim().match(/[#,.0]+/)[0],i=t.split("."),r=i[0],o=i[1],s=r.split(","),a=e.split(t);return{pattern:e,decimalPlaces:void 0===o?0:o.length,leftSpacing:a[0],rightSpacing:a[1],groupLengths:s.map(e=>e.length)}}(t);return Object.assign(r,i),e=>Number.isNaN(e)?"NaN":function(e,t){const i=_c.toFixed(Math.abs(e),t.decimalPlaces).split("."),r=t.groupLengths.length-1;let o,s="",a="",n=i[0].length,l=r;if(r>0){for(;n>0;)l=l<0?0:l,o=t.groupLengths[l],s=i[0].substring(n-o,n)+t.group+s,n-=o,--l;s=s.slice(0,Math.max(0,s.length-1))}else s=i[0];return a=t.leftSpacing+s,a+=void 0===i[1]||t.isDecimalOptional&&e%1==0?"":t.decimal+i[1],a+=t.rightSpacing,a.replaceAll("^",e<0?t.negative||"-":"").replaceAll("!",t.symbol).trim()}(Number(e),r)},format(e,t){return this.getFormatter(e)(t)}},Ic={computed:{...r("config",["getDefaultConfig"]),...r("promotions",["getPromotionData"]),...i("cart",["currencyCode"]),pricePattern(){return this.getDefaultConfig("pricePattern")},language(){return this.getDefaultConfig("language")},country(){return this.getDefaultConfig("country")},isPublicShop(){return this.getDefaultConfig("siteId")?.toLowerCase().endsWith("pub")},isOmnibusPricingEnabled(){return this.getDefaultConfig("enableOmnibusDirectivePricing")&&this.isPublicShop},isOmnibusMsrpPriceEnabled(){return this.getDefaultConfig("enableOmnibusMsrpPrice")},isMicrositeId(){return this.getDefaultConfig("siteId")?.toLowerCase().indexOf("pub")<=0}},methods:{getFormattedPrice(e){const t=this.pricePattern,i=`${this.language}-${this.country}`,r=t?_c.getFormatter(t):null;let o=e;return e&&void 0!==e.value&&null!==e.value&&""!==e.value&&(e.formattedValue||=new Intl.NumberFormat(i,{style:"currency",currency:this.currencyCode}).format(e.value),o=r?r(e.value):e.formattedValue),o.replaceAll(/\s/g," ")},getCorrectPrice:e=>e.totalPrice.value/e.quantity,getPriceObject(e){const t={value:"",formattedValue:"",currency:""};let i;if(this.isOmnibusPricingEnabled)i={toPrice:e.toPrice||t,fromPrice:e.fromPrice,discount:e.discountRibbon?.formattedValue},e.toPrice&&e.fromPrice&&e.discountRibbon&&(i.hasTooltipText=this.i18n("cartoverview.price-discount-tooltip")),this.isOmnibusMsrpPriceEnabled&&!e.fromPrice&&e.msrpPrice?.value&&e.toPrice.value&&e.msrpPrice.value>e.toPrice.value&&(i.fromPrice=e.msrpPrice,i.hasTooltipText=this.i18n("cartoverview.price-msrp-tooltip"));else{const r=this.getPromotionData(e);i={toPrice:e.price||t};const o=r.consumedItems?r.consumedItems[0]?.adjustedUnitPrice:"";r.active&&o&&o.value<e.discountPrice.value?i={toPrice:o,fromPrice:e.discountPrice}:e.discountPrice?.value&&e.price?.value&&e.discountPrice.value!==e.price.value&&(i={toPrice:e.discountPrice,fromPrice:this.isOmnibusMsrpPriceEnabled&&e.msrpPrice?.value?e.msrpPrice:e.price}),r.active&&!this.isMicrositeId&&(i.discount="percentage-discount"===r.labelType?`${r.labelData}%`:r.labelData)}return i}}},Pc={class:"p-heading-light"},Ac={key:0,class:"p-ec01-checkout-input--error p-ec01-form__error-msg p-margin-none p-spacing-top-b p-spacing-bottom-a"},wc={key:0,class:"p-grid p-form p-xs-spacing-top-a p-s-spacing-top-a"},Sc={class:"p-grid-item p-xs-one-whole p-s-one-half p-m-one-half p-l-one-half"},xc={class:"p-ec01-checkout-method__account-title"},Ec=["href"],Tc={class:"p-grid-item p-xs-one-whole p-s-one-half p-m-one-half p-l-one-half p-xs-spacing-top-a"},Dc={class:"p-ec01-checkout-method__account-title"},Oc=["href"],Lc={key:1,class:"p-grid p-form p-xs-spacing-top-a p-s-spacing-top-a sss"},Mc={class:"p-grid-item p-one-whole p-xs-spacing-bottom-a p-s-spacing-bottom-a"},Bc={__name:"CheckoutMethods",props:{errors:{type:Object,default:void 0},isCheckoutOptionsDisabled:{type:Boolean}},setup(e){const t=e,i=_(),r=C(null),{trackCheckoutMethodConversion:s,trackCheckoutMethodLink:u,trackEmailInput:m}=Xa(),{i18n:h}=Ii(),{getValidationSchema:f}=ht(),{generateGoogleAnalyticsData:b,trackGoogleAnalytics:P}=kc.methods,{getCorrectPrice:A}=Ic.methods,w=k(()=>[{label:h("checkoutoverview.checkout-with-account-title"),description:h("checkoutoverview.checkout-with-account-desc"),id:"login-or-create",isVisible:U.value,
2name:"checkoutMethod",isSubscriptionApplicable:!0},{label:h("checkoutoverview.guest-title"),description:h("checkoutoverview.guest-checkout-desc"),id:"guest-checkout",isVisible:!0,name:"checkoutMethod",isSubscriptionApplicable:!V.value}].filter(e=>!0===e.isVisible)),E=k(()=>i.getters["config/isGuestCheckout"]),T=k(()=>i.getters["payments/isCancelledPayment"]),D=k(()=>i.state.cart.items),L=k(()=>i.state.cart.sellerGroupItems),M=k(()=>i.state.cart.hasHealthProduct),B=k(()=>i.state.consent.isMarketingConsentAccepted),$=k(()=>i.state.delivery.emailConfiguration[0]||{}),V=k(()=>i.state.cart.isSubscriptionApplicable),N=k({get:()=>i.state.config.selectedCheckoutMethodId,set(e){i.dispatch("config/updateSelectedCheckoutMethodId",e)}}),R=k({get:()=>i.state.delivery.email,set(e){i.dispatch("delivery/updateEmail",{email:e})}}),F=e=>k(()=>i.getters["config/getDefaultConfig"](e)),U=k(()=>"true"===F("isLoginEnabled").value),q=F("language"),H=F("country"),W=F("sessionUrl"),z=k(()=>{let e=`${W.value}/login?sourceChannel=COMMERCE&redirectUrl=${Y.value}&redirectErrorUrl=${Z.value}&country=${H.value}&language=${q.value}`;return""!==R.value&&(e+=`&emailId=${R.value}`),e}),Q=j(),K=G(),J=(e={})=>{const{href:t}=K.resolve({name:Q.name,params:Q.params,query:e});return encodeURIComponent(t)},Y=k(()=>J()),Z=k(()=>J({loggedin:"error"})),X=k(()=>`${W.value}/login?sourceChannel=COMMERCE&prompt=create&redirectUrl=${Y.value}&redirectErrorUrl=${Z.value}&country=${H.value}&language=${q.value}`),ee=k(()=>t.errors.checkoutMethod?h(t.errors.checkoutMethod):i.state.config.showAccountError?h("checkoutoverview.login-or-create-account-error"):""),te=()=>{ie(),i.dispatch("config/updateShowAccountError",!1),r.value.scrollIntoView({behavior:"smooth",block:"center"}),(()=>{const e={items:D.value,cartItems:D.value,sellerGroupItems:L.value,isGuestCheckout:E.value,isSubscriptionApplicable:V.value,currencyCode:i.state.cart.currencyCode,catalogId:i.getters["config/getDefaultConfig"]("catalogId"),localeId:i.getters["config/getDefaultConfig"]("localeId"),getProductByCtn:i.getters["cart/getProductByCtn"],getAppliedBundles:i.getters["bundles/getAppliedBundles"],getCorrectPrice:A,trackGoogleAnalytics:P};if(b.call(e,"ecommerce.checkout.step.option","login",D.value,"complete-order",E.value?"guest":"account"),"{}"!==JSON.stringify(L.value))for(const[t,i]of Object.entries(L.value))b.call(e,"ecommerce.checkout.step.option","login",i,t,E.value?"guest":"account")})()},ie=()=>{const e=E.value?"selected":"unselected",t=E.value?"unselected":"selected";s(e,t)},re=e=>{u(e)};return p(()=>{T.value&&R.value&&i.dispatch("config/updateSelectedCheckoutMethodId",w.value[1].id);const e=f([$.value]);e.checkoutMethod=e=>Boolean(e)||"checkoutoverview.checkout-required-error-message",i.dispatch("config/updateValidationSchema",e)}),(i,s)=>(o(),g("section",{ref_key:"checkoutMethod",ref:r,class:"p-ec01-checkout-method"},[l("h3",{class:d(["p-heading-03 p-ec01__title",{"p-margin-none":!!e.errors.checkoutMethod}])},[O(c(v(h)("checkoutoverview.step-one"))+" ",1),l("span",Pc," - "+c(v(h)("checkoutoverview.checkout-method-title")),1)],2),ee.value?(o(),g("p",Ac,c(ee.value),1)):I("",!0),(o(!0),g(S,null,x(w.value,i=>(o(),a(Cc,{key:i.id,modelValue:N.value,"onUpdate:modelValue":s[4]||(s[4]=e=>N.value=e),name:i.name,value:i.id,class:d({"p-ec01-checkout-input--error":!!e.errors.checkoutMethod}),title:i.label,subtitle:i.isSubscriptionApplicable?i.description:v(h)("checkoutoverview.subscription-not-possible-with-subscriptions"),disabled:!i.isSubscriptionApplicable||e.isCheckoutOptionsDisabled,onChange:s[5]||(s[5]=e=>te())},{checkoutMethods:n(()=>[E.value?E.value?(o(),g("div",Lc,[l("div",Mc,[y($s,{id:$.value.name,modelValue:R.value,"onUpdate:modelValue":s[2]||(s[2]=e=>R.value=e),modelModifiers:{trim:!0},type:$.value.type,inputmode:$.value.inputMode,name:$.value.name,autocomplete:$.value.autocomplete||"",error:e.errors[$.value.name],"is-float-label":"","label-text":`${v(h)("checkoutoverview.email")}${$.value.mandatory?"*":""}`,"max-length":$.value.maxLength,"form-field":$.value,onBlur:s[3]||(s[3]=e=>{void 0===t.errors?.email&&m()})},null,8,["id","modelValue","type","inputmode","name","autocomplete","error","label-text","max-length","form-field"])]),y(nc),M.value?(o(),a(dc,{key:0,disabled:!B.value},null,8,["disabled"])):I("",!0)])):I("",!0):(o(),g("div",wc,[l("div",Sc,[l("p",xc,c(v(h)("checkoutoverview.have-philips-account")),1),l("a",{href:z.value,class:"p-link p-link-more",onClick:s[0]||(s[0]=e=>re("login"))},c(v(h)("checkoutoverview.login-text")),9,Ec)]),l("div",Tc,[l("p",Dc,
2c(v(h)("checkoutoverview.dont-have-account")),1),l("a",{href:X.value,class:"p-link p-link-more",onClick:s[1]||(s[1]=e=>re("new_account_signup"))},c(v(h)("checkoutoverview.create-account-link")),9,Oc)])]))]),_:1},8,["modelValue","name","value","class","title","subtitle","disabled"]))),128))],512))}},$c={class:"p-ec01-address-item"},Vc={class:"p-ec01-address-item__icon"},Nc={class:"p-ec01-address-item__content"},Rc={key:0,class:"p-heading-04-large p-heading-medium"},Fc={class:"p-ec01-address-item__title p-heading-04-large p-heading-medium"},Uc={class:"p-ec01-address-item__address p-heading-04 p-heading-book"};const qc={components:{CommerceAddressItem:yi({components:{BaseIcon:fi},props:{commerceAddress:{type:Object,required:!0},addressType:{type:String,required:!0}}},[["render",function(e,t,i,r,s,a){const n=D("base-icon");return o(),g("section",$c,[l("div",Vc,[y(n,{"icon-name":"delivery"===i.addressType?"transport-truck":"coins",title:"delivery"===i.addressType?e.i18n("checkoutoverview.delivery-address-title"):e.i18n("checkoutoverview.billing-address-title")},null,8,["icon-name","title"])]),l("div",Nc,[i.commerceAddress.companyName?(o(),g("div",Rc,c(i.commerceAddress.companyName),1)):I("",!0),l("div",Fc,c(i.commerceAddress.firstName)+" "+c(i.commerceAddress.lastName),1),l("div",Uc,c(i.commerceAddress.line1)+" "+c(i.commerceAddress.town),1)])])}]])},computed:{...i("config",["net"]),...i("delivery",["commerceAddressType","selectedCommerceDeliveryAddress","selectedCommerceBillingAddress","billingCommerceAddresses","billingFormConfiguration","deliveryCommerceAddresses","deliveryFormConfiguration","showMorePup"]),filteredCommerceAddresses(){return"delivery"===this.commerceAddressType?this.deliveryCommerceAddresses:this.billingCommerceAddresses},selectedCommerceAddress(){return"delivery"===this.commerceAddressType?this.selectedCommerceDeliveryAddress:this.selectedCommerceBillingAddress}},methods:{selectCommerceAddress(e){let t=".p-ec01-delivery-mode";if("delivery"===this.commerceAddressType){this.$store.dispatch("delivery/updateSelectedCommerceDeliveryAddress",e);const t=Boolean(e?.taxNumber);this.$store.dispatch("delivery/updateReceiptOrEInvoice",t),this.$store.dispatch("delivery/updateSameAsDelivery",!t)}else"billing"===this.commerceAddressType&&(t=".p-ec01-checkout-overview__billing-address",this.$store.dispatch("delivery/updateSelectedCommerceBillingAddress",e));this.net&&this.getEstimatedTax(e),this.$store.dispatch("delivery/updateAddressOverlayStatus",{isVisible:!1,type:this.commerceAddressType}),document.querySelector(t).scrollIntoView({behavior:"smooth",block:"start"}),"delivery"===this.commerceAddressType?(this.$store.dispatch("delivery/updateIsDeliveryAddressMismatch",!1),this.compareAddressFields(e,this.deliveryFormConfiguration,"delivery")):"billing"===this.commerceAddressType&&(this.$store.dispatch("delivery/updateIsBillingAddressMismatch",!1),this.compareAddressFields(e,this.billingFormConfiguration,"billing"))},getEstimatedTax(e){this.$store.dispatch("tax/getEstimatedTax",{zipCode:e.postalCode,state:e.region?.split("-")[1]||""}).catch(e=>{const{data:{errors:t=[{}]}}=e.response;this.trackGoogleAnalyticsError(t,"estimateTax")})},compareAddressFields(e,t,i){const r=new Set(["billingAddress","defaultAddress","deliveryAddress","isCollectionPoint","formattedAddress","isoCode","title","id"]),o=new Set(t.map(e=>"title"===e.name?"titleCode":e.name));Object.keys(e).some(t=>!o.has(t)&&e[t]&&!r.has(t))&&(this.$store.dispatch("notification/updateErrorNotifications",{text:`${this.i18n("checkoutoverview.addressfields.mismatch-notification")} (9010)`,type:"warning"}),"delivery"===i?this.$store.dispatch("delivery/updateIsDeliveryAddressMismatch",!0):"billing"===i&&this.$store.dispatch("delivery/updateIsBillingAddressMismatch",!0))},showAllCommerceAddresses(){this.$store.dispatch("delivery/updateShowMorePup",!0)}}},Hc={class:"p-ec01-address-items"},jc={key:0,class:"p-ec01-address-items__wrapper"};const Gc=yi(qc,[["render",function(e,t,i,r,s,n){const l=D("commerce-address-item");return o(),g("section",Hc,[n.filteredCommerceAddresses.length>0?(o(),g("div",jc,[(o(!0),g(S,null,x(n.filteredCommerceAddresses,(t,i)=>f((o(),a(l,{key:`address-${t.id}
2`,"commerce-address":t,"address-type":e.commerceAddressType,class:d({"p-ec01-address--selected":t.id===n.selectedCommerceAddress.id}),onClick:e=>n.selectCommerceAddress(t)},null,8,["commerce-address","address-type","class","onClick"])),[[B,i<=3||e.showMorePup]])),128)),n.filteredCommerceAddresses.length>4&&!e.showMorePup?(o(),g("button",{key:0,class:"p-heading-secondary p-link-anchor p-body-copy-01",type:"button",onClick:t[0]||(t[0]=e=>n.showAllCommerceAddresses())},c(e.i18n("checkoutoverview.collectionpoint-showmore")),1)):I("",!0)])):I("",!0)])}]]),Wc={class:"p-ec01-form__label"},zc={key:0,class:"p-ec01-form__label-text"},Qc={key:1,class:"p-ec01-form__label-text"};const Kc=yi({name:"BaseRadioSet",components:{Field:V},mixins:[Rs]},[["render",function(e,t,i,r,s,a){const n=D("field");return o(),g("section",{class:d(["p-ec01-base-radio-set",{"p-input--disabled":e.disabled}])},[l("label",Wc,["before"===e.labelPosition?(o(),g("div",zc,[e.labelText?(o(),g(S,{key:0},[O(c(e.labelText),1)],64)):P(e.$slots,"default",{key:1})])):I("",!0),l("div",{class:d(["p-radio",{"p-ec01-checkout-radio--error p-ec01-checkout-input--error":e.error,"p-ec01-form__label-right":"after"===e.labelPosition,"p-ec01-form__label-left":"after"!==e.labelPosition}])},[y(n,{id:e.id,modelValue:e.selectedValue,"onUpdate:modelValue":t[0]||(t[0]=t=>e.selectedValue=t),type:"radio",disabled:e.disabled,value:e.inputValue,name:e.name},null,8,["id","modelValue","disabled","value","name"])],2),"after"===e.labelPosition?(o(),g("div",Qc,[e.labelText?(o(),g(S,{key:0},[O(c(e.labelText),1)],64)):P(e.$slots,"default",{key:1})])):I("",!0)])],2)}]]),Jc={name:"BaseSelectSet",components:{Field:V},props:{id:{type:String,required:!0},customClass:{type:String,required:!1,default:""},optionItems:{type:Array,required:!0},isOptionEmptyEnabled:{type:Boolean,required:!1},isFloatLabel:{type:Boolean,required:!1},isSelectInvalid:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},labelPosition:{type:String,required:!1,default:"before"},labelText:{type:String,required:!1,default:void 0},modelValue:{type:String,required:!1,default:""},error:{type:String,required:!1,default:""}},data:()=>({isOpen:!1}),computed:{currentOption:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},methods:{setIsOpen(e){this.isOpen=e}}},Yc={class:"p-ec01-base-select__wrapper"},Zc=["for"],Xc=["selected"],ed=["value"],td=["for"],id={key:0,class:"p-ec01-form__error-msg"};const rd=yi(Jc,[["render",function(e,t,i,r,s,a){const u=D("field");return o(),g("section",Yc,[l("div",{class:d(["p-ec01-base-select-set",{"p-float-label-wrapper p-float-label-wrapper--select":i.isFloatLabel,"p-float-label-wrapper--select-empty":!a.currentOption,"p-ec01-checkout-input--error":i.error||i.isSelectInvalid,"p-select--error":i.isSelectInvalid}])},["before"!==i.labelPosition||i.isFloatLabel?I("",!0):(o(),g("label",{key:0,for:i.id},c(i.labelText||e.i18n("generic.option-label-text")),9,Zc)),l("div",{class:d(["p-select p-large",[s.isOpen?"p-select--open":null]])},[y(u,{id:i.id,modelValue:a.currentOption,"onUpdate:modelValue":t[0]||(t[0]=e=>a.currentOption=e),as:"select",name:i.id,class:d([i.customClass,a.currentOption?null:"p-select--empty"]),disabled:i.disabled,onClick:t[1]||(t[1]=e=>a.setIsOpen(!0)),onContextmenu:t[2]||(t[2]=T(e=>a.setIsOpen(!1),["right"])),onBlur:t[3]||(t[3]=e=>a.setIsOpen(!1))},{default:n(()=>[i.isOptionEmptyEnabled?(o(),g("option",{key:0,value:"",selected:""===a.currentOption},c(i.labelText||e.i18n("generic.option-label-text")),9,Xc)):I("",!0),(o(!0),g(S,null,x(i.optionItems,e=>(o(),g("option",{key:e.key,value:e.key},c(e.value),9,ed))),128))]),_:1},8,["id","modelValue","name","class","disabled"])],2),"after"===i.labelPosition||i.isFloatLabel?(o(),g("label",{key:1,for:i.id,class:d({"p-float-label":i.isFloatLabel})},c(i.labelText||e.i18n("generic.option-label-text")),11,td)):I("",!0)],2),i.error?(o(),g("p",id,c(i.error),1)):I("",!0)])}]]),od={class:"p-ec01-checkbox-group"},sd={key:0,class:"p-ec01-form__error-msg p-margin-none"};const ad=yi({name:"CheckboxExtended",components:{BaseCheckboxSet:js},props:{formType:{type:String,required:!0},formField:{type:Object,required:!0},singleMultiple:{type:String,required:!0},initialValues:{type:Array,required:!0},error:{type:String,required:!1,default:""}},emits:["title-selected"],data:()=>({valid:!0,selectedValues:[],initialLoad:!0}),watch:{initialValues:{immediate:!0,handler(e){this.selectedValues=[...e]}}},methods:{updateSelected(e){this.initialLoad=!1,"single"===this.singleMultiple&&(this.selectedValues[1]&&this.selectedValues.shift(),this.$emit("title-selected",this.selectedValues[0]??"")),"single-selected"===this.singleMultiple&&(e===this.formField.options[0].key&&(this.selectedValues=[e],this.$emit("title-selected",[e])),e===this.formField.options[1].key&&(this.selectedValues=[e],this.$emit("title-selected",[e])))}}},[["render",function(e,t,i,r,s,n){const l=D("base-checkbox-set");return o(),g("section",od,[(o(!0),g(S,null,x(i.formField.options,e=>(o(),a(l,{id:`${i.formType}-${i.formField.name}-${e.key}`,key:e.key,modelValue:s.selectedValues,"onUpdate:modelValue":t[0]||(t[0]=e=>s.selectedValues=e),"ref-prop":e.key,disabled:i.formField.disabled,"input-value":e.key,"label-text":e.value,name:`${i.formType}-${i.formField.name}`,"has-error":!(!i.error&&(s.valid||""===s.selectedValues[0]||s.initialLoad)),onInput:t=>n.updateSelected(e.key)},null,8,["id","modelValue","ref-prop","disabled","input-value","label-text","name","has-error","onInput"]))),128)),i.error||!s.valid&&""!==s.selectedValues[0]&&
2!s.initialLoad?(o(),g("p",sd,c(i.formField.mandatoryError),1)):I("",!0)])}]]),nd={__name:"OverlayAddressButton",props:{addressType:{type:String,required:!0,validator:e=>["delivery","billing"].includes(e)},shouldShow:{type:Boolean}},setup(e){const t=e,i=_(),{i18n:r}=Ii(),s=k(()=>i.state.config.isLoggedIn),a=k(()=>"true"===i.getters["config/getDefaultConfig"]("isLoginEnabled")),n=k(()=>"delivery"===t.addressType?i.state.delivery.deliveryCommerceAddresses:i.state.delivery.billingCommerceAddresses),l=k(()=>"delivery"===t.addressType?i.state.delivery.selectedCommerceDeliveryAddress:i.state.delivery.selectedCommerceBillingAddress),d=k(()=>n.value.length>0&&s.value&&a.value&&t.shouldShow),u=k(()=>{const e="{}"!==JSON.stringify(l.value);return r(e?"checkoutoverview.pup-change-link":"checkoutoverview.address-overlay-select")});return(e,r)=>d.value?(o(),g("button",{key:0,class:"p-link-style",type:"button",onClick:r[0]||(r[0]=e=>{i.dispatch("delivery/updateAddressOverlayStatus",{isVisible:!0,type:t.addressType})})},c(u.value),1)):I("",!0)}},ld={name:"AddressForm",components:{BaseHidden:Ns,InputExtended:$s,BaseCheckboxSet:js,BaseSelectSet:rd,BaseRadioSet:Kc,CheckboxExtended:ad,OverlayAddressButton:nd},props:{formType:{type:String,required:!0},errors:{type:Object,default:void 0},deliveryMode:{type:Object,required:!0},customAddressFieldConfig:{type:Array,default:void 0},isAdditionalAddress:{type:Boolean}},emits:["is-type-ahead-check"],setup(){const{trackTypeaheadStartTyping:e,trackBillingAddressToggle:t,trackTypeaheadSuggestionSelection:i,trackTypeaheadSuggestionLoad:r,trackTypeaheadEmptyResponse:o}=Xa();return{trackTypeaheadStartTyping:e,trackBillingAddressToggle:t,trackTypeaheadSuggestionSelection:i,trackTypeaheadSuggestionLoad:r,trackTypeaheadEmptyResponse:o}},data(){return{addressList:[],addressListForLine1:[],cityList:[],geoLocationDataList:[],checkFieldName:"",inputHandlers:{"update:modelValue":this.updateStateAddress,blur:this.updateStateAddress},isRangeItemsExistFlag:!1}},computed:{...r("config",["getDefaultConfig"]),...i("config",["net","fieldConfigByAPI"]),...i("delivery",["deliveryAddress","billingAddress","totalTaxError","receiptOrEInvoice","suggestedAddress","deliveryFormConfiguration","billingFormConfiguration","serverAddressErrors"]),...i({formConfig(e){return this.customAddressFieldConfig?this.customAddressFieldConfig:{...e.delivery[`${this.formType}FormConfiguration`]}}}),address(){return{...this[`${this.formType}Address`]}},country(){return this.getDefaultConfig("country")},sameAsDelivery:{get(){return"billing"===this.formType&&this.$store.state.delivery.sameAsDelivery},set(e){this.$store.dispatch("delivery/updateSameAsDelivery",e||!1),this.toggleAddressForm()}},getFieldError(){return e=>this.errors?.[`${this.formType}-${e}`]||this.serverAddressErrors[`${this.formType}-${e}`]||""},isSameAsDeliveryCheckboxVisible(){return"billing"===this.formType&&!this.deliveryMode.isCollectionPoint}},created(){this.typeAheadDebounced=this._debounce(this.typeAheadDebounced,500),this.typeAheadOnGeoLocationDebounced=this._debounce(this.typeAheadOnGeoLocationDebounced,200),this.estimateTaxCallDebounced=this._debounce(this.estimateTaxCallDebounced,1e3)},beforeUnmount(){this.typeAheadDebounced.cancel(),this.typeAheadOnGeoLocationDebounced.cancel(),this.estimateTaxCallDebounced.cancel()},mounted(){let e;this.updateTypeAheadSelected(!1),"delivery"===this.formType?(e=this.getValidationSchema(JSON.parse(JSON.stringify(this.deliveryFormConfiguration)),this.formType),setTimeout(()=>{this.updateDeliveryAddress({country:this.deliveryAddress.country})},0)):"billing"===this.formType&&(e=this.getValidationSchema(JSON.parse(JSON.stringify(this.billingFormConfiguration)),this.formType)),this.$store.dispatch("config/updateValidationSchema",e)},methods:{clearTypeahead(){this.addressList=[],this.cityList=[],this.$emit("is-type-ahead-check",!1)},trackTypeahead(e,t){t&&"delivery-line1"===e.target.id&&this.trackTypeaheadStartTyping()},outsideClickListener(e){const t=this.$el.querySelector(".p-ec01-typeahead");!t||t.contains(e.relatedTarget)||this.isRangeItemsExistFlag||this.clearTypeahead(),this.isAdditionalAddress||this._emit("addressFormFocusEvent",!0)},isDropdownInvalid(e,t){return"delivery"===e&&"region"===t&&this.totalTaxError},dropdownErrorMessage(e,t){return"delivery"===e&&"region"===t&&this.totalTaxError&&this.i18n("checkoutoverview.delivery.total-tax-error-message")||""},getTitle:e=>e?[e]:[],updateTitle(e,t){this.address[t]=e,this.updateStateAddress()},updateStateAddress(){if("delivery"===this.formType){if(Object.keys(this.suggestedAddress).length>0)for(const e of Object.entries(this.suggestedAddress))e[1]!==this.deliveryAddress[e[0]]&&this.$store.dispatch("delivery/updateIsOptionalValidationFlag",!0);if(this.net){const e=this.address.postalCode,t=this.address.region?.split("-")[1]||"",i=this.deliveryAddress.postalCode,r=this.deliveryAddress.region?.split("-")[1]||"";e&&t&&(e!==i||t!==r)&&this.estimateTaxCallDebounced(e,t)}this.$store.commit("delivery/updateTotalTaxError",null),this.updateDeliveryAddress(this.address),this.updateBillingAddress({...this.billingAddress,companyName:this.address.companyName})}else"billing"===this.formType&&(this.updateBillingAddress(this.address),this.updateDeliveryAddress({...this.deliveryAddress,companyName:this.address.companyName}))},estimateTaxCallDebounced(e,t){this.$store.dispatch("tax/getEstimatedTax",{zipCode:e,state:t}).catch(e=>{const{data:{errors:t=[{}]}}=e.response;this.trackGoogleAnalyticsError(t,"estimateTax")})},toggleAddressForm(){this.trackBillingAddressToggle(this.$route.meta.pagename,this.sameAsDelivery)},selectedAddressItem(e){if(this.address.line1=this.addressList[e]?.line1||"",this.address.houseNumber=this.addressList[e]?.houseNumber||"",this.address.line2=this.addressList[e]?.line2||"",this.address.postalCode=this.addressList[e]?.postalCode||"",this.address.region=this.addressList[e]?.region?.isocode||"",this.address.town=this.addressList[e]?.town||"",this.updateDeliveryAddress(this.address),this.updateSuggestedAddress({line1:this.address.line1,houseNumber:this.address.houseNumber,line2:this.address.line2,postalCode:this.address.postalCode,region:this.address.region,town:this.address.town}),this.$store.dispatch("delivery/updateIsOptionalValidationFlag",!1),this.address.postalCode&&this.address.region&&this.net&&this.estimateTaxCallDebounced(this.address.postalCode,this.address.region.split("-")[1]),this.addressList[e]?.addressRanges?.addresses?.length>0){const t=this.addressList[e].addressRanges.addresses.map(e=>(this.addressListForLine1.push(e),e.formattedAddress));return this.addressList=t,void(this.isRangeItemsExistFlag=!0)}this.clearTypeahead(),this.trackTypeaheadSuggestionSelection(),this.updateTypeAheadSelected(!0)},selectedRangeItem(e){this.address.line1=this.addressListForLine1[e].line1,this.addressListForLine1=[],this.isRangeItemsExistFlag=!1,this.updateDeliveryAddress(this.address),this.updateSuggestedAddress({line1:this.address.line1,houseNumber:this.address.houseNumber,line2:this.address.line2,postalCode:this.address.postalCode,region:this.address.region,town:this.address.town}),this.$store.dispatch("delivery/updateIsOptionalValidationFlag",!1),this.clearTypeahead(),this.trackTypeaheadSuggestionSelection(),this.updateTypeAheadSelected(!0)},selectedCityItem(e){this.address.region=this.cityList[e]?.region?.isocode||"",this.address.postalCode=this.cityList[e]?.postalCode||"",this.address.town=this.cityList[e]?.town||"",this.updateDeliveryAddress(this.address),this.clearTypeahead()},selectedGeoLocationFieldValue(e,t){const i={searchField:t,preSelectedSearchText:this.geoLocationDataList[e]?.[t]};this.geoLocationDataList=[],this.address[t]=i.preSelectedSearchText,this.updateDeliveryAddress(this.address),et(i).then(e=>{for(const[t,i]of Object.entries(e.data.locations[0]))if("region"===t&&i.name&&!this.address[t]){const e=[...document.querySelectorAll("#delivery-region option")].find(e=>e.textContent.trim()===i.name);this.address[t]=e.value,this.updateStateAddress()}else"country"!==t&&i&&!this.address[t]&&(this.address[t]=i);this.updateDeliveryAddress(this.address),this.addressList=[],this.checkFieldName=""}).catch(e=>{console.log(`Error: ${JSON.stringify(e.response.data.errors[0].title)}`)})},resetTypeaheadAPI(e){"delivery-line1"===e.target.id&&"delivery-town"===e.target.id&&"delivery-line2"===e.target.id||this.clearTypeahead()},typeaheadAPI(e){const t={searchText:this.address.line1,searchRadius:5e3,unit:"MI",maxCandidates:10,countryCode:this.country,matchOnAddressNumber:!1,includeRangesDetails:"Y"};let i=!1,r=!1,o=!1;if(this.clearTypeahead(),"delivery"===this.formType&&"Escape"!==e.key&&("delivery-line1"===e.target.id||"delivery-town"===e.target.id)){if("delivery-line1"===e.target.id&&this.address.line1?.length>
25){if(this.address.town&&""!==this.address.town){if(void 0!==this.address.region){const e=this.address.region?.split("-")[1];t.areaName1=e}t.areaName3=this.address.town,t.postCode=this.address.postalCode,t.returnAdminAreasOnly="N"}r=!0,i=!0}else this.address.town?.length>3&&!this.address.line1&&"delivery-town"===e.target.id&&(t.searchText=this.address.town,t.areaName1="",t.areaName3="",t.postCode="",t.returnAdminAreasOnly="Y",o=!0,i=!0);i&&this.typeAheadDebounced(t,r,o)}},typeAheadDebounced(e={},t=!1,i=!1){this.$emit("is-type-ahead-check",!0),this.trackTypeaheadSuggestionLoad(),function(e){return _e.get(`${ye()}/validation-service/locations`,{params:e||{}})}(e).then(e=>{0===e?.data?.locations?.length?(this.clearTypeahead(),this.trackTypeaheadEmptyResponse()):t?this.addressList=[...e.data.locations]:i&&(this.cityList=[...e.data.locations])}).catch(e=>{console.log(`Error${JSON.stringify(e)}`)})},geolocationTypeAheadAPI(e){const t={},i=document.querySelector("select[name=delivery-region]"),r=e.target.id.replaceAll("delivery-","");let o="",s=!1;if(i?.value&&(o=i.options[i.selectedIndex].text),"delivery"===this.formType)for(const a of this.deliveryFormConfiguration)a.isGeolocationsEnabled&&""!==this.address[a.name]&&(t[a.name]=this.address[a.name],"region"===a.name&&(t[a.name]=o||"")),a.name===r&&a.isGeolocationsEnabled&&""!==this.address[r]&&this.address[r].length>=3&&(s=!0,this.checkFieldName=r,t.searchText=this.address[r]||"",t.searchField=r||"",delete t[r]);s&&this.typeAheadOnGeoLocationDebounced(t)},typeAheadOnGeoLocationDebounced(e){et(e).then(e=>{this.geoLocationDataList=[...e.data.locations]}).catch(e=>{console.log(`Error: ${JSON.stringify(e.response.data.errors[0].title)}`)})},getClassNames(e){return this.fieldConfigByAPI&&e.mobileWidth&&e.desktopWidth?this.getClassesFromPILS(e.mobileWidth,e.desktopWidth):this.getClasses(e.columns)},...W({updateDeliveryAddress:"delivery/updateDeliveryAddress",updateBillingAddress:"delivery/updateBillingAddress",updateSuggestedAddress:"delivery/updateSuggestedAddress",updateTypeAheadSelected:"delivery/updateTypeAheadSelected"})}},cd={key:0,class:"p-form"},dd={class:"p-grid p-ec01-delivery-address__same-as-delivery"},ud={class:"p-grid-item p-one-whole"},pd={key:1,class:"p-form p-grid"},md={key:0,class:"p-ec01-typeahead p-ec01-typeahead__list test"},hd={class:"p-ec01-typeahead__list-item-container"},gd=["onClick","onKeyup"],yd={key:0,class:"p-ec01-typeahead__list-item-multiple"},vd=["onClick","onKeyup"],fd={key:1,class:"p-ec01-typeahead p-ec01-typeahead__city-list"},bd={class:"p-ec01-typeahead__list-item-container"},Cd=["onClick","onKeyup"],kd={key:0,class:"p-ec01-typeahead p-ec01-typeahead__geolocation-city-list"},_d={class:"p-ec01-typeahead__list-item-container"},Id=["onClick","onKeyup"],Pd={key:2,class:"p-grid"},Ad={class:"p-grid-item p-xs-one-whole p-m-one-half p-push-m-one-half p-ec01-required-fields"};const wd=yi(ld,[["render",function(e,t,i,r,s,u){const p=D("base-checkbox-set"),m=D("overlay-address-button"),h=D("base-select-set"),v=D("checkbox-extended"),f=D("base-radio-set"),b=D("base-hidden"),C=D("input-extended");return o(),g("section",{class:"p-ec01-delivery-address",onFocusout:t[4]||(t[4]=e=>u.outsideClickListener(e))},[u.isSameAsDeliveryCheckboxVisible?(o(),g("div",cd,[l("div",dd,[l("div",ud,[y(p,{id:"checkbox-billing",modelValue:u.sameAsDelivery,"onUpdate:modelValue":t[0]||(t[0]=e=>u.sameAsDelivery=e),name:"sameAsDelivery","input-value":!0,disabled:e.receiptOrEInvoice,class:d({"p-ec01-delivery-address__same-as-delivery--disabled":e.receiptOrEInvoice})},{default:n(()=>[l("span",{class:d({"p-ec01-delivery-address__same-as-delivery--disabled":e.receiptOrEInvoice})},c(e.i18n("checkoutoverview.billing-same-as-shipping")),3)]),_:1},8,["modelValue","disabled","class"]),y(m,{"address-type":"billing","should-show":!u.sameAsDelivery},null,8,["should-show"])])])])):I("",!0),!u.sameAsDelivery||i.deliveryMode.isCollectionPoint?(o(),g("div",pd,[(o(!0),g(S,null,x(e.formConfig,r=>(o(),g("div",{key:r.order,class:d(["p-grid-item",u.getClassNames(r),{"p-hidden":"hidden"===r.type||!e.receiptOrEInvoice&&("companyName"===r.name||"taxNumber"===r.name)}])},["dropdown"===r.type||"selectBox"===r.type?(o(),a(h,{key:0,id:`${i.formType}-${r.name}`,modelValue:u.address[r.name],"onUpdate:modelValue":[e=>u.address[r.name]=e,t[1]||(t[1]=e=>u.updateStateAddress())],value:u.address[r.name],disabled:r.disabled,"option-items":r.options,"is-option-empty-enabled":e.isHavingDefaultValue(r),"label-text":r.label,"is-float-label":"","is-select-invalid":u.isDropdownInvalid(i.formType,r.name),"error-msg":u.dropdownErrorMessage(i.formType,r.name),error:i.errors?.[`${i.formType}-${r.name}`]},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","option-items","is-option-empty-enabled","label-text","is-select-invalid","error-msg","error"])):"radio"===r.type&&"titleCode"===r.name?(o(),a(v,{key:1,id:`${i.formType}-${r.name}`,"initial-values":u.getTitle(u.address[r.name]),"form-type":i.formType,"form-field":r,error:i.errors?.[`${i.formType}-${r.name}`],"single-multiple":"single",onTitleSelected:e=>u.updateTitle(e,r.name)}
2,null,8,["id","initial-values","form-type","form-field","error","onTitleSelected"])):"radio"===r.type?(o(!0),g(S,{key:2},x(r.options,e=>(o(),a(f,{id:`${i.formType}-${r.name}-${e.key}`,key:e.key,modelValue:u.address[r.name],"onUpdate:modelValue":e=>u.address[r.name]=e,disabled:r.disabled,"input-value":e.key,"label-text":e.value,name:`${i.formType}-${r.name}`,onInput:t[2]||(t[2]=e=>u.updateStateAddress())},null,8,["id","modelValue","onUpdate:modelValue","disabled","input-value","label-text","name"]))),128)):"checkbox"===r.type?(o(!0),g(S,{key:3},x(r.options,e=>(o(),a(p,{id:`${i.formType}-${r.name}`,key:e.key,modelValue:u.address[r.name],"onUpdate:modelValue":[e=>u.address[r.name]=e,t[3]||(t[3]=e=>u.updateStateAddress())],disabled:r.disabled,"input-value":e.key,"label-text":e.value,error:i.errors[`${i.formType}-${r.name}`],name:`${i.formType}-${r.name}`},null,8,["id","modelValue","onUpdate:modelValue","disabled","input-value","label-text","error","name"]))),128)):"hidden"===r.type?(o(),a(b,{key:4,id:`${i.formType}-${r.name}`,modelValue:u.address[r.name],"onUpdate:modelValue":e=>u.address[r.name]=e,name:`${i.formType}-${r.name}`},null,8,["id","modelValue","onUpdate:modelValue","name"])):"phone"===r.name&&"billing"===i.formType&&!i.deliveryMode.isCollectionPoint||!("companyName"!==r.name||"delivery"!==i.formType&&"billing"!==i.formType||e.receiptOrEInvoice)||"taxNumber"===r.name&&"billing"===i.formType&&!e.receiptOrEInvoice?I("",!0):(o(),a(C,{key:5,id:`${i.formType}-${r.name}`,modelValue:u.address[r.name],"onUpdate:modelValue":e=>u.address[r.name]=e,name:`${i.formType}-${r.name}`,disabled:r.disabled,"is-float-label":"",autocomplete:r.isGeolocationsEnabled?"off":r.autocomplete,"label-text":r.label,type:r.type,inputmode:r.inputMode,placeholder:r.placeholderText,handlers:r.isTypeAheadEnabled?{keyup:u.typeaheadAPI,focus:u.resetTypeaheadAPI,...s.inputHandlers}:r.isGeolocationsEnabled?{keyup:u.geolocationTypeAheadAPI,focus:u.resetTypeaheadAPI,...s.inputHandlers}:s.inputHandlers,"max-length":r.maxLength,"is-combine-input":Boolean(r.helpText),"tooltip-text":r.helpText||"",error:u.getFieldError(r.name),onClick:e=>u.trackTypeahead(e,r.isTypeAheadEnabled)},{dropDownOverride:n(()=>[r.isTypeAheadEnabled&&"line1"===r.name?(o(),g("div",md,[l("ul",hd,[(o(!0),g(S,null,x(s.addressList,(t,i)=>(o(),g(S,null,[t.formattedAddress?(o(),g("li",{key:t.formattedAddress,class:"p-ec01-typeahead__list-item",tabindex:"0",onClick:e=>u.selectedAddressItem(i),onKeyup:z(e=>u.selectedAddressItem(i),["enter"])},[O(c(t.formattedAddress)+" ",1),0!==t.addressRanges.count?(o(),g("span",yd," - "+c(t.addressRanges.count)+" "+c(1===t.addressRanges.count?e.i18n("checkoutoverview.address"):e.i18n("checkoutoverview.addresses")),1)):I("",!0)],40,gd)):(o(),g("li",{key:t.id,class:"p-ec01-typeahead__list-item",tabindex:"0",onClick:e=>u.selectedRangeItem(i),onKeyup:z(e=>u.selectedRangeItem(i),["enter"])},c(t),41,vd))],64))),256))])])):I("",!0),r.isTypeAheadEnabled&&"town"===r.name?(o(),g("div",fd,[l("ul",bd,[(o(!0),g(S,null,x(s.cityList,(e,t)=>(o(),g("li",{key:e.formattedAddress,tabindex:"0",class:"p-ec01-typeahead__list-item",onClick:e=>u.selectedCityItem(t),onKeyup:z(e=>u.selectedCityItem(t),["enter"])},c(e.formattedAddress),41,Cd))),128))])])):I("",!0),r.isGeolocationsEnabled?(o(),g(S,{key:2},[r.name===s.checkFieldName?(o(),g("div",kd,[l("ul",_d,[(o(!0),g(S,null,x(s.geoLocationDataList,(e,t)=>(o(),g("li",{key:e[r.name],tabindex:"0",class:"p-ec01-typeahead__list-item",onClick:e=>u.selectedGeoLocationFieldValue(t,r.name),onKeyup:z(e=>u.selectedGeoLocationFieldValue(t,r.name),["enter"])},c(e[r.name]),41,Id))),128))])])):I("",!0)],64)):I("",!0)]),_:2},1032,["id","modelValue","onUpdate:modelValue","name","disabled","autocomplete","label-text","type","inputmode","placeholder","handlers","max-length","is-combine-input","tooltip-text","error","onClick"]))],2))),128))])):I("",!0),u.isSameAsDeliveryCheckboxVisible||i.deliveryMode.isCollectionPoint?(o(),g("div",Pd,[l("div",Ad," * "+c(e.i18n("generic.required-fields")),1)])):I("",!0)],32)}]]),Sd={class:"p-ec01-overlay-address-confirmation-text-center p-ec01-overlay-address-confirmation-text-center__bold"},xd={class:"p-ec01-confirmation-address-text p-ec01-overlay-address-confirmation-text-center"},Ed={class:"p-ec01-confirmation-address-text"},Td={class:"p-ec01-confirmation-address-text"},Dd={class:"p-ec01-confirmation-address-text p-body-copy-02"},Od={class:"p-ec01-confirmation-address-text p-ec01-overlay-address-confirmation-text-center"},Ld={class:"p-ec01-overlay-address-confirmation-button"};const Md=yi({components:{Overlay:Vi,InputListOption:Cc},props:{addressValidationDataObject:{type:Object,default:void 0}}
2,emits:["is-confirm-address-check","confirm-validated-address"],data:()=>({actualAddress:"",suggestedAddress:"",suggestionAddressFieldsList:[],addressType:["actual-address","suggested-address"],selectedAddress:null}),mounted(){this.loadOverlayData(),this.selectedAddress=this.addressType[1]},methods:{loadOverlayData(){const e=[],t=[];for(const i of Object.entries(this.addressValidationDataObject.validateAddress))"country"!==i[0]&&(e.push("region"===i[0]?this.addressValidationDataObject.resultData[i[0]]?.isocode:this.addressValidationDataObject.resultData[i[0]]),t.push("region"===i[0]?this.addressValidationDataObject.validateAddress[i[0]]?.name:this.addressValidationDataObject.validateAddress[i[0]]));this.suggestionAddressFieldsList=[];for(const i of Object.values(this.addressValidationDataObject.resultData?.changes))this.suggestionAddressFieldsList.push(i);this.suggestedAddress=e.join(", "),this.actualAddress=t.join(", ")},backToEdit(){this.$emit("is-confirm-address-check",!1)},confirmAddress(){const e=this.selectedAddress===this.addressType[1];this.$emit("confirm-validated-address",e)}}},[["render",function(e,t,i,r,s,d){const u=D("input-list-option"),p=D("overlay");return o(),a(p,{"show-header":"","hide-close-icon":"",title:e.i18nv2("checkoutoverview.shipping-address-title","Delivery Address")},{description:n(()=>[l("p",Sd,c(e.i18nv2("checkoutoverview.address-confirmation-text","Address updated")),1),l("p",xd,c(e.i18nv2("checkoutoverview.address-confirmation-text-description","We have updated your address to one that is verified by us:")),1),l("p",Ed,c(e.i18nv2("checkoutoverview.address-confirmation-entered-address","Address you entered:")),1),y(u,{modelValue:s.selectedAddress,"onUpdate:modelValue":t[0]||(t[0]=e=>s.selectedAddress=e),name:"selected-address",value:s.addressType[0],subtitle:s.actualAddress},null,8,["modelValue","value","subtitle"]),l("p",Td,c(e.i18nv2("checkoutoverview.address-confirmation-updated-address","Updated address:")),1),l("ul",Dd,[(o(!0),g(S,null,x(s.suggestionAddressFieldsList,e=>(o(),g("li",{key:e},c(e),1))),128))]),y(u,{modelValue:s.selectedAddress,"onUpdate:modelValue":t[1]||(t[1]=e=>s.selectedAddress=e),name:"selected-address",value:s.addressType[1],subtitle:s.suggestedAddress},null,8,["modelValue","value","subtitle"]),l("p",Od,c(e.i18nv2("checkoutoverview.address-confirmation-address","Confirm this address ?")),1),l("div",Ld,[l("button",{class:"p-button p-xs-s-full p-ec01-button--xlarge",type:"button",onClick:t[2]||(t[2]=e=>d.backToEdit())},c(e.i18nv2("checkoutoverview.address-confirmation-back-to-edit","Back to editing")),1),l("button",{class:"p-button p-xs-s-full p-ec01-button--xlarge",type:"button",onClick:t[3]||(t[3]=e=>d.confirmAddress())},c(e.i18nv2("cartoverview.age-consent-overlay-confirm","Confirm")),1)])]),_:1},8,["title"])}]]),Bd={name:"InputSearch",components:{InputExtended:$s,VeeForm:R},props:{inputSearch:{type:String,default:void 0},labelValue:{type:String,default:void 0},inputFormat:{type:Object,default:void 0},fieldId:{type:String,default:void 0},isSearchByCityVisible:{type:Boolean},searchByPostCode:{type:Boolean},deliveryMode:{type:Object,default:void 0},hideUseMyLocationLink:{type:Boolean},hideSubmitLink:{type:Boolean}},emits:["on-input","on-search"],data:()=>({isInProgress:!1,internalInputValue:"",invalidState:!1,invalidMessage:""}),computed:{...r("delivery",["isCollectionPointSelected"]),...i("cart",["applicableDeliveryModes"]),...i("config",["payButtonWasClicked"]),inputValue:{get(){return void 0===this.inputSearch?this.internalInputValue:this.inputSearch},set(e){this.showError(!1),void 0!==this.inputSearch?this.$emit("on-input",{isPostCodeChanged:this.searchByPostCode,value:e}):this.internalInputValue=e}},validationSchema(){return this.getValidationSchema([this.inputFormat])}},watch:{payButtonWasClicked(){this.payButtonWasClicked&&(this.$refs.searchForm.validate(),this.isCollectionPointSelected||(this.invalidState=!0,this.invalidMessage=this.i18n("checkoutoverview.collection-point-not-selected")))}},methods:{showError(e,t){this.invalidState=e,this.invalidMessage=t},geoAllowed:()=>(void 0!==navigator.permissions&&navigator.permissions.query({name:"geolocation"}).then(({state:e})=>"denied"!==e),!1),onSearchClick(){!0===this.$refs?.searchForm?.getMeta().valid?(this.$store.dispatch("delivery/updatePupErrorMessageStatus",!1),this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"button:search_PUP"}),this.$emit("on-search",{searchParameterObject:{query:this.inputValue},inputSearchElement:this})):this.$store.dispatch("delivery/updatePupErrorMessageStatus",!0)},onUseMyLocation(){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"PUP:usemylocation"}),this.searchMyLocation()},searchMyLocation(){this.$store.dispatch("delivery/updateOverlayLoading",!0),navigator.geolocation.getCurrentPosition(this.onSuccessSearchMyLocation,this.onErrorSearchMyLocation,{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})},onSuccessSearchMyLocation({coords:e}){this.showPUPOverlay||this.$store.dispatch("delivery/updatePupOverlayStatus",!0),this.$store.dispatch("delivery/updatePupDeliveryMode",this.deliveryMode.id),this.$store.dispatch("delivery/updateShowMorePup",!1),this.$store.dispatch("delivery/resetCollectionPoints").then(()=>{this.$store.dispatch("delivery/getCollectionPoints",{latitude:e.latitude,longitude:e.longitude}).then(()=>{this.$store.dispatch("delivery/updateActivePUPIndex",null),this.$store.dispatch("delivery/updateOverlayLoading",!1)}).catch(e=>{this.$store.dispatch("delivery/updateOverlayLoading",!1);const t=this.applicableDeliveryModes?.length>
21?"checkoutoverview.collection-points-geolocation-error-with-checkout":"checkoutoverview.collection-points-geolocation-error";return this.$store.dispatch("notification/updateErrorNotifications",{title:"checkoutoverview.collection-points-error",text:t,isI18n:!0},{root:!0}),this.$store.dispatch("delivery/updatePupOverlayStatus",!1),console.error(e)})}).catch(e=>{console.log(e)})},onErrorSearchMyLocation(e){switch(e.code){case e.PERMISSION_DENIED:this.$store.dispatch("delivery/updatePermissionDeniedErrorMessageStatus",!0);break;case e.POSITION_UNAVAILABLE:this.$store.dispatch("delivery/updatePositionUnavailableErrorMessageStatus",!0);break;case e.TIMEOUT:this.$store.dispatch("delivery/updateTimeOutErrorMessageStatus",!0);break;default:this.$store.dispatch("updateErrorDetails",{showError:!0})}}}},$d={class:"p-ec01-input-search"},Vd={class:"p-ec01-input-search__box p-grid-item p-one-whole p-m-three-fifths"},Nd={key:0,class:"p-ec01-input-search__link p-grid-item p-one-whole p-m-two-fifths p-m-spacing-top-b p-l-spacing-top-b p-xs-s-hidden"},Rd={type:"submit",class:"p-link-more p-body-copy-01 p-link-style"},Fd={class:"p-ec01-input-search__location p-body-copy-02"};const Ud=yi(Bd,[["render",function(e,t,i,r,s,a){const d=D("input-extended"),u=D("vee-form");return o(),g("section",$d,[y(u,{ref:"searchForm",class:"p-form p-grid","validation-schema":a.validationSchema,onSubmit:t[1]||(t[1]=e=>a.onSearchClick())},{default:n(({errors:r})=>[l("div",Vd,[y(d,{id:i.fieldId,modelValue:a.inputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>a.inputValue=e),"label-text":i.labelValue,"is-float-label":"","is-combine-input":!i.hideSubmitLink,"is-icon-button":!0,"icon-name":"arrow-right","is-in-progress":s.isInProgress,"validate-on-button":i.hideSubmitLink?void 0:a.onSearchClick,"is-icon-desktop":!1,"invalid-state":s.invalidState,"reader-text":e.i18n("checkoutoverview.input-search-link"),autocomplete:"off",error:r[i.inputFormat.name]||s.invalidState&&s.invalidMessage||""},null,8,["id","modelValue","label-text","is-combine-input","is-in-progress","validate-on-button","invalid-state","reader-text","error"])]),i.hideSubmitLink?I("",!0):(o(),g("div",Nd,[l("button",Rd,c(e.i18n("checkoutoverview.input-search-link")),1)]))]),_:1},8,["validation-schema"]),f(l("div",Fd,[l("button",{type:"button",class:"p-link-style",onClick:t[2]||(t[2]=T(e=>a.onUseMyLocation(),["stop","prevent"]))},c(e.i18n("checkoutoverview.input-search-location-title")),1)],512),[[B,a.geoAllowed&&!i.isSearchByCityVisible&&!i.hideUseMyLocationLink]])])}]]),qd={class:"p-ec01-address-item"},Hd={class:"p-ec01-address-item__icon"},jd={class:"p-ec01-address-item__content"},Gd={class:"p-ec01-address-item__title p-heading-04-large p-heading-medium"},Wd={class:"p-ec01-address-item__address p-heading-04 p-heading-book"},zd={key:0,class:"p-ec01-address-item__timing p-heading-04 p-heading-book"},Qd={key:0,class:"p-ec01-address-item__change"},Kd={key:1,class:"p-ec01-address-item__distance p-heading-04-large p-heading-book"},Jd={__name:"CollectionPointItem",props:{collectionPoint:{type:Object,required:!0},isInPupForm:{type:Boolean}},emits:["open-overlay"],setup(e,{emit:t}){const i=e,r=t,{i18n:s}=Ii(),{groupOpeningHours:a}=ht(),n=k(()=>i.collectionPoint?.attributes?.address?.firstName||""),d=k(()=>{const e=i.collectionPoint?.attributes?.address;if(!e)return"";const{line1:t="",houseNumber:r="",town:o=""}=e;return`${`${t} ${r}`.trim()}, ${o}`}),u=k(()=>{const e=i.collectionPoint?.attributes?.distance;return e?.value?`${e.value} ${e.unit}`:""}),p=k(()=>{const e=i.collectionPoint?.attributes?.openingHours;return e?a(e,s):""});return(t,i)=>(o(),g("section",qd,[l("div",Hd,[y(fi,{"icon-name":"marker-2"})]),l("div",jd,[l("div",Gd,c(n.value),1),l("div",Wd,c(d.value),1),p.value?(o(),g("div",zd,c(p.value),1)):I("",!0)]),e.isInPupForm?(o(),g("div",Qd,[l("button",{class:"p-link-style",type:"button",onClick:i[0]||(i[0]=e=>r("open-overlay"))},c(v(s)("checkoutoverview.pup-change-link")),1)])):I("",!0),!e.isInPupForm&&u.value?(o(),g("div",Kd,c(u.value),1)):I("",!0)]))}},Yd={components:{CollectionPointItem:Jd},props:{prefilledBillingAddress:{type:Object,default:()=>({})}},computed:{...i("delivery",["billingAddress","collectionPoints","showMorePup","activePUPIndex"])},methods:{selectCollectionPoint(e,t){this.$store.dispatch("delivery/updateActivePUPIndex",t),this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:e.attributes.distance?`pup_layover:location_${e.attributes.address.town}:distance_${e.attributes.distance.value}${e.attributes.distance.unit}`:`pup_layover:location_${e.attributes.address.town}`}),this.$store.dispatch("delivery/updateSelectedCollectionPoint",e).then(()=>{this.$store.dispatch("delivery/clearPupErrorMessages"),this.$store.dispatch("delivery/updateBillingAddress",{...this.billingAddress,...this.prefilledBillingAddress}),this._emit("addressFormFocusEvent",!0)}).catch(e=>{console.log(e)})},showAllCollectionPoints(){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"pup_layover:show_more"}),this.$store.dispatch("delivery/updateShowMorePup",!0)}}},Zd={key:0,class:"p-ec01-address-items__wrapper"};const Xd=yi(Yd,[["render",function(e,t,i,r,s,n){const l=D("collection-
2point-item");return e.collectionPoints.length>0?(o(),g("section",Zd,[(o(!0),g(S,null,x(e.collectionPoints,(t,i)=>(o(),g(S,{key:`pup-${t.id}`},[i<=24?f((o(),a(l,{key:0,"collection-point":t,class:d({"p-ec01-address--selected":i===e.activePUPIndex}),onClick:e=>n.selectCollectionPoint(t,i)},null,8,["collection-point","class","onClick"])),[[B,i<=3||e.showMorePup]]):I("",!0)],64))),128)),e.collectionPoints.length>4&&!e.showMorePup?(o(),g("button",{key:0,class:"p-link-style p-link-anchor p-body-copy-01",type:"button",onClick:t[0]||(t[0]=e=>n.showAllCollectionPoints())},c(e.i18n("checkoutoverview.collectionpoint-showmore")),1)):I("",!0)])):I("",!0)}]]),eu=[{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#444444"}]},{featureType:"administrative.country",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{weight:"0.40"}]},{featureType:"administrative.country",elementType:"labels.text",stylers:[{visibility:"on"},{saturation:"-40"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#333366"}]},{featureType:"administrative.country",elementType:"labels.text.stroke",stylers:[{hue:"#ff0000"},{visibility:"on"}]},{featureType:"administrative.province",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"administrative.locality",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"administrative.neighborhood",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"administrative.land_parcel",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#ffffff"}]},{featureType:"landscape.man_made",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"landscape.natural",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi",elementType:"all",stylers:[{saturation:-100},{visibility:"on"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45},{weight:"1.25"},{visibility:"on"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"on"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"water",elementType:"all",stylers:[{visibility:"on"},{color:"#dddcdc"}]}];var tu="AIzaSyCiw5ivt_P9RCUh-XTBnBaJPo5b5LytDHM";const iu={class:"p-ec01-map-wrapper"},ru={__name:"CollectionPointMap",setup(e){const t=_(),i=j(),r=C(null),s=C(null),{trackCollectionPointSelection:a}=Xa(),{i18n:n}=Ii(),{groupOpeningHours:c}=ht(),d=k(()=>t.state.delivery.collectionPoints),u=k(()=>t.state.delivery.activePUPIndex),m=()=>{try{if(0===d.value.length)return;const{latitude:e,longitude:t}=d.value[u.value??0].attributes,i=new google.maps.Map(r.value,{zoom:13,center:{lat:e,lng:t},styles:eu,zoomControl:!0,mapTypeControl:!1,scaleControl:!0,streetViewControl:!1,rotateControl:!1,fullscreenControl:!0});h(i)}catch(e){console.error("Error initializing Google Maps:",e)}},h=e=>{const t=new google.maps.InfoWindow,i={path:"M20.5,0C9.2,0,0,9.1,0,20.3c0,13.9,18.3,34.3,19.1,35.1c0.7,0.8,2,0.8,2.7,0C22.7,54.5,41,34.2,41,20.3C41,9.1,31.8,0,20.5,0z M20.5,33C13.6,33,8,27.4,8,20.5S13.6,8,20.5,8S33,13.6,33,20.5S27.4,33,20.5,33z",fillColor:"#0492C2",fillOpacity:.8,strokeWeight:0,rotation:0,scale:.7,anchor:new google.maps.Point(20,50)};for(const[r,o]of d.value.entries()){const s=new google.maps.Marker({map:e,icon:i,title:o.attributes.address.line1,animation:google.maps.Animation.DROP,position:{lat:o.attributes.latitude,lng:o.attributes.longitude}});r===u.value&&(s.icon.fillColor="green"),s.addListener("click",()=>{t.close(),t.setContent(y(o,r)),t.open(e,s)})}},y=(e,t)=>{const{attributes:{address:{firstName:i="",line1:r="",houseNumber:o="",town:a=""}}}=e,l=v(e),c=f(e);return s.value&&document.removeEventListener("click",s.value),s.value=i=>{const r=i.target.closest("[data-index]");r&&r.dataset.index===String(t)&&b(e,t)},document.addEventListener("click",s.value),`\n    <div class="p-ec01-address-item">\n      <div class="p-ec01-address-item__content">\n        <div class="p-ec01-address-item__title p-heading-04-large p-heading-medium">${i}</div>\n        <div class="p-ec01-address-item__address p-heading-04 p-heading-book">${r} ${o}, ${a}</div>\n        ${l}\n        <button data-index="${t}" class="p-body-copy-01 p-link-style">\n          ${n("checkoutoverview.address-overlay-select")}\n        </button>\n      </div>\n      ${c}\n    </div>`},v=e=>e.attributes.openingHours?`<div class="p-ec01-address-item__timing p-heading-04 p-heading-book">\n        ${c(e.attributes.openingHours,n)}\n      </div>`:"",f=e=>e.attributes.distance?.value?`<div class="p-ec01-address-item__distance p-heading-04-large p-heading-book">\n        ${e.attributes.distance.value}\n        ${e.attributes.distance.unit}\n      </div>`:"",b=(e,r)=>{t.dispatch("delivery/updateActivePUPIndex",r),a(i.meta.pagename,e),t.dispatch("delivery/updateSelectedCollectionPoint",e).then(()=>{t.dispatch("delivery/clearPupErrorMessages")}).catch(e=>{console.log(e)})};return p(()=>{(()=>{if(window.google?.maps)m();else{const e=document.createElement("script");
2e.src=`https://maps.googleapis.com/maps/api/js?key=${tu}&libraries=places`,e.addEventListener("load",()=>{m()}),e.addEventListener("error",()=>{console.error("Failed to load Google Maps API")}),document.body.append(e)}})()}),E(()=>{s.value&&document.removeEventListener("click",s.value)}),(e,t)=>(o(),g("div",iu,[l("div",{ref_key:"map",ref:r,class:"p-ec01-map"},null,512)]))}};var ou="AIzaSyCiw5ivt_P9RCUh-XTBnBaJPo5b5LytDHM";const su={name:"InputPlaces",components:{InputSearch:Ud},inheritAttrs:!1,props:{fieldId:{type:String,required:!0},placeTypes:{type:Array,default:()=>["geocode"]},placeholderValue:{type:String,default:void 0},forceToSelectOnlyFromSuggestion:{type:Boolean},deliveryMode:{type:Object,default:void 0},preSelectedLocationName:{type:String,default:""},inputFormat:{type:Object,default:void 0}},emits:["on-place-selection"],computed:{country(){return this.getDefaultConfig("country")||"aa"}},mounted(){if(window.google?.maps)this.initGeoSearchField();else{const e=document.createElement("script"),t=`https://maps.googleapis.com/maps/api/js?key=${ou}&libraries=places&language=${this.getDefaultConfig("language")||"en"}&region=${this.country}`;e.src=t,document.body.append(e),e.addEventListener("load",()=>{this.initGeoSearchField()})}},methods:{initGeoSearchField(){const e=this.$el.querySelector("input"),t=new window.google.maps.places.Autocomplete(e,{types:this.placeTypes,componentRestrictions:{country:this.country}});t.setFields(["geometry","formatted_address"]),t.addListener("place_changed",()=>{const e=t.getPlace();e.geometry&&this.$emit("on-place-selection",{searchParameterObject:{latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()},inputSearchElement:this.$refs.inputSearch,geoSelectedLocationName:e.formatted_address})})},triggerPlaceChange(e){this.forceToSelectOnlyFromSuggestion?this.forceToSelectOnlyFromSuggestion&&this.$refs.inputSearch.showError(!0,this.i18n("checkoutoverview.input-places-choose-suggestion")):this.$emit("on-place-selection",{...e,geoSelectedLocationName:e.searchParameterObject.query})}}};const au={components:{AddressForm:wd,BaseIcon:fi,InputSearch:Ud,Overlay:Vi,CollectionPointItem:Jd,CollectionPointItems:Xd,CollectionPointMap:ru,InputPlaces:yi(su,[["render",function(e,t,i,r,s,n){const l=D("input-search");return o(),a(l,w({ref:"inputSearch","field-id":i.fieldId,"input-search":i.preSelectedLocationName,"label-value":i.placeholderValue||e.i18n("checkoutoverview.input-places-placeholder-generic"),"hide-submit-link":i.forceToSelectOnlyFromSuggestion},e.$attrs,{"input-format":i.inputFormat,"delivery-mode":i.deliveryMode,onOnSearch:t[0]||(t[0]=e=>n.triggerPlaceChange(e))}),null,16,["field-id","input-search","label-value","hide-submit-link","input-format","delivery-mode"])}]]),OverlayAddressButton:nd},props:{deliveryMode:{type:Object,default:void 0},errors:{type:Object,default:void 0}},data:()=>({inputSearch:"",inputCitySearch:"",geoSelectedCoords:null,geoSelectedLocationName:"",hideFilterWithinSelectedLocationField:!1,noCollectionPointsMessage:""}),computed:{...r("delivery",["isBillingAddressHidden","isNovaPoshtaLimitNoticeVisible"]),...r("config",["getDefaultConfig"]),...i("cart",["applicableDeliveryModes"]),...i("config",["collectionPointMap"]),...i("delivery",["collectionPoints","overlayLoading","selectedCollectionPoint","deliveryFormConfiguration","showPermissionDeniedError","showPositionUnavailableError","showPUPOverlay","showTimeOutError","billingFormConfiguration"]),inputFormat(){if(this.deliveryFormConfiguration&&"{}"!==JSON.stringify(this.deliveryFormConfiguration)){return this.deliveryFormConfiguration.find(e=>"postCode"===e.name||"postalCode"===e.name)||{}}return""},inputCityFormat(){if(this.deliveryFormConfiguration&&"{}"!==JSON.stringify(this.deliveryFormConfiguration)){return this.deliveryFormConfiguration.find(e=>"town"===e.name)||{}}return""},isSearchByCityVisible(){return"DPD_COLLECTION_POINT"===this.deliveryMode?.id?.toUpperCase()&&"pl_PL"!==this.getDefaultConfig("localeId")},isSearchByGeoLocation(){return this.isNovaPoshtaCollectionPoint},isNovaPoshtaCollectionPoint(){return"NOVA_POSHTA_COLLECTION_POINT"===this.deliveryMode?.id},prefilledBillingAddress(){if(this.isNovaPoshtaCollectionPoint&&this.selectedCollectionPoint?.attributes?.address){const e=this.selectedCollectionPoint.attributes.address;return function(e,t){const i=JSON.parse(JSON.stringify(e)),r=Object.keys(i);for(const o of r)for(const e of t)if(e.name===o){e.format&&(i[o]=i[o].replaceAll(/[!"#$%&()*+:;<=>?@[\\\]^`{|}~]/g,"")),e.maxLength&&(i[o]=i[o].substring(0,e.maxLength));break}return i}({postalCode:e.postalCode||"01000",line1:e.line1||"",houseNumber:e.houseNumber||"",town:e.town||""},this.billingFormConfiguration)}return null},customAddressFieldConfig(){const e=new Set(["line1","line2","line3","regi
2on","postalCode","houseNumber","town"]);return this.isNovaPoshtaCollectionPoint?this.billingFormConfiguration.map(t=>{const i={...t};return i.name&&e.has(i.name)&&(i.type="hidden"),i}):null}},methods:{updatePupOverlayStatus(e){this.$store.dispatch("delivery/updatePupOverlayStatus",e)},changeSearchInput({isPostCodeChanged:e,value:t}){e?this.inputSearch=t:this.inputCitySearch=t},searchCollectionPoints({searchParameterObject:e,inputSearchElement:t},i){this.$store.dispatch("delivery/updateOverlayLoading",!0),this.isSearchByGeoLocation&&i&&(this.hideFilterWithinSelectedLocationField=!0),this.showPUPOverlay||this.updatePupOverlayStatus(!0),this.$store.dispatch("delivery/updatePupDeliveryMode",this.deliveryMode.id),this.$store.dispatch("delivery/updateShowMorePup",!1),this.$store.dispatch("delivery/resetCollectionPoints").then(()=>{this.$store.dispatch("delivery/getCollectionPoints",e).then(()=>{this.afterSuccessfulCollectionPointsRequest(t)}).catch(e=>{this.afterFailCollectionPointsRequest(e,t)}).finally(()=>{this.$store.dispatch("delivery/updateOverlayLoading",!1)})}).catch(e=>{console.log(e)})},afterSuccessfulCollectionPointsRequest(e){this.$store.dispatch("delivery/updateActivePUPIndex",null),0===this.collectionPoints.length?(this.noCollectionPointsMessage=this.i18n("checkoutoverview.no-collection-points-message"),this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"pup_layover:no_results"})):(this.noCollectionPointsMessage="",this.hideFilterWithinSelectedLocationField=!1),e?.searchByPostCode?this.inputCitySearch="":this.inputSearch=""},afterFailCollectionPointsRequest(e){this.$store.dispatch("delivery/updatePupErrorMessageStatus",!0),this.updatePupOverlayStatus(!1);const t=this.applicableDeliveryModes?.length>1?"checkoutoverview.collection-points-location-error-with-checkout":"checkoutoverview.collection-points-location-error";return this.$store.dispatch("notification/updateErrorNotifications",{title:"checkoutoverview.collection-points-error",text:t,isI18n:!0},{root:!0}),this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"pup_layover:invalid_postcode"}),console.error(e)},onPlaceSelection({inputSearchElement:e,searchParameterObject:t,geoSelectedLocationName:i}){t.latitude&&t.longitude&&(this.geoSelectedCoords=t),this.geoSelectedLocationName=i,this.hideFilterWithinSelectedLocationField=!0,this.searchCollectionPoints({searchParameterObject:t,inputSearchElement:e},!0)},filterCollectionPointsWithinGeoSelectedPlace({searchParameterObject:e,inputSearchElement:t}){this.searchCollectionPoints({searchParameterObject:{...e,...this.geoSelectedCoords},inputSearchElement:t})},changeGeoSelectedLocationName({value:e}){this.geoSelectedLocationName=e}}},nu={class:"p-ec01-pickup-point p-grid"},lu={class:"p-grid-item p-one-whole"},cu={class:"p-ec01-pickup-point__wrapper"},du={class:"p-ec01-pickup-point__title p-heading-04-large p-heading-book"},uu={key:2,class:"p-ec01-pickup-point"},pu={key:3,class:"p-ec01-form__error-msg p-ec01-checkout-input--error"},mu={key:4,class:"p-ec01-form__error-msg p-ec01-checkout-input--error"},hu={key:5,class:"p-ec01-form__error-msg p-ec01-checkout-input--error"},gu={class:"p-spacing-top-c"},yu={key:0,class:"p-ec01-checkout-overview__billing-address p-heading-04-large p-heading-book p-ec01__title"},vu={class:"p-m-hidden p-l-hidden p-heading-04-large p-heading-light"},fu={key:1,class:"p-body-copy-03 p-ec01-form__note-msg pv-margin-block-start--sm"},bu={key:0,class:"p-ec01-form__error-msg p-ec01-checkout-input--error"},Cu={key:1},ku={key:2,class:"p-ec01-overlay-loader"};const _u=yi(au,[["render",function(e,t,i,r,s,d){const u=D("collection-point-item"),p=D("input-places"),m=D("input-search"),h=D("overlay-address-button"),v=D("address-form"),f=D("collection-point-map"),b=D("collection-point-items"),C=D("base-icon"),k=D("overlay");return o(),g("section",nu,[l("div",lu,[l("div",cu,[l("p",du,c(e.i18n("checkoutoverview.pup-title")),1),e.selectedCollectionPoint?.type&&i.deliveryMode?.isCollectionPoint?(o(),a(u,{key:`pup-${e.selectedCollectionPoint.id}
2`,"collection-point":e.selectedCollectionPoint,class:"p-ec01-address--active","is-in-pup-form":"",onOpenOverlay:t[0]||(t[0]=e=>d.updatePupOverlayStatus(!0))},null,8,["collection-point"])):d.isSearchByGeoLocation?(o(),a(p,{key:1,"field-id":"searchCollectionPointByGeoCode","placeholder-value":e.i18n("checkoutoverview.input-places-placeholder-city"),"place-types":["(cities)"],"input-format":d.inputCityFormat||"","force-to-select-only-from-suggestion":"","delivery-mode":i.deliveryMode,"pre-selected-location-name":s.geoSelectedLocationName,onOnPlaceSelection:t[1]||(t[1]=e=>d.onPlaceSelection(e)),onOnInput:t[2]||(t[2]=e=>d.changeGeoSelectedLocationName(e))},null,8,["placeholder-value","input-format","delivery-mode","pre-selected-location-name"])):(o(),g("div",uu,[y(m,{"field-id":d.inputFormat.name,"input-search":s.inputSearch,"label-value":e.i18n("checkoutoverview.input-search-label")||"","input-format":d.inputFormat||"","is-search-by-city-visible":d.isSearchByCityVisible,"search-by-post-code":"","delivery-mode":i.deliveryMode,onOnSearch:t[3]||(t[3]=e=>d.searchCollectionPoints(e)),onOnInput:t[4]||(t[4]=e=>d.changeSearchInput(e))},null,8,["field-id","input-search","label-value","input-format","is-search-by-city-visible","delivery-mode"]),d.isSearchByCityVisible?(o(),a(m,{key:0,class:"pv-margin-block-start--s","field-id":d.inputCityFormat.name,"input-search":s.inputCitySearch,"label-value":e.i18n("checkoutoverview.shipping-city")||"","input-format":d.inputCityFormat||"","is-search-by-city-visible":d.isSearchByCityVisible,"delivery-mode":i.deliveryMode,onOnSearch:t[5]||(t[5]=e=>d.searchCollectionPoints(e)),onOnInput:t[6]||(t[6]=e=>d.changeSearchInput(e))},null,8,["field-id","input-search","label-value","input-format","is-search-by-city-visible","delivery-mode"])):I("",!0)])),e.showPermissionDeniedError?(o(),g("p",pu,c(e.i18n("checkoutoverview.PUP-permission-denied-error-message")),1)):I("",!0),e.showPositionUnavailableError?(o(),g("p",mu,c(e.i18n("checkoutoverview.PUP-position-unavailable-error-message")),1)):I("",!0),e.showTimeOutError?(o(),g("p",hu,c(e.i18n("checkoutoverview.PUP-time-out-error-message")),1)):I("",!0),l("div",gu,[e.isBillingAddressHidden?I("",!0):(o(),g("h3",yu,[O(c(e.i18n("checkoutoverview.billing-address-title"))+" ",1),y(h,{"address-type":"billing","should-show":!d.isNovaPoshtaCollectionPoint},null,8,["should-show"])])),e.isBillingAddressHidden?I("",!0):(o(),a(v,{key:1,"form-type":"billing","custom-address-field-config":d.customAddressFieldConfig,errors:i.errors,"delivery-mode":i.deliveryMode},null,8,["custom-address-field-config","errors","delivery-mode"]))])]),e.showPUPOverlay?(o(),a(k,{key:0,"show-header":"",title:e.i18n("checkoutoverview.overlay-title"),onCloseOverlay:t[14]||(t[14]=e=>d.updatePupOverlayStatus(!1))},{description:n(()=>[l("p",vu,c(e.i18n("checkoutoverview.overlay-sub-title")),1),d.isSearchByGeoLocation?(o(),g(S,{key:0},[y(p,{"field-id":"searchCollectionPointByGeoCodeInsideOverlay","placeholder-value":e.i18n("checkoutoverview.input-places-placeholder-city"),"place-types":["(cities)"],"force-to-select-only-from-suggestion":"","delivery-mode":i.deliveryMode,"input-format":d.inputCityFormat||"","pre-selected-location-name":s.geoSelectedLocationName,onOnPlaceSelection:t[7]||(t[7]=e=>d.onPlaceSelection(e)),onOnInput:t[8]||(t[8]=e=>d.changeGeoSelectedLocationName(e))},null,8,["placeholder-value","delivery-mode","input-format","pre-selected-location-name"]),s.hideFilterWithinSelectedLocationField?I("",!0):(o(),a(m,{key:0,class:"pv-margin-block-start--s","field-id":"filterWithinGeoSelectedPlace","label-value":e.i18n("checkoutoverview.input-search-within-selected-location"),"format-message":e.i18n("checkoutoverview.collection-points-error"),"delivery-mode":i.deliveryMode,"input-format":d.inputCityFormat||"","hide-use-my-location-link":"","allow-empty-search":"",onOnSearch:t[9]||(t[9]=e=>d.filterCollectionPointsWithinGeoSelectedPlace(e))},null,8,["label-value","format-message","delivery-mode","input-format"])),e.isNovaPoshtaLimitNoticeVisible?(o(),g("p",fu,c(e.i18n("checkoutoverview.nova-poshta-limit-notice")),1)):I("",!0),e.overlayLoading?I("",!0):(o(),g(S,{key:2},[e.collectionPointMap?(o(),a(f,{key:0})):(o(),a(b,{key:1,"prefilled-billing-address":d.prefilledBillingAddress},null,8,["prefilled-billing-address"]))],64))],64)):(o(),g(S,{key:1},[y(m,{"field-id":d.inputFormat.name,"input-search":s.inputSearch,"label-value":e.i18n("checkoutoverview.input-search-label")||"","input-format":d.inputFormat||"","is-search-by-city-visible":d.isSearchByCityVisible,"search-by-post-code":"","delivery-mode":i.deliveryMode,onOnSearch:t[10]||(t[10]=e=>d.searchCollectionPoints(e)),onOnInput:t[11]||(t[11]=e=>d.changeSearchInput(e))},null,8,["field-id","input-search","label-value","input-format","is-search-by-city-visible","delivery-mode"]),d.isSearchByCityVisible?(o(),a(m,{key:0,class:"pv-margin-block-start--s","field-id":d.inputCityFormat.name,"input-search":s.inputCitySearch,"label-value":e.i18n("checkoutoverview.shipping-city")||"","input-format":d.inputCityFormat||"","is-search-by-city-visible":d.isSearchByCityVisible,"delivery-mode":i.deliveryMode,onOnSearch:t[12]||(t[12]=e=>d.searchCollectionPoints(e)),onOnInput:t[13]||(t[13]=e=>d.changeSearchInput(e))},null,8,["field-id","input-search","label-value","input-format","is-search-by-city-visible","delivery-mode"])):I("",!0),e.overlayLoading?I("",!0):(o(),g(S,{key:1},[""!==s.noCollectionPointsMessage?(o(),g("div",bu,[l("span",null,c(s.noCollectionPointsMessage),1)])):I("",!0),""===s.noCollectionPointsMessage?(o(),g("div",Cu,[e.collectionPointMap?(o(),a(f,{key:0})):(o(),a(b,{key:1,"prefilled-billing-address":d.prefilledBillingAddress},null,8,["prefilled-billing-address"]))])):I("",!0)],64))],64)),e.overlayLoading?(o(),g("div",ku,[y(C,{"class-name":"p-heading-02-small p-heading-light p-ec01-loader--animation p-ec01-base-icon__rotate-cw",tag:"span","icon-name":"rotate-cw"})])):I("",!0)]),_:1},8,["title"])):I("",!0)])])}]]),Iu={components:{CheckboxExtended:ad},data:()=>({companyFields:null,initialValues:[]}),computed:{...i("config",["isBusinessFlagEnabled"]),...i("delivery",["re
2ceiptOrEInvoice"])},created(){this.initialValues=[this.receiptOrEInvoice?this.i18n("checkoutoverview.company-fields-invoice"):this.i18n("checkoutoverview.company-fields-receipt")],this.companyFields={columns:[8,8,8,8],name:"typeCode",type:"radio",label:"Type",placeholderText:"",mandatory:!1,format:"",formatError:"",options:[{key:this.i18n("checkoutoverview.company-fields-receipt"),value:this.i18n("checkoutoverview.company-fields-receipt")},{key:this.i18n("checkoutoverview.company-fields-invoice"),value:this.i18n("checkoutoverview.company-fields-invoice")}]}},methods:{updateTitle(e){this.initialValues=e,e[0]===this.i18n("checkoutoverview.company-fields-receipt")&&(this.$store.dispatch("delivery/updateReceiptOrEInvoice",!1),this.$store.dispatch("delivery/updateSameAsDelivery",!0)),e[0]===this.i18n("checkoutoverview.company-fields-invoice")&&(this.$store.dispatch("delivery/updateReceiptOrEInvoice",!0),this.$store.dispatch("delivery/updateSameAsDelivery",!1))}}},Pu={key:0,class:"p-ec01-checkout-overview__company_fields_wrapper"},Au={class:"p-ec01-checkout-overview__company_fields"};const wu={components:{InputListOption:Cc,AddressForm:wd,NotificationBar:$n,PickupPoint:_u,CompanyFields:yi(Iu,[["render",function(e,t,i,r,s,a){const n=D("checkbox-extended");return e.isBusinessFlagEnabled?(o(),g("section",Pu,[l("div",Au,[y(n,{id:"delivery-typeCode","initial-values":s.initialValues,"form-type":"delivery","form-field":s.companyFields,"single-multiple":"single-selected",onTitleSelected:t[0]||(t[0]=e=>a.updateTitle(e))},null,8,["initial-values","form-field"])])])):I("",!0)}]]),OverlayAddressConfirmation:Md,OverlayAddressButton:nd},props:{formFields:{type:Object,default:void 0},isWalletFormOverlay:{type:Boolean},isCheckoutOptionsDisabled:{type:Boolean},stepText:{type:String,default:""}},emits:["is-address-validated"],setup(){const{trackDeliveryMethodSelection:e,trackAddressVerificationError:t,trackPreciselyError:i}=Xa();return{trackDeliveryMethodSelection:e,trackAddressVerificationError:t,trackPreciselyError:i}},data:()=>({validateAddress:{},subscriptionBackupFormFieldsData:{},isConfirmAddressFlag:!1,addressValidationDataObject:{},isCheckTypeAhead:!1,mandatoryFieldsQuantity:0,invalidFieldsQuantity:0,checkFocusEventViaAddressConfirmationPopup:!1,isAddressValidated:!1}),computed:{...r("delivery",["isBillingAddressHidden","addressType","selectedDeliveryMode"]),...r("notification",["findIndexByText","getAddressNotifications"]),...i("payments",["link2PayEnabled"]),...i("config",["isLoggedIn"]),...i("notification",["errorNotifications"]),...i("cart",["cartSummary","sellerGroupItems","existingSubscriber","isSubscriptionApplicable"]),...i("delivery",["deliveryFormConfiguration","billingFormConfiguration","deliveryAddress","billingAddress","selectedCommerceDeliveryAddress","receiptOrEInvoice"]),...i({deliveryModes:e=>e.cart.applicableDeliveryModes}),selectedDeliveryModeId:{get(){return this.$store.state.delivery.selectedDeliveryModeId},set(e){this.updateSelectedDeliveryModeId(e)}},formConfig(){return""===this.addressType?{}:"delivery"===this.addressType?this.deliveryFormConfiguration:this.billingFormConfiguration},selectedAddressType(){return""===this.addressType?{}:"delivery"===this.addressType?this.deliveryAddress:this.billingAddress},applicableDeliveryModes(){return this.isWalletFormOverlay?[this.deliveryModes.find(e=>!e.isCollectionPoint)]:this.deliveryModes}},watch:{formFields:{handler(){this.watchFormFields()},deep:!0}},created(){this.verifyAddressDebounced=this._debounce(this.verifyAddressDebounced,1e3)},beforeUnmount(){this.verifyAddressDebounced.cancel(),this._off("addressFormFocusEvent",this.addressFormFocusEvent)},mounted(){const e={"delivery-method":e=>Boolean(e)||this.i18n("checkoutoverview.shipping-required-error-message")};this.$store.dispatch("config/updateValidationSchema",e),this.isWalletFormOverlay?(this.updateSelectedDeliveryModeId(this.applicableDeliveryModes[0].id),this.$nextTick().then(()=>{this.$store.dispatch("payments/updateIsPayButtonDisabled",!0),this.verifyAddressDebounced()})):this.link2PayEnabled?this.updateSelectedDeliveryModeId(this.applicableDeliveryModes[0].id):this.isLoggedIn&&this.$store.dispatch("cart/getAddresses",this),this._on("addressFormFocusEvent",this.addressFormFocusEvent)},methods:{updateSelectedDeliveryModeId(e){this.$store.dispatch("delivery/updateSelectedDeliveryModeId",e)},watchFormFields(){if(this.existingSubscriber&&this.isSubscriptionApplicable&&this.verifyExistingSubscriber(),this.calculateInvalidMandatoryFields(),"{}"!==JSON.stringify(this.formConfig)){for(const e of this.formConfig)""!==this.selectedAddressType[e.
2name]&&(this.validateAddress[e.name]=this.selectedAddressType?this.selectedAddressType[e.name]:"","region"===e.name&&(this.validateAddress[e.name]={isocode:this.selectedAddressType?.[e.name]||""}),"country"===e.name&&(this.validateAddress[e.name]="selectBox"===e.type?{isocode:this.getBillingCountry(e)?.key||this.country||"",name:this.getBillingCountry(e)?.value||""}:{isocode:this.selectedAddressType?.isoCode||this.country||"",name:this.selectedAddressType?.[e.name]||""}));if(!this.receiptOrEInvoice){const{companyName:e,...t}=this.validateAddress;this.validateAddress=t}}},getBillingCountry(e){return this.billingFormConfiguration.find(e=>"country"===e.name).options.find(t=>t.key===this.selectedAddressType?.[e.name])||{}},analyticsOnLoad(){if(this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","delivery",this.cartItems,"complete-order",this.selectedDeliveryModeId),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[e,t]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","delivery",t,e,this.selectedDeliveryModeId)},isConfirmAddressCheck(e){this.isConfirmAddressFlag=e,this.checkFocusEventViaAddressConfirmationPopup=!0,this.handleAddressValidationData(this.addressValidationDataObject.resultData,e)},confirmValidatedAddress(e){this.isConfirmAddressFlag=!1,this.checkFocusEventViaAddressConfirmationPopup=!0,this.handleAddressValidationData(this.addressValidationDataObject.resultData,e)},isTypeAheadCheck(e){this.isCheckTypeAhead=e},verifyExistingSubscriber(){if(!this.selectedCommerceDeliveryAddress.defaultAddress)for(const e of this.formConfig)"country"!==e.name&&"region"!==e.name&&this.deliveryAddress?.[e.name]&&this.verifyExistingSubscriberNotification();if(this.selectedCommerceDeliveryAddress.defaultAddress){0===Object.keys(this.subscriptionBackupFormFieldsData).length&&(this.subscriptionBackupFormFieldsData=this.deliveryAddress);for(const e of this.formConfig)if(this.subscriptionBackupFormFieldsData[e.name]!==this.deliveryAddress?.[e.name]){this.verifyExistingSubscriberNotification();break}}},verifyExistingSubscriberNotification(){this.$store.dispatch("notification/updateErrorNotifications",{text:`${this.i18n("checkoutoverview.subscription-existing-customer-alert")} (9030)`})},addressFormFocusEvent(e){this.watchFormFields();const t=!this.checkFocusEventViaAddressConfirmationPopup&&e;this.checkFocusEventViaAddressConfirmationPopup=!1,t&&(this.$store.dispatch("payments/updateIsPayButtonPartialDisabled",!0),setTimeout(()=>{this.addressVerificationAPICall()},100))},addressVerificationAPICall(){this.$store.dispatch("payments/updateIsPayButtonPartialDisabled",!1),this.isAddressValidated&&!this.isCheckTypeAhead&&(this.$store.dispatch("payments/updateIsPayButtonDisabled",!0),this.verifyAddressDebounced())},verifyAddressDebounced(){this.verifyAddress(),this.$store.dispatch("config/updateIsAddressError",!1)},verifyAddress(){tt({type:"commerceAddress",attributes:{type:this.addressType,address:this.validateAddress,...this.receiptOrEInvoice&&{entityType:"legalPerson"}}}).then(e=>{const t=e?.data?.data?.attributes;let i=!1;if(t)if(t.isChanged&&!t.autoUpdateAddress){for(const e of Object.entries(this.validateAddress))"country"!==e[0]&&this.validateAddress[e[0]]!==t[e[0]]&&(i=!0);i&&(this.addressValidationDataObject.resultData=t,this.addressValidationDataObject.validateAddress=this.validateAddress,this.addressValidationDataObject[`${this.addressType}Address`]=this.selectedAddressType,this.isConfirmAddressFlag=!0)}else this.handleAddressValidationData(t)}).catch(e=>{console.error(`Error ${e}`),this.$store.dispatch("config/updateIsAddressError",!0),this.addressValidationErrorNotification(e?.response?.data?.errors[0]?.title||this.i18n("error.page-title")),this.trackAddressVerificationError(e?.response?.data?.errors[0]?.title||this.i18n("error.page-title"))})},handleAddressValidationData(e,t=!1){const i={...this.selectedAddressType};if(t||e.autoUpdateAddress)for(const o of Object.entries(this.validateAddress))if("country"!==o[0]){const t=this.selectedAddressType[o[0]]||"";i[o[0]]="region"===o[0]?e[o[0]].isocode||t:e[o[0]]||t}if(e?.mandatoryChecksPassed){if(!e.optionalChecksPassed&&e.errors?.addressErrors.length>0)for(const t of Object.entries(e.errors?.addressErrors))this.addressValidationErrorNotification(t[1]?.error);else this.removeAddressNotifications(e.addressType);this.$store.dispatch("payments/updateIsPayButtonDisabled",!1)}else if(!e.mandatoryChecksPassed){if(!e.optionalChecksPassed&&e.errors?.addressErrors)for(const t of Object.entries(e.errors.addressErrors))this.addressValidationErrorNotification(t[1]?.error);this.addressValidationErrorNotification(this.i18n("cartoverview.undeliverable-address-error"));for(const t of Object.entries(this.validateAddress))"country"!==t[0]&&"region"!==t[0]&&(i[t[0]]||=e[t[0]]||"");this.$store.dispatch("config/updateIsAddressError",!0),this.updateServerAddressErrors(e.errors.addressFieldErrors)}const r="delivery"===this.addressType?"delivery/updateDeliveryAddress":"delivery/updateBillingAddress";this.$store.dispatch(r,i)},updateServerAddressErrors(e){const t=e.reduce((e,t)=>
2(this.addressType&&t.field&&(e[`${this.addressType}-${t.field}`]=t.error),e),{});this.$store.dispatch("delivery/updateServerAddressErrors",t)},onOptionSelect(e,t){this.analyticsOnLoad(),this.$store.dispatch("delivery/clearPupErrorMessages"),this.$store.dispatch("delivery/updateDeliveryMode",{deliveryMode:e.id}),this.$store.dispatch("delivery/resetCollectionPoints"),this.$store.dispatch("config/updateIsAddressError",!1),this.$store.dispatch("notification/removeByText",this.i18n("cartoverview.undeliverable-address-error")),setTimeout(()=>{this.addressVerificationAPICall()},100),this.trackDeliveryMethodSelection(this.$route.meta.pagename,e.id),t&&this.$nextTick().then(()=>{const e=document.querySelector(".p-ec01-delivery-mode .p-ec01-input-list-option--selected");null!==e&&e.scrollIntoView({behavior:"smooth"})})},addressValidationErrorNotification(e){this.$store.dispatch("notification/updateErrorNotifications",{text:e,location:"AddressForm"}),this.trackPreciselyError(e)},removeAddressNotifications(e){let t;"P"!==e&&"M"!==e||(t=this.findIndexByText(this.i18n("cartoverview.military-address-error")));for(const[i,r]of this.errorNotifications.entries())"AddressForm"===r.location&&i!==t&&this.$store.commit("notification/removeErrorNotifications",i)},calculateInvalidMandatoryFields(){if(this.mandatoryFieldsQuantity=0,this.invalidFieldsQuantity=0,"{}"!==JSON.stringify(this.selectedDeliveryMode)){for(const e of this.formConfig)if(e.mandatory&&!["companyName","taxNumber"].includes(e.name)){this.mandatoryFieldsQuantity++;const t=this.selectedDeliveryMode?.isCollectionPoint?`billing-${e.name}`:`delivery-${e.name}`;(this.formFields[t]||""===this.selectedAddressType[e.name])&&this.invalidFieldsQuantity++}this.isAddressValidated=0===this.invalidFieldsQuantity&&this.mandatoryFieldsQuantity>0,this.$emit("is-address-validated",this.isAddressValidated)}}}},Su={class:"p-ec01-delivery-method p-ec01-delivery-mode p-spacing-top-c"},xu={class:"p-heading-light"},Eu={key:1,class:"p-ec01-form__error-msg p-margin-none p-spacing-top-b p-spacing-bottom-a"},Tu={class:"p-spacing-top-a"},Du={class:"p-heading-04-large p-heading-book p-ec01__title"},Ou={key:0,class:"p-spacing-top-a"},Lu={class:"p-ec01-checkout-overview__billing-address p-heading-04-large p-heading-book p-ec01__title"};const Mu=yi(wu,[["render",function(e,t,i,r,s,u){const p=D("overlay-address-confirmation"),m=D("company-fields"),h=D("overlay-address-button"),v=D("notification-bar"),f=D("address-form"),b=D("pickup-point"),C=D("input-list-option");return o(),g("section",Su,[s.isConfirmAddressFlag?(o(),a(p,{key:0,"address-validation-data-object":s.addressValidationDataObject,onIsConfirmAddressCheck:t[0]||(t[0]=e=>u.isConfirmAddressCheck(e)),onConfirmValidatedAddress:t[1]||(t[1]=e=>u.confirmValidatedAddress(e))},null,8,["address-validation-data-object"])):I("",!0),l("h3",{class:d(["p-heading-03 p-ec01__title",{"p-margin-none":i.formFields["delivery-method"]}])},[O(c(i.stepText)+" ",1),l("span",xu," - "+c(e.i18n("checkoutoverview.shipping-title")),1)],2),i.formFields["delivery-method"]?(o(),g("p",Eu,c(i.formFields["delivery-method"]),1)):I("",!0),(o(!0),g(S,null,x(u.applicableDeliveryModes,r=>(o(),a(C,{key:r.id,modelValue:u.selectedDeliveryModeId,"onUpdate:modelValue":t[3]||(t[3]=e=>
2u.selectedDeliveryModeId=e),name:"delivery-method",value:r.id,title:r.label,subtitle:r.description,disabled:i.isCheckoutOptionsDisabled,class:d({"p-ec01-checkout-input--error":i.formFields["delivery-method"]}),onChange:e=>u.onOptionSelect(r,!0)},{aside:n(()=>[l("div",{class:d(["p-body-copy-01 p-bold",0===r.deliveryCost.value||r.id===u.selectedDeliveryModeId&&0===e.cartSummary.totalDelivery.value?"p-text-accent":null])},c(0===r.deliveryCost.value||r.id===u.selectedDeliveryModeId&&0===e.cartSummary.totalDelivery.value?e.i18n("generic.free"):e.getFormattedPrice(r.deliveryCost)),3)]),inlineContent:n(()=>[r.isCollectionPoint?I("",!0):(o(),g(S,{key:0},[y(m,{"delivery-mode":r},null,8,["delivery-mode"]),l("div",Tu,[l("h3",Du,[O(c(e.i18n("checkoutoverview.shipping-address-title"))+" ",1),y(h,{"address-type":"delivery","should-show":""})]),e.getAddressNotifications.length>0?(o(),a(v,{key:0,"error-notifications":e.getAddressNotifications},null,8,["error-notifications"])):I("",!0),y(f,{"form-type":"delivery","delivery-mode":r,errors:i.formFields,onIsTypeAheadCheck:t[2]||(t[2]=e=>u.isTypeAheadCheck(e))},null,8,["delivery-mode","errors"])]),e.isBillingAddressHidden?I("",!0):(o(),g("div",Ou,[l("h3",Lu,c(e.i18n("checkoutoverview.billing-address-title")),1),y(f,{"form-type":"billing",errors:i.formFields,"delivery-mode":r,"is-additional-address":""},null,8,["errors","delivery-mode"])]))],64)),r.isCollectionPoint?(o(),g(S,{key:1},[e.getAddressNotifications.length>0?(o(),a(v,{key:0,"error-notifications":e.getAddressNotifications},null,8,["error-notifications"])):I("",!0),e.link2PayEnabled?I("",!0):(o(),a(m,{key:1,"delivery-mode":r},null,8,["delivery-mode"])),y(b,{"delivery-mode":r,errors:i.formFields},null,8,["delivery-mode","errors"])],64)):I("",!0)]),_:2},1032,["modelValue","value","title","subtitle","disabled","class","onChange"]))),128))])}]]);function Bu(e=1e6){return Math.floor(Math.random()*e)}const $u={components:{InputListOption:Cc,CustomCard:q(()=>ie(()=>import("./CustomCard-jNjX-aFM.js"),__vite__mapDeps([10,1,3,4,11])).catch(()=>{})),Ideal:q(()=>ie(()=>import("./Ideal-BJBUp5p1.js"),__vite__mapDeps([12,1,3,4,13]))),OnlineBanking:q(()=>ie(()=>import("./OnlineBanking-C1gcCZYy.js"),__vite__mapDeps([14,1,3,4,13]))),Vipps:q(()=>ie(()=>import("./Vipps-DBNDfy--.js"),__vite__mapDeps([15,1,3,4]))),Blik:q(()=>ie(()=>import("./Blik-DohcEqax.js"),__vite__mapDeps([16,1,3,4]))),PayU:q(()=>ie(()=>import("./PayU-DGYrgByL.js"),__vite__mapDeps([17,1,3,4,18]))),MBWayPayment:q(()=>ie(()=>import("./MBWayPayment-DgED1TTu.js"),__vite__mapDeps([19,1,3,4,20])))},mixins:[gi],props:{isCheckoutOptionsDisabled:{type:Boolean},stepText:{type:String,default:""},errors:{type:Object,default:void 0}},setup(){const{trackPaymentMethodSelection:e}=Xa();return{trackPaymentMethodSelection:e}},data:()=>({inlinePaymentKey:Bu()}),computed:{...i("payments",["applicablePaymentMethods"]),...i("cart",["sellerGroupItems","isSubscriptionApplicable"]),selectedPaymentMethodId:{get(){return this.$store.state.payments.selectedPaymentMethodId},set(e){this.$store.dispatch("payments/updateSelectedPaymentMethodId",e)}},formattedPaymentMethodId(){return this.selectedPaymentMethodId?this.selectedPaymentMethodId.replace("-","_"):""},showIdealSubscriptionNotice(){return"IDEAL2-SSL"===this.selectedPaymentMethodId&&this.isSubscriptionApplicable&&!this.isTotal}},created(){this._on("reset-payment-component-data",this.reRenderComponent)},mounted(){const e={"payment-method":e=>Boolean(e)||this.i18n("checkoutoverview.payment-required-error-message")};this.$store.dispatch("config/updateValidationSchema",e)},unmounted(){this._off("reset-payment-component-data",this.reRenderComponent)},methods:{reRenderComponent(){this.inlinePaymentKey=Bu()},analyticsOnLoad(){if(this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","payment",this.cartItems,"complete-order",this.formattedPaymentMethodId),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[e,t]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","payment",t,e,this.formattedPaymentMethodId)},onOptionSelect(){this.$store.dispatch("payments/updateOtherPaymentSelected",!0),this.trackPaymentMethodSelection(this.$route.meta.pagename,this.formattedPaymentMethodId),this.analyticsOnLoad()}}},Vu={class:"p-ec01-payment-method p-spacing-top-c"},Nu={class:"p-heading-light"},Ru={key:0,class:"p-ec01-form__error-msg p-margin-none p-spacing-top-b p-spacing-bottom-a"},Fu=["src","alt"],Uu={key:0,class:"p-ec01-payment-method__ideal-notice"};const qu=yi($u,[["render",function(e,t,i,r,s,u){const p=D("custom-card"),m=D("ideal"),h=D("online-banking"),y=D("vipps"),v=D("blik"),f=D("pay-u"),b=D("m-b-way-payment"),C=D("input-list-option");return o(),g("section",Vu,[l("h3",{class:d(["p-heading-03 p-ec01__title",{"p-margin-none":i.errors["payment-method"]}])},[O(c(i.stepText)+" ",1),l("span",Nu," - "+c(e.i18n("checkoutoverview.payment-method-title")),1)],2),i.errors["payment-method"]?(o(),g("p",Ru,c(i.errors["payment-method"]),1)):I("",!0),(o(!0),g(S,null,x(e.applicablePaymentMethods,r=>(o(),a(C,{key:r.id,modelValue:u.selectedPaymentMethodId,"onUpdate:modelValue":t[0]||(t[0]=e=>u.selectedPaymentMethodId=e),disabled:r.id!==u.selectedPaymentMethodId&&i.isCheckoutOptionsDisabled,class:d({"p-ec01-checkout-input--error":i.errors["payment-method"]}
2),name:"payment-method",value:r.id,title:r.label,onChange:t[1]||(t[1]=e=>u.onOptionSelect())},Q({aside:n(()=>["pay_with_iyzico"!==r?.pspPaymentMethod?.toLowerCase()?(o(),g("img",{key:0,src:r.icon,alt:r.label,class:"p-ec01-input-list-option__aside-payment-logo",loading:"lazy"},null,8,Fu)):I("",!0)]),_:2},[r.isInline&&r.id===u.selectedPaymentMethodId?{name:"inlineContent",fn:n(()=>[(o(),g("section",{key:s.inlinePaymentKey},[u.showIdealSubscriptionNotice?(o(),g("div",Uu,c(e.i18n("cartoverview.ideal-subscription-payment-message")),1)):I("",!0),r.isApm?"ideal"===r.pspPaymentMethod&&"IDEAL2-SSL"!==r.id?(o(),a(m,{key:2,"payment-method":r},null,8,["payment-method"])):"dotpay"===r.pspPaymentMethod||"onlineBanking_PL"===r.pspPaymentMethod||"onlineBanking_CZ"===r.pspPaymentMethod?(o(),a(h,{key:3,"payment-method":r},null,8,["payment-method"])):"vipps"===r.pspPaymentMethod?(o(),a(y,{key:4})):"blik"===r.pspPaymentMethod?(o(),a(v,{key:5})):"pay_with_iyzico"===r.pspPaymentMethod?(o(),a(f,{key:6})):"mbway"===r.pspPaymentMethod?(o(),a(b,{key:7})):I("",!0):(o(),a(p,{key:1,brands:[r.pspPaymentMethod]},null,8,["brands"]))]))]),key:"0"}:void 0]),1032,["modelValue","disabled","class","value","title"]))),128))])}]]),Hu={components:{Scene7Image:Di,Wrapper:Si},mixins:[gi,Hr],computed:{...i("config",["isMicrositeId"]),subscriptionBundledItem(){return jr(this.bundle)}}},ju={class:"p-ec01-order-summary__item-wrapper p-ec01-order-summary__bundle p-ec01-order-summary__item--bundle-subscription"},Gu={key:0,class:"p-ec01-order-summary__bundle-content"},Wu={class:"p-ec01-order-summary__item-details p-ec01-order-summary__item--bundled-item p-heading-04-large p-spacing-bottom-a"},zu={class:"p-ec01-order-summary__item"},Qu={class:"p-ec01-order-summary__item-thumbnail"},Ku={class:"p-ec01-order-summary__item-details-wrapper"},Ju={class:"p-ec01-order-summary__item-details"},Yu={class:"p-heading-04 p-heading-book"},Zu={class:"p-ec01-order-summary__item p-ec01-order-summary__item--bundle-summary"},Xu={key:0,class:"p-heading-04 p-ec01-order-summary__item-qty"},ep={class:"p-heading-book"},tp={class:"p-ec01-order-summary__item-price"},ip={class:"p-ec01-order-summary__item-price-current text-bold"},rp={class:"p-ec01-order-summary__item--bundle-summary-middle p-body-copy-02 p-ec01__payment-date"},op={class:"p-ec01-order-summary__item--bundle-summary-bottom p-spacing-top-a"},sp={class:"p-body-copy-02 p-ec01-order-summary__item-qty p-ec01__payment-date"},ap={class:"p-ec01-order-summary__item-price-current p-bold"};
2const np={components:{BundledItems:qr,Scene7Image:Di,SubscriptionBundleSummary:yi(Hu,[["render",function(e,t,i,r,s,a){const u=D("scene7-image"),p=D("wrapper");return o(),g("section",ju,[e.isSubscriptionBundle(e.bundle)?(o(),g("div",Gu,[l("h2",Wu,c(e.displayTitle(e.bundle,e.product(e.item.itemId).subcatCode)),1),l("div",zu,[l("div",Qu,[y(p,{wrap:Boolean(e.product(e.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",href:e.product(e.item.itemId).productURL,class:"p-ec01-order-summary__item-link",onClick:t[0]||(t[0]=t=>e.productClickHandler(t,{itemId:e.item.itemId,from:"image"}))},{default:n(()=>[y(u,{url:e.item.image,alt:e.product(e.item.itemId).productTitle||e.item.itemId,class:"p-picture"},null,8,["url","alt"])]),_:1},8,["wrap","href"])]),l("div",Ku,[l("h2",Ju,[y(p,{wrap:Boolean(e.product(e.item.itemId).productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-order-summary__item-details-title-link",href:e.product(e.item.itemId).productURL,onClick:t[1]||(t[1]=t=>e.productClickHandler(t,{itemId:e.item.itemId,from:"title"}))},{default:n(()=>[l("p",Yu,[O(c(e.product(e.item.itemId).descriptor||e.product(e.item.itemId).familyName||e.item.itemId)+" ",1),"BUNDLED"===e.bundle.subscriptionBundleType?(o(),g(S,{key:0},[O(" + "+c(e.product(e.subItem.itemId).descriptor||e.product(e.subItem.itemId).familyName||e.subItem.itemId),1)],64)):I("",!0)])]),_:1},8,["wrap","href"])])])])])):I("",!0),l("div",Zu,[l("div",{class:d(["p-ec01-order-summary__item--bundle-summary-top",{"p-ec01-order-summary__item--noqty":e.quantity<=1}])},[e.quantity>1?(o(),g("p",Xu,[O(c(e.i18n("cartsummary.quantity-short"))+": ",1),l("span",ep,c(e.quantity),1)])):I("",!0),l("div",tp,[l("p",ip,c(e.getFormattedPrice({value:a.subscriptionBundledItem.initialPrice*e.quantity})),1)])],2),l("p",rp,c(e.i18n("cartoverview.subscription-first-payment")),1),l("div",op,[l("p",sp,c(1===e.bundle.billingPeriodInMonths?e.i18n("cartoverview.subscription-frequency-text-medium-one-month"):e.i18n("cartoverview.subscription-frequency-text-medium",[e.bundle.billingPeriodInMonths])),1),l("p",ap,c(e.getFormattedPrice({value:a.subscriptionBundledItem.recurringPrice*e.quantity})),1)])])])}]]),Wrapper:Si,SellerInfo:Yi,PhSellerInfo:Wo,CartSummary:ma},mixins:[gi],props:{calledFrom:{type:String,default:"checkout"}},computed:{...r("cart",["getProductByCtn"]),...r("promotions",["getPrice","getQuantity"]),...r("bundles",["getBundleWithId"]),...i("config",["showPHSellerInfo","isMicrositeId"]),...i({items(e){return e.cart.items.map(e=>({...e,product:this.getProductByCtn(e.itemId),...e.isSingleItem&&{productPrice:this.getPriceObject(e)}}))}})},methods:{}},lp={key:0,class:"p-ec01-minicart-title"},cp={class:"p-ec01-order-summary__items"},dp={key:1,class:"p-ec01-order-summary__item-wrapper p-ec01-order-summary__individual"},up={class:"p-ec01-order-summary__item"},pp={class:"p-ec01-order-summary__item-thumbnail"},mp={key:0,class:"promo-label"},hp={class:"p-ec01-order-summary__item-details-wrapper"},gp={class:"p-ec01-order-summary__item-details-wrapper-top"},yp={class:"p-ec01-order-summary__item-details"},vp={key:0,class:"p-heading-04 p-ec01-order-summary__item-qty"},fp={class:"p-heading-book"},bp={class:"p-ec01-order-summary__item-price"},Cp={class:"p-ec01-order-summary__item-price-current"};const kp=yi(np,[["render",function(e,t,i,r,s,u){const p=D("bundled-items"),m=D("scene7-image"),h=D("wrapper"),v=D("seller-info"),f=D("ph-seller-info"),b=D("subscription-bundle-summary"),C=D("cart-summary");return o(),g("section",{class:d(["p-ec01-order-summary",{"p-ec01-order-summary--minicart":"minicart"===i.calledFrom}])},["minicart"===i.calledFrom?(o(),g("h3",lp,c(e.i18n("cartoverview.page-title")),1)):I("",!0),l("div",cp,[(o(!0),g(S,null,x(e.items,t=>(o(),g(S,{key:t.itemId},[t.bundleId?I("",!0):(o(),g(S,{key:0},[t.isBundle?(o(),a(p,{key:0,items:t.bundle,"is-order-summary":""},null,8,["items"])):I("",!0),t.isSingleItem?(o(),g("div",dp,[l("div",up,[l("div",pp,[y(h,{wrap:Boolean(t.product.productURL)&&!e.isMicrositeId,tag:"a",href:t.product.productURL,class:"p-ec01-order-summary__item-link",onClick:i=>e.productClickHandler(i,{itemId:t.itemId,from:"image"})},{default:n(()=>[y(m,{url:t.image,alt:t.product.productTitle||t.itemId,class:"p-picture"},null,8,["url","alt"]),t.productPrice.discount?(o(),g("div",mp,c(`- ${t.productPrice.discount}`),1)):I("",!0)]),_:2},1032,["wrap","href","onClick"])]),l("div",hp,[l("div",gp,[l("h2",yp,[y(h,{wrap:Boolean(t.product.productURL)&&!e.isMicrositeId,tag:"a",class:"p-ec01-order-summary__item-details-title-link",href:t.product.productURL,onClick:i=>e.productClickHandler(i,{itemId:t.itemId,from:"title"})},{default:n(()=>[l("p",{class:d(["p-heading-04 p-heading-book",{"p-margin-none":t.sellerId&&t.sellerName||e.showPHSellerInfo}])},c(t.product.descriptor||t.product.familyName||t.itemId),3)]),_:2},1032,["wrap","href","onClick"]),t.sellerName&&t.sellerId?(o(),a(v,{key:0,"seller-name":t.sellerName,"seller-id":t.sellerId},null,8,["seller-name","seller-id"])):(o(),a(f,{key:1}))])]),l("div",{class:d(["p-ec01-order-summary__item-details-wrapper-bottom",{"p-ec01-order-summary__item--noqty":e.getQuantity(t)<=1}])},[e.getQuantity(t)>
21?(o(),g("p",vp,[O(c(e.i18n("cartsummary.quantity-short"))+": ",1),l("span",fp,c(e.getQuantity(t)),1)])):I("",!0),l("div",bp,[l("p",Cp,c(e.getFormattedPrice({value:e.getPrice(t)})),1)])],2)])])])):I("",!0)],64)),t.bundleId&&"SUBSCRIPTION"===t.bundleType&&t.isRenderingReference?(o(),a(b,{key:1,"bundle-id":t.bundleId,items:e.getBundleWithId(t.bundleId)},null,8,["bundle-id","items"])):I("",!0)],64))),128))]),y(C)],2)}]]),_p={data:()=>({}),computed:{...r("config",["getDefaultConfig"]),sessionUrl(){return this.getDefaultConfig("sessionUrl")},logoutUrl(){return this.getDefaultConfig("logoutUrl")||this.getDefaultConfig("checkoutUrl")}},methods:{onStayLoggedIn(){this.$store.dispatch("delivery/updateLogoutOverlayStatus",!1)},onLogout(){this.trackConversion({name:"interaction",pagename:this.$route.meta.pagename,description:"link:logout"})}}},Ip={class:"p-ec01-logout"},Pp={class:"p-heading-04-large p-heading-light"},Ap={class:"p-ec01-logout__button"},wp=["href"];const Sp=yi(_p,[["render",function(e,t,i,r,s,a){return o(),g("section",Ip,[l("p",Pp,c(e.i18n("checkoutoverview.overlay-logout-sub-title")),1),l("div",Ap,[l("button",{type:"button",class:"p-ec01-logout__button-stay p-button p-large",onClick:t[0]||(t[0]=e=>a.onStayLoggedIn())},c(e.i18n("checkoutoverview.overlay-logout-button-stayloggedin")),1),l("a",{class:"p-ec01-logout__button-logout p-button p-button-secondary p-large",href:`${a.sessionUrl}/logout?redirectUrl=${encodeURIComponent(a.logoutUrl)}&redirectErrorUrl=${encodeURIComponent(`${a.logoutUrl}?loggedout=error`)}`,onClick:t[1]||(t[1]=e=>a.onLogout())},c(e.i18n("checkoutoverview.overlay-logout-button-logout")),9,wp)])])}]]),xp={class:"p-ec01-user-details"},Ep={class:"p-grid p-form"},Tp={class:"p-grid-item p-one-whole p-body-copy-01 p-heading-light p-xs-spacing-bottom-a p-s-spacing-bottom-a p-l-spacing-bottom-a p-m-spacing-bottom-a"},Dp={key:0,class:"p-bold"},Op={class:"p-body-copy-01 p-heading-light"},Lp={class:"p-bold"},Mp={class:"p-ec01-tooltip-extended p-body-copy-03"},Bp={class:"p-ec01-tooltip-extended__label"},$p={class:"p-link-style",type:"button"},Vp={compatConfig:{ATTR_FALSE_VALUE:!1},components:{OrderOverview:oc,OrderSummary:kp,Voucher:En,NotificationBar:$n,DeliveryMode:Mu,UserDetails:{__name:"UserDetails",setup(e){const t=_(),{i18n:i}=Ii(),{trackUserReady:r}=Xa(),s=k(()=>t.getters["config/getDefaultConfig"]("isProofOfConsent")||!1),d=k(()=>t.state.config.userDetails),u=k(()=>t.state.cart.loggedInFirstName),m=k(()=>t.state.cart.loggedInLastName),h=k(()=>t.state.cart.hasHealthProduct),f=k(()=>t.state.consent.isMarketingConsentVisible),b=k(()=>t.state.consent.isHealthConsentVisible),C=k(()=>t.state.consent.isMarketingConsentAccepted),P=k(()=>t.state.consent.isMarketingConsentHasChecked),A=k(()=>t.state.consent.marketingConsentVersion),w=k(()=>t.state.consent.healthConsentVersion),x=k(()=>t.state.delivery.showLogoutOverlay),E=k(()=>s.value?f.value&&!P.value&&A.value:f.value&&!P.value),T=k(()=>s.value?h.value&&f.value&&b.value&&w.value:h.value&&f.value&&b.value),D=k(()=>u.value||m.value);p(()=>{d.value||t.dispatch("config/getUserDetails").then(()=>{r(d.value)})});return(e,r)=>(o(),g("section",xp,[l("div",Ep,[l("div",Tp,[O(c(v(i)("checkoutoverview.loggedin-text"))+", ",1),D.value?(o(),g("span",Dp,c(u.value)+" "+c(m.value)+", ",1)):I("",!0),O(" "+c(v(i)("checkoutoverview.welcome-text")),1)])]),l("div",Op,[D.value?(o(),g(S,{key:0},[O(c(v(i)("generic.not"))+" ",1),l("span",Lp,c(u.value)+" "+c(m.value)+"? ",1)],64)):I("",!0),l("button",{class:"p-link-style",type:"button",onClick:r[0]||(r[0]=e=>{x.value||t.dispatch("delivery/updateLogoutOverlayStatus",!0)})},c(v(i)("checkoutoverview.logout-text")),1)]),x.value?(o(),a(Vi,{key:0,"overlay-type":"alert","show-header":"",title:v(i)("checkoutoverview.overlay-logout-title"),onCloseOverlay:r[1]||(r[1]=e=>{t.dispatch("delivery/updateLogoutOverlayStatus",!1)})},{description:n(()=>[y(Sp)]),_:1},8,["title"])):I("",!0),E.value?(o(),a(nc,{key:1})):I("",!0),T.value?(o(),a(dc,{key:2,disabled:!C.value},null,8,["disabled"])):I("",!0)]))}},PaymentMethods:qu,PayButtonWrapper:Dl,CommerceAddressItems:Gc,Overlay:Vi,CheckoutMethods:Bc,TooltipExtended:{__name:"TooltipExtended",setup(e){const{i18n:t}=Ii();return(e,i)=>(o(),g("div",Mp,[l("span",Bp,c(v(t)("checkoutoverview.privacy-notice")),1),l("button",$p,[y(_i,{"tooltip-icon-name":"information-circle","tooltip-text":v(t)("checkoutoverview.privacy-notice-text")},null,8,["tooltip-text"])])]))}},VeeForm:R,OverlaySubmitLoader:kl},mixins:[gi,_l],data:()=>({isAddressValidated:!1,isMobileScreen:!1,isCheckoutOptionsDisabled:!1,stepOneText:"",stepTwoText:"",stepThreeText:""}),computed:{CHECKOUT_STEPS:()=>Te,...r("delivery",["addressType"]),...r("config",["getDefaultConfig"]),...r("notification",["getGenericNotifications"]),...i("payments",["selectedPaymentMethodId","isAdyenWebComponentValidated","link2PayEnabled","applicablePaymentMethods"]),...i("order",["orderId"]),...i("config",["isLoggedIn","validationSchema","payButtonWasClicked"]),...i("delivery",["showAddressOverlay","deliveryCommerceAddresses","billingCommerceAddresses"]),...i("cart",["loggedInFirstName","loggedInLastName","
2items","sellerGroupItems","deliveryMode"]),loggedInText(){return"delivery"===this.addressType?this.i18n("checkoutoverview.loggedin-text",[`\n          <span class="${this.loggedInFirstName||this.loggedInLastName?"p-bold":""}">\n            ${this.loggedInFirstName||this.loggedInLastName?`${this.loggedInFirstName} ${this.loggedInLastName}, `:""}\n          </span>\n          `,this.i18n("checkoutoverview.address-overlay-welcome-text")]):this.i18n("checkoutoverview.billing-address-overlay-welcome-text")},isAddressOverlayVisible(){return this.showAddressOverlay&&("delivery"===this.addressType?this.deliveryCommerceAddresses.length>0:this.billingCommerceAddresses.length>0)}},watch:{payButtonWasClicked(){this.payButtonWasClicked&&this.validateCheckout()}},created(){document.title=this.i18n("checkoutoverview.page-title"),this.resizeHandler=this._debounce(this.setIsMobile),window.addEventListener("resize",this.resizeHandler),this.stepOneText=this.i18n("checkoutoverview.step-one"),this.stepTwoText=this.i18n("checkoutoverview.step-two"),this.stepThreeText=this.i18n("checkoutoverview.step-three")},mounted(){this.initializeCheckout(),this.setIsMobile(),this._on("disablePaymentMethods",this.disableCheckoutOptions)},beforeUnmount(){this._off("disablePaymentMethods",this.disableCheckoutOptions),document.querySelector("html").classList.remove("p-has-sticky--bottom"),window.removeEventListener("resize",this.resizeHandler)},methods:{...$({updateLoginRedirect:"config/updateLoginRedirect"}),disableCheckoutOptions(){this.isCheckoutOptionsDisabled=!0},setIsMobile(){this.isMobileScreen=document.documentElement.clientWidth<=767},validateCheckout(){this.$refs.checkoutOverview.validate(),this.$nextTick().then(()=>{this.$store.commit("config/updatePayButtonWasClicked",!1)})},initializeCheckout(){ne.removeCookie({key:"isFirstTime"}),this.trackAjax({pagename:this.$route.meta.pagename}),document.querySelector("html").classList.add("p-has-sticky--bottom"),this.initObserver(),"accepted"===ne.getCookie("ageConsent-opt-in")?(this.$store.commit("consent/updateShowAgeConsent",!1),this.$store.commit("consent/updateAgeConsentApplied",!0),this.$store.commit("consent/updateIsAgeConsentAccepted",!0),this.$store.dispatch("consent/updateIsAgeConsent",!0)):(this.$store.commit("consent/updateShowAgeConsent",!0),this.$store.commit("consent/updateIsAgeConsentAccepted",!1)),this.$store.dispatch("payments/updateOtherPaymentSelected",!0),this.analyticsOnLoad()},analyticsOnLoad(){const e=this.selectedPaymentMethodId?this.selectedPaymentMethodId.replace("-","_"):"";if(this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","login",this.items,"complete-order",this.isLoggedIn?"account":"guest"),this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","delivery",this.items,"complete-order",this.deliveryMode.id),this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","payment",this.items,"complete-order",e),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[t,i]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","login",i,t,this.isLoggedIn?"account":"guest"),this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","delivery",i,t,this.deliveryMode.id),this.generateGoogleAnalyticsData("ecommerce.checkout.step.option","payment",i,t,e)},editCartClickHandler(){this.updateLoginRedirect(!1),this.trackConversion({name:"interaction",description:"link:edit_shopping_cart",pagename:"checkout"})},createAnalyticsData(e){if(this.generateGoogleAnalyticsData("ecommerce.checkout.step",e,this.items,"complete-order"),"{}"!==JSON.stringify(this.sellerGroupItems))for(const[t,i]of Object.entries(this.sellerGroupItems))this.generateGoogleAnalyticsData("ecommerce.checkout.step",e,i,t)},initObserver(){const e=new IntersectionObserver(t=>{t[0].isIntersecting&&(this.createAnalyticsData("details"),e.disconnect())}),t=new IntersectionObserver(e=>{e[0].isIntersecting&&(this.createAnalyticsData("delivery"),t.disconnect())}),i=new IntersectionObserver(e=>{e[0].isIntersecting&&(this.createAnalyticsData("payment"),i.disconnect())});null!==document.querySelector(".p-ec01-user-details, .p-ec01-checkout-method")&&e.observe(document.querySelector(".p-ec01-user-details, .p-ec01-checkout-method")),null!==document.querySelector(".p-ec01-delivery-method")&&t.observe(document.querySelector(".p-ec01-delivery-method")),null!==document.querySelector(".p-ec01-payment-method")&&i.observe(document.querySelector(".p-ec01-payment-method"))},onPupOverlayClose(){this.$store.dispatch("delivery/updateAddressOverlayStatus",!1)},setDeliveryModeValidated(e){this.isAddressValidated=e}}},Np={class:"p-layout-inner"},Rp={class:"p-ec01-checkout-overview p-xs-spacing-top-b p-s-spacing-top-b p-m-sp
2acing-top-c p-l-spacing-top-c p-row-gutter"},Fp={class:"p-heading-02 p-heading-light"},Up={class:"p-spacing-bottom-b"},qp={key:1,class:"p-heading-02 p-heading-light"},Hp={class:"p-grid"},jp={class:"p-ec01-checkout-overview__sticky p-grid-item p-ec01-checkout-overview__order-summary p-one-whole p-m-five-twelfths p-push-m-seven-twelfths p-l-one-third p-push-l-two-thirds"},Gp={key:2,class:"p-ec01-checkout-overview__tooltip p-xs-s-hidden"},Wp={key:3,class:"p-ec01-checkout-overview__summary"},zp={id:"user-info",class:"p-ec01-checkout-overview__checkout-details p-s-spacing-top-d p-xs-spacing-top-d p-grid-item p-one-whole p-m-seven-twelfths p-pull-m-five-twelfths p-l-two-thirds p-pull-l-one-third"},Qp={key:0,class:"p-ec01-checkout-overview__tooltip"},Kp={class:"p-heading-04-large p-heading-light"};const Jp=yi(Vp,[["render",function(e,t,i,r,s,u){const p=D("notification-bar"),m=D("router-link"),v=D("order-summary"),b=D("voucher"),C=D("tooltip-extended"),k=D("pay-button-wrapper"),_=D("user-details"),P=D("checkout-methods"),A=D("delivery-mode"),w=D("payment-methods"),x=D("commerce-address-items"),E=D("overlay"),T=D("order-overview"),L=D("overlay-submit-loader"),M=D("vee-form"),$=h("safe-html");return o(),g("div",Np,[y(M,{ref:"checkoutOverview","validation-schema":e.validationSchema},{default:n(({validate:i,meta:r,errors:h})=>[f(l("section",Rp,[e.link2PayEnabled?(o(),g(S,{key:0},[l("h1",Fp,c(e.i18n("cartoverview.wallet-form-overlay-button")),1),l("p",Up,c(`${e.i18n("confirmationoverview.order-number")}: ${e.orderId}`),1)],64)):(o(),g("h1",qp,c(e.i18n("checkoutoverview.page-title")),1)),e.getGenericNotifications.length>0?(o(),a(p,{key:2,"error-notifications":e.getGenericNotifications},null,8,["error-notifications"])):I("",!0),l("div",Hp,[l("div",jp,[e.link2PayEnabled?I("",!0):(o(),g("div",{key:0,class:d(["p-ec01-checkout-overview__edit-cart p-heading-04-large p-heading-medium",{"p-ec01-checkout-overview__edit-cart--disabled":s.isCheckoutOptionsDisabled||e.isButtonDisabled}])},[y(m,{to:{name:"cart",params:e.$route.params},onClick:t[0]||(t[0]=e=>u.editCartClickHandler())},{default:n(()=>[O(c(e.i18n("checkoutoverview.edit-cart")),1)]),_:1},8,["to"])],2)),y(v),e.link2PayEnabled?I("",!0):(o(),a(b,{key:1,"is-checkout-options-disabled":s.isCheckoutOptionsDisabled},null,8,["is-checkout-options-disabled"])),["en_CA","fr_CA"].includes(e.getDefaultConfig("localeId"))?(o(),g("div",Gp,[y(C)])):I("",!0),s.isMobileScreen?I("",!0):(o(),g("div",Wp,[y(k,{"button-text":e.buttonText,onPayButtonClick:t=>e.handleButtonClick(i,r.valid)},null,8,["button-text","onPayButtonClick"])]))]),l("div",zp,[e.link2PayEnabled?I("",!0):(o(),g(S,{key:0},[e.isLoggedIn?(o(),a(_,{key:0})):I("",!0),e.isLoggedIn?I("",!0):(o(),a(P,{key:1,errors:h,"is-checkout-options-disabled":s.isCheckoutOptionsDisabled},null,8,["errors","is-checkout-options-disabled"]))],64)),y(A,{id:"delivery","form-fields":h,"is-checkout-options-disabled":s.isCheckoutOptionsDisabled,"step-text":e.link2PayEnabled||e.isLoggedIn?s.stepOneText:s.stepTwoText,onIsAddressValidated:t[1]||(t[1]=e=>u.setDeliveryModeValidated(e))},null,8,["form-fields","is-checkout-options-disabled","step-text"]),e.applicablePaymentMethods.length>0?(o(),a(w,{key:1,id:"payment",errors:h,"step-text":e.link2PayEnabled||e.isLoggedIn?s.stepTwoText:s.stepThreeText,"is-checkout-options-disabled":s.isCheckoutOptionsDisabled},null,8,["errors","step-text","is-checkout-options-disabled"])):I("",!0)])]),s.isMobileScreen?(o(),g("div",{key:3,class:d(["p-ec01-checkout-overview__cta",{"p-ec01-checkout-overview__cta-sticky":e.isLoggedIn&&s.isAddressValidated&&e.isAdyenWebComponentValidated}])},[["en_CA","fr_CA"].includes(e.getDefaultConfig("localeId"))?(o(),g("div",Qp,[y(C)])):I("",!0),y(k,{"button-text":e.buttonText,onPayButtonClick:t=>e.handleButtonClick(i,r.valid)},null,8,["button-text","onPayButtonClick"])],2)):I("",!0),u.isAddressOverlayVisible?(o(),a(E,{key:4,"show-header":"",title:"delivery"===e.addressType?e.i18n("checkoutoverview.address-overlay-title"):e.i18n("checkoutoverview.billing-address-overlay-title"),onCloseOverlay:t[2]||(t[2]=e=>u.onPupOverlayClose())},{description:n(()=>[f(l("p",Kp,null,512),[[$,u.loggedInText]]),y(x)]),_:1},8,["title"])):I("",!0)],512),[[B,e.checkoutStep===u.CHECKOUT_STEPS.STEP_CHECKOUT_OVERVIEW]]),e.checkoutStep===u.CHECKOUT_STEPS.STEP_ORDER_OVERVIEW?(o(),a(T,{key:0})):I("",!0),e.showLoader?(o(),a(L,{key:1})):I("",!0)]),_:1},8,["validation-schema"])])}]]),Yp={key:0,class:"p-ec01-create-account pv-margin-block-start--xl"},Zp={class:"p-ec01-create-account__wrapper"},Xp={class:"pv-heading pv-heading--xs pv-bold pv-margin-block-end--2xs"},em={class:"pv-heading pv-subheading--m pv-margin-block-end--m"},tm=["href"],im={__name:"CreateAccount",setup(e){const t=_(),{i18n:i}=Ii(),r=k(()=>t.state.config.isLoggedIn),s=k(()=>t.state.delivery.email),a=e=>k(()=>t.getters["config/getDefaultConfig"](e)),n=k(()=>"true"===a("isLoginEnabled").value),d=a("sessionUrl"),u=a("language"),p=a("country"),m=k(()=>encodeURIComponent(a("userRedirectUrl").value)),y=k(()=>i("checkoutoverview.create-account-text",[`<strong>${i("checkoutoverview.create-account-extended")}</strong>`,`<strong>${i("checkoutoverview.create-account-support")}</strong>`])),b=k(()=>!r.value&&n.value&&m.value),C=k(()=>`${d.value}/login?prompt=create&sourceChannel=COMMERCE&redirectUrl=${m.value}&redirectErrorUrl=${m.value}&country=${p.value}&language=${u.value}&emailId=${s.value}`);return(e,t)=>{const r=h("safe-html");return b.value?(o(),g("section",Yp,[l("div",Zp,[l("h3",Xp,c(v(i)("checkoutoverview.create-account")),1),f(l("p",em,null,512),[[r,y.value]]),l("a",{href:C.value,class:"pv-button"},c(v(i)("checkoutoverview.create-account-button")),9,tm)])])):I("",!0)}}},rm={components:{BaseIcon:fi},props:{iconName:{type:String,default:()=>"envelope"}},data:()=>({envelopeTypeArray:["POSTNL_ENVELOPE_DOMESTIC","POSTNL_ENVELOPE_INTERNATIONAL"]}),computed:{...r("config",["getDefaultConfig"]),...i("cart",["deliveryMode"]),envelopShipmentLink(){return this.getDefaultConfig("envelopShipmentLink")},showEnvelopeShipment(){return this.envelopeTypeArray.includes("{}"!==JSON.stringify(this.deliveryMode)&&this.deliveryMode.id.toUpperCase())}}},om={key:0,class:"p-ec01-envelope-shipment__wrapper p-spacing-top-a"},sm={class:"p-ec01-envelope-shipment-icon"}
2,am={class:"p-ec01-envelope-shipment-content"},nm={class:"p-heading-04-large"},lm={class:"p-heading-04 p-heading-light"},cm=["href"];const dm=yi(rm,[["render",function(e,t,i,r,s,a){const n=D("base-icon");return a.showEnvelopeShipment?(o(),g("section",om,[l("div",sm,[y(n,{"icon-name":i.iconName},null,8,["icon-name"])]),l("div",am,[l("h2",nm,c(e.i18n("confirmationoverview.envelope-title")),1),l("p",lm,c(e.i18n("confirmationoverview.envelope-text")),1),a.envelopShipmentLink?(o(),g("a",{key:0,href:a.envelopShipmentLink,class:"p-link p-link-more"},c(e.i18n("confirmationoverview.envelope-more-link")),9,cm)):I("",!0)])])):I("",!0)}]]),um={getPaymentMethods:e=>_e.post(`${ge()}/paymentMethods`,{data:e||{}}),paymentDetails:e=>_e.post(`${ge()}/paymentDetails`,{data:e||{}})};const pm=yi({name:"HandlePayment",components:{OverlayLoader:Cl},mixins:[kc],computed:{...r("cart",["getProductByCtn"]),...r("config",["getDefaultConfig"]),...i("order",["orderId"]),...i("payments",["paymentStatus"]),...i("cart",["currencyCode"])},async mounted(){const e=ne.getCookie("isFirstTime")||"";ne.setCookie({key:"isFirstTime",value:!e}),await this.$store.dispatch("tax/checkStorageForTaxReliefInfo");const t=new URLSearchParams(window.location.search);await((t.get("ordernumber")||t.get("orderCode"))&&t.get("token")?this.handlePayByLink():this.getPaymentDetails())},methods:{async getPaymentDetails(){const e=new URLSearchParams(window.location.search),t=e.get("redirectResult"),i=localStorage.getItem("threeDSResult"),r=e.get("mbwayResult"),o=e.get("blikResult"),s=e.get("pp_token"),a=e.get("paymentMethod");let n={},l={};if(""!==window.location.search&&(t||i||o||r||s||"LIQPAY-SSL"===a))"LIQPAY-SSL"===a?l={type:"paymentDetailsRequest",attributes:{orderNumber:e.get("orderNumber"),paymentProvider:e.get("paymentProvider")}}:s?l={type:"paymentDetailsRequest",attributes:{paymentProvider:"pointspay",ppToken:s}}:t?l={type:"paymentDetailsRequest",attributes:{redirectResult:t}}:i?(localStorage.removeItem("threeDSResult"),l={type:"paymentDetailsRequest",attributes:{threeDSResult:i}}):l=o?{type:"paymentDetailsRequest",attributes:{payload:o}}:{type:"paymentDetailsRequest",attributes:{payload:r}},await um.paymentDetails(l).then(e=>{const t=e.data?.data?.attributes||{};let i,r="success";"REFUSED"!==t.resultCode?.toUpperCase()&&"CANCELLED"!==t.resultCode?.toUpperCase()&&"ERROR"!==t.status?.toUpperCase()&&"FAILURE"!==t.status?.toUpperCase()&&"TRY_AGAIN"!==t.status?.toUpperCase()&&"FAILED"!==t.status?.toUpperCase()&&"CANCELED"!==t.status?.toUpperCase()||(r="cancel"),i="LIQPAY-SSL"===a?{callbackType:r,authResult:t.status,pspReference:t.liqpayOrderId,orderKey:t.orderId,paymentId:t.paymentId}:s?{callbackType:r,authResult:t.status,pspReference:t.pspReference,orderKey:t.orderId}:{callbackType:r,authResult:t.resultCode,merchantReference:t.merchantReference,pspReference:t.pspReference},n={data:{type:"commerceValidatePayment",attributes:{validationData:i}}}}).catch(e=>{console.log(e),this.handlePaymentFailure(e,{},!0)});else{const t={};for(const[i,r]of e.entries())switch(i){case"payment_id":t.paymentId=r;break;case"action_id":t.pspReference=r;break;case"status":t.paymentStatus=r;break;case"ordernumber":case"orderNumber":t.orderKey=r;break;default:t[i]=r}n={data:{type:"commerceValidatePayment",attributes:{validationData:t}}}}this.handleValidatePayment(n)},handlePayByLink(){const e=new URLSearchParams(window.location.search),t={type:"commerceValidatePayment",attributes:{callbackType:"success",orderKey:e.get("ordernumber")||e.get("orderCode"),token:e.get("token")}};this.$store.dispatch("order/validatePayByLinkPayment",{paymentDetailsObject:t}).then(e=>{"SUCCESS"===e.attributes?.validationStatus?this.handlePaymentSuccess(e):"IN_PROGRESS"===e.attributes?.validationStatus&&setTimeout(()=>{this.handlePayByLink()},1e4)}).catch(e=>{this.handlePaymentFailure(e,t)})},createShopOrderData(e){if(!window.philips||!window.philips.context)return;const t=e.attributes,i=t.orderId,r={orderId:i,orderValue:t.pricing?.total?.value||"",currency:this.currencyCode,orderTax:t.pricing?.tax?.value||"",orderDelivery:t.pricing?.totalDelivery?.value||"",orderDiscount:t.pricing?.totalDiscount?.value||"",products:[]},o=t.items,a=[],n=[];if(o?.length>0)for(const s of o){const e=this.getProductByCtn(s.itemId),t={quantity:s.quantity,price:this.getCorrectPrice(s),name:s.title,currency:this.currencyCode,id:s.itemId,subcatCode:e.subcatCode,catCode:e.catCode,grpCode:e.grpCode,locale:this.getDefaultConfig("localeId"),product_level:{productGroup:e.grpCode,productSubCategory:e.subcatCode,productCategory:e.catCode}},i=`;${s.itemId};${s.quantity};${s.totalPrice.value};eVar59=one_time`;r.products.push(t),a.push(i),n.push(s.itemId)}r.ctns=n.join(","),window.philips.context.shopOrderDetails=r,window.shopOrderDetails=r,window.philips.context.order||={},window.philips.context.order[i]={id:i,type:"commerceOrder",attributes:t},window.p_initMetricsProps=()=>{s.currencyCode=r.currency,s.purchaseID=r.orderId},this.trackAjax({events:"purchase",products:a.join(","),pagename:"order_confirmation"})},handleValidatePayment(e){this.$store.dispatch("order/validatePayment",{validatePaymentParameters:e,isFirstTime:ne.getCookie("isFirstTime")}).then(e=>{this.handlePaymentSuccess(e)}).catch(t=>{this.handlePaymentFailure(t,e)})},handlePaymentSuccess(e){const t=ne.getCookie("_transaction_ids")||"",i=ne.getLocalStorage("_transaction_ids")||"";if(this.createShopOrderData(e),!t.includes(e.attributes.orderId)&&!i.includes(e.attributes.orderId))try{this.orderConfirmationAnalytics(e)}catch(r){console.error(r)}},handlePaymentFailure(e={},t={},i=!1){const r=this.paymentStatus;try{if(t.data?.attributes?.validationData?.callbackType?.toLowerCase()!==e.attributes?.validationStatus?.toLowerCase()&&t.data?.attributes?.validationData?.authResult?.toLowerCase()!==e.attributes?.validationStatus?.toLowerCase()){const r={request:t,response:e,debug:{locale:this.getDefaultConfig("localeId"),siteId:this.getDefaultConfig("siteId")}};window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push({trigger:"event.errors",event:"systemEvent",interaction:{goal:"errorCode",description:JSON.stringify(r),status:i?"7778":"7777",interactive:!1},component:{name:"ec01-checkout",type:"error"}})},0)}}catch(a){console.error(a)}const o=r||e?.attributes?.validationStatus?.toLocaleLowerCase()||t?.data?.attributes?.validationData?.authResult?.toLowerCase()||t?.data?.attributes?.validationData?.callbackType?.toLowerCase();let s=this.getDefaultConfig("checkoutUrl")+localStorage.getItem("last_route_path_before_confirmation");if(s+=o?`?authResult=${o}`:"",localStorage.getItem("orderIdLink2Pay")){const e=s.includes("?")?"&":"?";s+=`${e}orderId=${localStorage.getItem("orderIdLink2Pay")}`}localStorage.removeItem("orderIdLink2Pay"),window.location=s}}},[["render",function(e,t,i,r,s,d){const u=D("overlay-loader");return e.orderId?I("",!0):(o(),a(u,{key:0,title:e.i18n("confirmationoverview.loader-title")},{description:n(()=>[l("p",null,c(e.i18n("confirmationoverview.loader-description")),1)]),_:1},8,["title"]))}]]),mm=q(()=>ie(()=>import("./ProductSupportSection-5oBcqO43.js"),__vite__mapDeps([21,1,3,4,22]))),hm=[{img:"/c-e/shop/checkout/assets/img/confirmation/order-confirmation.png",title:"confirmationoverview.confirmation",description:"confirmationoverview.confirmation-description"},{img:"/c-e/shop/checkout/assets/img/confirmation/delivery-in-progress.png",title:"confirmationoverview.shipment",description:"confirmationoverview.shipment-description"},{img:"/c-e/shop/checkout/assets/img/confirmation/received.png",title:"confirmationoverview.completion",description:"confirmationoverview.completion-description"}],gm=[{href:"confirmationoverview.change-order-url",img:"/c-e/shop/checkout/assets/img/confirmation/shopping-cart.svg",text:"confirmationoverview.change-order"}
2,{href:"confirmationoverview.myphilips-url",img:"/c-e/shop/checkout/assets/img/confirmation/person.svg",text:"confirmationoverview.myphilips"},{href:"confirmationoverview.faqs-url",img:"/c-e/shop/checkout/assets/img/confirmation/question-mark.svg",text:"confirmationoverview.faqs"},{href:"confirmationoverview.customer-service-url",img:"/c-e/shop/checkout/assets/img/confirmation/heart.svg",text:"confirmationoverview.customer-service"}],ym={components:{HandlePayment:pm,CreateAccount:im,EnvelopeShipment:dm,ProductSupportSection:mm},mixins:[gi],data:()=>({specificProductId:"BRP958/00"}),computed:{...r("config",["getDefaultConfig"]),...i("order",["orderId"]),...i("cart",["items"]),confirmationSteps:()=>hm,confirmationLinks:()=>gm,isSupportVisible(){const e=this.getDefaultConfig("country"),t=this.items.some(e=>e.itemId===this.specificProductId);return["GB","DE","FR"].includes(e)&&t}},created(){document.title=this.i18n("confirmationoverview.confirmation"),window.philips.context.user??={},window.philips.context.user.loginStatus="not_logged_in"}},vm={class:"p-ec01-order-confirmation pv-margin-block-end--xl"},fm={class:"p-layout-inner p-row-gutter"},bm={class:"p-grid"},Cm={class:"p-grid-item p-m-two-thirds p-xs-one-whole p-push-l-one-sixth p-push-m-one-sixth p-push-s-none p-push-xs-none"},km={class:"p-ec01-order-confirmation__title pv-heading pv-heading--m pv-margin-block-end--sm pv-margin-block-start--xl"},_m={class:"p-ec01-order-confirmation__subtitle pv-heading pv-subheading--m"},Im={class:"p-bold"},Pm={class:"p-ec01-order-confirmation__title pv-heading--s pv-heading pv-heading--m pv-margin-block-end--l pv-margin-block-start--l p-bold"},Am={class:"p-ec01-order-confirmation__steps"},wm=["src"],Sm={class:"pv-heading pv-heading--s pv-margin-block-end--m pv-margin-block-start--xl p-bold"},xm={class:"p-ec01-order-confirmation__links"},Em=["href"],Tm={class:"p-ec01-order-confirmation__links-icon"},Dm=["src"];const Om=yi(ym,[["render",function(e,t,i,r,s,n){const u=D("envelope-shipment"),p=D("create-account"),m=D("product-support-section"),h=D("handle-payment");return o(),g("section",{class:d(["p-ec01-order-confirmation-overview",{"p-ec01-hide-content":!e.orderId}])},[f(l("div",vm,[t[0]||(t[0]=K('<div class="p-ec01-order-confirmation__banner"><div class="p-layout-inner p-row-gutter"><div class="p-grid"><div class="p-grid-item p-m-two-thirds p-xs-one-whole p-push-l-one-sixth p-push-m-one-sixth p-push-s-none p-push-xs-none"><img src="/c-e/shop/checkout/assets/img/confirmation/confirmation-banner.png" alt=""></div></div></div></div>',1)),l("div",fm,[l("div",bm,[l("div",Cm,[l("h1",km,c(e.i18n("confirmationoverview.page-title")),1),l("div",_m,[O(c(e.i18n("confirmationoverview.order-number"))+": ",1),l("span",Im,c(e.orderId),1)]),l("h2",Pm,c(e.i18n("confirmationoverview.what-next")),1),l("ul",Am,[(o(!0),g(S,null,x(n.confirmationSteps,(t,i)=>(o(),g("li",{key:i},[l("img",{src:t.img,alt:""},null,8,wm),l("div",null,[l("h3",null,c(e.i18n(t.title)),1),l("p",null,c(e.i18n(t.description)),1)])]))),128))]),y(u),y(p),n.isSupportVisible?(o(),a(m,{key:0,"specific-product-id":s.specificProductId},null,8,["specific-product-id"])):I("",!0),l("h2",Sm,c(e.i18n("confirmationoverview.here-to-help")),1),l("ul",xm,[(o(!0),g(S,null,x(n.confirmationLinks,(t,i)=>(o(),g("li",{key:i},[l("a",{href:e.i18n(t.href),target:"_blank"},[l("div",Tm,[l("img",{src:t.img,alt:""},null,8,Dm)]),l("span",null,c(e.i18n(t.text)),1)],8,Em)]))),128))])])])])],512),[[B,e.orderId]]),y(h)],2)}]]),Lm={class:"p-layout-inner"},Mm={class:"p-ec01-not-found p-xs-spacing-top-b p-s-spacing-top-b p-m-sp
2acing-top-c p-l-spacing-top-c p-row-gutter p-m-one-half"},Bm={class:"p-heading-02 p-heading-book"},$m={class:"p-spacing-top-a"},Vm={class:"p-spacing-top-a"},Nm=["href"],Rm={__name:"NotFound",setup(e){const{i18n:t}=Ii(),i=ll();return p(()=>{document.title=t("error.404.page-title"),window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push({trigger:"event.errors",event:"systemEvent",interaction:{goal:"errorCode",description:`404 Not Found: ${window.location.pathname}`,status:"0404",interactive:!1},component:{name:"ec01-checkout",type:"error"}})},0)}),(e,r)=>(o(),g("div",Lm,[l("section",Mm,[l("h1",Bm,c(v(t)("error.404.page-title")),1),l("p",$m,c(v(t)("error.404.page-description")),1),l("p",Vm,[O(c(v(t)("error.404.page-redirect-text-label")),1),l("a",{href:v(i)},c(v(t)("error.404.page-redirect-link-label")),9,Nm)])])]))}},Fm=/^[A-Z]{2}_/,Um=e=>Fm.test(e),qm=e=>{if(Um(e))return e;const t=ui.getters["config/getDefaultConfig"]("country"),i=hi[t]?.[e];return i||null};function Hm(){const e=(()=>{const e=globalThis.location.pathname,t=new RegExp(/\/checkout[^ /]*/).exec(e);return t?e.substring(0,e.indexOf(t[0])+t[0].length):""})();let t=null;return t=J({history:Y(e),routes:[{path:"/",redirect:"/cart"},{path:"/:siteId?/cart",name:"cart",meta:{pagename:"shoppingcart",luxLabel:"Cart Overview"},component:vl},{path:"/:siteId?/details",name:"details",meta:{pagename:"checkout",luxLabel:"Checkout"},component:Jp},{path:"/:siteId?/confirmation",name:"confirmation",meta:{pagename:"order_confirmation",luxLabel:"Checkout Order Confirmation"},component:Om},{path:"/:pathMatch(.*)*",name:"notFound",meta:{luxLabel:"Not Found"},component:Rm}],scrollBehavior:()=>({top:0,left:0})}),t.beforeEach((t,i,r)=>{if(((e,t)=>{const i=e.path.split("/").filter(Boolean);if("notFound"!==e.name||1!==i.length)return!1;const r=qm(i[0]);return!(!r||!Um(r)||(console.log(`Redirecting from /${i[0]} to /${r}/cart`),t(`/${r}/cart`),0))})(t,r))return;const o=t.params.siteId,s=`${globalThis.location.origin}${a="confirmation",o?`${e}/${o}/${a}`:`${e}/${a}`}`;var a;const n=Boolean(s&&globalThis.location.href.includes(s)),l=(e=>o?`/${o}/${e}`:`/${e}`)(n?"confirmation":"cart"),c=new URLSearchParams(globalThis.location.search).get("orderId");ui.dispatch("payments/updateLink2PayEnabled",!1),ui.dispatch("config/updateOrderConfirmationUrl",s),ui.dispatch("config/updateCheckoutUrl",e),o&&((e,t,i)=>{const r=qm(i);if(!r||!Um(r))return console.log(`Invalid siteId: ${i}. Showing NotFound.`),e.matched[0].components.default=Rm,t(),!0;if(r!==i){const o=e.path.replace(String(i),r);return console.log(`Redirecting legacy slug /${i} to canonical /${r}`),t(o),!0}return ui.dispatch("config/updateSiteId",r),ui.dispatch("config/updateIsMicrositeId",!0),!1})(t,r,o)||(c?((e,t,i,r)=>{localStorage.setItem("orderIdLink2Pay",r),ui.dispatch("payments/updateLink2PayEnabled",!0),ui.commit("order/updatedOrderId",r),pi().then(()=>{ui.dispatch("config/getConfigAPI"),ui.dispatch("cart/getPayByLinkCollectionPoints",{orderId:r}).catch(e=>{console.log(e.response)}).finally(()=>{const r=i?`/${i}/details`:"/details";e.path===r?t():t(r)})}).catch(e=>{console.log(e.response)})})(t,r,o,c):"cart"===t.name&&"details"===i.name||"details"===t.name&&"cart"===i.name?r():pi().then(()=>{if("confirmation"!==t.name&&ui.dispatch("config/getConfigAPI"),"cart"===t.name&&!n)return mi(n,t.name).catch(e=>{console.log(e.response)}),void r();
2mi(n,t.name).catch(e=>{console.log(e.response)}).finally(()=>{"cart"===t.name&&n||"details"===t.name&&!ui.getters["cart/getCartItemsLength"]||"confirmation"===t.name&&!n?r(l):r()})}).catch(e=>{console.log("getAccessToken error:",e.response),r()}))}),t.afterEach(e=>{const{luxLabel:t,pagename:i}=e.meta,r=globalThis.philips?.context?.page;"confirmation"!==e.name&&localStorage.setItem("last_route_path_before_confirmation",e.path),globalThis.LUX&&(globalThis.LUX.label=t),r&&(r.pageName=i,"order_confirmation"===i&&(r.pageType=i))}),t}const jm={de_at:()=>ie(()=>import("./de_at-CbcgI46U.js"),[]),en_au:()=>ie(()=>import("./en_au-CkQS3NfP.js"),[]),nl_be:()=>ie(()=>import("./nl_be-CNjflzWe.js"),[]),fr_be:()=>ie(()=>import("./fr_be-DDKGYorw.js"),[]),en_ca:()=>ie(()=>import("./en_ca-FAhGdNgg.js"),[]),fr_ca:()=>ie(()=>import("./fr_ca-D1NluUlS.js"),[]),de_ch:()=>ie(()=>import("./de_ch-C68vTqjw.js"),[]),fr_ch:()=>ie(()=>import("./fr_ch-D3Y5kZAp.js"),[]),cs_cz:()=>ie(()=>import("./cs_cz-qEvxz9dk.js"),[]),de_de:()=>ie(()=>import("./de_de-DUdAaDyc.js"),[]),da_dk:()=>ie(()=>import("./da_dk-CCCj74Ad.js"),[]),es_es:()=>ie(()=>import("./es_es-Bp8bTR_G.js"),[]),fi_fi:()=>ie(()=>import("./fi_fi-De8PtK5q.js"),[]),fr_fr:()=>ie(()=>import("./fr_fr-CZXO7nxK.js"),[]),en_gb:()=>ie(()=>import("./en_gb-Q58BNt6g.js"),[]),hu_hu:()=>ie(()=>import("./hu_hu-D_B4Pcob.js"),[]),it_it:()=>ie(()=>import("./it_it-V0Q5gt8s.js"),[]),nl_nl:()=>ie(()=>import("./nl_nl-C1MTQm1Q.js"),[]),no_no:()=>ie(()=>import("./no_no-COgPgNhU.js"),[]),pl_pl:()=>ie(()=>import("./pl_pl-B0DJz9aP.js"),[]),pt_pt:()=>ie(()=>import("./pt_pt-4VpNIcBf.js"),[]),ro_ro:()=>ie(()=>import("./ro_ro-m1YsABL9.js"),[]),en_sg:()=>ie(()=>import("./en_sg-D9B0DVXB.js"),[]),sv_se:()=>ie(()=>import("./sv_se-LnhWVeiW.js"),[]),tr_tr:()=>ie(()=>import("./tr_tr-BY3RJHrZ.js"),[]),uk_ua:()=>ie(()=>import("./uk_ua-GEr__giL.js"),[]),ru_ua:()=>ie(()=>import("./ru_ua-CpFld8af.js"),[]),en_us:()=>ie(()=>import("./en_us-CvvY05sL.js"),[])};async function Gm(){const e=function(){const e=nl();return e?.locale||Ae}(),t=jm[e]||jm[Ae];if(!t)throw new Error(`Configuration loader for locale '${e}' not found.`);const i=(await t()).default,r=nl();return i.checkoutConfig.currency=r.currency,i.checkoutConfig.dir=r.dir,i}const Wm={computed:{i18n:()=>function(e,t){return this.translate({key:e,optionalArguments:t})},i18nv2:()=>function(e,t,i){return this.translate({key:e,fallbackValue:t,optionalArguments:i})},...i("config",{translations:e=>e.config.translations})},methods:{translate({key:e,fallbackValue:t,optionalArguments:i}){let r=this.translations[e]||t;if(void 0!==r){if(i&&i.length>0)for(const[e,t]of i.entries())r=r.split(`{${e}}`).join(t);return r}return e}}},zm={methods:{_debounce(e,t=300){let i;const r=function(){clearTimeout(i);const r=arguments;i=setTimeout(()=>{e.apply(this,r)},t)};return r.cancel=function(){clearTimeout(i),i=null},r},sanitize(e=""){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replaceAll(/["&'<>]/g,e=>t[e])},isHavingDefaultValue:e=>e.defaultValue&&"object"==typeof e.defaultValue?e.defaultValue[0]:!(!e.defaultValue||"string"!=typeof e.defaultValue),getClasses(e){let t="";const i=["xs-","s-","m-","l-"];if(e&&e.length>0)for(const[r,o]of e.entries())switch(o){case 1:t+=` p-${i[r]}one-eighth`;break;case 2:t+=` p-${i[r]}one-quarter`;break;case 3:t+=` p-${i[r]}three-eighths`;break;case 4:t+=` p-${i[r]}one-half`;break;case 5:t+=` p-${i[r]}five-eighths`;break;case 6:t+=` p-${i[r]}three-quarters`;break;case 7:t+=` p-${i[r]}seven-eighths`;break;default:t+=` p-${i[r]}one-whole`}return t},getClassesFromPILS(e,t){let i="";switch(e){case"1/8":i+="p-xs-one-eighth";break;case"1/4":i+="p-xs-one-quarter";break;case"3/8":i+="p-xs-three-eighths";break;case"1/2":i+="p-xs-one-half";break;case"5/8":i+="p-xs-five-eighths";break;case"3/4":i+="p-xs-three-quarters";break;case"7/8":i+="p-xs-seven-eighths";break;default:i+="p-xs-one-whole"}switch(t){case"1/8":return`${i} p-m-one-eighth`;case"1/4":return`${i} p-m-one-quarter`;case"3/8":return`${i} p-m-three-eighths`;case"1/2":return`${i} p-m-one-half`;case"5/8":return`${i} p-m-five-eighths`;case"3/4":return`${i} p-m-three-quarters`;case"7/8":return`${i} p-m-seven-eighths`;default:return`${i} p-m-one-whole`}},getCookie(e){const t=`${e}=`,i=decodeURIComponent(document.cookie).split(";");for(let r of i){for(;r.startsWith(" ");)r=r.slice(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},setCookie(e,t,i){let r="";if(i&&i>0){const e=new Date;e.setTime(e.getTime()+24*i*60*60*1e3),r=`; expires=${e.toGMTString()}`}document.cookie=`${e}=${t}${r}; path=/`},getValidationSchema(e,t){const i={};if(e&&e.length>0)for(const r of e){const e=t?`${t}-${r.name}`:r.name;r.mandatory&&(i[e]={required:r.mandatoryError}),r.format&&""!==r.format&&(r.mandatory?i[e].regex=[r.format,r.formatError||""]:i[e]={regex:[r.format,r.formatError||""]})}return i}}},Qm={computed:{...r("config",["getDefaultConfig"]),featureToggles(){return this.getDefaultConfig("featureToggles")},localeId(){return this.getDefaultConfig("localeId")},siteId(){return this.getDefaultConfig("siteId")},getVariantUS1581709(){return"nl_NL"===this.localeId?this.getVariant("us1581709"):0},getVariantUS2039874(){return["en_US","en_GB","nl_NL","de_DE","fr_FR","pl_PL"].includes(this.localeId)?this.getVariant("us2039874"):"0"},getVariantUS3745029(){return["en_US","nl_NL","en_GB","de_DE"].includes(this.localeId)?this.getVariant("us3745029"):"0"},getVariantUS2624304(){return["en_GB","nl_NL","hu_HU","pl_PL"].includes(this.localeId)?this.getVariant("us2624304"):"0"}},methods:{getVariant(e){if(void 0===this.featureToggles[e]||!this.siteId.includes("Pub"))return 0;const t=this.featureToggles[e].variants,i=this.featureToggles[e].days,r=`eddl_abt_${e}`;let o="";if(i){const e=this.getCookie(r);e&&""!==e&&(o=e)}if(!o){const e=Math.random(),s=Array.isArray(t)?t.length:t;let a=0;for(let i=0;i<s;
2i++)if(a+=Array.isArray(t)?t[i]:1/s,e<a){o=String(i);break}i&&this.setCookie(r,o,2*i)}return i&&(window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push({trigger:"eddl.exp.apply",event:"systemEvent",activityId:e,experienceId:o,platform:"aem",type:"abt"})},0)),o}}},Km={methods:{_on:(...e)=>Z.on(...e),_once:(...e)=>Z.once(...e),_off:(...e)=>Z.off(...e),_emit:(...e)=>Z.emit(...e)}};var Jm={};function Ym(e){const{country:t,language:i,localeId:r,dir:o,currency:s}=e.checkoutConfig||{};window.philips=window.philips??={},window._page=window._page??={},window.dtm=window.dtm??={},window.dtm.dnt=!1,document.documentElement.setAttribute("lang",r?.replace("_","-").toLowerCase()||"en"),document.querySelector('meta[property="og:url"]')?.setAttribute("content",window.location.href),window.philips??={},window.philips.context={...window.philips.context,sector:"SH",locale:{country:t,language:i,code:r,currency:s}},window.philips.context.page??={},window.philips.context.page.section="shop",document.body.dataset.country=t,document.body.dataset.language=i,document.body.dataset.locale=r,document.documentElement.setAttribute("dir",o),function(){const e=document.createElement("script");e.src=`${Jm.VUE_APP_TOOLSLIB_BASE_URL||""}/a1l4rgpa1fx2crzaqh/t1l6vgru59xvprnlz0ll.js`,e.async=!0,document.head.append(e)}()}X("required",(e,[t])=>!(Array.isArray(e)&&0===e.length||"string"==typeof e&&0===e.trim().length)||(t||!1)),X("regex",(e,[t,i])=>{const r=new RegExp(t);return!(e&&!r.test(e))||(i||!1)});const Zm={ADD_ATTR:["target"]},Xm={mounted(e,t){e.innerHTML=ee.sanitize(t.value,Zm)},updated(e,t){e.innerHTML=ee.sanitize(t.value,Zm)}},eh={name:"ErrorState",data:()=>({showTimeoutHTML:!1}),computed:{...i({errorMessageCode:e=>e.error.errorMessageCode,fullErrorMessage:e=>e.error.fullErrorMessage})},mounted(){document.querySelector("body").scrollIntoView({behavior:"smooth",block:"start"}),this.fullErrorMessage?.toLowerCase().includes("network error")||this.fullErrorMessage?.toLowerCase().includes("request aborted")||(this.errorMessageCode?.startsWith("80")&&(this.showTimeoutHTML=!0),window.eddlEvents||=[],setTimeout(()=>{window.eddlEvents.push({trigger:"event.errors",event:"systemEvent",interaction:{goal:"errorCode",description:this.fullErrorMessage,status:this.errorMessageCode,interactive:!1},component:{name:"ec01-checkout",type:"error"}})},0))}},th={class:"p-layout-inner"},ih={class:"p-ec01-error p-xs-spacing-top-b p-s-spacing-top-b p-m-sp
2acing-top-c p-l-spacing-top-c p-row-gutter p-m-one-half"},rh={class:"p-heading-02 p-heading-book"},oh={class:"p-heading-04"},sh={class:"p-spacing-top-a"},ah={class:"p-spacing-top-b p-bullets"};const nh=yi(eh,[["render",function(e,t,i,r,s,a){const n=h("safe-html");return o(),g("div",th,[l("section",ih,[l("h1",rh,c(e.i18n("error.page-title")),1),l("h3",oh,c(`${e.i18nv2("error.error-code","Error Code")}: ${e.errorMessageCode}`),1),l("p",sh,c(e.i18n("error.page-sub-title")),1),f(l("ul",ah,null,512),[[n,s.showTimeoutHTML?e.i18n("error.page-timeout-message",["<li>","</li>"]):e.i18n("error.page-error-message",["<li>","</li>"])]])])])}]]),lh={class:"p-ec01-stepper p-row-gutter"},ch={class:"p-layout-inner p-ec01-grid__one-whole"},dh={class:"p-ec01-steps"},uh={class:"p-ec01-stepper__number"};const ph=yi({data:()=>({steps:[],checkoutStep:0}),watch:{$route(e){this.checkoutStep=this.steps.findIndex(t=>e.name===t.name)}},mounted(){this.steps=[{name:"cart",text:this.i18n("cartoverview.page-title")},{name:"details",text:this.i18n("checkoutoverview.page-title")},{name:"confirmation",text:this.i18n("confirmationoverview.page-title")}]}},[["render",function(e,t,i,r,s,a){return o(),g("section",lh,[l("div",ch,[l("div",dh,[(o(!0),g(S,null,x(s.steps,(t,i)=>(o(),g("div",{key:t.name,class:d(["p-ec01-stepper__step",{"p-active":e.$route.name===t.name,"p-inactive":i>s.checkoutStep}])},[l("div",uh,c(i+1),1),O(" "+c(t.text),1)],2))),128))])])])}]]);var mh="https://eu-cdn.contentstack.com/v3",hh="blte23630023bb36e19",gh="csbb73928c1f632e2fe1c9586a",yh="main";const vh={getFooterLinks(e){const t=`${mh}/content_types/footer/entries`,i={locale:e,include_count:!0,include_fallback:!0,"include[]":["compliance_links.cookie_notice.link","compliance_links.section_links.link_reference"]},r={access_token:gh,api_key:hh,branch:yh};return _e.get(t,{params:i,headers:r})},getUspLinks(e){const t=`${mh}/content_types/consumer_locale/entries`,i={locale:e,include_count:!0,include_fallback:!0,"include[]":["marketing_config.usps.content.link.link_reference"]},r={access_token:gh,api_key:hh,branch:yh};return _e.get(t,{params:i,headers:r})}},fh={class:"p-ec01-footer"},bh={class:"p-layout-inner"},Ch={class:"p-row-gutter"},kh={class:"p-ec01-footer__wrapper"},_h={class:"p-ec01-footer__nav"},Ih=["href"],Ph={key:0},Ah=["data-track-type","href"],wh={class:"p-ec01-footer__copyright p-body-copy-03 p-heading-light"},Sh=yi({__name:"AppFooter",setup(e){const{i18n:t}=Ii(),i=_(),r=C([]),s=C({}),a=k(()=>(new Date).getFullYear()),n=k(()=>i.getters["config/locale"]);return p(async()=>{try{const e=await vh.getFooterLinks(n.value);r.value=e.data?.entries?.[0]?.compliance_links?.section_links,s.value=e.data?.entries?.[0]?.compliance_links?.cookie_notice}catch(e){console.error(e)}}),(e,i)=>(o(),g("footer",fh,[l("div",bh,[l("div",Ch,[i[0]||(i[0]=l("div",{class:"p-ec01-footer__logo"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"80",viewBox:"0 0 144 187"},[l("path",{fill:"currentColor","fill-rule":"evenodd",d:"M124.984 145.615c-5.03.624-12.672 1.622-14.517 2.139-1.878.522-3.71 1.735-4.511 4.584-.527 1.873-1.5 9.668-2.105 14.789 8.644-5.317 15.911-12.715 21.133-21.512M71.737 176.21a61.05 61.05 0 0 0 30.058-7.876c-.583-5.002-1.677-13.969-2.251-15.996-.795-2.849-2.63-4.062-4.5-4.584-2.823-.788-19.073-2.689-19.073-2.689v-1.14s16.25-1.902 19.072-2.692c1.872-.522 3.706-1.728 4.501-4.584.762-2.699 2.482-17.875 2.665-19.505-11.144 2.099-18.785 7.329-28.364 12.311-10.184 5.298-20.12 9.098-33.048 9.098-11.401 0-21.543-3.769-28.897-8.397 7.359 26.575 31.361 46.054 59.837 46.054M10.587 39.925h6.661V34.63h2.373c6.203 0 10.126-3.25 10.126-8.916 0-6.224-4.196-8.452-11.038-8.452-2.648 0-5.839.185-8.121.464zm21.806 0h6.66v-8.73h6.935v8.73h6.66v-22.2h-6.66v8.824h-6.934v-8.823h-6.66zm25.182 0h6.66v-22.2h-6.66zm11.586 0h12.042l1.003-4.458H75.82V17.726h-6.66zm15.417 0h6.662v-22.2h-6.662zm11.68 0h6.658V34.63h2.372c6.204 0 10.129-3.25 10.129-8.916 0-6.224-4.199-8.452-11.041-8.452-2.644 0-5.84.185-8.118.464zm-24.52 9.81c-5.263 0-10.371.67-15.252 1.922.261 2.225 1.004 8.4 1.367 9.689.445 1.577 1.459 2.248 2.499 2.539 1.554.435 10.31 1.443 10.31 1.443v.633s-8.756 1.052-10.31 1.488c-1.04.29-2.054.961-2.499 2.538-.346 1.227-1.037 6.895-1.327 9.35 5.179.7 10.74 1.35 10.74 1.35v1.14s-16.253 1.902-19.063 2.689c-1.878.521-3.709 1.735-4.512 4.584-.74 2.633-2.362 16.966-2.604 19.125 11.445-2.121 21.239-8.16 28.59-11.771 10.45-5.134 20.021-9.341 33.077-9.341 11.35 0 21.367 3.7 28.711 8.299-7.481-26.381-31.388-45.676-59.728-45.676m56.085-15.94c0 1.393-1.002 2.136-3.465 2.136-2.19 0-5.566-.742-7.573-1.765l.729 5.11c2.007.742 4.743 1.114 6.934 1.114 5.566 0 10.128-1.858 10.128-7.432 0-7.43-10.491-6.037-10.491-9.566 0-1.207 1.185-1.766 3.101-1.766 2.097 0 4.38.465 5.929 1.117l-.547-4.832c-1.732-.371-3.285-.65-6.112-.65-5.383 0-9.034 2.16-9.034 6.689 0 7.802 10.401 6.223 10.401 9.845m-24.541 83.168c.145 1.291 1.905 16.951 2.674 19.686.801 2.856 2.633 4.062 4.511 4.584 1.997.562 10.789 1.685 15.705 2.288a63.6 63.6 0 0 0 7.277-22.955c-6.852-2.807-14.729-4.264-21.193-4.264-3.276 0-6.239.236-8.974.661M32.78 77.995c1.87-.523 3.706-1.727 4.5-4.584.518-1.831 1.459-9.303 2.066-14.42-8.443 5.255-15.558 12.501-20.714 21.098 5.027-.626 12.342-1.588 14.148-2.094m-22.718 27.044c6.817 2.76 14.633 4.139 21.095 4.139 3.055 0 5.961-.271 8.73-.736-.25-2.267-1.864-16.718-2.607-19.342-.794-2.85-2.63-4.062-4.5-4.584-1.964-.548-10.425-1.635-15.393-2.246a63.6 63.6 0 0 0-7.325 22.769m44.24-35.052c-.44-1.577-1.455-2.248-2.491-2.538-1.234-.344-6.943-1.072-9.296-1.363.437 3.3.88 6.262 1.176 7.325.803 2.857 2.634 4.061 4.512 4.584 1.07.3 4.087.763 7.414 1.22-.297-2.517-.972-8.02-1.315-9.228m0-8.641c.354-1.248 1.062-7.078 1.343-9.466a61.2 61.2 0 0 0-14.163 5.844c.247 2.12.578 4.87.919 7.498 2.277-.27 8.156-.988 9.41-1.337 1.036-.291 2.051-.962 2.49-2.54m-44.26 59.463c7.862 5.091 18.806 7.611 27.975 7.611 13.893 0 22.256-4.208 31.416-8.857 12.591-6.39 23.042-13.13 39.448-13.042 9.931.053 18.706 2.696 25.012 6.106a65 65 0 0 0-.507-7.861c-7.855-5.056-18.763-7.654-27.897-7.654-13.89 0-22.233 4.322-31.401 8.953-11.765 5.945-23.028 13.087-39.382 13.087-9.961 0-25.13-6.202-25.13-6.179 0 2.625.16 5.294.466 7.836M143.418 3.997v108.911c0 40.214-32.175 72.993-71.706 72.993C31.492 185.901 0 153.122 0 112.908V3.998C9.34 2.825 39.275 0 71.713 0c31.714 0 62.076 2.652 71.705 3.997M88.672 156.901c-.347-1.229-1.137-8.167-1.137-8.167h-.49s-.79 6.938-1.137 8.167c-.343 1.231-1.133 1.751-1.94 1.976-1.218.341-8.031 1.16-8.031 1.16v.492s6.814.82 8.03 1.159c.808.225 1.598.748 1.94 1.975.348 1.229 1.138 8.168 1.138 8.168h.49s.79-6.939 1.137-8.168c.345-1.227 1.135-1.75 1.944-1.975 1.21-.339 8.025-1.159 8.025-1.159v-.492s-6.815-.819-8.025-1.16c-.81-.225-1.599-.745-1.944-1.976m20.501-131.094c0-2.787-1.551-4.366-4.834-4.366-.343 0-.709 0-1.097.024v9.171h1.097c3.465 0 4.834-1.951 4.834-4.83m-90.502 4.83h-1.096v-9.172c.387-.024.753-.024 1.096-.024 3.284 0 4.835 1.58 4.835 4.366 0 2.878-1.37 4.83-4.835 4.83","clip-rule":"evenodd"})])],-1)),l("div",kh,[l("ul",_h,[(o(!0),g(S,null,x(r.value,e=>(o(),g("li",{key:e?.link_reference?.[0]?.uid},[l("a",{href:e?.link_reference?.[0]?.link_external?.href,target:"_blank"},c(e?.link_reference?.[0]?.link_external?.title),9,Ih)]))),128)),s.value?.link?.[0]?.link_external?.href?(o(),g("li",Ph,[l("a",{"data-cookie-sett
2ings":"","data-track-type":s.value?.data_track_type,href:s.value?.link?.[0]?.link_external?.href,target:"_blank"},c(s.value?.link?.[0]?.link_external?.title),9,Ah)])):I("",!0)]),l("p",wh,c(v(t)("cartoverview.copyright",[a.value])),1)])])])]))}},[["__scopeId","data-v-ac31fd26"]]),xh={class:"p-ec01__usp-bar"},Eh={class:"p-layout-inner"},Th={key:0,class:"p-ec01__usp-icon","aria-hidden":"true"},Dh={class:"p-ec01__usp-text"},Oh={__name:"UspBar",setup(e){const t=_(),i=C([]),r=C(!1),s={CalendarClock:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M21 10.5V5.75a.75.75 0 0 0-.75-.75H3.75a.75.75 0 0 0-.75.75v14.5c0 .414.336.75.75.75H11"/><path stroke="currentColor" stroke-width="1.5" d="M3 9h18"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M17 6V4M7 6V4"/><path fill="currentColor" fill-rule="evenodd" d="M17.5 23a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11m.75-5.81v-3.44h-1.5v4.06l2.22 2.22 1.06-1.06z" clip-rule="evenodd"/></svg>',CheckmarkRosette:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="m8.75 12.5 2.16 3.024a.375.375 0 0 0 .63-.032L15.25 9"/><path stroke="currentColor" stroke-width="1.5" d="M11.266 3.412a1.5 1.5 0 0 1 1.468 0l1.03.577a1.5 1.5 0 0 0 .715.192l1.18.014a1.5 1.5 0 0 1 1.27.734l.603 1.015a1.5 1.5 0 0 0 .524.524l1.015.602a1.5 1.5 0 0 1 .734 1.271l.014 1.18a1.5 1.5 0 0 0 .192.716l.577 1.03a1.5 1.5 0 0 1 0 1.467l-.577 1.03a1.5 1.5 0 0 0-.192.715l-.014 1.18a1.5 1.5 0 0 1-.734 1.27l-1.015.603a1.5 1.5 0 0 0-.524.524l-.602 1.015a1.5 1.5 0 0 1-1.271.734l-1.18.014a1.5 1.5 0 0 0-.716.192l-1.03.577a1.5 1.5 0 0 1-1.467 0l-1.03-.577a1.5 1.5 0 0 0-.714-.192l-1.18-.014a1.5 1.5 0 0 1-1.272-.734l-.602-1.015a1.5 1.5 0 0 0-.524-.524l-1.015-.602a1.5 1.5 0 0 1-.734-1.271l-.014-1.18a1.5 1.5 0 0 0-.192-.716l-.577-1.03a1.5 1.5 0 0 1 0-1.467l.577-1.03a1.5 1.5 0 0 0 .192-.714l.014-1.18A1.5 1.5 0 0 1 4.93 7.07l1.015-.602a1.5 1.5 0 0 0 .524-.524l.602-1.015a1.5 1.5 0 0 1 1.271-.734l1.18-.014a1.5 1.5 0 0 0 .716-.192z"/></svg>',CheckmarkShield:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M5 4.54a.71.71 0 0 1 .518-.693C6.54 3.567 8.987 3 12 3s5.459.567 6.482.847a.71.71 0 0 1 .518.694V12c0 5.264-5.388 8.219-6.71 8.865a.66.66 0 0 1-.58 0C10.388 20.219 5 17.265 5 12z"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="m9 12 1.327 1.99a.75.75 0 0 0 1.275-.044L15 8"/></svg>',Coupon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M3 13.75v3.5c0 .414.336.75.75.75h16.5a.75.75 0 0 0 .75-.75v-3.5m-18-3.5V6.749A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 .75.75v3.5"/><path stroke="currentColor" stroke-width="1.5" d="M3 14.5a2.5 2.5 0 0 0 0-5m18 0a2.5 2.5 0 0 0 0 5m-6.25-5.25-5.5 5.5"/><path fill="currentColor" d="M15 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-4-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg>',DocumentReportEdit:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M20.146 12.854a.5.5 0 0 1 .707 0l1.293 1.292a.5.5 0 0 1 0 .707l-.866.867-2-2zM18.22 14.78l-4.637 4.637a.5.5 0 0 0-.12.195l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l4.636-4.637zM3.75 2.25a1.5 1.5 0 0 0-1.5 1.5v14.5a1.5 1.5 0 0 0 1.5 1.5h8.75v-1.5H3.75V3.75h14.5V11h1.5V3.75a1.5 1.5 0 0 0-1.5-1.5zm2.25 7h-.75v1.5h3.5v-1.5zm-.75 3h9.5v1.5h-9.5zm.75 3h-.75v1.5h9.25v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M10.75 5.25h6v5.5h-6zm1.5 1.5v2.5h3v-2.5z" clip-rule="evenodd"/><path fill="currentColor" d="M11.5 6H16v4h-4.5z"/></svg>',Leaves:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M20.435 3.569c-9.676 1.817-9.361 8.633-8.606 12.098a.37.37 0 0 0 .326.284c8.283.762 9.282-7.474 8.715-12.073a.367.367 0 0 0-.435-.31ZM3.416 8.329c-1.73 6.838 2.344 7.942 4.813 7.622a.36.36 0 0 0 .283-.224c1.921-4.819-1.551-7.077-4.68-7.67a.365.365 0 0 0-.416.272Z"/><path stroke="currentColor" stroke-width="1.5" d="M5.25 11c1.417 1.667 4.4 6.7 5 10.5.167-1.75.25-5.5 7.75-14.5"/></svg>',PaymentCard:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="18" height="12" x="3" y="6" stroke="currentColor" stroke-width="1.5" rx=".75"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M6 12h7m3 0h2M6 15h4M3 9h18"/></svg>',PersonHeadset:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2<path stroke="currentColor" stroke-linecap="square" stroke-linejoin="round" stroke-width="1.5" d="M18 12h1.013c.993 0 1-4.5 0-4.5h-1.516m-10.802 0H5.007c-1.02 0-1.015 4.5-.002 4.5H7m9.5 5c2.193.398 4.315 2.375 4.5 3.983L3 21c.354-1.647 1.942-3.134 4-3.5 2.854-.48 2.5-1.5 2.5-2v-1C6.947 12.798 7.002 9.662 7.002 7c0-3.056 3.028-4 4.969-4 1.94 0 4.506.993 5.052 4 .227 1.25.477 3.47 0 5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.5 14.219c0-.655-.5-1.219-1-1.219h-1.502c-.5 0-.998.564-.998 1.219s.494 1.281.998 1.281H14.5c.499 0 .999-.626.999-1.281" clip-rule="evenodd"/><path stroke="currentColor" stroke-width="1.5" d="M15.5 14.5H19a.75.75 0 0 0 .75-.75V10"/></svg>',RotateGeneral:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M16 9h3a1 1 0 0 0 1-1V5"/><path stroke="currentColor" stroke-width="1.5" d="M4 12a8 8 0 0 1 8-8 8 8 0 0 1 7.25 4.614"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M8 15H5a1 1 0 0 0-1 1v3"/><path stroke="currentColor" stroke-width="1.5" d="M20 12a8 8 0 0 1-15.25 3.386"/></svg>',Speedometer:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M12 6.938v1.5m6.05 1L17 10.506m-9.95 0L6 9.437"/><path fill="currentColor" d="m14.335 10.77-3.188 3.984a.19.19 0 0 0 .063.288l1.594.797a.19.19 0 0 0 .265-.11l1.594-4.781c.067-.201-.196-.344-.328-.179"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M16 15.438h4.25c.414 0 .753-.338.72-.75a9 9 0 0 0-17.94 0c-.033.412.306.75.72.75H8"/><circle cx="12" cy="15.5" r="2" fill="currentColor"/></svg>',Star:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M11.825 3.091a.188.188 0 0 1 .35 0l2.161 5.738 6.16.268a.188.188 0 0 1 .108.334l-4.824 3.8
211 1.648 5.901a.187.187 0 0 1-.284.207L12 15.97l-5.144 3.38a.187.187 0 0 1-.284-.207l1.648-5.901-4.824-3.811a.188.188 0 0 1 .108-.334l6.16-.268z"/></svg>',Subscription:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M3 5.75A.75.75 0 0 1 3.75 5h16.5a.75.75 0 0 1 .75.75v14.5a.75.75 0 0 1-.75.75H3.75a.75.75 0 0 1-.75-.75z"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M17 6V4M7 6V4m7 7 2.051.684a1 1 0 0 0 1.265-.633L18 9m-8 6-2.051-.684a1 1 0 0 0-1.265.633L6 17"/><path stroke="currentColor" stroke-width="1.5" d="M16.75 11.434A5.002 5.002 0 0 0 7.416 11m-.166 3.566a5.002 5.002 0 0 0 9.334.434"/></svg>',Truck:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.5 21a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m9 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"/><path stroke="currentColor" stroke-width="1.5" d="M3 4.75A.75.75 0 0 1 3.75 4h10.5a.75.75 0 0 1 .75.75V12H3zM5 18H3.75a.75.75 0 0 1-.75-.75V12h18v5.25a.75.75 0 0 1-.75.75H19m-9 0h4m1-12h2.25A3.75 3.75 0 0 1 21 9.75V12h-6z"/></svg>',Undo:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M6 5 3.53 7.47a.75.75 0 0 0 0 1.06L6 11"/><path stroke="currentColor" stroke-linecap="square" stroke-width="1.5" d="M4 8h12a5 5 0 0 1 5 5v0a5 5 0 0 1-5 5H6"/></svg>',WrenchScrewdriver:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="1.5" d="M11.5 11.5 19 19"/><path fill="currentColor" fill-rule="evenodd" d="M20.892 21.608a.25.25 0 0 1-.311.034l-2.318-1.475a.25.25 0 0 1-.043-.387l1.56-1.56a.25.25 0 0 1 .387.043l1.475 2.318a.25.25 0 0 1-.034.31z" clip-rule="evenodd"/><path stroke="currentColor" stroke-width="1.5" d="M3.75 3.75c-.781.781-.86 2.14 0 3l6.47 6.008a.75.75 0 0 0 1.041-.019l1.247-1.246a.75.75 0 0 0 .038-1.02L6.75 3.75c-1-1-2.219-.781-3 0Z"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M11.25 5.463A5.25 5.25 0 0 1 15.7 3c1.134 0 2.185.36 3.043.972L14.226 6.58c-.008 1.876.46 2.685 2.122 3.674l4.564-2.636q.038.312.038.632a5.25 5.25 0 0 1-4.068 5.116M11.778 15l-5.364 5.364a2 2 0 0 1-2.828 0 2.043 2.043 0 0 1 0-2.864l4.209-4.134"/></svg>'},m=k(()=>t.getters["config/locale"]),y=e=>{if(!e)return null;const t=s[e];return t||(console.error(`Icon ${e} was not found`),null)};return p(async()=>{try{const e=await vh.getUspLinks(m.value),t=e.data?.entries?.[0]?.marketing_config?.usps?.filter(e=>e?.scope?.slots?.includes("usp_top_bar")).slice(0,4)??[];i.value=t.map(e=>{return{iconSvg:y(e.usp_icon),title:e.content.header,href:(t=e.content?.link?.link_reference?.[0]?.link_external?.href,t&&(t.startsWith("#")||t.startsWith("/#"))?`${window.location.origin}${t}`:t),uuid:e.uuid};var t})}catch(e){console.error(e)}finally{r.value=0===i.value.length}}),(e,t)=>{const s=h("safe-html");return f((o(),g("div",xh,[l("div",Eh,[l("ul",{class:d(`p-ec01__usp-list p-ec01__usp-list--items${i.value.length}`)},[(o(!0),g(S,null,x(i.value,e=>(o(),g("li",{key:e.uuid,class:"p-ec01__usp-item"},[(o(),a(u(e.href?"a":"span"),w({class:e.href?"p-ec01__usp-item-link":"p-ec01__usp-item-content"},{ref_for:!0},e.href?{href:e.href,target:"_blank"}:{}),{default:n(()=>[e.iconSvg?f((o(),g("span",Th,null,512)),[[s,e.iconSvg]]):I("",!0),l("span",Dh,c(e.title),
21)]),_:2},1040,["class"]))]))),128))],2)])],512)),[[B,!r.value]])}}},Lh={key:0,class:"p-ec01-language-switcher"},Mh=["src"],Bh={key:0},$h={key:1},Vh=["href","onClick"],Nh=yi({__name:"LanguageSwitcher",setup(e){const t=function(){const{hostname:e,pathname:t}=al(),i=nl();if(!i)return[];const r=Pe.filter(e=>e.url.split("/")[0]===i.url.split("/")[0]);return r.length<=1?[]:r.map(r=>{const o=r.url.split("/")[1],s=r.locale.split("_")[0].toUpperCase(),a=o?`/${o}`:"",n=i.url.split("/")[1]||"",l=n?t.replace(`/${n}`,""):t;return{id:r.locale,label:s,url:`https://${e}${a}${l}`,isActive:r.locale===i.locale}})}(),i=nl(),r=i?.locale.split("_")[1]?.toLowerCase(),{trackLanguageSwitch:s}=Xa(),a=!i?.url.split("/")[1];return(e,n)=>v(t).length>0?(o(),g("div",Lh,[l("img",{src:`/c-e/shop/checkout/assets/img/flags/${v(r)}.svg`,alt:""},null,8,Mh),(o(!0),g(S,null,x(v(t),(e,t)=>(o(),g(S,{key:e.id},[t>0?(o(),g("span",Bh,"/")):I("",!0),e.isActive?(o(),g("strong",$h,c(e.label),1)):(o(),g("a",{key:2,href:e.url,class:"p-ec01-language-switcher__link",onClick:t=>(e=>{const t=a?"default_to_alternate":"alternate_to_default";s(i.locale,e.id,t)})(e)},c(e.label),9,Vh))],64))),128))])):I("",!0)}},[["__scopeId","data-v-5faa054e"]]),Rh={class:"p-ec01-header"},Fh={class:"p-layout-inner"},Uh={class:"p-row-gutter p-ec01-header__inner"},qh=["href","title"],Hh={components:{AppHeader:yi({__name:"AppHeader",setup(e){const{i18n:t}=Ii(),i=ll();return(e,r)=>(o(),g("header",Rh,[l("div",Fh,[l("div",Uh,[l("a",{href:v(i),"aria-labelledby":"philips-logo",class:"p-ec01-header__logo",title:v(t)("cartoverview.main-page")},[...r[0]||(r[0]=[l("svg",{id:"philips-logo",width:"131",height:"24",viewBox:"0 0 131 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M44.4019 0.480751V23.5192H37.3709V14.4601H30.0545V23.5192H23.0235V0.480751H30.0545V9.63756H37.3709V0.480751H44.4019ZM68.8676 18.892V0.480751H61.8366V23.5192H74.5465L75.6056 18.892H68.8601H68.8676ZM56.6385 0.480751H49.6075V23.5192H56.6385V0.48
20751ZM85.1455 0.480751H78.1145V23.5192H85.1455V0.480751ZM119.82 6.36244C119.82 5.10798 121.074 4.52958 123.095 4.52958C125.311 4.52958 127.715 5.01033 129.36 5.68639L128.781 0.676056C126.948 0.292958 125.311 0 122.329 0C116.65 0 112.789 2.2385 112.789 6.94085C112.789 15.0385 123.771 13.4009 123.771 17.1568C123.771 18.5991 122.712 19.3728 120.113 19.3728C117.799 19.3728 114.238 18.5991 112.12 17.5399L112.894 22.8432C115.012 23.6169 117.904 24 120.218 24C126.092 24 130.907 22.0695 130.907 16.2854C130.907 8.5784 119.827 10.0207 119.827 6.35493L119.82 6.36244ZM110.67 8.77371C110.67 14.6554 106.524 18.0282 99.9812 18.0282H97.4798V23.5192H90.4488V0.480751C92.8601 0.187794 96.2254 0 99.0197 0C106.246 0 110.678 2.31361 110.678 8.77371H110.67ZM103.737 8.87136C103.737 5.97934 102.1 4.34178 98.6291 4.34178C98.2685 4.34178 97.8854 4.34178 97.4723 4.36432V13.8817H98.6291C102.287 13.8817 103.737 11.861 103.737 8.87136ZM20.2291 8.77371C20.2291 14.6554 16.0901 18.0282 9.53991 18.0282H7.0385V23.5192H0V0.480751C2.41127 0.187794 5.77653 0 8.57089 0C15.7972 0 20.2216 2.31361 20.2216 8.77371H20.2291ZM13.2883 8.87136C13.2883 5.97934 11.6507 4.34178 8.18779 4.34178C7.82723 4.34178 7.44413 4.34178 7.03099 4.36432V13.8817H8.18779C11.846 13.8817 13.2883 11.861 13.2883 8.87136Z",fill:"#0B5ED7"})],-1)])],8,qh),y(Nh)])])]))}},[["__scopeId","data-v-867f7da5"]]),UspBar:Oh,AppFooter:Sh,ErrorState:nh,Stepper:ph},data:()=>({visibilityAbortController:null}),computed:{...i("order",["orderId"]),...i("delivery",["selectedDeliveryModeId"]),...i("payments",["link2PayEnabled"]),...i({showError:e=>e.error.showError||!1}),isStepperVisible(){return"confirmation"!==this.$route.name&&"1"===this.getVariantUS1581709&&!this.link2PayEnabled}},mounted(){const e=this.i18n("checkoutoverview.cart-reload-message");this.$store.commit("cart/updateAlertTextToRefresh",e),document.addEventListener("visibilitychange",this.visibilityHandler),vt()},beforeUnmount(){document.removeEventListener("visibilitychange",this.visibilityHandler)},methods:{async visibilityHandler(){if("confirmation"===this.$route.name)return;if(this.visibilityAbortController?.abort(),this.visibilityAbortController=null,document.hidden)return;this.visibilityAbortController=new AbortController;const{signal:e}=this.visibilityAbortController;this.link2PayEnabled?await this.$store.dispatch("cart/getPayByLinkCollectionPoints",{orderId:this.orderId,signal:e}):(this.selectedDeliveryModeId&&await this.$store.dispatch("delivery/updateDeliveryMode",{deliveryMode:this.selectedDeliveryModeId,signal:e}),await this.$store.dispatch("cart/getCartItems",{signal:e}))}}},jh={class:"p-layout-row"},Gh={key:2,class:"p-layout-main"};const Wh=yi(Hh,[["render",function(e,t,i,r,s,n){const l=D("app-header"),c=D("usp-bar"),d=D("stepper"),u=D("error-state"),p=D("router-view"),m=D("app-footer");return o(),g("div",jh,[y(l),y(c),n.isStepperVisible?(o(),a(d,{key:0})):e.showError?(o(),a(u,{key:1})):(o(),g("main",Gh,[y(p)])),y(m)])}]]);console.log("PH Checkout Web version: 20260831.8-1490187");try{await async function(){let e={};try{e=await Gm(window.location)}catch(r){console.error("Failed to load config:",r)}const t=Hm();let i=null;i=te(Wh),i.directive("safe-html",Xm),i.use(t),i.use(ui),i.mixin(Wm),i.mixin(zm),i.mixin(Ic),i.mixin(kc),i.mixin(Qm),i.mixin(Km),ui.dispatch("config/updateConfig",e),ui.dispatch("config/updateUserLogInStatus"),ui.dispatch("config/updateLoginRedirect"),ui.dispatch("payments/updatePaymentStatus"),Ym(e),i.mount(".p-ec01__app")}()}catch(zh){console.error(zh)}export{rd as B,Ie as C,Mu as D,Se as E,$s as I,kl as O,Ee as R,we as S,yi as _,Xa as a,Vi as b,gi as c,xe as d,tt as g,Gs as h,Ii as u,tl as w};

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.