PageSourceSearch

https://divus.cz/cdn/shopifycloud/checkout-web/assets/c1/dffdfb34.CC5iYpqj.js

js divus.cz collected 2026-10-02 11:43:09 UTC 113,557 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["f2ade998.DJbl4Bue.js","2c1ab0fe.GMbxnz74.js","4c290a1e.C6TDJ9Fn.js","app.CepNJbvh.js","assets/app.BuSMBobh.css","assets/previous.Cyrg41An.css","164ad2e3.BbIvMjRY.js","9f047e05.CCJUgz_L.js","0a7dffce.DfUtZWCu.js","5fda1420.KYpufQ--.js","60a453ce.CkhHeRBc.js","21cc90a2.DAzJmttM.js","bb728e1c.iawBHR84.js","assets/helpers.CWAfD7H_.css","74835653.CRP9zX7D.js","31cc568e.eY_zQ4dB.js","assets/index.CiYh36Pk.css","29034f35.BtTRppF-.js","ac5a19ff.CRrh5Bdw.js","47b970b2.hK1atmf1.js","0727407f.CsUvC--9.js","assets/PhoneField.-WW1pYgW.css","064f6ac1.B1U3VPaO.js","assets/Popover.Bi1nHaU-.css","53bbdad9.CGJC_1cv.js","efa0389a.Cyj781OI.js","assets/Choice.CIaVEvsx.css","assets/BillingAddressForm.2HXntA0X.css","a25deb9a.DBfpGDzj.js","2fdb3dd3.YdlRJDkL.js","91319467.CaV5Q69j.js","c57e39e6.BkBRz_xN.js","2210eadb.DF0gIp_2.js","assets/ShopPayVerificationSwitch.B-eXy2pX.css","d56ce0bb.r0GPilE8.js","7b0c98ea.CqdLBMXo.js","assets/TransitionHeight.CuRoM9zv.css","e3e348f2.tCxUo2up.js","ca5e9c49.BT49yYQL.js","0c0ad074.A9YqaSW6.js","cb38e5c2.DHRUgYmP.js","945a08d6.BXUdjYDL.js","assets/useShopPayButtonClassName.Lp0gX49z.css","0e67bd3b.rrDC0LWO.js","f1968089.C3ZYp3_Z.js","55098bf1.CKQdNNxq.js","cb5cf153.bw-I465_.js","ed9f2238.D-8_6d2f.js","ccdf3592.CGA4lGQ3.js","a422df8c.BXxALpKm.js","assets/EmptyState.CZwDb_Yh.css","79974aab.hHH-4idQ.js","d22d2b80.DxyGtOjJ.js","f49d4216.BS85dmZ4.js","assets/ApplePayButton.BM2doXr6.css","56bd1136.BGuQJKXV.js","3a819064.Dx-RF2LD.js","8536083a.BLo7Yz4V.js","assets/WalletSandbox.DOuxlppk.css","4aab4b34.DxKnKnlM.js","assets/amazonWalletLazy.hSB1Y1Ss.css","assets/delivery-method-transitions.S-FSTp4Y.css","78af98ed.Cs6St23D.js","be176b00.DFWVMQsh.js","assets/Map.C9t3_4_W.css","8574876b.DlqSeZRL.js","assets/PickupPoint.CTLIABcy.css"])))=>i.map(i=>d[i]);
2import{t as e,_ as n,u as t,m as a,C as i,T as o,o as r,p as l,q as s,l as c,x as d,s as u,w as p,n as m,S as h,v,z as _,N as y,X as g,E as b,a as f,j as k,F as C,aA as P,f as I,G as S,ae as L}from"./2c1ab0fe.GMbxnz74.js";import{h as M,F as A,b as w}from"./31cc568e.eY_zQ4dB.js";import{S as E,W as x,ab as N,b6 as T,aZ as O,J as F,T as D,j7 as B,eI as V,bo as z,bp as R,bq as U,ak as H,a9 as j,j8 as $,cl as q,aa as K,j9 as G,ac as W,ja as Y,Q,aH as X,jb as J,eY as Z,jc as ee,a1 as ne,ck as te,b3 as ae,jd as ie,je as oe,aj as re,jf as le,df as se,bh as ce,g5 as de,_ as ue,jg as pe,jh as me,y as he,g3 as ve,ji as _e,jj as ye,j2 as ge,dJ as be,jk as fe,jl as ke,ev as Ce,jm as Pe,ah as Ie,cS as Se,jn as Le,jo as Me,I as Ae,eM as we,eL as Ee,K as xe,f8 as Ne,jp as Te,cr as Oe,af as Fe,eP as De,aW as Be,k as Ve,n as ze,cs as Re,cV as Ue,cj as He,jq as je,jr as $e,dh as qe,ai as Ke,js as Ge,ik as We,jt as Ye,ju as Qe}from"./4c290a1e.C6TDJ9Fn.js";import{dB as Xe,f as Je,dC as Ze,i as en,a9 as nn,P as tn,cx as an,c as on,e2 as rn,cs as ln,I as sn,l as cn,hl as dn,bi as un,g4 as pn,eR as mn,M as hn,a as vn,ay as _n,o as yn,gO as gn,Q as bn,bT as fn,J as kn,T as Cn,c0 as Pn,gM as In,S as Sn,L as Ln,hm as Mn,bU as An,hd as wn,cX as En,cz as xn,gB as Nn,ae as Tn,fF as On,H as Fn,bz as Dn,cQ as Bn,B as Vn,ah as zn,b6 as Rn,c6 as Un,a4 as Hn,a2 as jn,a5 as $n,a3 as qn,hn as Kn,w as Gn,ho as Wn,df as Yn,X as Qn,U as Xn,b as Jn,gp as Zn,g as et,W as nt,F as tt,N as at,bo as it,bn as ot,co as rt,eZ as lt,fd as st,hp as ct,bN as dt,f_ as ut,hq as pt,cv as mt,cw as ht,hr as vt,fP as _t,e_ as yt,bF as gt,ai as bt,bv as ft,ct as kt,hs as Ct,cm as Pt,f6 as It,f7 as St,ds as Lt,V as Mt,cp as At,bE as wt,cq as Et,ht as xt,hu as Nt,fl as Tt,aG as Ot,c7 as Ft,aC as Dt,hv as Bt,b5 as Vt,ak as zt,bt as Rt,hw as Ut,aE as Ht,a1 as jt,db as $t,dc as qt,ep as Kt,a6 as Gt,c8 as Wt,hx as Yt}from"./164ad2e3.BbIvMjRY.js";import{a as Qt,v as Xt,b as Jt,S as Zt}from"./0c0ad074.A9YqaSW6.js";import{p as ea,a as na}from"./9f047e05.CCJUgz_L.js";import{b as ta,c as aa,d as ia,e as oa,i as ra,f as la}from"./2fdb3dd3.YdlRJDkL.js";import{u as sa,A as ca}from"./53bbdad9.CGJC_1cv.js";import{u as da,S as ua,a as pa,b as ma,A as ha}from"./0e67bd3b.rrDC0LWO.js";import{L as va}from"./f1968089.C3ZYp3_Z.js";
2import{P as _a,u as ya,F as ga}from"./47b970b2.hK1atmf1.js";import{_ as ba,k as fa,j as ka}from"./app.CepNJbvh.js";import{I as Ca}from"./55098bf1.CKQdNNxq.js";import{S as Pa,u as Ia,G as Sa}from"./cb5cf153.bw-I465_.js";import{b as La,d as Ma,e as Aa,h as wa,i as Ea,j as xa,k as Na,a as Ta}from"./ed9f2238.D-8_6d2f.js";import{a as Oa,e as Fa,S as Da}from"./ca5e9c49.BT49yYQL.js";import{g as Ba,P as Va,h as za}from"./e3e348f2.tCxUo2up.js";import{S as Ra}from"./cb38e5c2.DHRUgYmP.js";import{a as Ua}from"./945a08d6.BXUdjYDL.js";import{M as Ha}from"./ccdf3592.CGA4lGQ3.js";import{b as ja,C as $a,a as qa}from"./efa0389a.Cyj781OI.js";import{C as Ka}from"./a422df8c.BXxALpKm.js";import{S as Ga}from"./79974aab.hHH-4idQ.js";import{T as Wa}from"./7b0c98ea.CqdLBMXo.js";import{u as Ya}from"./d22d2b80.DxyGtOjJ.js";import{a as Qa,s as Xa,M as Ja}from"./74835653.CRP9zX7D.js";import{P as Za}from"./f49d4216.BS85dmZ4.js";import{P as ei}from"./064f6ac1.B1U3VPaO.js";function ni(){const{shop:n,checkout:t}=E(),{shippingAddress:a,billingAddress:i}=x(),o=Xe();return e(()=>{const e=ea({isShippingRequired:t.isShippingRequired.value,isPickupSelected:o.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:i.fields.countryCode.value});return na(n,e)})}function ti(){const{shop:n,source:t,checkout:a}=E(),i=Je(),o=x(),r=Xe(),l=Ze(),s=ni();return e(()=>{const e=o.phone.value,c=o.email.value,d=a.identity.current.value;let u,p=Boolean(s.value)||"OFF"!==n.smsMarketing;if("shopPay"!==d&&"businessCustomer"!==d||(p=!1),a.configuration.visibility.showSmsMarketing&&p&&!1!==i?.smsMarketingEnabled&&!T(t)){let n;n=e&&!c?"contact":r.value||!a.isShippingRequired.value?"billing":"delivery",u=l.value[n]?"root":n}else u="none";return{isNone:"none"===u,isContact:"contact"===u,isDelivery:"delivery"===u,isBilling:"billing"===u,isRoot:"root"===u}})}function ai({origin:e="contact_info_page"}){const{acceptEmailMarketing:a}=x(),{negotiate:i}=en(),{emailMarketingOptInShownSignal:o}=O(),{i18n:r,userEvents:l,checkout:s,source:{checkoutSessionIdentifier:c,sourceId:d},shop:{id:u,myshopifyDomain:p}}=E(),m=s.configuration.layout.isOnePage.value;n(()=>{o.value=!0},[o]);const h=M("marketing.disclaimer.description_html",r)?t(tn,{type:"small",color:"subdued",children:t(nn,{children:r.translate("marketing.disclaimer.description_html",{privacy_policy_link:t(va,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:t(va,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return t(on,{gap:"small-200",children:[t(an,{id:"marketing_opt_in",name:"marketing_opt_in",checked:a.value,onChange:function(n){a.value=n,i({legacyFiltering:{},loading:["acceptEmailMarketing"],silenceViolations:["payment-session"]}),l.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:c||d,shopId:Number(F(u)),shopifyDomain:p,action:n?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:m?"checkout_one_redesign":"checkout_one"}})},label:ii({identity:s.identity,i18n:r})}),h]})}function ii({identity:e,i18n:n}){switch(e.current.value){case"shopPay":case"buyWithPrime":return n.translate("marketing.accept_shop_pay_marketing_checkbox_label");default:return n.translate("marketing.accept_marketing_checkbox_label")}}ai.displayName="MarketingOptIn";const oi=/<a\b(?<attributes>[^>]*)>(?<text>.*?)<\/a>/gi,ri=/data-policy-handle=(["'])(?<handle>privacy-policy|terms-of-service)\1/i,li=/<\/?[a-z][\s\S]*>/i;function si(e){return t(nn,{dangerouslySetInnerHTML:{__html:e}})}function ci(e,n){return t("span",{dangerouslySetInnerHTML:{__html:e}},n)}function di(e){const n=[];let a=0,i=!1;for(const r of e.matchAll(oi)){const o=r.index,l=ui(r);if(null==o||!l)continue;const s=e.slice(a,o);if(li.test(s))return si(e);s&&n.push(ci(s,`text-before-${o}`)),n.push(t(va,{handle:l,tone:"monochrome"},`${l}-${o}`)),a=o+r[0].length,i=!0}const o=e.slice(a);return!i||li.test(o)?si(e):(o&&n.push(ci(o,"trailing-text")),t(nn,{children:n}))}function ui(e){const n=e.groups?.attributes??"",t=n.match(ri)?.groups?.handle;return"privacy-policy"===t?"privacy-policy":"terms-of-service"===t?"terms-of-service":null}function pi(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function mi(){const{i18n:r,shop:l,checkout:s,embed:c}=E(),{marketingPhoneInputError:d,previousPhoneMarketingDisclosureKeySignal:u,smsMarketingOptInShownSignal:p}=O(),{phone:m,acceptSmsMarketing:h,smsMarketingPhone:v,shippingAddress:_}=x(),y=ta(),g=ni(),b=g.value,f=pi(b),k=!b&&"OFF"!==l.smsMarketing,C=f?.label??(k?r.translate("marketing.accept_sms_checkbox_label"):void 0),P=Boolean(C);n(()=>{P&&(p.value=!0)},[P,p]);const I=D(),{handleSmsMarketingConsent:S}=aa(),L=e(()=>I.buyerIdentity.value?.customerProfile),M=e(()=>!m.value&&!s.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),A=e(()=>Boolean(!m.value)),w=e(()=>!c?.isFlagshipPartner&&!L.value&&!A.value);a(()=>
2{if(!v.value){const e=M.value?_.fields.phone.value:m.value;v.value=e??""}},[]),i(()=>{const e=_.fields.phone.value;M.value&&!pi(g.value)&&"OFF"===l.smsMarketing&&(v.value=e||"")}),ia(),i(()=>{const e=(n=g.value)?JSON.stringify([n.label,n.disclaimerHtml]):null;var n;const t=u.peek();u.value=e,null!=t&&null!=e&&t!==e&&h.value&&(h.value=!1)}),i(()=>{m.value&&!L.value&&(v.value=m.value)});const N=r.translate("field_errors.sms_marketing_phone_invalid"),T=oa(N),F=o(()=>({state:{phone:v},errors:{phone:d}}),[d,v]);if(!C)return null;const B=t(tn,f?{type:"small",color:"subdued",children:di(f.disclaimerHtml)}:{type:"small",color:"subdued",children:t(nn,{children:r.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:t(va,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:t(va,{handle:"terms-of-service",tone:"monochrome"})})})});return t(ln,{...F,children:t(rn,{id:"smsMarketingOptInDisclosure",open:h.value,summary:t(an,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:C,checked:h.value,onChange:function(e){d.value=void 0,S(e)},"aria-controls":"smsMarketingOptInDisclosure"}),content:t(on,{gap:"base",paddingBlockStart:"base",children:[t(_a,{countryCode:y.value??"",label:r.translate("marketing.sms.mobile_phone_number"),disabled:w.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...h.value?T:{}}),B]})})})}mi.displayName="PhoneMarketingOptIn";const hi=r({displayName:"ShopPayVerificationSwitch",load:()=>l(()=>ba(()=>import("./f2ade998.DJbl4Bue.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))});function vi({onClick:e}){const{i18n:n}=E();return t(cn,{variant:"primary",accessibilityLabel:n.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:t("div",{className:"rdvNk",children:t(sn,{type:"mobile",size:"large"})})})}function _i(){const e=dn({key:"india_phone_autofill",variants:[B.Control,B.Treatment]}),n=yi()===B.Treatment;return e||(n?B.Treatment:B.Control)}function yi(){const{client:e}=E();return e.unstable_getSerialization("experiments")?.find(({clientHandle:e})=>e===fa)?.variant}function gi({emailInput:e,email:n,isShopPayUnauthenticatedUser:t}){const{shopPay:o}=E(),r=c(""),l=t?mn.C1ModalShopPay:void 0,[s,p]=d(l),[m,h]=d(!1),[v,_]=d(!1),y=n.trim(),g=u((e,n)=>{n&&(r.current=n),t||_(!e),h(e)},[t,r]);return i(()=>{const e=o.session.verificationTrigger.value;e&&(g(!0),o.session.unstable_updateVerificationTrigger(null),t&&[pn.LoginLink,pn.ErrorModalClearEmail].includes(e.source)&&(p(mn.C1ModalShopPaySignIn),e.source===pn.ErrorModalClearEmail&&window.dispatchEvent(new Event("shop_pay_verification_reset"))))}),a(()=>{y!==r.current&&(_(!1),h(!1))},[y,r]),a(()=>{_(!1)},[e]),{modalUrlOrigin:l,modalUpdatedOrigin:s,shopPayVerificationVisible:m,showShopPayVerificationToggle:v,showShopPayVerification:g,setModalUpdatedOrigin:p,setShowShopPayVerificationToggle:_}}const bi=bn("EmailFieldAccessory");function fi({saved:e}){const{i18n:n}=E(),i=hn(void 0,bi),o=n.translate("contact.field_saved_label"),[r,l]=d(!1);return a(()=>{if(e)return vn({content:o,role:"status"})},[e,o]),t("span",{className:"iWrC7",children:[t(_n,{className:e?"aDczq":void 0,accessibilityLabel:n.translate("contact.field_tooltip_accessibility_label"),accessibilityVisibility:e&&!r?"hidden":"visible",onFocus:()=>l(!0),onBlur:()=>l(!1),interestFor:i,children:t(sn,{type:"question"})}),e?t("span",{className:"oMR3v","aria-hidden":!0,children:t(yn,{type:"small",tone:"neutral",children:o})}):null,t(gn,{id:i,children:n.translate("contact.field_tooltip_helper_text")})]})}function ki(e){return(e??"").trim().toLowerCase()}const Ci="contact-information-text-field-container",Pi=`#${Ci}`;function Ii({onInputTypeChange:e,onInlineEmailValidation:n,onInlinePhoneValidation:r}){const l=H(),{inMemoryPayPalParts:{accountStatus:u}}=j(),{i18n:h,observability:v,shop:_,shopPay:y,checkout:g,source:b}=E(),f=y.user.isUnauthenticatedUser.value,k=N(),C=ta(),{email:P,phone:I,smsMarketingPhone:S}=x(),L=P.value,M=I.value,[A,w]=d(P.peek()??""),[T,O]=d(k.value||""===I.peek()||""!==P.peek()&&P.peek()||f?"EMAIL":"PHONE"),[F,D]=d(0),G=h.translate("contact.email_or_phone_label"),W=h.translate("field_errors.email_or_phone_invalid"),Y=function(e,n,t="PHONE"){const{phone:a}=x(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:o,emailInputError:r}},wallets:l}}=E(),c=l.activeSession.value;un(e=>{if("EMAIL"!==t&&"error"===e.type)for(const t of e.violations)if("UnprocessableTermViolation"===t.__typename&&V.has(t.code)&&!ra(t.target))if("BUYER_IDENTITY_EMAIL_REQUIRED"===t.code){const e=t.localizedMessage??t.nonLocalizedMessage;o.value=e}else{const e=n||(t.localizedMessage??t.nonLocalizedMessage);o.value=e,r.value=void 0}});const d=s(void 0),u=c?d:o;return z(a,u,n=>
2{if(c)i.leaveErrorBreadcrumb("[useValidatedPhoneField] Not validating phone - wallet session active");else{if("EMAIL"!==t)return i.leaveErrorBreadcrumb("[useValidatedPhoneField] Validating phone number"),e(n);i.leaveErrorBreadcrumb("[useValidatedPhoneField] Skipping phone validation - input type is EMAIL")}},R.InvalidContactMethod),U(a,u,"PHONE"===t?e:void 0)}(r,W,T),Q=$(_,C.value),X=k.value||f||!Q.includes("PHONE"),J=_i(),Z=""===A&&!L,ee=J===B.Treatment&&"IN"===C.value&&!X&&Z?"tel":"email";function ne(e,n){if("EMAIL"===T&&(w(e),f&&ce(mn.C1ModalShopPay)),!X)if(null!=n&&D(n),""===e)O("EMAIL"),m(()=>{I.value="",P.value="","PHONE"===T&&(S.value="")}),v?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const n=/([A-Za-z]|\.|@)/.test(e);n&&"EMAIL"!==T?(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),m(()=>{I.value="",P.value=e,S.value=""}),O("EMAIL")):n||"PHONE"===T||(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),P.value="",I.value=e,O("PHONE"))}}a(()=>{v.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[v]),a(()=>{e&&e(T)},[e,T]),a(function(){if(X)return void("EMAIL"!==T&&O("EMAIL"));const e=null!=L&&""!==L,n=null!=M&&""!==M;return e||n||"EMAIL"===T?e&&"EMAIL"!==T?(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),void O("EMAIL")):void(!e&&n&&"PHONE"!==T&&(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),O("PHONE"))):(v.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),void O("EMAIL"))},[L,T,v,X,M]);const te=c(!0);a(function(){const e=te.current;te.current=!1,(!Q.includes("PHONE")||f)&&"EMAIL"!==T&&(O("EMAIL"),""===L&&""!==M&&(I.value="",e||(P.value=M)))},[Q]),q(async({reason:e,parts:n})=>"progression"!==e?{behavior:"allow"}:{behavior:"allow",perform(){const e=n.phone.peek();""!==e&&n.deliveryLines.peek().forEach(n=>{const t=n.peek();n.value={...t,deliveryMethodOptions:{...t.deliveryMethodOptions,phone:e}}})}});const ae=da(),{modalUrlOrigin:ie,modalUpdatedOrigin:oe,shopPayVerificationVisible:re,showShopPayVerificationToggle:le,showShopPayVerification:se,setModalUpdatedOrigin:ce,setShowShopPayVerificationToggle:de}=gi({emailInput:A,email:P.value,isShopPayUnauthenticatedUser:f}),ue=c(null),pe=function(e,n,t="EMAIL"){const{email:a}=x(),{i18n:i,checkout:{validation:{contactErrors:{emailInputError:o,phoneInputError:r}},wallets:l},observability:c}=E(),{inMemoryApplePayParts:{asPaymentMethod:d,isLoadingPaymentSheet:u},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=j();un(n=>{if("PHONE"!==t)if("error"===n.type)if(!l.activeSession.value||d.value)if("negotiation"!==n.negotiationStage||u.value||p.value){c.leaveErrorBreadcrumb(`[ContactInformation] Processing ${n.violations.length} violations`);for(const t of n.violations){if("UnprocessableTermViolation"!==t.__typename||!V.has(t.code)||ra(t.target))continue;const n=e||(t.localizedMessage??t.nonLocalizedMessage);o.value=n,r.value=void 0}}else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - negotiation stage without wallet validation");else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - wallet active without Apple Pay");else c.leaveErrorBreadcrumb(`[ContactInformation] Journey listener skipped - event type: ${n.type}`);else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - input type is PHONE")});const m=s(void 0),h=l.activeSession.value?m:o;return z(a,h,e=>{if(l.activeSession.value)return void c.leaveErrorBreadcrumb("[ContactInformation] Not val
2idating email - wallet session active");if(n)return c.leaveErrorBreadcrumb("[ContactInformation] Using custom email validation"),n(e);c.leaveErrorBreadcrumb("[ContactInformation] Using default email validation");const t=Xt(e,i.translate("field_errors.email_blank")),a=Qt(e,i.translate("field_errors.email_invalid"));return t||a},R.InvalidContactMethod),U(a,h,"EMAIL"===t?n:void 0)}(X?void 0:W,"PHONE"===T?Si:n,T),me=K(),he=me.current.value.contactInfo?.email,ve=function(e,n){const t=o(()=>ki(e),[e]),i=o(()=>ki(n),[n]),[r,l]=d(!1),s=c(""!==t&&i===t);return a(()=>{const e=""!==t&&i===t,n=e&&!s.current;if(s.current=e,!e)return void l(!1);if(!n)return;l(!0);const a=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(a)},[t,i]),r}(L??"",he),_e=!b.isAbandonedCheckoutSupported||"EMAIL"!==T||ae.value&&le?void 0:t(fi,{saved:ve}),ye=ya({countryCode:C.value??"",label:G,onInputValueChange:ne,caretPosition:F,inputMode:"text",disableFormatting:!0,required:!0,...Y}),ge=X?void 0:{label:G,type:"text",caretPosition:F,inputMode:"text"},be=function({ref:e,email:n,addressType:o="shipping",contactAutocompleteType:r="email",disabled:l,label:s,onInputValueChange:c,caretPosition:d,inputMode:u,type:p="email",required:m,accessory:h}){const{i18n:v,shopPay:_}=E();return a(()=>{if(void 0!==d&&e.current&&n?.value&&d<n.value.length)try{e.current.setSelectionRange(d,d)}catch{}},[n.value,d,e]),function(){const{email:e}=x();i(()=>{"invalid"!==Qt(e.value,"invalid")&&document.cookie.includes("_tracking_consent=")})}(),{label:s??v.translate("contact.email_label"),id:"email",name:"email",type:p,ref:e,autocomplete:In([o,r]),disabled:l,inputMode:u,...n,onInput:async t=>{const a=t.trim();n.onInput(a),c?.(a,function(e){try{return e?.selectionStart}catch{}}(e.current)??0)},error:n.error,autoCapitalize:"text"===p?"off":void 0,accessoryEnd:"loading"===_.userVerification.value.status?t(Sn,{size:"small"}):h,required:m}}({email:pe,ref:ue,addressType:g.isShippingRequired.value?"shipping":"billing",disabled:"loading"===u.value.status,required:!0,accessory:_e,contactAutocompleteType:ee,...ge,onInputValueChange:ne}),fe="PHONE"===T?ye:be,ke="PHONE"===T?null==M||""===M:Z,{isEnabled:Ce,impressionFeatures:Pe,fieldProps:Ie}=function({fieldProps:e,countryCode:n,combinedFieldRendered:t,fieldIsEmpty:a}){const i=fn(),o=_i(),r=function(){const e=yi();return e===B.Control||e===B.Treatment}(),l="IN"===n&&t,s=c(void 0),d=c(void 0);l&&(s.current??=e.autocomplete??"none",d.current??=a);const u=c(!1);function p(t){const i=e.autocomplete??"none",l=Boolean(e.error);return[`variant:${o}`,`assigned:${r}`,`autocomplete:${s.current??i}`,`autocomplete_at_impression:${i}`,`untouched_at_first_paint:${d.current??a}`,`country:${n}`,`field_has_error:${l}`,`trigger:${t}`]}return{isEnabled:l,impressionFeatures:p("seen"),fieldProps:l?{...e,onFocus:()=>{e.onFocus?.(),u.current||(u.current=!0,i("impression",{impressionType:"contact_autocomplete_hint",impressionFeatures:p("focus"),timestamp:new Date}))}}:e}}({fieldProps:fe,countryCode:C.value,combinedFieldRendered:!X,fieldIsEmpty:ke}),Se=ae.value&&le?t(vi,{onClick:()=>{se(!0),f&&ce(mn.C1ModalShopPay)}}):null,Le=ae.value?t(p,{when:l,children:t(hi,{popoverActivator:ue,popoverAnchorSelector:Pi,email:A,onSetEmail:e=>{pe.onInput(e),ne(e),pe.onChange(e)},open:re,showPopover:se,showToggle:de,urlOrigin:ie,updatedOrigin:oe})}):null,Me="PHONE"===T?"phone":"email",Ae=t(on,{gap:"small-400",children:[t(kn,{id:Ci,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[t(Cn,{...Ie,id:Me,error:Boolean(Ie.error),segment:Se?"start":void 0}),Se]}),"string"==typeof Ie.error&&Ie.error?t(Pn,{controlID:Me,children:Ie.error}):null]});return t("div",{children:[t(Ca,{impressionType:"contact_autocomplete_hint",impressionFeatures:Pe,enabled:Ce,children:Ae}),Le]})}function Si(){}function Li({showLogoutLink:e,logoutUrl:n}){const{i18n:i,shopPay:o,observability:r,source:l}=E(),s=D().buyerIdentity.value,{firstName:c,lastName:d,email:u,phone:p}=s?.customerProfile??{},m=s?.purchasingCompany?.company.name,v=da(),_="simulated"===l.type,y=c||d,{phone:g}=x(),b=u??p,f=!m&&b?` (${b})`:"",{modalUrlOrigin:k,modalUpdatedOrigin:C,shopPayVerificationVisible:P,showShopPayVerification:I}=gi({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return a(()=>{r.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${Boolean(u)}, hasPhone: ${Boolean(p)}`),s?.purchasingCompany||(g.value="")},[]),t(h,{children:[t(on,{direction:"inline",alignItems:"center",gap:"base",children:t(on,{gap:"small-400",children:[t(yn,{children:y?`${i.translate("general.display_name",{firstName:c??"",lastName:d??""})}${f}`:f}),m?t(on,{direction:"inline",gap:"small-400",children:[t(yn,{color:"subdued",type:"small",children:m}),u&&t(h,{children:[t(yn,{color:"subdued",type:"small",children:"•"}),t(yn,{color:"subdued",type:"small",children:u})]})]}):null,e&&!_?t(on,{direction:"inline",gap:"base",children:t(Ln,{href:n,children:i.translate("customer_account.sign_out_link_label")})}):null]})}),u&&v.value&&t(hi,{email:u,open:P,showPopover:I,urlOrigin:k,updatedOrigin:C})]})}function Mi(){const{i18n:e}=E();return t(yn,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:t(va,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:t(va,{handle:"terms-of-service",tone
2:"monochrome"})})})}function Ai({hideAllOptIns:n=!1,hideContactInfoEntry:a=!1,hideCustomerCard:i=!1,showEmailMarketingOptIn:r=!0,onValidateEmailInput:l}){const s=D(),c=s.buyerIdentity.value?.customerProfile,p=Mn().value,m=Je(),v=!1===m?.smsMarketingEnabled,{client:_,checkout:y,i18n:g,checkout:{validation:{contactErrors:{emailInputError:b,phoneInputError:f}},wallets:k},shop:C}=E(),{emailMarketing:P,contactInfoOptions:I}=C,S=_.unstable_getSerialization("logoutUrl")||"",{isContact:L}=ti().value,{showEmailMarketing:M}=y.configuration.visibility,w=C.hasFlagEnabled(G),{value:T}=s.buyerIdentity,O=T?.countryCode,[F,B]=d(r&&wi({emailMarketing:P,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:O,customerProfile:c,showEmailMarketing:M})),[V,z]=d(!1),R=ta(),{validatePhoneNumber:U}=sa(),{negotiate:H}=en(),j=u(e=>{B(r&&wi({emailMarketing:P,inputType:e,hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:O,showEmailMarketing:M})),z(!1)},[P,w,O,r,M]),q=function(){const{i18n:n,shop:t,shopPay:a}=E(),{shippingAddress:i}=x(),o=N();return e(()=>{const e=i.fields.countryCode.value,r=(e&&t.countrySpecific[e]?.contactInfoOptions)??t.contactInfoOptions;return o.value||a.user.isUnauthenticatedUser.value||!r.includes("PHONE")?n.translate("field_errors.email_blank"):n.translate("field_errors.email_or_phone_blank")})}(),K=u(e=>{const n=Xt(e,q.value),t=Qt(e,g.translate("field_errors.email_invalid"));return n||t||l?.(e)},[q,l,g]),Y=u(e=>{const n=Xt(e,g.translate("field_errors.email_or_phone_blank"));if(n)return z(!n),n;const t=U(e,R.value??"ZZ")?void 0:g.translate("field_errors.address_phone_blank");return z(!t),t},[g,U,R]),Q=fn(),X=An(),J=u(({contact:e})=>{k.activeSession.value||H({legacyFiltering:{silenceViolations:["all"],include:[]},silenceViolations:["all"],fieldsToResolve:[...wn]}),e.value=!0,Q("sectionComplete",{section:"contact",timestamp:new Date}),X({type:"section_complete",section:"contact"})},[k,H,Q,X]),Z=u(({contact:e})=>{e.value=!1},[]),{email:ee,phone:ne}=x(),te=o(()=>({state:{phone:ne,email:ee},errors:{phone:f,email:b}}),[ee,b,ne,f]),ae=N(),ie=C.hasFlagEnabled(W)?$(C,R.value):I,oe=ae.value||!ie.includes("PHONE"),re=!c?.email&&!c?.phone||oe&&!c?.email;return t(A,{children:t(En,{target:"cart.buyerIdentity",children:[c&&!i&&t(Li,{showLogoutLink:p,logoutUrl:S}),!a&&re&&t(ln,{...te,children:t(ua,{onValid:J,onInvalid:Z,children:t(Ii,{onInputTypeChange:j,onInlineEmailValidation:K,onInlinePhoneValidation:Y})})}),!n&&t(h,{children:[V&&!v?t(Mi,{}):null,r&&F?t(ai,{}):null,L&&t(mi,{})]})]})})}function wi(e){const{emailMarketing:n,inputType:t,hideNonEuropeMarketingOptInFlagEnabled:a,buyerCountryCode:i,customerProfile:o,showEmailMarketing:r}=e,l=a&&!Y(i);return r&&"OFF"!==n&&"EMAIL"===t&&!l&&!o?.acceptsEmailMarketing}function Ei(){const e=xn(),{editorSetShopPaySignal:n}=O(),t=u(e=>n.value?.setShopPay(e),[n]);return{setEditorShopPay:e&&n.value?t:void 0}}function xi(){const n=Nn(),t=function(){const{checkout:n}=E(),t=pa();return e(()=>t.value&&n.configuration.visibility.showExpressCheckout.value)}();return e(()=>n.value?"wallets":t.value?"skeleton":"hidden")}Li.displayName="CustomerCard";const Ni={ApplePayButton:"vT2w7",dark:"f1x20",light:"hKWGx"},Ti=r({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>t(Fi,{...e}),useError:function(e){const{observability:n}=E(),{buttonStatus:t}=j().inMemoryApplePayParts;a(()=>{e&&(t.value={status:"error"},n.leaveErrorBreadcrumb("Apple Pay button chunk failed to load",{wallet:La.ApplePay,errorName:e.name,errorMessage:e.message}),n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:La.ApplePay,status:"error",reason:"chunk_load_error",isPaymentMethodFlow:!1}}))},[t,e,n])},load:()=>l(()=>ba(async()=>{const{ApplePayButton:e}=await(import("./d56ce0bb.r0GPilE8.js"));return{ApplePayButton:e}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,35,36,37,38,15,16,39,40,24,41,42,29,43,14,17,18,19,20,21,22,23,25,26,27,44,45,46,47,48,49,50,51,52,53,54])).then(({ApplePayButton:e})=>e))});function Oi(e){const{source:n}=E(),{buttonStatus:a,sessionLoadFailed:i}=j().inMemoryApplePayParts;return Oa("ApplePay","simulated"!==n.type&&"not_rendered"===a.value.status&&!i.value),t(Ti,{...e})}function Fi({color:e}){const{i18n:n}=E();return t("button",{className:v(Ni.ApplePayButton,Ni[e],X.borderRadius,Q({focu
2sRing:"base"})),lang:n.locale,disabled:!0,type:"button","aria-label":n.translate("brand.apple_pay")})}const Di=r({displayName:"PortableWalletsPCIButtonContent",load:()=>ba(()=>import("./56bd1136.BGuQJKXV.js"),__vite__mapDeps([55,1,6,2,3,4,5,7,8,9,10,11,12,13,56,18,57,58,59,60])).then(e=>e.PortableWalletsPCIButtonContent),useError:ma});function Bi(e){return t(Di,{...e})}const Vi="oHCaH";function zi(){const{shopPay:e,observability:n,checkout:{wallets:i}}=E(),o=e.app.config,r=Ma(La.ShopifyPay),l=Jt({foregroundColor:Ra}),s=Ua(),c=J(o,s),d=la(Z.DirectCheckoutCheckout),p=Tn(),m=On(La.ShopifyPay),{setEditorShopPay:h}=Ei();a(()=>{n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})},[n]);const _=u(()=>{r(Aa.Success),m(),i.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),i.clearActiveSession({invokingWallet:"SHOP_PAY"})},[i,m,r]),y=u(e=>{if(h)return e.preventDefault(),void h(!0);_()},[_,h]),g=v("Xicuw",{[Vi]:!l&&!c},X.borderRadius,Q({focusRing:"base"}));return t("a",{id:"shop-pay-button",href:d,ref:p("shop_pay"),className:g,onClick:y,children:"shop"===e.logoBrand?t(Zt,{size:"medium"}):t(Pa,{size:"medium"})})}function Ri(){const{i18n:e}=E();return t(Dn,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:t(on,{gap:"large-200",padding:"large-200",children:[t(Fn,{level:1,children:e.translate("wallets.payment_in_progress_title")}),t(yn,{children:e.translate("wallets.payment_in_progress_body")})]})})}const Ui={Header:"o1z23",Text:"_4aXW0",Layout:"DUnBb",StackWrapper:"kTI19",SkeletonWrapper:"JH5oc",SkeletonExited:"Athif",ButtonWrapper:"pUo2R",loading:"_5SdgT",subsequentLoad:"RKgRy",Stack:"iRnuh",SimulatedWalletStack:"QKTth",ShopPayEmphasis:"Pnahu",Container:"OTERX",DrawerLink:"WTXfy",InnerDrawerLink:"qLVAT",DrawerHideButtons:"XHLFs",walletItem:"xBRI9"},Hi="express-checkout-heading";function ji({buttonCount:e,footer:n,children:a}){const{i18n:i}=E();return t(Vn,{className:Ui.Container,"data-count":e,children:[t("div",{className:Ui.Header,children:t(Bn,{id:Hi,className:Ui.Text,children:i.translate("alternative_payment_method_banner.express_checkout")})}),t("div",{className:Ui.StackWrapper,children:[t("div",{className:Ui.Layout,children:a}),n]})]})}function $i({count:e,transition:n,shopPayEmphasis:a=!1,hideWallets:i=!1}){const{client:o}=E(),r="fast"!==o.unstable_getSerialization("workerVersion");return t("div",{className:v(Ui.Stack,Ui.SkeletonWrapper,{[Ui.SkeletonExited]:"exited"===n,[Ui.ShopPayEmphasis]:a,[Ui.DrawerHideButtons]:i}),children:[...Array(e).keys()].map(e=>t(zn,{delay:r},e))})}const qi=/(iPhone|iPod|iPad|Mac OS)/i,Ki=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,Gi=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function Wi(e,n,t){return{walletName:n,isRendered:()=>"rendered"===e.value?.status,isLoading:()=>"not_rendered"===e.value?.status&&(t?.()??!0),onTimeout:()=>{e.value={status:"error"}}}}function Yi({buttonCount:n,children:r,walletPaymentMethods:l}){const[s,m]=d(performance.now()),[y,g]=d(!0),b=function(){const{client:{userAgent:e},embed:n}=E(),t=Ki.test(e),a=qi.test(e)&&Gi.test(e),i=void 0!==n&&("SWIFT"===n.platform||"REACT_NATIVE_SWIFT"===n.platform);return!(a||t||i)}(),f=H(),{inMemoryApplePayParts:{paymentSheetError:k}}=j(),C=function(){const{source:n}=E(),t=function(){const n=j();return e(()=>ee.some(e=>function(e,n){const t=Boolean(e.acceleratedWalletPaymentMethods.value.find(e=>e.name===n)),a=(()=>{switch(n){case"APPLE_PAY":{const{buttonStatus:n,sessionLoadFailed:t}=e.inMemoryApplePayParts;return t.value?void 0:n.value}case"PAYPAL_EXPRESS":return e.inMemoryPayPalParts.acceleratedCheckoutButtonStatus.value;case"VENMO":return e.inMemoryVenmoParts.buttonStatus.value;case"GOOGLE_PAY":return e.inMemoryGooglePayParts.buttonStatus.value;case ne.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case ne.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();
2return t&&"not_rendered"===a?.status}(n,e)))}(),a="simulated"===n.type;return e(()=>!a&&t.value)}().value,P=function(){const{source:e}=E(),n="simulated"===e.type,{inMemoryApplePayParts:{buttonStatus:t,sessionLoadFailed:a},inMemoryPayPalParts:{acceleratedCheckoutButtonStatus:i},inMemoryVenmoParts:{buttonStatus:r},inMemoryGooglePayParts:{buttonStatus:l},inMemoryAmazonPayParts:{buttonStatus:s,buyWithPrimeButtonStatus:c},inMemoryShopPayParts:{buttonStatus:d},acceleratedWalletPaymentMethods:u}=j(),p=u.value;return o(()=>p.flatMap(e=>{switch(e.name){case"PAYPAL_EXPRESS":return Wi(i,La.PayPalV6);case"VENMO":return Wi(r,La.Venmo);case"GOOGLE_PAY":return Wi(l,La.GooglePay);case"SHOP_PAY":return Wi(d,La.ShopifyPay);case ne.AmazonPay:return Wi(s,ne.AmazonPay);case ne.BuyWithPrime:return Wi(c,ne.BuyWithPrime);case"APPLE_PAY":return Wi(t,La.ApplePay,()=>!n&&!a.value);default:return[]}}),[t,a,p,s,c,l,n,i,d,r])}();Ba(P),function(e){const{observability:n}=E(),t=c(performance.now()),a=o(()=>e.filter(({walletName:e})=>e!==La.ShopifyPay),[e]),r=c(new Set),l=_(a);i(()=>{l.value.forEach(e=>{e.isRendered()&&!r.current.has(e.walletName)&&(r.current.add(e.walletName),n.histogram({name:"wallet_express_button_ready_time",value:performance.now()-t.current,unit:"ms",attributes:{wallet_name:e.walletName,isPaymentMethodFlow:!1}}))})})}(P);const I=D().managedByMarketsPro,S=Rn(C,"base"),[L,M]=d(!1),A=N(),{checkout:w,i18n:x,shop:{id:T},source:O,observability:B,userEvents:V}=E(),z=Un(),R=e(()=>f.value&&"full_express_agreement"===te({hasSubscription:ae({checkout:w}),isApplePayAvailable:l.value.some(({name:e})=>"APPLE_PAY"===e),variant:z})),U=wa();Ea(l.value,n);const $=u((e,t)=>{const a=parseInt(F(T),10),i=xa({state:t,shopId:a,nascarData:{...e,walletsRenderedCount:n},paymentMethods:l.value});i&&V.monorailEvent(i)},[T,V,n,l]),q=l.value.some(e=>"SHOP_PAY"===e.name)&&b;C||L||(M(!0),m(e=>performance.now()-e)),a(()=>{L&&B.histogram({name:"wallets_container_render_time",value:s})},[L,B,s]);const K=c(!1);return a(()=>{"simulated"===O.type||"exited"!==S||K.current||(K.current=!0,performance.mark(ie))},[O,S]),t(h,{children:[t(ji,{buttonCount:n,footer:t(h,{children:[t("div",{className:Ui.DrawerLink,children:t(Ln,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{y?(g(!1),$(U.value,Aa.NascarDrawerOpen)):(g(!0),$(U.value,Aa.NascarDrawerClose))},children:t("div",{className:Ui.InnerDrawerLink,children:[t(yn,{children:y?x.translate("alternative_payment_method_banner.show_more_options"):x.translate("alternative_payment_method_banner.hide_more_options")}),t(sn,{type:y?"chevron-down":"chevron-up",size:"small-200"})]})})}),t(p,{when:A,children:t(Va,{isForExpressCheckout:!0,showFullSubscriptionConsent:R})}),t(p,{when:I,children:t(on,{gap:"base",padding:"large-100 none none none",children:t(Ha,{textProps:{color:"subdued",size:"small"}})})})]}),children:[t($i,{count:Math.min(n,4),transition:S,shopPayEmphasis:q,hideWallets:y}),t("ul",{id:"express-checkout-wallets-wrapper",role:"list",className:v(Ui.Stack,Ui.ButtonWrapper,{[Ui.loading]:C,[Ui.subsequentLoad]:C&&L,[Ui.DrawerHideButtons]:y,[Ui.ShopPayEmphasis]:q}),children:f.value&&r})]}),"payment_cancelled_while_processing"===k?.value?.type&&t(Ri,{})]})}function Qi(){const{i18n:e}=E(),{divider:{borderStyle:n,borderWidth:a}}=Hn(),{main:{divider:{borderStyle:i=n,borderWidth:o=a}={},section:r,spacing:l}}=jn(),s=oe(r);return t(Vn,{padding:s?`@media (inline-size >= extraSmall) ${l?le(l):"large-200"} none, ${l?le(l):"base"} none`:"large-100 none large-300 none",children:t($n,{borderStyle:i,borderWidth:re(o),children:t(tn,{textAlign:"center",children:t(yn,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}function Xi(){return t(h,{children:[t(qn,{accessibilityLabelledBy:Hi,children:t(ji,{buttonCount:3,children:t($i,{count:3,shopPayEmphasis:!0})})}),t(Qi,{})]})}const Ji=e=>e,Zi=y(function(){const{i18n:e,source:n}=E(),a="simulated"===n.type,{acceleratedWalletPaymentMethods:i,buttonCount:o}=j(),r=Kn(),l=xi(),{setEditorShopPay:s}=Ei(),{expressCheckout:{button:{cornerRadius:c}={}}}=jn(),d=Gn("Checkout::Dynamic::Render","WALLETS1"),u=Wn(),p=a&&u.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return t(Xi,{})}const m=t("li",{className:Ui.walletItem,children:t(Vn,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:"_2SmAP",children:t(yn,{color:"subdued",children:e.translate("payment.simulated_express_checkout")})})});return t("div",{style:{...no(c)},children:[t(qn,{accessibilityLabelledBy:Hi,children:t(Yn,{sectionId:"expressCheckout",children:t(Qn,{section:"expressCheckout",children:[t(Xn,{customizations:d,gap:"large-200",render:Ji}),d.length>0&&t(Jn,{blockSize:"large-200"}),t(Yi,{buttonCount:p?1:o,walletPaymentMethods:i,children:p?m:t(eo,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:a,preserveShopPay:Boolean(s)})})]})})}),t(Qi,{})]})});function eo({paymentMethods:e,triggerProgression:n,isSimulated:a,preserveShopPay:i}){const o=Zn(),r=Ia();return t(h,{children:e.map(e=>{if(a&&"VENMO"===e.name)return null;const l=a&&"SHOP_PAY"===e.name&&i;return t("li",{className:Ui.walletItem,children:a&&!l?t(Vn,{className:"eFu6h",children:t(Vn,{className:v([Ui.walletButton,Ui.Stack,Ui.SimulatedWalletStack]),inert:!0,children:t(to,{method:e,triggerProgression:n})})}):t(to,{method:e,triggerProgression:n})},`${e.name}-${o}-${r.value}`)})})}function no(e){return e&&{"--x-express-checkout-button-border-radius":(n=se.borderRadius,e=>e?n[e]:void 0)(e)};var n}function to({method:e,triggerProgression:n}){const a=Zn();switch(e.name){case"APPLE_PAY":return t(Oi,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return t(za,{progressToNextPage:n});case"VENMO":return t(za,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:n});case"SHOP_PAY":return t(zi,{});case"GOOGLE_PAY":return t(Sa,{});case ne.AmazonPay:return t(ha,{});case ne.BuyWithPrime:return t(Bi,{wallet:ne.BuyWithPrime});default:return null}}const ao=["ApplePay","GooglePay","PayPal","Venmo"];function io({id:e}){return Fa({id:e,stage:({pendingComponents:e})=>ao.some(n=>e.has(n))?Da.Usable:Da.Complete}),null}function oo(){const e=D(),n=e.buyerIdentity.value?.customerProfile,{i18n:a}=E(),i=et().value,{value:o}=e.buyerIdentity,r=x().rememberMe,l=Boolean(o?.rememberMe)||r.value,c=s(l),{negotiate:d}=en(),p=Je(),m=p?.saveShippingAddressCheckboxEnabled??!0,h=Boolean(n),v=x().shippingAddress.value,_=!i&&m&&!h&&!v.oneTimeUse,y=u(e=>{c.value=e,r.value=e,d({legacyFiltering:{},silenceViolations:["payment-session"]})},[d,r,c]);return _?t(an,{id:"save_shipping_information",name:"save_shipping_information",checked:c.value,onChange:y,label:a.translate("customer_account.save_my_information_label")}):null}function ro(e,n){return n.some(n=>e.includes(n))}function lo({options:n,selected:a,select:i}){const{i18n:o,source:r}=E(),l="simulated"===r.type,s=D(),c=s.deliveryNext,d=s.paymentLines,u=ce("deliveryNext"),m=e(()=>{const e=de(c.value,"ONE_TIME_PURCHASE"),n=void 0!==ue(d?.value?.lines,"APPLE_PAY"),t="available"===e?.status&&!u.value&&e.hasDeliveryLineChange;return!n&&t});return t(h,{children:[t(p,{when:m,children:()=>t(nt,{tone:"warning",errorType:tt.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),l&&n.map(e=>t(Yn,{sectionId:`deliveryMethods-${e.id}`},e.id)),t(Ka,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:a,onChange:i,children:n.map(e=>t(ja,{value:e.id,accessibilityLabel:e.label,secondaryContent:t(sn,{type:e.icon,tone:ro(a,e.value)?"accent":void 0}),children:e.label},e.id))})]})}const so=g(null);var co={Fieldset:"_16tpi2ma _1fragemeg _1fragemdw _1fragemf0 _1fragemdc _1fragemqt _1fragemsm _1fragemp0 _1fragemuf _1fragem11h",Legend:"_16tpi2mb _1fragemnh",Segments:"_16tpi2me _16tpi2md _1fragemws _1fragem6t _1fragemx7",ChoiceSegmented:"_16tpi2m3 _16tpi2m2 _1fragem7n _1fragem9g _1fragemq4 _1fragemob _1fragemtb _1fragemri _1fragemyl _1fragem12z _1fragemyd _1fragem64 _1fragem73 _1fragem19 _1fragembj _1fragem124 _1fragemzi",ChoiceSegmentedSelected:"_16tpi2mc _1fragemy6",PrimaryContent:"_16tpi2m4 _1fragem7s _1fragem9l _1fragem64 _1fragem19 _1fragembj",contentDirectionVariant:{auto:"_16tpi2m7",inline:"_16tpi2m8 _16tpi2m5 _1fragem78",block:"_16tpi2m9 _16tpi2m6 _1fragem73"},Input:"_16tpi2m1 _1fragem121",inert:"_16tpi2mf _1fragemz0 _1fragem11v"};function uo({name:e,label:n,labelAccessibilityVisibility:a="visible",contentDirection:i="auto",selected:r,onChange:l,children:s}){const c=u(e=>l(e),[l]),d=o(()=>({name:e,selected:r,select:c,contentDirection:i}),[e,r,c,i]);let p;n&&"exclusive"===a?p=t("legend",{className:Q({screenReaders:"only"}),children:n}):n&&(p=t("legend",{className:co.Legend,children:t(Fn,{level:3,accessibilityRole:"presentation",children:n})}));const m=t("div",{className:co.Segments,"data-choice-list-segmented-part":"control",children:s});return t(so.Provider,{value:d,children:n?t("fieldset",{className:co.Fieldset,children:[p,m]}):m})}function po({value:e,children:n,icon:a,secondaryContent:i,accessibilityLabel:o}){const r=b(so),l=at();if(!r)return console.warn(`Unable to render ChoiceSegmented (value: "${e}"). Verify it is a child of ChoiceListSegmented.`),null;const{name:s,selected:c,select:d,contentDirection:u}=r,p=c===e;return t("label",{className:v(co.ChoiceSegmented,p&&co.ChoiceSegmentedSelected,l&&co.inert),"data-choice-list-segmented-part":"segment",children:[t("input",{id:`${s}-${e}`,type:"radio",name:s,value:e,checked:p,disabled:l,"aria-label":o,"aria-hidden":!!l||void 0,tabIndex:l?-1:void 0,className:co.Input,onChange:()=>d(e)}),t("span",{className:v(co.PrimaryContent,co.contentDirectionVariant[u]),children:[a&&t(sn,{type:a,color:"strong"}),t(yn,{type:"strong",children:n})]}),i&&t(yn,{color:"subdued",children:i})]})}function mo(){const{i18n:e}=E(),n=D(),a=ce("deliveryNext").value,i=de(n.deliveryNext.value,"ONE_TIME_PURCHASE"),o=n.paymentLines?.value?.lines;return void 0===ue(o,"APPLE_PAY")&&"available"===i?.status&&!a&&i?.hasDeliveryLineChange?t(nt,{tone:"warning",errorType:tt.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const ho="PICK_UP_AND_SHIP";function vo(e,n){switch(e){case"PICK_UP":return n.translate("split_delivery.pickup_all_items");case"SHIPPING":return n.translate("split_delivery.ship_all_items");default:f(e)}}function _o(e){return"PICK_UP"===e.id||"SHIPPING"===e.id}function yo({options:e,selectedIndex:n,select:a}){const{i18n:i,observability:o}=E(),r=u(e=>{e!==ho&&a([e])},[a]),l=e.filter(_o),s=c(!1);if(!s.current&&l.length<e.length){s.current=!0;const n=e.filter(({id:e})=>"PICK_UP"!==e&&"SHIPPING"!==e).map(({id:e})=>e).join(", ");o.log("split_ship_pickup_delivery_method_selector","Unexpected delivery method options for split ship/pickup selector",{optionIds:n})}return t("div",{className:v("qX6SV",Q({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":n},children:t(it,{name:"delivery_strategies",value:ho,onChange:r,children:[t(ot,{value:ho,children:i.translate("split_delivery.pickup_and_ship")}),l.map(({id:e})=>t(ot,{value:e,children:vo(e,i)},e))]})})}const go="_207IL";function bo({options:a,selected:i,select:o,showChangedBanner:r=!0}){const{i18n:l,source:c}=E(),d="simulated"===c.type,m=D(),{value:h}=m.deliveryNext,_=rt(),y=de(h,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:g}=function(e){const{source:n,userEvents:t,shop:{id:a},checkout:{identity:i}}=E(),o="shopPay"===i.current.value,r=D().buyerIdentity.value?.customerProfile;return{deliveryMethodSelectorClickEvent:function(i){let l;switch(i){case"SHIPPING":l="checkout_shipping_tab_clicked";break;case"PICK_UP":l="checkout_pickup_tab_clicked";break;case"PICKUP_POINT":l="checkout_pickup_point_tab_clicked"}if(!l)return;const s=e&&"methods"in e?e?.methods.length:void 0;t.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:n.
2checkoutSessionIdentifier||"",eventType:l,shopId:parseInt(F(a),10),numberLocationsFound:s,userId:r?.id?parseInt(F(r.id),10):void 0,checkoutSurface:o?"shop_pay":"guest_checkout"}})}}}(y),b=e(()=>!_.value),f=s(!1);n(()=>{let e=_.peek();return k(()=>{const n=_.value;e&&!n&&(f.value=!0),e=n})},[_,f]);const P=u(()=>{f.value=!1},[f]),I=u(([e])=>{if(!e||i.value.includes(e))return;const n=a.value.findIndex(e=>e.id===i.value[0]),t=a.value.findIndex(n=>n.id===e);ka(()=>{o([e])},[t>n?"delivery-slide-end":"delivery-slide-start"]),g(e)},[o,i,g,a]),S=e(()=>a.value.findIndex(e=>e.id===i.value[0])),L=e(()=>a.value.length),M=e(()=>a.value.some(e=>e.label.length>16));return t("div",{className:"SnB3D",children:[r&&t(mo,{}),d&&t(C,{each:a,getKey:e=>e.id,children:e=>t(Yn,{sectionId:`deliveryMethods-${e.id}`})}),t(p,{when:b,fallback:t(yo,{options:a.value,selectedIndex:S.value,select:o}),children:t("div",{style:{"--selected-index":S.value,"--option-count":L.value},className:v("wvTT8",{[go]:f.value}),onAnimationEnd:P,children:t(uo,{name:"delivery_method",label:l.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:i.value[0],onChange:e=>I([e]),contentDirection:M.value?"block":"auto",children:t(C,{each:a,getKey:e=>e.id,children:({id:e,label:n,icon:a})=>t(po,{value:e,icon:a,children:n})})})})})]})}function fo(){const e=lt();if(!e)return null;const{variant:n,...a}=e;return"next"===n?t(bo,{...a}):t(lo,{options:a.options.value,selected:a.selected.value,select:a.select})}function ko({message:e}){return e?t(nt,{errorType:tt.DeliveryError,tone:"critical",children:t(on,{alignItems:"start",gap:"small-500",children:t(yn,{children:e})})}):null}function Co(){const{i18n:e,url:n,client:a}=E(),i=a.unstable_getSerialization("apiClientId"),o=ut(i),r=x().shippingAddress.value,{href:l,onClick:s}=st(),{countryName:c,loading:d}=ct(r),{hasViolations:u}=dt(pe);if(!u)return null;if(o)return t(ko,{message:t(h,{children:e.translate("merchant_redirect.shop_app_not_supported",{storefront_link:t(Ln,{href:n.storefront(),children:e.translate("contact.storefront_link")})})})});const p=d?r.countryCode:c;return t(ko,{message:t(h,{children:e.translate("payment_errors.payment_method_not_supported",{country:p,checkout_as_guest_link:t(Ln,{href:l,onClick:s,children:e.translate("account_management.checkout_as_guest_link")})})})})}function Po(){const{negotiate:e}=en(),{deliveryLines:n,merchandiseLines:t,discountLines:a}=x();return i=>{me({deliveryLines:n,merchandiseLines:t,merchandiseStableIds:i,discountLines:a}),e({legacyFiltering:{include:["deliveryNext","merchandiseLines"]},silenceViolations:he(["deliveryNext","merchandiseLines"])})}}function Io(e){return"shopPay"===e.current.value?"shop_pay":"guest_checkout"}function So(e){requestAnimationFrame(()=>{vn({content:e,role:"status"})})}function Lo({merchandiseLines:e,bannerType:n,allowAlternativeAction:a}){const{i18n:i}=E(),r=pt(),l=Po(),s=ve(),c=Na(),d="pickup"===n,p=Array.from(new Map(e.value.map(e=>[e.stableId,e])).values()),m=p.map(({stableId:e})=>e),v=new Map;for(const t of p){const e=v.get(t.digest);e?v.set(t.digest,{...e,quantity:e.quantity+t.quantity}):v.set(t.digest,t)}const _=Array.from(v.values()),y=p.reduce((e,{quantity:n})=>e+Math.max(1,n),0),g=d?"SHIPPING":"PICK_UP",{deliveryMethodsByMerchandise:b}=s.value,f=p.filter(({stableId:e})=>b[e]?.includes(g)),k=f.map(({stableId:e})=>e),C=f.reduce((e,{quantity:n})=>e+Math.max(1,n),0),P=(a?.value??!0)&&!c.value&&k.length===m.length&&C>0,I=function({allLinesAlternativeEligible:e,isPickupBanner:n,variantIds:t}){const{userEvents:a,shop:i,source:r,checkout:{identity:l}}=E(),{merchandiseLines:s}=D();let c="remove_only";e&&(c=n?"remove_or_switch_to_shipping":"remove_or_switch_to_pickup");const d=n?"pick-up":"shipping",p=t.join(","),m=o(()=>t.map(e=>{if(e)try{return parseInt(F(e),10)}catch{return}}).filter(e=>void 0!==e),[p]);return u(e=>{const n={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt(F(i.id),10),checkoutToken:r.checkoutSessionIdentifier??"",productVariantIds:m,bannerType:c,buyerAction:e,deliveryMethodType:d,checkoutSurface:Io(l),sourceName:"checkout_one",checkoutProductVariantsCount:s.value?.lines.length}};a.monorailEvent(n)},[c,d,l,s,a,m,i,r])}({allLinesAlternativeEligible:P,isPickupBanner:d,variantIds:p.map(e=>e.variantId)});if(0===p.length)return null;const S=d?i.translate("split_delivery.inventory_issue_banner.heading.cannot_be_picked_up",{count:y}):i.translate("split_delivery.inventory_issue_banner.heading.cannot_be_shipped",{count:y}),L=P?i.translate("split_delivery.inventory_issue_banner.remove_item",{count:y}):i.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:y}),M=d?i.translate("split_delivery.inventory_issue_banner.ship_separately",{count:C}):i.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:C}
2),A=_.map(({title:e,subtitle:n,quantity:t})=>{const a=n?`${e} / ${n}`:e;return t>1?i.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:a,quantity:t}):a}).join(", "),w=()=>{I("switch_delivery_method"),r({targetDeliveryMethodType:g,merchandiseStableIds:k}),So(d?i.translate("split_delivery.accessibility.status.ship_separately",{items:A}):i.translate("split_delivery.accessibility.status.pickup_in_store",{items:A}))},x=t(Ln,{onClick:()=>{I("remove_items"),l(m),So(i.translate("split_delivery.accessibility.status.remove_items",{items:A}))},children:L});let N=x;if(P){const e=t(Ln,{onClick:w,children:M});N=t(h,d?{children:i.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:e,remove_items_link:x})}:{children:i.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:e,remove_items_link:x})})}return t(nt,{tone:"critical",errorType:tt.DeliveryError,heading:S,children:t(on,{gap:"small-300",children:[t(mt,{gap:"small-300",children:_.map(({stableId:e,title:n,subtitle:a,quantity:o})=>{const r=a?`${n} / ${a}`:n;return t(ht,{children:o>1?i.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:r,quantity:o}):r},e)})}),t(yn,{children:N})]})})}const Mo=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function Ao(n){const{shop:{shipPickupInOneOrderEnabled:t}}=E(),{allViolations:a,merchandiseLines:i,deliveryNext:o}=D(),r=ve(),l=rt(),{deliveryLines:s,merchandiseLines:c}=x();return e(()=>{const e=Boolean(!(!o.value||!("supportsSplitDeliveryMethod"in o.value))&&o.value.supportsSplitDeliveryMethod),d={allViolations:a.value,deliveryMethodsByMerchandise:r.value.deliveryMethodsByMerchandise,isSplitShipAndPickup:l.value,negotiatedMerchandiseLines:i.value,proposedDeliveryLines:s.value,proposedMerchandiseLines:c.value},u=t&&e;return"localPickup"===n.mode?function({canUseDeliveryMethodScopedViolations:e,state:n}){if(e){const e=wo({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:n.isSplitShipAndPickup,state:n});if(e.length>0)return{merchandiseLines:e,allowAlternativeAction:!0}}return n.isSplitShipAndPickup?{merchandiseLines:[],allowAlternativeAction:!1}:(t=n.negotiatedMerchandiseLines,(t?.lines.filter(({requiresShipping:e})=>e).length??0)>1?{merchandiseLines:wo({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:n}),allowAlternativeAction:!1}:{merchandiseLines:[],allowAlternativeAction:!1});var t}({canUseDeliveryMethodScopedViolations:u,state:d}):u?function({deliveryMethodType:e,state:n}){return{merchandiseLines:wo({deliveryMethodType:e,suppressUnscopedPickupViolations:"PICK_UP"===e&&n.isSplitShipAndPickup,state:n}),allowAlternativeAction:!0}}({deliveryMethodType:n.deliveryMethodType,state:d}):{merchandiseLines:[],allowAlternativeAction:!1}})}function wo({deliveryMethodType:e,suppressUnscopedPickupViolations:n,state:{allViolations:t,deliveryMethodsByMerchandise:a,negotiatedMerchandiseLines:i,proposedDeliveryLines:o,proposedMerchandiseLines:r}}){const l=function(e,n,t){function a(e){const a=n[e]??[];return t.some(e=>a.includes(e))}return e.flatMap(e=>e.lineComponents.length>0?e.lineComponents.filter(e=>!a(e.stableId)):a(e.stableId)?[]:[e])}(t&&i?vt(t,i,Mo)??[]:[],a,[e]);return function({violationLines:e,deliveryMethodType:n,proposedDeliveryLines:t,proposedMerchandiseLines:a}){const i=new Set(t.filter(e=>{return t=e.value.deliveryMethodTypes,a=n,0!==t.length&&("PICK_UP"===a?t.every(e=>"SHIPPING"===e||"LOCAL"===e):t.every(e=>"PICK_UP"===e));var t,a}).flatMap(e=>e.value.targetMerchandiseLines??[]).map(e=>e.stableId)),o=a.length>0;return e.filter(e=>{const n=_e(a,e.stableId),t=n?.stableId??e.stableId;return!(i.has(e.stableId)||i.has(t)||o&&null==n)})}({violationLines:n?l.filter(e=>(a[e.stableId]??[]).length>0):l,deliveryMethodType:e,proposedDeliveryLines:o,proposedMerchandiseLines:r})}function Eo(e){return"LOCAL"===e?"SHIPPING":e}function xo(){const{violations:n}=dt(ye),{client:i,i18n:o,shop:r,source:l,observability:s,url:u,embed:m,checkout:h}=E(),{merchandiseLines:v,shippingAddress:_}=x(),{countryName:y,loading:g}=ct(_.value),{value:b}=D().merchandiseLines,{negotiate:f}=en(),k=_t(),{negotiating:C,methods:P}=yt(),{loading:I}=K(),S=c(k.peek()),L=c(I.peek().has("deliveryNext")),M=e(()=>{const e=I.value.has("deliveryNext"),n=L.current&&!e;return k.value?S.current=!0:n&&(S.current=!1),L.current=e,S.current}).value,{cartUpdated:A,setCartUpdated:w}=function(){const[e,n]=d(!1),t=K(),i=c(0);return a(()=>{Date.now()<i.current||n(!1)},[t.lastNegotiation.value]),{cartUpdated:e,setCartUpdated:function(){i.current=Date.now()+1e3,n(!0)}}}(),N=fn(),[T,O]=d(void 0),F=Boolean(m);a(()=>{n.size>0&&O(y)},[n]);const B=Ao({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),V=e(()=>B.value.merchandiseLines),z=e(()=>B.value.merchandiseLines.length>0);if(!b||0===b.lines.length||g||T!==y)return null;if(M)return null;if(A)return t(gt,{heading:o.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(0===n.size)return null;if(r.shipPickupInOneOrderEnabled&&C.value&&function(e){const n=new Set(e.map(Eo));return 1===n.size?n.has("SHIPPING")||n.has("PICK_UP")||n.has("PICKUP_POINT"):2===n.size&&n.has("SHIPPING")&&n.has("PICK_UP")}(P.value))return null;const R=vt(Array.from(n),b,Array.from(ye)),U=R?.map(({stableId:e})=>e),H=v.value.filter(({stableId:e})=>!U?.includes(e)),j=0===H.length,$=t(Lo,{bannerType:"shipping",merchandiseLines:V});if(null==R)return z.value?$:null;const q=Array.from(n).some(({code:e})=>"MERCHANDISE_PRODUCT_NOT_PUBLISHED_IN_BUYER_LOCATION"===e)?y??o.translate("merchandise_unavailable_in_buyer_location.missing_country_fallback"):o.translate("merchandise_unavailable_in_buyer_location.indeterminate_location_fallback");let G=null;G=j&&1===R.length?o.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:q}):j?o.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:q}):1===R.length?o.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:q}):o.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:q});const W=j?null:t(mt,{children:R.map(e=>
2t(ht,{children:e.subtitle?o.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:e.title,variant_label:e.subtitle}):e.title},e.stableId))}),Y=1===R.length?o.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):o.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),Q=o.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");const X=t(yn,{children:j?!j||!F&&r.hasStorefront?o.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(Ln,{onClick:function(){N("click",{element:{tagName:"a",textContent:Q},section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:j,redirectSuccess:r.hasStorefront}),ge({client:i,url:u,source:l,configuration:h.configuration})},children:Q})}):o.translate("merchandise_unavailable_in_buyer_location.change_address_only"):o.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(Ln,{onClick:function(){N("click",{element:{tagName:"a",textContent:Y},section:"delivery",timestamp:new Date}),v.value=H,f({onComplete:w})},children:Y})})}),J=t(Ca,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(n).map(({code:e})=>e),children:t(nt,{heading:G,tone:"critical",children:t(on,{gap:"base",children:[W,X]})})});return t(p,{when:z,fallback:J,children:$})}function No({selectedAddress:e,shouldAddressModalSetAsDefault:n}){const{checkout:{address:a,identity:i},i18n:o}=E(),r=x().shippingAddress.value,l=ct(r),{createAddressParts:s}=O(),c=u(e=>{s.addressModalState.value={status:"editing",address:be(e.address,{extendedAddressMode:a.extendedAddressMode}),addressType:"shipping",addressId:e.id,setAsDefault:n?"default":"disabled"}},[a.extendedAddressMode,s.addressModalState,n]),d=e?t(Ln,{tone:"monochrome",onClick:()=>c(e),children:o.translate("shipping.address_update")}):o.translate("shipping.address_update"),{hasViolations:p}=dt(fe),{hasViolations:m}=dt(ke),{hasViolations:h}=dt(Ce),{hasViolations:v}=dt(pe),{hasViolations:_}=dt(ye),y=function({identity:e,hasMerchandiseUnavailableInBuyerLocationViolations:n,hasUnsupportedPaymentMethodViolations:a}){return"shopPay"!==e.current.value?null:n?t(xo,{}):a?t(Co,{}):null}({identity:i,hasMerchandiseUnavailableInBuyerLocationViolations:_,hasUnsupportedPaymentMethodViolations:v});if(y)return y;let g=o.translate("shipping_errors.invalid_selected_address");return m?g=o.translate("customer_account.incomplete_address",{update_address_link:d}):p?g=l.loading?t(on,{children:[t(bt,{inlineSize:"large"}),t(bt,{inlineSize:"small"})]}):o.translate("shipping_errors.shipping_method_not_available_generic.one"):(h||Boolean(e))&&(g=o.translate("shipping_errors.invalid_selected_address_with_update_link",{update_address_link:d})),t(ko,{message:g})}function To(){const{checkout:e,client:n}=E(),i=e.addressManager.shipping.value.selectedAddress.value,o=Boolean(i?.default),r=n.unstable_getSerialization("apiClientId"),l=ft(),s=c(!1),{hasViolations:d}=dt(fe),{hasViolations:u}=dt(Pe),p=ut(r);return a(()=>{(d||u)&&p&&!s.current&&(l.notify(d?{no_delivery_strategy_available:!0}:{out_of_stock_at_origin:!0}),s.current=!0)},[d,u,p,l]),t(No,{selectedAddress:i,shouldAddressModalSetAsDefault:o})}function Oo({name:e,variant:n="content",children:a}){return P(()=>ba(()=>Promise.resolve({}),__vite__mapDeps([61]))),t("div",{className:`delivery-transition-${n}`,style:{"--delivery-view-transition-name":e||void 0},children:a})}const Fo={MILES:100,KILOMETERS:200};function Do(e,n){const t=n&&("MILES"===n.unit?"mi":"km"),a=n&&n.value<100?1:0;return[n&&e.numberFormatter({minimumFractionDigits:0,maximumFractionDigits:a}).format(n.value),t].join(" ").trim()}function Bo(e){const{pickupLocation:n}=e;return n&&"distanceFromBuyer"in n?n.distanceFromBuyer:void 0}const Vo=e=>e.every(e=>{const n=Bo(e);return n?.value&&n.value>Fo[n.unit]});function zo({postalCode:e,city:n,zoneCode:t}){const a=["address2","company","firstName","lastName","phone"];return e?[...a,"zoneCode","city","address1","countryCode"]:n?[...a,"zoneCode","address1","countryCode"]:t?[...a,"zoneCode"]:[...a,"address1"]}
2function Ro(e,n){const t=e.lastIndexOf(",");if(-1===t)return e.length>n?`${e.slice(0,n)}...`:e;const a=e.slice(0,t),i=e.slice(t);return a.length>n?`${a.slice(0,n)}...${i}`:e}function Uo(){const{locationAddress:e}=x(),n=e.peek(),{countryCode:t,postalCode:a,city:i}=n,o=Boolean(t&&!a&&!i),{details:r}=Ie(t);return{isOnlyCountryAvailable:o,fullCountryName:r?.name||void 0,formattedAddress:kt(n,{hiddenFields:zo(n),multiline:!1,countryFormat:"explicit"})}}function Ho({onClick:e,commandFor:n}){const{i18n:a}=E(),{formattedAddress:i}=Uo(),o=a.translate("local_pickup.toggle_location");return t(cn,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:i?`${o}, ${i}`:o,onClick:e,commandFor:n,children:i?t(on,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(sn,{type:"geolocation",size:"small-100"}),t(yn,{children:Ro(i,13)})]}):t(yn,{children:o})})}function jo({itemCount:e,methods:n,onChangeLocationClick:i}){const{i18n:o}=E(),{isOnlyCountryAvailable:r,formattedAddress:l}=Uo(),s=Ct({methods:n});if(a(()=>{r||s("pickup_long_distance_banner_rendered")},[s,r]),r)return null;const c=(e=>e.every(e=>{const n=Bo(e);return"MILES"===n?.unit}))(n)?"MILES":"KILOMETERS",d=Do(o,{value:Fo[c],unit:c}),u=t("span",{className:"oCDzB",children:l});return t(gt,{children:t(yn,{children:l?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:t("span",{className:"qIyj1",children:d}),location:i?t(Ln,{tone:"monochrome",onClick:function(){s("pickup_long_distance_banner_change_location_click"),i?.()},children:u}):u,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:d})})})}function $o(){const{i18n:e}=E();return t(nt,{autoFocus:!0,tone:"warning",errorType:tt.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:t(yn,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function qo({allLocationsFarAway:n,selectedPickupOptionNoLongerAvailable:t}){const a=ce("deliveryNext");return e(()=>n.value&&!t.value&&!a.value)}function Ko({hideText:e,singleItem:n}){const{i18n:a}=E(),i=Se(),o=i.value?.methods??[],r=n?1:o.length||2,l=Array.from({length:r},(e,n)=>`LocationSkeleton${(n+1).toString()}`);return t(h,{children:[e?null:t(on,{gap:"base",padding:"small-400 none base none",children:t(bt,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),t($a,{border:"none",background:"transparent",children:t(qa,{name:"skeleton-loading",variant:"block",hideRadioControl:1===l.length,children:l.map(e=>t(ja,{disabled:!0,value:e,accessibilityLabel:a.translate("general.loading"),secondaryContent:t(on,{gap:"small-400",alignItems:"end",children:[t(bt,{inlineSize:"small",size:"small"}),t(bt,{inlineSize:"base",size:"small"})]}),children:t(on,{gap:"small-400",children:[t(bt,{inlineSize:"small",size:"small"}),t(bt,{inlineSize:"base",size:"small"})]})},e))})})]})}const Go={timeout:8e3,enableHighAccuracy:!0};class Wo extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}const Yo=e=>new Promise(n=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>n({reason:"granted",position:e}),e=>n({reason:Qo(e),error:e}),e):n({reason:"unsupported"})});function Qo(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Xo({disabled:e,displayAsLink:n,onSuccess:a,onError:i,onLocateStart:o,options:r,sharingNotAllowedError:l}){const{i18n:c}=E(),d=function(){const{observability:e}=E();return u(n=>(async(e=Go,n,t)=>{if("permissions"in navigator)try{switch((await navigator.permissions.query({name:"geolocation"})).state){case"granted":case"prompt":return n(e);case"denied":return Promise.resolve({reason:"denied"});default:throw new Wo('"geolocation" permission is not supported in this browser')}}catch{t.log("geolocation_permission_supported",'"geolocation" permission is supported in this browser. Using navigator.geolocation.getCurrentPosition instead.')}return n(e)})(n,Yo,e),[e])}(),m=s(!1),v=s(void 0),_=c.translate("pickup_point.geolocation.shared_location_button"),y=c.translate("pickup_point.geolocation.errors.unsuported_by_browser"),g=l||c.translate("pickup_point.geolocation.errors.permission_not_allowed"),b=c.translate("pickup_point.geolocation.errors.permission_denied");return t(h,{children:[m.value&&n?t(on,{direction:"inline",gap:"small-400",children:[t(Sn,{}),t(yn,{color:"subdued",children:_})]}):t(cn,{disabled:e,inlineSize:n?void 0:"fill",onClick:async function(){v.value=void 0,m.value=!0,o?.();const e=await d(r);switch(m.value=!1,e.reason){case"granted":a(e.position);break;case"denied":v.value=g;break;case"timeout":case"unavailable":v.value=b;break;case"unsupported":v.value=y}"error"in e&&void 0!==e.error&&i?.(e.error)},loading:m.value,variant:n?"plain":void 0,textDecoration:n?"none":void 0,children:t(on,{direction:"inline",alignItems:"center",gap:"small-400",children:[t(sn,{type:"geolocation"}),t(tn,{children:_})]})}),t(p,{when:v,children:t(Pn,{children:v})})]})}function Jo({heading:n,tryDifferentLocationOnClick:i}){const{i18n:o}=E(),r=yt(),l=ve(),s=e(()=>Le(l.value.enabledDeliveryMethods)),c=e(()=>s.value.length>0),d=_(i),u=e(()=>c.value||Boolean(d.value)),m=Se(),h=Ct({methods:m.value?.methods||[],selectedDeliveryMethodHandle:m.value?.selectedDeliveryMethodHandle});a(()=>{h("pickup_no_location_banner_rendered")},[h]);const v=t(Ln,{tone:"monochrome",onClick:function(){h("pickup_no_location_banner_ship_items_click"),r.setSelectedMethodTypes(s.value)},children:o.translate("local_pickup.pickup_unavailable_banner_body.ship_items")});function y(){h("pickup_no_location_banner_search_click"),i?.()}const g=i?t(Ln,{tone:"monochrome",onClick:y,children:o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere")}
2):o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),b=i?t(Ln,{tone:"monochrome",onClick:y,children:o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone")}):o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone");return t(nt,{tone:"critical",errorType:tt.DeliveryError,heading:n,children:t(p,{when:u,children:t(tn,{children:t(p,{when:c,fallback:b,children:o.translate("local_pickup.pickup_unavailable_banner_body.ship_items_or_search_elsewhere",{ship_items:v,search_elsewhere:g})})})})})}function Zo(){const{shop:e}=E();return!e.hasFlagEnabled(Me)}const er=bn("AutocompleteSingleAddressField");function nr({address:e,onSelect:n,value:a,country:i,hiddenFields:o=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:r,...l}){const{value:s,setValue:c}=Ya({addressType:r,countryCode:i.code,initialAddressQuery:e.coordinates?Ae(e,i,o):a});return t(Qa,{addressType:r,id:hn(void 0,er),onSelect:function(e){c(Ae(e,i,o)),n&&n(e)},value:s,countryCode:i.code,...l})}function tr({pickupCountries:e,selectedCountry:n,onCountryChange:a}){const{i18n:i}=E(),[o,r]=d(!1);return t(Vn,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:v("_9uTul",o&&"_3zLFw"),children:t(on,{direction:"inline",alignItems:"center",children:[t("div",{className:"_9rPCU",children:t(ga,{countryCode:n.code.toLowerCase(),accessibilityLabel:n.name})}),t(sn,{type:"chevron-down",size:"small-200",tone:o?"accent":void 0}),t("select",{"aria-label":i.translate("contact.country_label"),className:"FayGq",value:n.code,onBlur:()=>r(!1),onFocus:()=>r(!0),name:"phone_country_select",onChange:e=>{a(e.target.value)},children:e.map(({label:e,value:n})=>t("option",{value:n,children:e},n))})]})})}const ar=bn("AutocompleteSingleAddressField");function ir({onSearch:e,onBeforeCountryChange:n,onAfterCountryChange:r,sharedLocationAddress:l,searchOnSelect:d,pickupCountries:p,addressAutoFocus:h,onAddressBlur:v}){const _=s(""),{i18n:y,observability:g}=E(),{geolocation:b}=Pt(),{locationAddress:f}=x(),k=f.peek(),C=c(k),P=we(),S=Zo(),L=o(()=>be(function(e,n,t,a){const i=Boolean(e.address1||e.postalCode||e.countryCode),o=t?.some(n=>n.value===e.countryCode),r=t?.some(e=>e.value===n);return i&&o?e:r||0===t.length?(a("auto-selected",n,"pickup"),{countryCode:n}):(a("auto-selected",t[0].value,"pickup"),{countryCode:t[0].value})}(k,b.country.code,p,P),{extendedAddressMode:null}),[]),M=o(()=>Ee({countryCode:void 0,address:void 0}),[]),N=U(L.fields.countryCode,M.countryCode),T=U(L.fields.postalCode,M.address),{details:O,loading:F}=Ie(N.value),D=o(()=>O??b.country,[O,b.country]),B=M.address.value,V=o(()=>p?.length?p:[{value:D.code,label:D.name}],[p,D.code,D.name]),z=u(e=>Ae(e,D,["company","firstName","lastName","phone","countryCode","zoneCode"]),[D]),H=D.zones,$=L.value,K=_.value,G=!!N.value&&Xa(N.value);!function(e,n){const{i18n:t,observability:a,checkout:{wallets:i}}=E(),{inMemoryApplePayParts:{asPaymentMethod:o,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=j();q(async({reason:s})=>{if("negotiation"===s&&!r.value&&!l.value)return{behavior:"allow"};if(i.activeSession.value&&!o.value)return{behavior:"allow"};const c=e.peek(),d=new Map;return c.coordinates||d.set("address",t.translate("field_errors.address_address1_blank")),Oe(c.countryCode)||d.set("countryCode",t.translate("field_errors.address_country_blank")),d.size?(a.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(d).map(([,e])=>e)}),{behavior:"block",reason:R.InvalidLocalPickupAddress,perform:()=>{m(()=>{for(const[e,t]of d)n[e].value=t})}}):{behavior:"allow"}})}(L,M);const W=It(L),Y=fn(),Q=()=>{(N.error||T.error)&&(N.clearError(),T.clearError())};i(()=>{const e=l?.value;e?.countryCode&&I(()=>{m(()=>{W({countryCode:e.countryCode}),_.value="",Q()})})}),i(()=>{const e=f.value;e!==C.current&&(C.current=e,e?.coordinates&&I(()=>{m(()=>{W(xe(e)),_.value=z(e),Q()})}))}),a(()=>{const e=L.value;_.value=z(G?e:{postalCode:e.postalCode})},[L,G,z,_]);const X=(n=$)=>{n.coordinates?(H.length||(n.zoneCode=void 0),e(n)):M.address.value=y.translate("local_pickup.could_not_resolve_address")},J=e=>{const t=()=>{r?.(e),W({countryCode:e}),N.onChange(e),Q(),P("user-input",e,"pickup")};n?n({countryCode:e},t):t()},Z=d&&!S?{source:"magnify",position:"end"}:void 0,ee=G&&d,ne=Boolean(!$.coordinates||!K.length),te=ee?null:t(cn,{variant:"primary",disabled:ne,onClick:X,loading:F,children:y.translate("local_pickup.search_button")}),ae={errors:M,state:{countryCode:L.fields.countryCode,address:G?_:L.fields.postalCode}},ie=Ne(B)?B.message:B,oe=G?"location address":"postalCode",re=hn(void 0,ar),le=S?y.translate("local_pickup.location_address_search_placeholder",{postal_code_label:D.labels.postalCode}):y.translate("local_pickup.location_address_search_label");let se;se=S||Boolean(te)?!!ie||void 0:ie;const ce={addressType:"pickup",country:D,address:$,error:se,field:"address1",value:K,icon:Z,autoFocus:h,onBlur:v,autocomplete:G?"shipping street-address":"shipping postal-code",label:G?le:D.labels.postalCode,name:oe,id:re},de=t(nr,G?{...ce,onSelect:e=>{!e.coordinates&&e.address1&&g.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:e.countryCode||N.value,hasAddress1:Boolean(e.address1),hasPostalCode:Boolean(e.postalCode)});const n=Fe(e.countryCode),t=Boolean(e.countryCode&&!n);
2t&&g.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:e.countryCode,fallbackCountryCode:N.value});const a=t?{...e,countryCode:N.value}:{...e,countryCode:n};W(a),d&&X(a),S&&Y("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},onInput:e=>{$.coordinates&&W({countryCode:N.value}),_.value=e,Q()}}:{...ce,onSelect:e=>{W(e),_.value=z(e)},required:!0,readOnly:F,onInput:e=>{e?Q():_.value=""},onChange:e=>{_.value=e},allowAllCountries:!0}),ue=t(Vn,{children:[t(or,{autocomplete:ce.autocomplete,label:ce.label,name:ce.name}),de]}),pe=St()?.checkoutProfile.hasOverrides.value;return t(En,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(ln,{...ae,children:S?t(on,{gap:"small-300",children:[t(kn,{gap:"small-400 small-300",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[t(tr,{pickupCountries:V,selectedCountry:D,onCountryChange:J}),ue,t(cn,{variant:"primary",onClick:X,disabled:ne,"data-event-name":"local_pickup_search_button",accessibilityLabel:y.translate("local_pickup.search_button"),children:t(sn,{type:"search"})})]}),ie?t(Pn,{controlID:re,children:Te(ie)?ie.textValue:ie}):null]}):t(A,{children:[t(w,{children:t(Ja,{interactive:!pe,children:t(it,{name:"countryCode",label:D.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:F,value:D.code,onChange:e=>J(e),children:V.map(e=>t(ot,{value:e.value,children:e.label},e.value))})})}),te?t(on,{gap:"small-300",children:[t(kn,{gap:"small-400 base",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[ue,te]}),ie?t(Pn,{controlID:re,children:Te(ie)?ie.textValue:ie}):null]}):ue]})})})}function or({autocomplete:e,label:n,name:a}){const i=Lt(),o=i?.nested?i.id:void 0;return t(Vn,{accessibilityVisibility:"exclusive",children:t("input",{type:"text",tabIndex:-1,"aria-hidden":!0,id:"autofill_localPickupAddress",name:a,autoComplete:e,form:o,"aria-label":n})})}function rr({locationFormVisible:e,toggleLocationFormVisibility:n,children:a,onLocationChange:i,pickupCountries:o}){return"shopPay"===E().checkout.identity.current.value?t(h,{children:[a,t(lr,{open:e,onModalClose:()=>n(!1),onLocationChange:i,pickupCountries:o})]}):e?t(sr,{onLocationChange:i,pickupCountries:o}):a}function lr({open:e,onModalClose:n,onLocationChange:a,pickupCountries:i}){const{i18n:o}=E();return t(Dn,{heading:o.translate("local_pickup.toggle_location"),open:e,onHide:n,children:t(Mt,{section:"delivery",children:[t(sr,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:i}),t(Vn,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),t(cn,{onClick:n,inlineSize:"fill",variant:"plain",size:"extraLarge",children:o.translate("local_pickup.cancel")})]})})}const sr=({onLocationChange:e,onBeforeLocationChange:n,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:i,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l})=>{const{geolocation:c}=Pt(),{locationAddress:d}=x(),m=It(d),{i18n:h}=E(),v=s(!0),_=s(),y=s(void 0),g=Zo(),{syncShippingFromPickup:b}=function(){const{shippingAddress:e}=x(),{shop:n}=E(),t=rt();return{syncShippingFromPickup:u(a=>{if(!t.value)return;if(!a)return;const i=e.value;i.countryCode!==a&&(i.postalCode||i.address1||i.address2||i.city||n.shippingCountries.some(e=>e.value===a)&&(e.value={...i,countryCode:a,zoneCode:void 0,coordinates:void 0}))},[t,e,n])}}(),f=(e,t)=>{const a=()=>{b(e.countryCode),t()};n?n(e,a):a()},k=n=>{if(i&&(v.value=!1),!De(n))return void(_.value=h.translate("pickup_point.could_not_resolve_address"));_.value=void 0;const t={zoneCode:c.zone?.code,countryCode:c.country.code,coordinates:{latitude:n.coords.latitude,longitude:n.coords.longitude}};f({countryCode:c.country.code},()=>{m(t),y.value=t,e(n)})};return t(on,{gap:g?"small-300":"base",children:[g?null:t(Xo,{onSuccess:k}),t(p,{when:v,fallback:t(cn,{inlineAlignment:"start",variant:"plain",onClick:()=>{v.value=!0},children:h.translate("shipping.local_pickup.search_address")}),children:t(on,{gap:"base",children:[g?null:t(kn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[t($n,{direction:"inline"}),t(Vn,{padding:"none base",children:t(yn,{color:"subdued",children:h.translate("local_pickup.or")}
2)}),t($n,{direction:"inline"})]}),t(ir,{sharedLocationAddress:y,searchOnSelect:a,onSearch:n=>{f(n,()=>{m(n),e(n)})},onBeforeCountryChange:n,onAfterCountryChange:b,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l}),t(p,{when:_,children:e=>t(on,{gap:"base",padding:"small-200 none none none",children:t(Jo,{heading:e})})})]})}),g&&t(Xo,{onSuccess:k,displayAsLink:!0,sharingNotAllowedError:h.translate("local_pickup.geolocation.permission_not_allowed")})]})},cr={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},dr=Be(({graphql:{coreGraphql:e},router:n,shop:t},{sellableDeliveryMethods:a})=>{const i=S(()=>n.currentUrl.value.pathname.endsWith("/throttle")),o=e.query(cr,{skip:()=>i.value}),r=S(()=>{const e=o.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:n,deliveryMethodsByMerchandise:i}=a.value,r=Object.keys(i).length>0&&function(e){const n=e.includes("PICK_UP"),t=e.some(e=>ur.includes(e));return n&&!t}(n);if(!r||!e)return e;const l=[...e],s=new Set(l.map(({value:e})=>e));for(const a of t.shippingCountries)s.has(a.value)||(l.push(a),s.add(a.value));return l});return{error:o.error,loading:o.loading,pickupCountries:r}}),ur=["SHIPPING","LOCAL"],pr=e=>e.every(({pickupLocation:e})=>{const n=e&&"distanceFromBuyer"in e?e.distanceFromBuyer:void 0;return n?.value&&n.value>Fo[n.unit]}),mr=(e,n,t,a,i={})=>{const o=e.length;return n?hr(t,{oneItem:()=>a.translate("local_pickup.location_information_far_away_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_information_far_away_other_items",{count:o})}):i.allLocationsFarAway?hr(t,{oneItem:()=>a.translate("local_pickup.location_far_away_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_far_away_other_items",{count:o})}):1===o?hr(t,{oneItem:()=>a.translate("local_pickup.location_nearby_short_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_nearby_short_other_items",{count:o})}):function(e,n){const t=e.map(e=>Bo(e)?.value).filter(e=>void 0!==e);if(0===t.length)return!0;const a=e.find(({handle:e})=>e===n),i=a?Bo(a)?.value:void 0;return void 0===i||i<=Math.min(...t)}(e,i.selectedDeliveryMethodHandle)?hr(t,{oneItem:()=>a.translate("local_pickup.location_closest_one_item"),otherItems:()=>a.translate("local_pickup.location_closest_other_items")}):a.translate("local_pickup.location_selected")};function hr(e,n){return 1===e?n.oneItem():n.otherItems()}function vr({distanceLabel:e,instructions:n}){return e||n?t(on,{className:"KHJ3S",direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&t(on,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(yn,{color:"subdued",children:t(sn,{type:"location",size:"small"})}),t(yn,{fonts:"secondary",type:"small",children:e})]}),n&&t(on,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(yn,{color:"subdued",children:t(sn,{type:"clock",size:"small"})}),t(yn,{fonts:"secondary",type:"small",children:n})]})]}):null}function _r(){const{checkout:n,shop:t}=E(),{deliveryNext:a,merchandiseLines:i}=D(),o=e(()=>{const e=Ve(i.value?.lines).filter(e=>Boolean(e.sellingPlan?.subscriptionDetails));return!!(a.value&&"lines"in a.value&&a.value.lines)&&a.value.lines.some(n=>{if("SUBSCRIPTION"!==n.type)return!1;const t=ze(n);return"PICK_UP"===t?.methodType&&n.targetMerchandiseLines?.some(n=>e.some(e=>e.stableId===n.stableId))})});return e(()=>t.shipPickupInOneOrderEnabled?o.value:ae({checkout:n}))}function yr({variant:e="text"}){const{i18n:n}=E(),a=_r(),i=n.translate("delivery_options.subscription_pickup_information");return t(p,{when:a,children:"banner"===e?t(gt,{tone:"info",children:i}):t(tn,{children:i})})}function gr({method:e,subscriptionBanner:n}){const{i18n:a}=E(),{isOnlyCountryAvailable:i}=Uo(),{cost:o,pickupLocation:r}=e,{name:l,address:s,distanceFromBuyer:c}=r,d=r.instructions.trim(),u=function(e,n){return 0===e.amount?{amount:n.translate("shipping.free_rate_label"),letterCase:"uppercase"}:{amount:n.formatCurrency(e.amount,{currency:e.currencyCode}),letterCase:void 0}}(o,a),p=!i&&c?Do(a,c):void 0;return t(on,{direction:"block",gap:"small-400",children:[t(on,{children:[t(kn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(yn,{type:"strong",children:l}),t(yn,{type:"strong",letterCase:u.letterCase,children:u.amount})]}),t(ca,{address:s,hiddenFields:["postalCode","countryCode","phone"]}),t(vr,{distanceLabel:p,instructions:d})]}),n?t(yr,{variant:"banner"}):null]})}function br({methods:e,selectedDeliveryMethodHandle:n,setSelectedDeliveryMethodHandle:a}){const i=o(()=>n?[n]:[],[n]),r=u(([e=""])=>a?.(e),[a]),l=Gn("purchase.checkout.pickup-location-option-item.render-after");return t(Ka,{name:"local_pickup_methods",values:i,onChange:r,hideRadioControl:1===e.length,children:e.map(e=>t(fr,{method:e,extensions:l},e.handle))})}function fr({method:e,extensions:n}){const a=e.handle,i=o(()=>({handle:a}),[a]);return t(ja,{value:a,children:[t(gr,{method:e,subscriptionBanner:!1}),t(Xn,{marginBlockStart:"small100",customizations:n,options:i})]},a)}const kr="pickup-locations-modal";function Cr({addressFocus:e,...n}){const a=s(!1);return t(Pr,{addressFocus:e??a,...n})}function Pr({methods:e,open:n,type:i,addressFocus:o,onClose:r}){const{i18n:l,shop:c}=E(),[d,v]=At({type:i,deliveryMethodType:"PICK_UP"}),y=Re(),{negotiate:g}=en(),b=D().merchandiseLines,f=_(wt(Ue).hasViolations),{fullCountryName:k,isOnlyCountryAvailable:C}=Uo(),P=s(d),I=s(!1),S=s(!1),{setInverseGroupDeliveryMethodHandle:L,getInverseGroupDeliveryMethodHandle:M}=Et(e||[],i||"ONE_TIME_PURCHASE"),A=ve(),{pickupCountries:w,loading:N}=He(dr,{sellableDeliveryMethods:A}),{deliveryLines:T,merchandiseLines:O,discountLines:F,shippingAddress:B}=x(),V=T.value,z=Se(),{shouldGateCrossBorder:R,crossBorderGate:U}=Ta(),H=_(Boolean(e&&pr(e))),j=qo({allLocationsFarAway:H,selectedPickupOptionNoLongerAvailable:f}),$=(e,n)=>{const t=e.countryCode;t&&R(t)?(r(),U(()=>{B.fields.zoneCode.value=void 0,B.fields.coordinates.value=void 0,B.fields.countryCode.value=t})):n()},q=xt(b.value?.lines),K=k?l.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:k,count:q}):l.translate("local_pickup.pickup_unavailable_banner_title",{count:q});a(()=>{(!I.value&&S.value||void 0!==d&&d!==P.value)&&(S.value&&(S.value=!1),P.value=d)},[I.value,d,S.value]);const G=()=>{c.shipPickupInOneOrderEnabled&&(je(T.value).some(({requiresShipping:e})=>e)||m(()=>{$e({deliveryLines:T,merchandiseLines:O.value,deliveryMethodTypes:["PICK_UP"]})&&qe(F)}))},W=()=>{const e=P.value;if(e!==d){if(v(e),y.value&&e){const n=M(e);L(n)}G(),g({legacyFiltering:{include:["deliveryNext"]},silenceViolations:he(["deliveryNext"])})}o.value=!1,r()},Y=()=>{I.value=!0,S.value=!0,G();const e=V.find(e=>{const n=e.peek().id;return n&&n===z.value?.id});e&&(e.fields.deliveryMethodHandle.value=void 0),g({legacyFiltering:{include:["deliveryNext"]},silenceViolations:he(["deliveryNext"]),fieldsToResolve:["deliveryNext"],onComplete:()=>{I.value=!1}})},Q=u(e=>{P.value=e},[P]);return t(Dn,{id:kr,onHide:W,open:n,heading:l.translate("delivery_options.pick_up_locations"),primaryAction:t(Tt,{handleSubmit:W,submitText:l.translate("payment.add_credit_card_modal.save")}),children:t(Mt,{section:"delivery",children:t(Nt,{children:t(on,{gap:"base",children:[t(p,{when:()=>N.value?null:w.value,children:e=>t(sr,{onLocationChange:Y,onBeforeLocationChange:$,changeLocationOnSelect:!0,pickupCountries:e,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),(()=>{if(S.value)return t(Ko,{hideText:!0});if(e){const n=xt(z.value?.targetMerchandiseLines),a=C||H.value?hr(n,{oneItem:()=>l.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>l.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}):hr(n,{oneItem:()=>l.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>l.translate("local_pickup.location_nearby_other_items",{count:e.length})});return t(h,{children:[t(p,{when:j,children:t(jo,{itemCount:n,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),f.value&&t($o,{}),t(yn,{color:"subdued",children:a}),t(br,{selectedDeliveryMethodHandle:P.value,setSelectedDeliveryMethodHandle:Q,methods:e})]})}return t(Jo,{heading:K,tryDifferentLocationOnClick:()=>{o.value=!0}})})()]})})})})}function Ir(e,n="base"){const t=Ke(n);if(null==e)return t;let a;a=Array.isArray(e)?4===e.length?[Sr(e[0],n),Sr(e[1],n),Sr(e[2],n),Sr(e[3],n)]:[Sr(e[0],n),Sr(e[1],n)]:Sr(e,n);const i=Ge({padding:a}).padding;return null==i?t:i}function Sr(e,n){return function(e){return null!=e&&"none"!==e}(e)?e:n}const Lr="split-delivery-merchandise-modal",Mr=6;function Ar(e){return e.filter(e=>e.requiresShipping)}function wr(e){return new Set(e.map(e=>e.digest)).size}function Er(e){return Ar(Ye(e))}function xr(e){return Ar(je(e))}function Nr(e){return wr(Er(e))+wr(xr(e))}function Tr({targetMerchandiseLines:e,merchandiseLines:n}){const t=Ot(e),a=function(e){return function(e){return e.filter(e=>e.requiresShipping).reduce((e,n)=>e+n.quantity,0)}(e.filter(We).flatMap(e=>e.lineComponents.length>0?e.lineComponents:[e]))}(n);return{targetMerchandiseQuantity:t,isAllItems:t===a}}function Or(){const{deliveryLines:n}=x(),t=e(()=>Nr(n.value)),a=e(()=>t.value>=6);return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function Fr(n){const{deliveryLines:t}=x();return e(()=>function(e,n){return"PICK_UP"===n?Er(e):xr(e)}(t.value,n))}function Dr(n){const{merchandiseLines:t}=x(),a=ce("deliveryNext"),i=e(()=>{const e=n.value,a=Tr({targetMerchandiseLines:e,merchandiseLines:t.value});if(0!==a.targetMerchandiseQuantity)return{merchandiseLines:e,totalItemCount:a.targetMerchandiseQuantity,isAllItems:a.isAllItems}}),o=c(),r=e(()=>{const e=i.value;return e?(o.current=e,e):o.current});return{currentSummary:i,visibleSummary:r,isNegotiating:a}}const Br="split-delivery-method-menu";function Vr(e,n){return`${Br}-${encodeURIComponent(e)}-${n}`}function zr(e,n){if(0!==e)return n>=0?n:0}function Rr({activeIndex:e,isOpen:n,menuOptionsLength:t,selectedOptionIndex:i,wasOpenRef:o}){return a(()=>n?o.current?void(void 0!==e.value&&e.value>=t&&(e.value=0===t?void 0:t-1)):(void 0===e.value&&(e.value=zr(t,i)),void(o.current=!0)):(e.value=void 0,void(o.current=!1)),[e,n,t,i,o]),a(()=>()=>{e.value=void 0,o.current=!1},[e,o]),null}function Ur(e){requestAnimationFrame(()=>{vn({content:e,role:"status"})})}function Hr({merchandiseStableIds:n,onMoveMerchandise:a,onRemoveMerchandise:i,selectedDeliveryMethodType:o,productTitle:r}){const l=L(),{i18n:d}
2=E(),u=ve(),m=pt(),v=Po(),y=_(a??m),g=_(i??v),b=_(Ft().hideOverlay),f=c(null),k=c(!1),P=n[0],I=Vr(P,l),S=function(e,n){return`${Vr(e,n)}-trigger`}(P,l),M=function(e){const{getInteraction:n}=Dt(),t=n(e);return"command"===t?.type&&"overlay"===t.kind&&t.active}(I),A=_(M),w=s(void 0),x=_(o),N=_(r),T=_(n),O=e(()=>{const e={SHIPPING:{label:d.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>n("SHIPPING")},PICK_UP:{label:d.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>n("PICK_UP")}},n=e=>{b.value(I),e!==x.value&&(y.value({targetDeliveryMethodType:e,merchandiseStableIds:T.value}),Ur("SHIPPING"===e?d.translate("split_delivery.accessibility.status.ship_separately",{items:N.value}):d.translate("split_delivery.accessibility.status.pickup_in_store",{items:N.value})))};return e}),F=e(()=>O.value[x.value].label),D=e(()=>{const{deliveryMethodsByMerchandise:e}=u.value,n=T.value.map(n=>e[n]);if(0===n.length||n.some(e=>!e))return[];const[t,...a]=n;return a.reduce((e,n)=>e.filter(e=>n.includes(e)),t)}),B=e(()=>{const e=D.value,n=e.map(e=>({...O.value[e],selected:e===x.value})).sort((e,n)=>Number(n.selected)-Number(e.selected));return 1===e.length&&n.push({label:d.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{b.value(I),g.value(T.value),Ur(d.translate("split_delivery.accessibility.status.remove_items",{items:N.value}))}}),n}),V=e(()=>B.value.length),z=e(()=>B.value.findIndex(e=>e.selected)),R=e=>{const n=V.value;if(0===n||void 0===w.value)return;const t=Math.min(w.value,n-1);w.value=(t+e+n)%n},U=()=>{w.value=zr(V.value,z.value)},H=()=>{M||U()},j=e=>{e&&(e.onClick(),requestAnimationFrame(()=>{var e;document.querySelector((e=P,`[id^="${Br}-${encodeURIComponent(e)}-"][id$="-trigger"]`))?.focus()}))},$=e=>{if(M)switch(e.key){case"ArrowDown":e.preventDefault(),R(1);break;case"ArrowUp":e.preventDefault(),R(-1);break;case"Home":e.preventDefault(),w.value=0;break;case"End":e.preventDefault(),w.value=V.value-1;break;case"Enter":case" ":e.preventDefault(),void 0!==w.value&&j(B.value[w.value]);break;case"Tab":e.stopPropagation(),b.value(I)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),U(),f.current?.click())},q=e(()=>A.value&&void 0!==w.value&&void 0!==B.value[w.value]?`${I}-option-${w.value}`:void 0);return t(p,{when:V,children:e=>t(h,{children:[t(Rr,{activeIndex:w,isOpen:M,menuOptionsLength:e,selectedOptionIndex:z.value,wasOpenRef:k}),t(_n,{ref:f,id:S,command:"--toggle",commandFor:I,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:"HoMMS",accessibilityLabel:`${r}, ${d.translate("review.blocks.change_delivery_method_link_label")}`,onClick:H,role:"combobox",onKeyDown:$,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":q.value,children:t(on,{direction:"inline",gap:"small-500",alignItems:"center",children:[t("span",{className:"g9aTP",children:F}),t("span",{className:"_5tEP0",children:t(sn,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),t(ei,{id:I,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:t("div",{role:"listbox","aria-labelledby":S,children:t(C,{each:B,getKey:e=>e.value,children:(e,n)=>{const a=w.value===n;return t("button",{id:`${I}-option-${n}`,type:"button",role:"option",tabIndex:-1,"aria-selected":e.selected,"data-active":a||void 0,className:"eWR8C",onClick:()=>{j(e)},onMouseOver:()=>{w.value=n},children:t(on,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(sn,{type:e.icon,tone:a?"accent":"auto"}),t(yn,{type:"small",tone:"remove"===e.value?"critical":"auto",children:e.label})]})})}})})})]})})}function jr({onMoveMerchandise:e,onRemoveMerchandise:n,title:a,selectedDeliveryMethodType:i}){const r=Fr(i).value,l=o(()=>{const e=new Map;for(const n of r){const t=n.digest,a=e.get(t);if(a){if(a.stableIds.includes(n.stableId))continue;a.stableIds.push(n.stableId),a.totalQuantity+=n.quantity}else e.set(t,{line:n,stableIds:[n.stableId],totalQuantity:n.quantity})}return Array.from(e.values())},[r]),s=Bt(l.map(({line:e})=>e.stableId)),c=Ut(i);return t(h,{children:t(on,{accessibilityRole:"unordered-list",accessibilityLabel:a,gap:"small-100",children:l.map(({line:{stableId:a,image:o,title:r,subtitle:l,sellingPlan:d},stableIds:u,totalQuantity:p})=>
2{const m=[l,d?.name].filter(Boolean).join(` ${Vt} `),h=s.has(a);return t(Vn,{accessibilityRole:"list-item",className:h?c:void 0,children:t(kn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"center",alignContent:"center",children:[t(zt,{alt:o?.altText,size:"small",src:o?.url,totalItems:p>1?p:void 0}),t(Vn,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[t(yn,{size:"base",children:t(Rt,{children:r})}),m&&t(yn,{color:"subdued",size:"small",children:t(Rt,{children:m})})]}),t(Vn,{inlineAlignment:"end",children:t(Hr,{merchandiseStableIds:u,onMoveMerchandise:e,onRemoveMerchandise:n,selectedDeliveryMethodType:i,productTitle:r})})]})},a)})})})}function $r(){const{i18n:n}=E(),a=rt(),o=c(null),r=Fr("PICK_UP"),{shouldOpenModal:l}=Or(),{currentSummary:d,visibleSummary:u,isNegotiating:m}=Dr(r),h=e(()=>1===d.value?.totalItemCount),v=e(()=>{const e=u.value;return e?e.isAllItems?n.translate("split_delivery.pickup_all_items"):n.translate("split_delivery.pickup_items_count",{count:e.totalItemCount}):""}),_=e(()=>{const e=n.translate("review.blocks.change_delivery_method_link_label");return v.value?`${v.value}, ${e}`:e}),y=e(()=>v.value||n.translate("split_delivery.items_for_pickup")),g=s(I(()=>l.value||!h.value&&!a.value));return i(()=>{g.value=l.value||!h.value&&!a.value}),t(Vn,{children:t(Wa,{children:t(p,{when:g,fallback:t("div",{ref:o,tabIndex:-1,children:t(jr,{title:n.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:t(cn,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:l.value?_.value:y.value,command:l.value?"--show":void 0,commandFor:l.value?Lr:void 0,"aria-expanded":!!l.value&&void 0,disabled:m.value,onClick:l.value?void 0:()=>{g.value=!1,requestAnimationFrame(()=>{o.current?.focus()})},children:t(kn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(Ht,{variant:"fan-legacy",sortByPrice:!0,merchandise:u.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),t(p,{when:()=>!m.value&&void 0!==u.value,fallback:t(bt,{inlineSize:"base"}),children:t(yn,{children:v})}),t(sn,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function qr(){const{shop:n}=E(),t=ve(),{deliveryNext:a}=D(),i=rt(),o=Na();return e(()=>{if(!n.shipPickupInOneOrderEnabled)return!1;if(!(a.value&&"supportsSplitDeliveryMethod"in a.value&&a.value.supportsSplitDeliveryMethod))return!1;const{enabledDeliveryMethods:e,deliveryMethodsByMerchandise:r}=t.value,l=e.includes("SHIPPING"),s=e.includes("PICK_UP");if(!l||!s)return!1;if(!i.value&&o.value)return!1;const c=Object.values(r);if(c.length<2)return!1;if(c.some(e=>e.includes("SHIPPING")&&e.includes("PICK_UP")))return!0;const d=c.some(e=>e.includes("SHIPPING")&&!e.includes("PICK_UP")),u=c.some(e=>e.includes("PICK_UP")&&!e.includes("SHIPPING"));return d&&u})}function Kr({localPickupDeliveryLine:e,onShowModal:n,sectionPadding:a}){const{i18n:i,shop:r}=E(),l=qr(),s=Ir(a),c=r.hasFlagEnabled(W),{methods:d,selectedDeliveryMethodHandle:u}=e,m=d.find(e=>e.handle===u),v=d.length-1,_=Ct({methods:d,selectedDeliveryMethodHandle:u}),y=Gn("purchase.checkout.pickup-location-option-item.render-after"),g=m?.handle??"",b=o(()=>({handle:g}),[g]);if(!m)return null;const f=t(h,{children:[t(p,{when:l,children:t(h,{children:[t(Vn,{padding:s,children:t($r,{})}),t($n,{accessibilityRole:"presentation"})]})}),t(Vn,{padding:s,children:[t(gr,{method:m,subscriptionBanner:!0}),t(Xn,{marginBlockStart:"small100",customizations:y,options:b})]}),v>0?t(on,{children:[t($n,{accessibilityRole:"presentation"}),t(Vn,{padding:s,children:t(cn,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:function(){n(),_("checkout_pickup_buyer_reveal_more")},children:t(on,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[t(yn,{type:"strong",children:i.translate("local_pickup.toggle_more_locations",{count:v})}),t(sn,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return t(on,{gap:"base",children:c?t(Ga,{target:"edgeToEdgeCard",children:t(qn,{accessibilityRole:"presentation",children:f})}):t(Vn,{border:"base",borderRadius:"large",children:f})})}function Gr({sectionPadding:e}){const{shop:n}=E(),a=qr(),i=Ir(e),o=n.hasFlagEnabled(W),r=t(h,{children:[t(p,{when:a,children:[t(Vn,{padding:i,children:t($r,{})}),t($n,{accessibilityRole:"presentation"})]}),t(Vn,{padding:i,children:t(on,{direction:"block",gap:"small-400",children:t(on,{children:[t(kn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(bt,{}),t(bt,{inlineSize:"small"})]}),t(bt,{inlineSize:"large"}),t(Vn,{paddingBlockStart:"small-500",children:t(bt,{size:"small"})})]})})}),t($n,{accessibilityRole:"presentation"}),t(Vn,{padding:i,children:t(bt,{inlineSize:"small"})})]});return t(on,{gap:"base",children:[t(on,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(bt,{inlineSize:"large"}),t(bt,{inlineSize:"small"})]}),o?t(Ga,{target:"edgeToEdgeCard",children:t(qn,{accessibilityRole:"presentation",children:r})}):t(Vn,{border:"base",borderRadius:"large",children:r})]})}function Wr({onShowModal:e,showLocationButton:n=!0}){const{i18n:a}=E(),{value:i}=D().merchandiseLines;jt({active:!0});const{fullCountryName:o,isOnlyCountryAvailable:r}=Uo(),l=Ct({methods:[],selectedDeliveryMethodHandle:void 0}),s=xt(i?.lines),c=o?a.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:o,count:s}):a.translate("local_pickup.pickup_unavailable_banner_title",{count:s});return t(on,{gap:"small",children:[n&&t(Ho,{onClick:()=>{e(),l(r?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),t(Jo,{heading:c,tryDifferentLocationOnClick:()=>e(!0)})]})}const Yr={isLocationFormVisible:!1};function Qr(){const{i18n:n,shop:a}=E(),{main:{section:i}}=jn(),o=a.hasFlagEnabled(W)?i?.padding:void 0,{negotiating:r}=yt(),l=Se(),c=H(),u=ce("deliveryNext"),{value:m}=$t().value,{value:v}=qt().value,y=Boolean(m||v),g=_(wt(Ue).hasViolations),b=Ao({mode:"localPickup"}),f=e(()=>b.value.merchandiseLines),k=e(()=>b.value.allowAlternativeAction),C=e(()=>b.value.merchandiseLines.length>0),{isOnlyCountryAvailable:P}=Uo(),I=e(()=>{const e=l.value?.methods??[];return e.length>0&&pr(e)}),S=qo({allLocationsFarAway:I,selectedPickupOptionNoLongerAvailable:g}),L=Ct({methods:l.value?.methods||[],selectedDeliveryMethodHandle:l.value?.selectedDeliveryMethodHandle}),[M,A]=d(!1),w=s(!1),x=Gn("Checkout::PickupLocations::RenderBefore"),N=Gn("Checkout::PickupLocations::RenderAfter"),T=e=>{A(!0),w.value=e??!1},O=()=>{T(),L(P?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},F=(()=>{const e=l.value,a=e?.methods.find(n=>n.handle===e.selectedDeliveryMethodHandle);if(!c.value||M)return t(Gr,{sectionPadding:o});if(r.value&&!a)return t(Gr,{sectionPadding:o});if(y)return t(p,{when:C,fallback:t(Wr,{onShowModal:T}),children:t(h,{children:[t(Lo,{bannerType:"pickup",merchandiseLines:f,allowAlternativeAction:k}),t(Xr,{})]})});if(!e)return t(Gr,{sectionPadding:o});const{methods:i}=e,s=xt(e.targetMerchandiseLines);return t(on,{gap:"base",children:[t(p,{when:C,children:t(Lo,{bannerType:"pickup",merchandiseLines:f,allowAlternativeAction:k})}),t(p,{when:g,children:t($o,{})}),t(p,{when:S,children:t(jo,{itemCount:s,methods:e.methods,onChangeLocationClick:T})}),t(on,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(p,{when:u,fallback:t(yn,{color:"subdued",children:mr(i,P,s,n,{selectedDeliveryMethodHandle:e.selectedDeliveryMethodHandle,allLocationsFarAway:I.value})}),children:t(bt,{inlineSize:"base"})}),t(Ho,{onClick:O})]}),t(Xn,{customizations:x,options:Yr}),t(Kr,{localPickupDeliveryLine:e,onShowModal:T,sectionPadding:o}),t(Xn,{customizations:N,options:Yr})]})})();return t(En,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(qn,{accessibilityLabel:n.translate("local_pickup.pick_up_location"),children:[F,t(Cr,{methods:l.value?.methods,type:l.value?.type,open:M,onClose:()=>{A(!1),w.value=!1},addressFocus:w})]})})}function Xr(){return jt({active:!0}),null}function Jr(){const{i18n:e}=E(),[n,a]=d(!1),{formattedAddress:i}=Uo(),o=i?t(on,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(sn,{type:"geolocation",size:"small-100"}),t(yn,{children:Ro(i,13)})]}):e.translate("local_pickup.toggle_location");return t(En,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(qn,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:t(on,{gap:"small-500",children:[t(kn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[t(Fn,{level:2,children:e.translate("delivery_options.pick_up_locations")}),t(Ln,{id:"change-pickup-location-button",textDecoration:"none",onClick:()=>a(e=>!e),accessibilityLabel:n?e.translate("local_pickup.cancel"):e.translate("local_pickup.toggle_location"),children:n?e.translate("local_pickup.cancel"):o})]}),t(Zr,{isLocationFormVisible:n,setIsLocationFormVisible:a})]})})})}function Zr({isLocationFormVisible:n,setIsLocationFormVisible:a}){const i=H(),{i18n:r,observability:l}=E(),{negotiating:c}=yt(),d=Se(),u=ce("deliveryNext"),p=s(!1),{value:m}=qt().value,h=Boolean(m),{isOnlyCountryAvailable:v}=Uo(),_=Zo(),{deliveryLines:y}=x(),g=y.value,{negotiate:b}=en(),f=Kt(),k=Gn("Checkout::PickupLocations::RenderBefore"),C=Gn("Checkout::PickupLocations::RenderAfter"),P=o(()=>({isLocationFormVisible:n}),[n]),I=()=>a(!1),S=()=>a(e=>!e),L=()=>{I(),async function({negotiate:e,proposedDeliveryLines:n,pickupDeliveryLineId:t,pending:a,deliveryNextLoading:i}){let o;a.value=!0,function(e,n){if(!n)return;const t=e.find(e=>e.value.id===n);t&&(t.fields.deliveryMethodHandle.value=void 0)}(n,t);try{await e({legacyFiltering:{include:["deliveryNext"]},silenceViolations:he(["deliveryNext"]),fieldsToResolve:["deliveryNext"],onComplete(e){o=e}})}catch(l){throw a.value=!1,l}if("stale"!==o?.status||!i.value)return void(a.value=!1);const r=i.subscribe(e=>{e||(a.value=!1,r())})}({negotiate:b,proposedDeliveryLines:g,pickupDeliveryLineId:d.value?.id,pending:p,deliveryNextLoading:u}).catch(e=>l.error(e))},M=ve(),{pickupCountries:A,loading:w}=He(dr,{sellableDeliveryMethods:M}),N=e(()=>Boolean(d.value&&Vo(d.value.methods)));if(h)return t(el,{isLocationFormVisible:n,setFormVisibilityFalse:I,handleLocationChange:L,pickupCountries:A.value??[],onToggleLocationFormClick:S});if(c.value||!i.value||w.value||!A.value)return t(Ko,{});if(d.value){const{methods:e,type:a}=d.value,i=f.value.PICK_UP??0,o=N.value&&_&&!v,l=hr(i,v?{oneItem:()=>r.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>r.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}:{oneItem:()=>r.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>r.translate("local_pickup.location_nearby_other_items",{count:e.length})});return t(on,{gap:"base",children:[t(yr,{}),t(Xn,{customizations:k,options:P}),t(kn,{gap:"@media (inline-size >= medium) large-500, none",gridTemplateColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gridAutoColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",justifyItems:"start",justifyContent:"start",alignItems:"start",alignContent:"start",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:!o&&t(tn,{color:"subdued",children:_?l:r.translate("local_pickup.location_information",{count:e.length})})}),t(rr,{locationFormVisible:n,toggleLocationFormVisibility:I,onLocationChange:L,pickupCountries:A.value,children:t(il,{itemCount:i,methods:e,type:a,allLocationsFarAway:N,loading:p.value,onToggleLocationFormClick:S})}),t(Xn,{customizations:C,options:P})]})}return t(el,{isLocationFormVisible:n,setFormVisibilityFalse:I,handleLocationChange:L,pickupCountries:A.value,onToggleLocationFormClick:S})}function el({isLocationFormVisible:e,setFormVisibilityFalse:n,handleLocationChange:a,pickupCountries:i,onToggleLocationFormClick:o}){const{value:r,loading:l}=$t().value,s=D().merchandiseLines,{i18n:c}=E(),{locationAddress:d}=x(),u=d.peek(),p=i.find(e=>e.value===u.countryCode)?.label,m=xt(s.value?.lines),h=p?c.translate("order_summary.pickup_unavailable_banner_title_with_country",{count:m,country:p}):c.translate("order_summary.pickup_unavailable_banner_title",{count:m});return!l&&r?t(on,{gap:"base",children:[t(rr,{locationFormVisible:e,toggleLocationFormVisibility:n,onLocationChange:a,pickupCountries:i,children:t(Jo,{heading:h,tryDifferentLocationOnClick:o})}),t(nl,{})]}):t(Ko,{})}function nl(){return jt({active:!0}),null}function tl({instructions:e}){return t(Vn,{maxInlineSize:"200px",children:t(tn,{type:"small",children:e})})}function al({handle:e,address:n,secondaryLabel:a,letterCase:i,showInstructionsLeft:r,showInstructionsRight:l,instructions:s,nameLabel:c,itemRenderAfterCustomizations:d}){const u=o(()=>({handle:e}),[e]);return t(ja,{value:e,details:t(h,{children:[t(ca,{address:n,textSize:"small",hiddenFields:["phone"]}),r&&s&&t(tl,{instructions:s})]}),secondaryContent:t(h,{children:[t(yn,{type:"strong",letterCase:i,children:t("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),l&&s&&t(tl,{instructions:s})]}),tertiaryContent:d?.length>0&&t(Xn,{customizations:d,options:u,render:e=>t(on,{padding:"small-100 none none none",gap:"small-100",children:e})}),children:t(yn,{type:"strong",children:c})})}function il({itemCount:e,methods:n,allLocationsFarAway:i,type:r,loading:l,onToggleLocationFormClick:s}){const{i18n:c,checkout:{identity:m}}=E(),v="shopPay"===m.current.value,{negotiate:y}=en(),g=Re(),{isOnlyCountryAvailable:b}
2=Uo(),f=Zo(),k=H(),C=Gt({base:!0,medium:!1}),P=!k.value||(C??!1),[I,S]=At({type:r,deliveryMethodType:"PICK_UP"}),{revealedMethods:L,amountLeft:M,allRevealed:A,revealMore:w}=function(e,n){const t=Ct({methods:e,selectedDeliveryMethodHandle:n}),[i,r]=d(5),l=o(()=>e.slice(0,i),[e,i]);a(()=>{const t=e.findIndex(e=>e.handle===n);t>=i&&r(t+1)},[e,i,n]);const s=e.length-l.length,c=l.length>=e.length;return{revealedMethods:l,amountLeft:s,allRevealed:c,revealMore:()=>{c||(r(e=>e+5),t("checkout_pickup_buyer_reveal_more"))}}}(n,I),{setInverseGroupDeliveryMethodHandle:x,getInverseGroupDeliveryMethodHandle:N}=Et(n,r),T=u(([e=""])=>{if(S(e),g.value){const n=N(e);x(n)}y({legacyFiltering:{include:["deliveryNext"]},silenceViolations:he(["deliveryNext"])})},[S,g,y,N,x]),O=Gn("purchase.checkout.pickup-location-option-item.render-after"),F=_(wt(Ue).hasViolations),D=qo({allLocationsFarAway:i,selectedPickupOptionNoLongerAvailable:F}),B=o(()=>I?[I]:[],[I]);return l?t(Ko,{hideText:!0}):t(on,{gap:"base",children:[t(p,{when:D,children:t(jo,{itemCount:e,methods:n,onChangeLocationClick:s})}),F.value&&t($o,{}),t(Ka,{name:"local_pickup_methods",values:B,onChange:T,hideRadioControl:!v&&1===L.length,children:L.map(({handle:e,cost:{amount:n,currencyCode:a},pickupLocation:i})=>{const{address:o,instructions:r,name:l,distanceFromBuyer:s,proximityLabel:d}=i,u=((e,n)=>0===e?c.translate("shipping.free_rate_label"):c.formatCurrency(e,{currency:n}))(n,a),p=(({name:e="",proximityLabel:n,distance:a})=>{if(b||!a&&!n)return e;const i=n||`(${Do(c,a)})`;return t(h,{children:[e," ",t(yn,{color:"subdued",children:i})]})})({name:l,distance:s,proximityLabel:f?void 0:d}),m=u===c.translate("shipping.free_rate_label")?"uppercase":void 0,_=Boolean(r&&(v||P)),y=Boolean(r&&!v&&!P);return t(al,{handle:e,address:o,secondaryLabel:u,letterCase:m,showInstructionsLeft:_,showInstructionsRight:y,instructions:r,nameLabel:p,itemRenderAfterCustomizations:O},e)})}),!A&&t(Vn,{inlineAlignment:"end",children:t(Ln,{onClick:w,children:c.translate("local_pickup.reveal_more_label",{count:M})})})]})}function ol({heading:e="auto"}){const{i18n:n}=E(),a=n.translate("pickup_point.title");return t(qn,{accessibilityLabel:a,children:t(on,{gap:"small-400",children:["auto"===e&&t(Fn,{level:2,children:a}),t(Jn,{blockSize:"small-500"}),t(Za,{text:n.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const rl=r({displayName:"PickupPoint",load:()=>l(()=>ba(()=>import("./78af98ed.Cs6St23D.js"),__vite__mapDeps([62,1,6,2,3,4,5,7,8,9,10,11,12,13,28,53,49,25,26,15,16,50,14,17,18,19,20,21,22,23,24,27,63,56,64,65,41,39,40,42,29,43,44,45,46,37,38,47,48,51,35,36,52,66]))),renderLoading:e=>t(ol,{...e})});function ll({selectedDeliveryMethodType:n}){const{i18n:a}=E(),{merchandiseLines:i}=x(),o=Fr(n),{shouldOpenModal:r}=Or(),l=e(()=>{const e=Tr({targetMerchandiseLines:o.value,merchandiseLines:i.value});return e.isAllItems?"PICK_UP"===n?a.translate("split_delivery.pickup_all_items"):a.translate("split_delivery.ship_all_items"):"PICK_UP"===n?a.translate("split_delivery.pickup_items_count",{count:e.targetMerchandiseQuantity}):a.translate("split_delivery.ship_items_count",{count:e.targetMerchandiseQuantity})}),s=e(()=>`${l.value}, ${a.translate("review.blocks.change_delivery_method_link_label")}`);return r.value?t(cn,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:s.value,command:"--show",commandFor:Lr,children:t(kn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(Ht,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),t(yn,{children:l}),t(sn,{type:"pen",size:"base",tone:"neutral"})]})}):t(jr,{title:"PICK_UP"===n?a.translate("split_delivery.items_for_pickup"):a.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:n})}function sl({id:e=Lr,open:n}){const{i18n:a}=E(),i=Fr("PICK_UP"),o=Fr("SHIPPING"),{moveMerchandise:r,removeMerchandise:l,saveAndClose:s}=function({onClose:e}={}){const{negotiate:n}=en(),{i18n:t}=E(),a=Wt(),{deliveryLines:i,merchandiseLines:o,discountLines:r}=x(),l=ve(),s=c(!1);return{moveMerchandise:u(({targetDeliveryMethodType:e,merchandiseStableIds:n})=>{const{orphanedRemovedFromCartStableIds:t}=Qe({deliveryLines:i,merchandiseLines:o,targetDeliveryMethodType:e,merchandiseStableIds:n,sellableDeliveryMethodsByStableId:l.value.deliveryMethodsByMerchandise,discountLines:r});t.length>0&&(s.current=!0)},[i,o,l,r]),removeMerchandise:u(e=>{me({deliveryLines:i,merchandiseLines:o,merchandiseStableIds:e,discountLines:r})},[i,o,r]),saveAndClose:u(()=>{e?.(),n({legacyFiltering:{include:["deliveryNext","merchandiseLines"]},silenceViolations:he(["deliveryNext","merchandiseLines"])}),s.current&&(s.current=!1,a(t.translate("stock.removed_from_cart_notice")))},[n,e,a,t])}}(),d=a.translate("delivery_options.pickup"),p=a.translate("delivery_options.ship_to_address");return t(Dn,{id:e,open:n,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:s,primaryAction:t(cn,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:t(on,{gap:"large-300",children:[i.value.length>0&&t(on,{gap:"base",children:[t(on,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(sn,{type:"marker"}),t(Fn,{level:2,children:d})]}),t(Vn,{border:"base",borderRadius:"large",padding:"base",children:t(jr,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"PICK_UP",title:d})})]}),o.value.length>0&&t(on,{gap:"base",children:[t(on,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(sn,{type:"package-delivery"}),t(Fn,{level:2,children:p})]}),t(Vn,{border:"base",borderRadius:"large",padding:"base",children:t(jr,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"SHIPPING",title:p})})]})]})})}const cl=bn("VatNumberFieldInfoTooltip");function dl({status:e}){const{i18n:n}=E();return"pending"===e.type?t(Sn,{size:"small",accessibilityLabel:n.translate("taxes.vat_number.accessibility.status.val
2idating")}):"invalid_format"===e.type?t(pl,{}):t(ul,{status:e})}function ul({status:{validationStatus:e}}){const{i18n:n}=E();return"VALID"===e?t(h,{children:[t(sn,{tone:"success",size:"small",type:"check-circle"}),t(yn,{accessibilityVisibility:"exclusive",children:n.translate("taxes.vat_number.accessibility.status.valid")})]}):t(pl,{})}function pl(){const{i18n:e}=E(),n=hn(void 0,cl);return t(h,{children:[t(sn,{size:"small",type:"question-circle",interestFor:n}),t(gn,{id:n,children:e.translate("taxes.vat_number.field.tooltip")})]})}function ml({taxId:n,applied:i,inputRef:o}){const{i18n:r}=E(),l=function({taxId:e}){const{negotiate:n}=en(),t=Yt(),i=()=>{n({identifier:Symbol.for("vat-id-validation"),force:!0})},o=n=>{e.format.validate(n)&&(i(),t({vatId:n}))};return a(()=>{null===e.validated.status&&o(e.value)},[]),{value:e.value,status:e.status,loading:"pending"===e.status.type,onBlur:()=>{e.value===e.validated.taxId&&e.validated.status||(i(),t({vatId:e.value}))},onInput:n=>{e.set(n),o(n)}}}({taxId:n}),s=function({status:n}){const{i18n:t}=E(),{shippingAddress:a}=x(),i=_(n);return e(()=>{const e=a.value.countryCode?.toLowerCase(),n=i.value;return"invalid_format"===n.type&&e?{code:"invalid_format",details:{country:e},message:t.translate("taxes.vat_number.status.invalid_format",{scope:e})}:"resolved"===n.type&&"INVALID"===n.validationStatus&&e?{code:"invalid_number",details:{country:e},message:t.translate("taxes.vat_number.status.invalid_number",{scope:e})}:"resolved"===n.type&&"SERVICE_ERROR"===n.validationStatus?{code:"service_error",message:t.translate("taxes.vat_number.status.service_error")}:"resolved"===n.type&&"SERVICE_UNAVAILABLE"===n.validationStatus?{code:"service_unavailable",message:t.translate("taxes.vat_number.status.service_unavailable")}:null})}(l),d=e(()=>s.value&&{type:"warning",value:s.value.message}),u=n.warnings.includes("DOMESTIC_NOT_APPLICABLE");return function(e,n){const t=c(e.type),i=c(n);a(()=>{i.current=n},[n]);const o=e.type;a(()=>{const e=t.current;t.current=o,"pending"===e&&"resolved"===o&&i.current()},[o])}(l.status,()=>{if("resolved"===l.status.type&&"VALID"===l.status.validationStatus&&i)return vn({content:r.translate("taxes.vat_number.accessibility.status.applied"),role:"alert"});if(u)return vn({content:r.translate("taxes.vat_number.accessibility.status.domestic"),role:"status"});const e=s.value;if(e)switch(e.code){case"invalid_number":return vn({content:r.translate("taxes.vat_number.accessibility.status.invalid_number"),role:"alert"});case"service_error":return vn({content:r.translate("taxes.vat_number.accessibility.status.service_error"),role:"alert"});case"service_unavailable":return vn({content:r.translate("taxes.vat_number.accessibility.status.service_unavailable"),role:"alert"})}}),t(on,{direction:"block",gap:"base",children:[t("div",{"aria-busy":l.loading,children:t(Cn,{ref:o,name:"vatNumber",label:r.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:t(dl,{status:l.status}),error:d.value,...l})}),u&&t(gt,{tone:"info",children:r.translate("taxes.vat_number.domestic_order")})]})}export{jr as $,nr as A,Vo as B,Ai as C,fo as D,Zi as E,qo as F,mr as G,jo as H,Lo as I,Ho as J,Cr as K,br as L,_r as M,Do as N,kr as O,Ko as P,vr as Q,bo as R,yr as S,Er as T,xo as U,ml as V,xr as W,Dr as X,Nr as Y,Mr as Z,Lr as _,Wr as a,mo as a0,ai as a1,Co as a2,$o as b,ti as c,mi as d,oo as e,To as f,qr as g,rl as h,Oo as i,sl as j,Zo as k,Qr as l,Jr as m,ll as n,io as o,xi as p,Ir as q,Xo as r,Ni as s,Jo as t,Ao as u,Ei as v,Bi as w,ko as x,hi as y,Uo as z};

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.