PageSourceSearch

https://mesocustoms.com/cdn/shopifycloud/checkout-web/assets/c1/co…onents-VatNumberValidationField.DqFc8B_9.js

js mesocustoms.com collected 2026-09-29 00:47:03 UTC 111,973 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-ShopPayVerificationSwitch.NNHrlsCO.js","esnext-vendor.DDpcaSqU.js","utilities-previous.Cnwy8G2v.js","app.DdDscdWN.js","assets/app.BuSMBobh.css","assets/previous.DjvIwnbB.css","hydrate.BcfGVx0L.js","graphql-PaymentSessionMutation.C-nDEOnn.js","shared-permissions.B59tuyWB.js","hooks-useShopPayExternalAppContext.R6pnDxYu.js","assets/helpers.BduNPqpW.css","stopwatch.B56VZk5r.js","CalloutHeader.DC7jgv42.js","assets/CalloutHeader.BxwwfmsJ.css","BillingAddressForm.B1Xpg2b3.js","FormLayout.UkTBTXMZ.js","amazon-pay-useAmazonPayPaymentLine.X7jqQiq6.js","assets/FormLayout.CFj15lwv.css","PhoneField.rAEISard.js","hooks-useSuppressShopPayModalOnLoad.Cvo-K0z2.js","assets/PhoneField.uZEuHncj.css","Popover.ZkMcWGfE.js","assets/Popover.Bi1nHaU-.css","utilities-stable-ref.dCtJn23l.js","Choice.D9vYH2mX.js","Checkbox.CdJzVizb.js","assets/Checkbox.SrYMuQu4.css","assets/Choice.DV6JSDrR.css","assets/BillingAddressForm.BdwN7V1K.css","hooks-useShopPayNewSignupLoginExperiment.DrmS3FLj.js","hooks-useForceShopPayUrl.JfumpHY0.js","utilities-publishMessage.DgMwhdOZ.js","localization-index.C3Jg94aR.js","useAuthorizeUrl-index.CkivndK9.js","dist-v4.EwEgHOG0.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","component-ApplePayButton.BvXcSeY7.js","TransitionHeight.Bhh9D1te.js","assets/TransitionHeight.CuRoM9zv.css","hooks-useWalletsTimeout.ByRalZ9t.js","useShopPayButtonClassName.C6ri8rG_.js","shared-shop-theme.BKb8cP_L.js","hooks-useShouldRevealCustomization.djt7DCHB.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","ChangeCompanyLocationLink.DXURX0D_.js","shop-pay-installments-monorail.B1-OWrOB.js","ShopPayLogo.D2iKuiAK.js","Monorail-monorailMetric-wallets.D__Peh7l.js","PayButton-helpers.DGMbMyz3.js","crypto-constants.Ca3tBkwm.js","assets/constants.Dlnp55te.css","cross-border-hooks.BVR78hJy.js","Section-SectionStyleOverride.CdNufRZ0.js","AutocompleteField-hooks.By5FDG3b.js","PendingShipping.D432iDGV.js","assets/ApplePayButton.CTcryfIc.css","component-amazonWalletLazy.B2F4OE22.js","hooks-useStableHostMethodsReferences.CidTc5Dm.js","WalletsSandbox-WalletSandbox.r7H6tjVA.js","assets/WalletSandbox.BoV0vp4z.css","negotiated-findSelectedDeliveryMethod.C8W7wTVp.js","amazon-constants.D9ZwhJsy.js","checkout-as-guest-amazon-pay.DVQDcxt_.js","assets/amazonWalletLazy.D78LrA7v.css","assets/delivery-method-transitions.S-FSTp4Y.css","component-PickupPoint.ClPZZS0v.js","Map.zn3N8TdH.js","assets/Map.cbVP6Hp_.css","utilities-dates.ChO2GdxN.js","assets/PickupPoint.3rHQv8Px.css"])))=>i.map(i=>d[i]);
2import{f as L,_ as Gn,u as n,h as K,o as Ae,T as se,d as mn,r as Kn,e as ce,A as te,k as le,q as j,i as Y,n as We,S as Q,g as Pe,l as de,Q as go,X as _o,x as fo,a as bo,j as Po,p as Bn,aA as ko,G as Fn,E as bt,ae as Co}from"./esnext-vendor.DDpcaSqU.js";import{F as qt,a as So}from"./FormLayout.UkTBTXMZ.js";import{T as y,W as $,ah as vn,iq as Io,ir as Lo,bb as Mo,a$ as qn,bl as Ao,I as $e,a5 as ue,j7 as Ne,eN as jt,bs as Yt,bt as jn,bu as cn,an as Ze,ae as Te,ct as Qt,af as Yn,j8 as Eo,j9 as To,cs as yn,aI as Xt,ja as wo,f4 as No,jb as Do,a7 as Me,cr as Oo,b8 as Jt,jc as xo,jd as Bo,am as Fo,je as Pt,dg as Ro,bm as Ke,g2 as Qn,at as Zt,jf as Vo,g0 as Fe,ak as ea,jg as na,dy as en,jh as Ho,ji as Uo,H as Rn,eR as zo,dN as Wo,eQ as $o,K as Go,jj as Ko,jk as kt,cA as qo,eS as jo,eV as Yo,aY as Qo,l as Xo,n as Jo,cB as ta,dA as Xn,bI as aa,jl as oa,jm as Zo,cU as ei,ik as ni,jn as ti,ai as ia,jo as ai,jp as Ct}from"./utilities-previous.Cnwy8G2v.js";import{da as sa,bf as Jn,c as oi,e as ke,a7 as gn,b2 as He,P as Ee,k as S,e3 as ii,cv as Zn,I as oe,i as ye,hx as si,bl as ra,fY as wn,f0 as un,F as _n,a as De,aE as la,l as O,gI as ca,M as fn,bQ as bn,G as ge,T as ua,aa as dn,gG as ri,S as et,L as me,hy as li,bR as ci,hp as ui,cT as Pn,cA as di,gx as pi,a6 as hi,fu as mi,n as Ge,bC as kn,dJ as vi,B as G,aj as yi,b7 as gi,ca as _i,a1 as fi,$ as da,a2 as Ue,a0 as ze,hz as bi,s as xe,hA as Pi,d5 as nt,Q as ki,U as Be,b as pa,bE as ha,hB as Ci,W as qe,C as nn,J as Si,bt as ma,bs as Vn,cr as tn,eT as Ii,hC as va,cw as Li,hD as je,bV as Cn,hE as ya,cx as ga,cy as _a,ak as pe,eU as Sn,cp as fa,f4 as ba,f5 as Mi,dm as Ai,O as Pa,cs as ka,bU as tt,ct as Ca,hF as Xe,hG as Ei,hH as Ti,aH as wi,cb as Ni,aC as Di,hI as Oi,b6 as xi,am as Bi,bw as St,hJ as Fi,aF as Sa,_ as at,e0 as Ia,e1 as La,eo as Ri,a3 as Vi,cc as Hi,c1 as Ui,hK as zi,fC as Wi,hl as $i,hL as Gi}from"./hydrate.BcfGVx0L.js";import{a as ot,v as Hn,b as Ki,S as qi}from"./useShopPayButtonClassName.C6ri8rG_.js";import{b as it,c as ji,d as Yi,e as Qi,i as Ma,f as Xi}from"./hooks-useForceShopPayUrl.JfumpHY0.js";import{u as Ji,A as Aa}from"./utilities-stable-ref.dCtJn23l.js";import{u as Ea,S as Zi,a as es,b as ns,A as ts}from"./ChangeCompanyLocationLink.DXURX0D_.js";import{C as st}from"./Checkbox.CdJzVizb.js";import{P as as,u as os,F as is}
2from"./PhoneField.rAEISard.js";import{_ as an,h as ss,f as rs}from"./app.DdDscdWN.js";import{I as Ta}from"./shop-pay-installments-monorail.B1-OWrOB.js";import{S as ls,u as cs,G as us}from"./ShopPayLogo.D2iKuiAK.js";import{a as be,c as Un,u as ds,d as ps,e as hs}from"./Monorail-monorailMetric-wallets.D__Peh7l.js";import{b as ms,e as vs,S as It}from"./CalloutHeader.DC7jgv42.js";import{g as ys,P as gs,h as Lt}from"./hooks-useWalletsTimeout.ByRalZ9t.js";import{S as _s}from"./shared-shop-theme.BKb8cP_L.js";import{a as fs}from"./hooks-useShouldRevealCustomization.djt7DCHB.js";import{a as bs}from"./PayButton-helpers.DGMbMyz3.js";import{M as Ps}from"./hooks-useShopPayNewSignupLoginExperiment.DrmS3FLj.js";import{C as In,b as ks,a as Cs}from"./Choice.D9vYH2mX.js";import{C as rt}from"./crypto-constants.Ca3tBkwm.js";import{b as wa,u as Ss}from"./cross-border-hooks.BVR78hJy.js";import{S as Na}from"./Section-SectionStyleOverride.CdNufRZ0.js";import{T as Is}from"./TransitionHeight.Bhh9D1te.js";import{u as Ls}from"./AutocompleteField-hooks.By5FDG3b.js";import{a as Ms,s as As,M as Es}from"./BillingAddressForm.B1Xpg2b3.js";import{P as Ts}from"./PendingShipping.D432iDGV.js";import{P as ws}from"./Popover.ZkMcWGfE.js";function Ns(){const{i18n:e,shop:t,shopPay:a}=y(),{shippingAddress:o}=$(),i=vn();return L(()=>{const s=o.fields.countryCode.value,r=(s&&t.countrySpecific[s]?.contactInfoOptions)??t.contactInfoOptions;return i.value||a.user.isUnauthenticatedUser.value||!r.includes("PHONE")?e.translate("field_errors.email_blank"):e.translate("field_errors.email_or_phone_blank")})}function Da(){const{shop:e,checkout:t}=y(),{shippingAddress:a,billingAddress:o}=$(),i=sa();return L(()=>{const s=Io({isShippingRequired:t.isShippingRequired.value,isPickupSelected:i.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:o.fields.countryCode.value});return Lo(e,s)})}function Ds(){const{shop:e,source:t,checkout:a}=y(),o=Jn(),i=$(),s=sa(),r=oi(),l=Da();return L(()=>{const c=i.phone.value,u=i.email.value,d=a.identity.current.value;let p=!!l.value||e.smsMarketing!=="OFF";(d==="shopPay"||d==="businessCustomer")&&(p=!1);let h;if(!a.configuration.visibility.showSmsMarketing||!p||o?.smsMarketingEnabled===!1||Mo(t))h="none";else{const v=c&&!u;let m;v?m="contact":s.value||!a.isShippingRequired.value?m="billing":m="delivery",r.value[m]?h="root":h=m}return{isNone:h==="none",isContact:h==="contact",isDelivery:h==="delivery",isBilling:h==="billing",isRoot:h==="root"}})}function Oa({origin:e="contact_info_page"}){const{acceptEmailMarketing:t}=$(),{negotiate:a}=ke(),{emailMarketingOptInShownSignal:o}=qn(),{i18n:i,userEvents:s,checkout:r,source:{checkoutSessionIdentifier:l,sourceId:c},shop:{id:u,myshopifyDomain:d}}=y(),p=r.configuration.layout.isOnePage.value;Gn(()=>{o.value=!0},[o]);function h(m){t.value=m,a({}),s.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:l||c,shopId:Number($e(u)),shopifyDomain:d,action:m?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:p?"checkout_one_redesign":"checkout_one"}})}const v=Ao("marketing.disclaimer.description_html",i)?n(Ee,{type:"small",color:"subdued",children:n(gn,{children:i.translate("marketing.disclaimer.description_html",{privacy_policy_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return n(S,{gap:"small-200",children:[n(st,{id:"marketing_opt_in",name:"marketing_opt_in",checked:t.value,onChange:h,label:Os({identity:r.identity,i18n:i})}),v]})}function Os({identity:e,i18n:t}){switch(e.current.value){case"shopPay":case"buyWithPrime":return t.translate("marketing.accept_shop_pay_marketing_checkbox_label");default:return t.translate("marketing.accept_marketing_checkbox_label")}}Oa.displayName="MarketingOptIn";const xs=/<a\b(?<attributes>[^>]*)>(?<text>.*?)<\/a>/gi,Bs=/data-policy-handle=(["'])(?<handle>privacy-policy|terms-of-service)\1/i,Mt=/<\/?[a-z][\s\S]*>/i;function At(e){return n(gn,{dangerouslySetInnerHTML:{__html:e}})}function Et(e,t){return n("span",{dangerouslySetInnerHTML:{__html:e}},t)}function Fs(e){const t=[];let a=0,o=!1;for(const s of e.matchAll(xs)){const r=s.index,l=Rs(s);if(r==null||!l)continue;const c=e.slice(a,r);if(Mt.test(c))return At(e);c&&t.push(Et(c,`text-before-${r}`)),t.push(n(He,{handle:l,tone:"monochrome"},`${l}-${r}`)),a=r+s[0].length,o=!0}const i=e.slice(a);return!o||Mt.test(i)?At(e):(i&&t.push(Et(i,"trailing-text")),n(gn,{children:t}))}function Rs(e){const a=(e.groups?.attributes??"").match(Bs)?.groups?.handle;return a==="privacy-policy"?"privacy-policy":a==="terms-of-service"?"terms-of-service":null}function Tt(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function Vs(e){return e?JSON.stringify([e.label,e.disclaimerHtml]):null}function xa(){const{i18n:e,shop:t,checkout:a,embed:o}=y(),{marketingPhoneInputError:i,previousPhoneMarketingDisclosureKeySignal:s,smsMarketingOptInShownSignal:r}=qn(),{phone:l,acceptSmsMarketing:c,smsMarketingPhone:u,shippingAddress:d}=$(),p=it(),h=Da(),v=h.value,m=Tt(v),g=!v&&t.smsMarketing!=="OFF",_=m?.label??(g?e.translate("marketing.accept_sms_checkbox_label"):void 0),I=!!_;Gn(()=>{I&&(r.value=!0)},[I,r]);const A=ue(),{handleSmsMarketingConsent:f}=ji(),b=L(()=>A.buyerIdentity.value?.customerProfile),N=L(()=>!l.value&&!a.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),k=L(()=>!l.value),M=L(()=>o?.isFlagshipPartner||b.value?!1:!k.value);K(()=>
2{if(!u.value){const P=N.value?d.fields.phone.value:l.value;u.value=P??""}},[]),Ae(()=>{const P=d.fields.phone.value;N.value&&!Tt(h.value)&&t.smsMarketing==="OFF"&&(u.value=P||"")}),Yi(),Ae(()=>{const P=Vs(h.value),C=s.peek();s.value=P,C!=null&&P!=null&&C!==P&&c.value&&(c.value=!1)});function z(P){i.value=void 0,f(P)}Ae(()=>{l.value&&!b.value&&(u.value=l.value)});const F=e.translate("field_errors.sms_marketing_phone_invalid"),T=Qi(F),R=se(()=>({state:{phone:u},errors:{phone:i}}),[i,u]);if(!_)return null;const V=m?n(Ee,{type:"small",color:"subdued",children:Fs(m.disclaimerHtml)}):n(Ee,{type:"small",color:"subdued",children:n(gn,{children:e.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})});return n(Zn,{...R,children:n(ii,{id:"smsMarketingOptInDisclosure",open:c.value,summary:n(st,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:_,checked:c.value,onChange:z,"aria-controls":"smsMarketingOptInDisclosure"}),content:n(S,{gap:"base",paddingBlockStart:"base",children:[n(as,{countryCode:p.value??"",label:e.translate("marketing.sms.mobile_phone_number"),disabled:M.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...c.value?T:{}}),V]})})})}xa.displayName="PhoneMarketingOptIn";const Ba=mn({displayName:"ShopPayVerificationSwitch",load:()=>Kn(()=>an(()=>import("./component-ShopPayVerificationSwitch.NNHrlsCO.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,34,35])))}),Hs="rdvNk",Us={MobilePhoneIcon:Hs};function zs({onClick:e}){const{i18n:t}=y();return n(ye,{variant:"primary",accessibilityLabel:t.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:n("div",{className:Us.MobilePhoneIcon,children:n(oe,{type:"mobile",size:"large"})})})}function Fa(){const e=si({key:"india_phone_autofill",variants:[Ne.Control,Ne.Treatment]}),t=Ra()===Ne.Treatment;return e||(t?Ne.Treatment:Ne.Control)}function Ws(){const e=Ra();return e===Ne.Control||e===Ne.Treatment}function Ra(){const{client:e}=y();return e.unstable_getSerialization("experiments")?.find(({clientHandle:t})=>t===ss)?.variant}function $s(e,t,a="PHONE"){const{phone:o}=$(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:s,emailInputError:r}},wallets:l}}=y(),c=l.activeSession.value;ra(p=>{if(a!=="EMAIL"&&p.type==="error"){for(const h of p.violations)if(!(h.__typename!=="UnprocessableTermViolation"||!jt.has(h.code)||Ma(h.target)))if(h.code==="BUYER_IDENTITY_EMAIL_REQUIRED"){const v=h.localizedMessage??h.nonLocalizedMessage;s.value=v}else{const v=t||(h.localizedMessage??h.nonLocalizedMessage);s.value=v,r.value=void 0}}});const u=ce(void 0),d=c?u:s;return Yt(o,d,p=>
2{if(c){i.leaveErrorBreadcrumb("[useValidatedPhoneField] Not validating phone - wallet session active");return}if(a==="EMAIL"){i.leaveErrorBreadcrumb("[useValidatedPhoneField] Skipping phone validation - input type is EMAIL");return}return i.leaveErrorBreadcrumb("[useValidatedPhoneField] Validating phone number"),e(p)},jn.InvalidContactMethod),cn(o,d,a==="PHONE"?e:void 0)}function Gs(){return document.cookie.includes("_tracking_consent=")}function Ks(){const{email:e}=$();Ae(()=>{ot(e.value,"invalid")==="invalid"||Gs()})}function Va({emailInput:e,email:t,isShopPayUnauthenticatedUser:a}){const{shopPay:o}=y(),i=te(""),s=a?un.C1ModalShopPay:void 0,[r,l]=le(s),[c,u]=le(!1),[d,p]=le(!1),h=t.trim(),v=j((m,g)=>{g&&(i.current=g),a||p(!m),u(m)},[a,i]);return Ae(()=>{const m=o.session.verificationTrigger.value;m&&(v(!0),o.session.unstable_updateVerificationTrigger(null),a&&[wn.LoginLink,wn.ErrorModalClearEmail].includes(m.source)&&(l(un.C1ModalShopPaySignIn),m.source===wn.ErrorModalClearEmail&&window.dispatchEvent(new Event("shop_pay_verification_reset"))))}),K(()=>{h!==i.current&&(p(!1),u(!1))},[h,i]),K(()=>{p(!1)},[e]),{modalUrlOrigin:s,modalUpdatedOrigin:r,shopPayVerificationVisible:c,showShopPayVerificationToggle:d,showShopPayVerification:v,setModalUpdatedOrigin:l,setShowShopPayVerificationToggle:p}}const qs="iWrC7",js="aDczq",Ys="oMR3v",Nn={AccessoryContainer:qs,TooltipTriggerHidden:js,SavedLabel:Ys},Qs=fn("EmailFieldAccessory");function Xs({saved:e}){const{i18n:t}=y(),a=_n(void 0,Qs),o=t.translate("contact.field_saved_label"),[i,s]=le(!1);return K(()=>{if(e)return De({content:o,role:"status"})},[e,o]),n("span",{className:Nn.AccessoryContainer,children:[n(la,{className:e?Nn.TooltipTriggerHidden:void 0,accessibilityLabel:t.translate("contact.field_tooltip_accessibility_label"),accessibilityVisibility:e&&!i?"hidden":"visible",onFocus:()=>s(!0),onBlur:()=>s(!1),interestFor:a,children:n(oe,{type:"question"})}),e?n("span",{className:Nn.SavedLabel,"aria-hidden":!0,children:n(O,{type:"small",tone:"neutral",children:o})}):null,n(ca,{id:a,children:t.translate("contact.field_tooltip_helper_text")})]})}const Js=2e3;function wt(e){return(e??"").trim().toLowerCase()}function Zs(e,t){const a=se(()=>wt(e),[e]),o=se(()=>wt(t),[t]),[i,s]=le(!1),r=te(a!==""&&o===a);return K(()=>{const l=a!==""&&o===a,c=l&&!r.current;if(r.current=l,!l){s(!1);return}if(!c)return;s(!0);const u=setTimeout(()=>s(!1),Js);return()=>clearTimeout(u)},[a,o]),i}function er({fieldProps:e,countryCode:t,combinedFieldRendered:a,fieldIsEmpty:o}){const i=bn(),s=Fa(),r=Ws(),l=t==="IN"&&a,c=te(void 0),u=te(void 0);l&&(c.current??=e.autocomplete??"none",u.current??=o);const d=te(!1);function p(h){const v=e.autocomplete??"none",m=!!e.error;return[`variant:${s}`,`assigned:${r}`,`autocomplete:${c.current??v}`,`autocomplete_at_impression:${v}`,`untouched_at_first_paint:${u.current??o}`,`country:${t}`,`field_has_error:${m}`,`trigger:${h}`]}return{isEnabled:l,impressionFeatures:p("seen"),fieldProps:l?{...e,onFocus:()=>{e.onFocus?.(),!d.current&&(d.current=!0,i("impression",{impressionType:"contact_autocomplete_hint",impressionFeatures:p("focus"),timestamp:new Date}))}}:e}}const Ha="contact-information-text-field-container",nr=`#${Ha}`;function tr({onInputTypeChange:e,onInlineEmailValidation:t,onInlinePhoneValidation:a}){const o=Ze(),{inMemoryPayPalParts:{accountStatus:i}}=Te(),{i18n:s,observability:r,shop:{contactInfoOptions:l,countrySpecific:c},shopPay:u,checkout:d,source:p}=y(),h=u.user.isUnauthenticatedUser.value,v=vn(),m=it(),{email:g,phone:_,smsMarketingPhone:I}=$(),A=g.value,f=_.value,[b,N]=le(g.peek()??""),[k,M]=le(_.peek()!==""&&(g.peek()===""||!g.peek())&&!h?"PHONE":"EMAIL"),[z,F]=le(0),T=s.translate("contact.email_or_phone_label"),R=s.translate("field_errors.email_or_phone_invalid"),V=$s(a,R,k),P=(m.value?c[m.value]?.contactInfoOptions:void 0)??l,C=v.value||h||!P.includes("PHONE"),D=Fa(),W=b===""&&!A,U=D===Ne.Treatment&&m.value==="IN"&&!C&&W?"tel":"email";function ie(he,ve){if(k==="EMAIL"&&(N(he),h&&J(un.C1ModalShopPay)),!C)if(ve!=null&&F(ve),he==="")M("EMAIL"),We(()=>{_.value="",g.value="",k==="PHONE"&&(I.value="")}
2),r?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const Ie=/([A-Za-z]|\.|@)/.test(he);Ie&&k!=="EMAIL"?(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),We(()=>{_.value="",g.value=he,I.value=""}),M("EMAIL")):!Ie&&k!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),g.value="",_.value=he,M("PHONE"))}}K(()=>{r.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[r]),K(()=>{e&&e(k)},[e,k]),K(function(){if(C)return;const ve=A!=null&&A!=="",Ie=f!=null&&f!=="";if(!ve&&!Ie&&k!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),M("EMAIL");return}if(ve&&k!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),M("EMAIL");return}!ve&&Ie&&k!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),M("PHONE"))},[A,k,r,C,f]);const re=te(!0);K(function(){const ve=re.current;re.current=!1,(!P.includes("PHONE")||h)&&k!=="EMAIL"&&(M("EMAIL"),A===""&&f!==""&&(_.value="",ve||(g.value=f)))},[P]),Qt(async({reason:he,parts:ve})=>he!=="progression"?{behavior:"allow"}:{behavior:"allow",perform(){const Ie=ve.phone.peek();Ie!==""&&ve.deliveryLines.peek().forEach(_t=>{const ft=_t.peek();_t.value={...ft,deliveryMethodOptions:{...ft.deliveryMethodOptions,phone:Ie}}})}});const X=Ea(),{modalUrlOrigin:w,modalUpdatedOrigin:B,shopPayVerificationVisible:H,showShopPayVerificationToggle:ee,showShopPayVerification:x,setModalUpdatedOrigin:J,setShowShopPayVerificationToggle:q}=Va({emailInput:b,email:g.value,isShopPayUnauthenticatedUser:h}),Ce=te(null),ae=sr(C?void 0:R,k==="PHONE"?ar:t,k),fe=Yn().current.value.contactInfo?.email,ne=Zs(A??"",fe),Se=p.isAbandonedCheckoutSupported&&k==="EMAIL"&&!(X.value&&ee)?n(Xs,{saved:ne}):void 0,En=os({countryCode:m.value??"",label:T,onInputValueChange:ie,caretPosition:z,inputMode:"text",disableFormatting:!0,required:!0,...V}),Ye=C?void 0:{label:T,type:"text",caretPosition:z,inputMode:"text"},Tn=or({email:ae,ref:Ce,addressType:d.isShippingRequired.value?"shipping":"billing",disabled:i.value.status==="loading",required:!0,accessory:Se,contactAutocompleteType:U,...Ye,onInputValueChange:ie}),E=k==="PHONE"?En:Tn,Re=k==="PHONE"?f==null||f==="":W,{isEnabled:on,impressionFeatures:sn,fieldProps:Qe}=er({fieldProps:E,countryCode:m.value,combinedFieldRendered:!C,fieldIsEmpty:Re}),yt=X.value&&ee?n(zs,{onClick:()=>{x(!0),h&&J(un.C1ModalShopPay)}}):null,vo=X.value?n(Y,{when:o,children:n(Ba,{popoverActivator:Ce,popoverAnchorSelector:nr,email:b,onSetEmail:he=>{ae.onInput(he),ie(he),ae.onChange(he)},open:H,showPopover:x,showToggle:q,urlOrigin:w,updatedOrigin:B})}):null,gt=k==="PHONE"?"phone":"email",yo=n(S,{gap:"small-400",children:[n(ge,{id:Ha,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[n(ua,{...Qe,id:gt,error:!!Qe.error,segment:yt?"start":void 0}),yt]}),typeof Qe.error=="string"&&Qe.error?n(dn,{controlID:gt,children:Qe.error}):null]});return n("div",{children:[n(Ta,{impressionType:"contact_autocomplete_hint",impressionFeatures:sn,enabled:on,children:yo}),vo]})}function ar(){}function or({ref:e,email:t,addressType:a="shipping",contactAutocompleteType:o="email",disabled:i,label:s,onInputValueChange:r,caretPosition:l,inputMode:c,type:u="email",required:d,accessory:p}){const{i18n:h,shopPay:v}=y();K(()=>{if(l!==void 0&&e.current&&t?.value&&l<t.value.length)try{e.current.setSelectionRange(l,l)}catch{}},[t.value,l,e]),Ks();function m(){return v.userVerification.value.status==="loading"?n(et,{size:"small"}):p}return{label:s??h.translate("contact.email_label"),id:"email",name:"email",type:u,ref:e,autocomplete:ri([a,o]),disabled:i,inputMode:c,...t,onInput:async g=>{const _=g.trim();t.onInput(_),r?.(_,ir(e.current)??0)},error:t.error,autoCapitalize:u==="text"?"off":void 0,accessoryEnd:m(),required:d}}function ir(e){try{return e?.selectionStart}catch{}}function sr(e,t,a="EMAIL"){const{email:o}=$(),{i18n:i,checkout:{validation:{contactErrors:{emailInputError:s,phoneInputError:r}},wallets:l},observability:c}
2=y(),{inMemoryApplePayParts:{asPaymentMethod:u,isLoadingPaymentSheet:d},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=Te();ra(m=>{if(a==="PHONE"){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - input type is PHONE");return}if(m.type!=="error"){c.leaveErrorBreadcrumb(`[ContactInformation] Journey listener skipped - event type: ${m.type}`);return}if(l.activeSession.value&&!u.value){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - wallet active without Apple Pay");return}if(m.negotiationStage==="negotiation"&&!d.value&&!p.value){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - negotiation stage without wallet validation");return}c.leaveErrorBreadcrumb(`[ContactInformation] Processing ${m.violations.length} violations`);for(const g of m.violations){if(g.__typename!=="UnprocessableTermViolation"||!jt.has(g.code)||Ma(g.target))continue;const _=e||(g.localizedMessage??g.nonLocalizedMessage);s.value=_,r.value=void 0}});const h=ce(void 0),v=l.activeSession.value?h:s;return Yt(o,v,m=>{if(l.activeSession.value){c.leaveErrorBreadcrumb("[ContactInformation] Not val
2idating email - wallet session active");return}if(t)return c.leaveErrorBreadcrumb("[ContactInformation] Using custom email validation"),t(m);c.leaveErrorBreadcrumb("[ContactInformation] Using default email validation");const g=Hn(m,i.translate("field_errors.email_blank")),_=ot(m,i.translate("field_errors.email_invalid"));return g||_},jn.InvalidContactMethod),cn(o,v,a==="EMAIL"?t:void 0)}const rr="•";function Ua({showLogoutLink:e,logoutUrl:t}){const{i18n:a,shopPay:o,observability:i,source:s}=y(),r=ue().buyerIdentity.value,{firstName:l,lastName:c,email:u,phone:d}=r?.customerProfile??{},p=r?.purchasingCompany?.company.name,h=Ea(),v=s.type==="simulated",m=l||c,{phone:g}=$(),_=u??d,I=!p&&_?` (${_})`:"",{modalUrlOrigin:A,modalUpdatedOrigin:f,shopPayVerificationVisible:b,showShopPayVerification:N}=Va({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return K(()=>{i.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${!!u}, hasPhone: ${!!d}`),r?.purchasingCompany||(g.value="")},[]),n(Q,{children:[n(S,{direction:"inline",alignItems:"center",gap:"base",children:n(S,{gap:"small-400",children:[n(O,{children:m?`${a.translate("general.display_name",{firstName:l??"",lastName:c??""})}${I}`:I}),p?n(S,{direction:"inline",gap:"small-400",children:[n(O,{color:"subdued",type:"small",children:p}),u&&n(Q,{children:[n(O,{color:"subdued",type:"small",children:rr}),n(O,{color:"subdued",type:"small",children:u})]})]}):null,e&&!v?n(S,{direction:"inline",gap:"base",children:n(me,{href:t,children:a.translate("customer_account.sign_out_link_label")})}):null]})}),u&&h.value&&n(Ba,{email:u,open:b,showPopover:N,urlOrigin:A,updatedOrigin:f})]})}Ua.displayName="CustomerCard";function lr(){const{i18n:e}=y();return n(O,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})}const cr="ZZ";function Tu({hideAllOptIns:e=!1,hideContactInfoEntry:t=!1,showEmailMarketingOptIn:a=!0,onValidateEmailInput:o}){const i=ue(),s=i.buyerIdentity.value?.customerProfile,r=li().value,c=Jn()?.smsMarketingEnabled===!1,{client:u,checkout:d,i18n:p,checkout:{validation:{contactErrors:{emailInputError:h,phoneInputError:v}},wallets:m},shop:g}=y(),{emailMarketing:_,contactInfoOptions:I}=g,A=u.unstable_getSerialization("logoutUrl")||"",{isContact:f}=Ds().value,{showEmailMarketing:b}=d.configuration.visibility,N=g.hasFlagEnabled(Eo),{value:k}=i.buyerIdentity,M=k?.countryCode,[z,F]=le(a&&Nt({emailMarketing:_,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:M,customerProfile:s,showEmailMarketing:b})),[T,R]=le(!1),V=it(),{validatePhoneNumber:P}=Ji(),{negotiate:C}=ke(),D=j(ae=>{F(a&&Nt({emailMarketing:_,inputType:ae,hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:M,showEmailMarketing:b})),R(!1)},[_,N,M,a,b]),W=Ns(),U=j(ae=>{const _e=Hn(ae,W.value),fe=ot(ae,p.translate("field_errors.email_invalid"));return _e||fe||o?.(ae)},[W,o,p]),ie=j(ae=>{const _e=Hn(ae,p.translate("field_errors.email_or_phone_blank"));if(_e)return R(!_e),_e;const fe=P(ae,V.value??cr)?void 0:p.translate("field_errors.address_phone_blank");return R(!fe),fe},[p,P,V]),re=bn(),X=ci(),w=j(({contact:ae})=>{m.activeSession.value||C({silenceViolations:["all"],include:[],fieldsToResolve:[...ui]}),ae.value=!0,re("sectionComplete",{section:"contact",timestamp:new Date}),X({type:"section_complete",section:"contact"})},[m,C,re,X]),B=j(({contact:ae})=>{ae.value=!1},[]),{email:H,phone:ee}=$(),x=se(()=>({state:{phone:ee,email:H},errors:{phone:v,email:h}}),[H,h,ee,v]),q=vn().value||!I.includes("PHONE"),Ce=!s?.email&&!s?.phone||q&&!s?.email;return n(qt,{children:n(Pn,{target:"cart.buyerIdentity",children:[s&&n(Ua,{showLogoutLink:r,logoutUrl:A}),!t&&Ce&&n(Zn,{...x,children:n(Zi,{onValid:w,onInvalid:B,children:n(tr,{onInputTypeChange:D,onInlineEmailValidation:U,onInlinePhoneValidation:ie})})}),!e&&n(Q,{children:[T&&!c?n(lr,{}):null,z?n(Oa,{}):null,f&&n(xa,{})]})]})})}
2function Nt(e){const{emailMarketing:t,inputType:a,hideNonEuropeMarketingOptInFlagEnabled:o,buyerCountryCode:i,customerProfile:s,showEmailMarketing:r}=e,l=o&&!To(i);return r&&t!=="OFF"&&a==="EMAIL"&&!l&&!s?.acceptsEmailMarketing}function za(){const e=di(),{editorSetShopPaySignal:t}=qn(),a=j(o=>t.value?.setShopPay(o),[t]);return{setEditorShopPay:e&&t.value?a:void 0}}function ur(e){return t=>t?e[t]:void 0}function dr(){const{checkout:e}=y(),t=es();return L(()=>t.value&&e.configuration.visibility.showExpressCheckout.value)}function pr(){const e=pi(),t=dr();return L(()=>e.value?"wallets":t.value?"skeleton":"hidden")}const hr="vT2w7",mr="f1x20",vr="hKWGx",Dt={ApplePayButton:hr,dark:mr,light:vr},yr=mn({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>n(_r,{...e}),useError:fr,load:()=>Kn(()=>an(async()=>{const{ApplePayButton:e}=await import("./component-ApplePayButton.BvXcSeY7.js");return{ApplePayButton:e}},__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,37,38,39,12,13,32,15,16,17,40,41,23,42,43,30,44,14,18,19,20,21,22,24,25,26,27,28,45,46,47,48,29,49,50,51,52,53,54,55])).then(({ApplePayButton:e})=>e))});function gr(e){const{source:t}=y(),{buttonStatus:a,sessionLoadFailed:o}=Te().inMemoryApplePayParts;return ms("ApplePay",t.type!=="simulated"&&a.value.status==="not_rendered"&&!o.value),n(yr,{...e})}function _r({color:e}){const{i18n:t}=y();return n("button",{className:Pe(Dt.ApplePayButton,Dt[e],Xt.borderRadius,yn({focusRing:"base"})),lang:t.locale,disabled:!0,type:"button","aria-label":t.translate("brand.apple_pay")})}function fr(e){const{observability:t}=y(),{buttonStatus:a}=Te().inMemoryApplePayParts;K(()=>{e&&(a.value={status:"error"},t.leaveErrorBreadcrumb("Apple Pay button chunk failed to load",{wallet:be.ApplePay,errorName:e.name,errorMessage:e.message}),t.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:be.ApplePay,status:"error",reason:"chunk_load_error",isPaymentMethodFlow:!1}}))},[a,e,t])}const br=mn({displayName:"PortableWalletsPCIButtonContent",load:()=>an(()=>import("./component-amazonWalletLazy.B2F4OE22.js"),__vite__mapDeps([56,1,6,2,3,4,5,7,8,9,10,57,16,58,59,60,61,62,63])).then(e=>e.PortableWalletsPCIButtonContent),useError:ns});function Pr(e){return n(br,{...e})}const kr="Xicuw",Ot={Button:kr,"Button--contrast":"oHCaH"},Cr="shop-pay-button";function Sr(){const{shopPay:e,observability:t,checkout:{wallets:a}}=y(),o=e.app.config,i=bs(be.ShopifyPay),s=Ki({foregroundColor:_s}),r=fs(),l=wo(o,r),c=Xi(No.DirectCheckoutCheckout),u=hi(),d=mi(be.ShopifyPay),{setEditorShopPay:p}=za();K(()=>{t.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})},[t]);const h=j(()=>{i(Un.Success),d(),a.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),a.clearActiveSession({invokingWallet:"SHOP_PAY"})},[a,d,i]),v=j(g=>{if(p){g.preventDefault(),p(!0);return}h()},[h,p]),m=Pe(Ot.Button,{[Ot["Button--contrast"]]:!s&&!l},Xt.borderRadius,yn({focusRing:"base"}));return n("a",{id:Cr,href:c,ref:u("shop_pay"),className:m,onClick:v,children:e.logoBrand==="shop"?n(qi,{size:"medium"}):n(ls,{size:"medium"})})}function Ir(){const e=Te();return L(()=>Do.some(t=>Lr(e,t)))}function Lr(e,t){const a=!!e.acceleratedWalletPaymentMethods.value.find(i=>i.name===t),o=(()=>{switch(t){case"APPLE_PAY":{const{buttonStatus:i,sessionLoadFailed:s}=e.inMemoryApplePayParts;return s.value?void 0:i.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 Me.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case Me.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();return a&&o?.status==="not_rendered"}function Mr(){const{source:e}=y(),t=Ir(),a=e.type==="simulated";return L(()=>!a&&t.value)}function Ar(){const{i18n:e}=y();return n(kn,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:n(S,{gap:"large-200",padding:"large-200",children:[n(Ge,{level:1,children:e.translate("wallets.payment_in_progress_t
2itle")}),n(O,{children:e.translate("wallets.payment_in_progress_body")})]})})}const Er="o1z23",Tr="_4aXW0",wr="DUnBb",Nr="kTI19",Dr="JH5oc",Or="Athif",xr="pUo2R",Br="_5SdgT",Fr="RKgRy",Rr="iRnuh",Vr="QKTth",Hr="Pnahu",Ur="OTERX",zr="WTXfy",Wr="qLVAT",$r="XHLFs",Gr="xBRI9",Z={Header:Er,Text:Tr,Layout:wr,StackWrapper:Nr,SkeletonWrapper:Dr,SkeletonExited:Or,ButtonWrapper:xr,loading:Br,subsequentLoad:Fr,Stack:Rr,SimulatedWalletStack:Vr,ShopPayEmphasis:Hr,Container:Ur,DrawerLink:zr,InnerDrawerLink:Wr,DrawerHideButtons:$r,walletItem:Gr},lt="express-checkout-heading";function Wa({buttonCount:e,footer:t,children:a}){const{i18n:o}=y();return n(G,{className:Z.Container,"data-count":e,children:[n("div",{className:Z.Header,children:n(vi,{id:lt,className:Z.Text,children:o.translate("alternative_payment_method_banner.express_checkout")})}),n("div",{className:Z.StackWrapper,children:[n("div",{className:Z.Layout,children:a}),t]})]})}function $a({count:e,transition:t,shopPayEmphasis:a=!1,hideWallets:o=!1}){const{client:i}=y(),s=i.unstable_getSerialization("workerVersion")!=="fast";return n("div",{className:Pe(Z.Stack,Z.SkeletonWrapper,{[Z.SkeletonExited]:t==="exited",[Z.ShopPayEmphasis]:a,[Z.DrawerHideButtons]:o}),children:[...Array(e).keys()].map(r=>n(yi,{delay:s},r))})}const Kr="express-checkout-wallets-wrapper",qr=/(iPhone|iPod|iPad|Mac OS)/i,jr=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,Yr=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function Qr(){const{client:{userAgent:e},embed:t}=y(),a=jr.test(e),o=qr.test(e)&&Yr.test(e),i=t!==void 0&&(t.platform==="SWIFT"||t.platform==="REACT_NATIVE_SWIFT");return!(o||a||i)}function Xr(){const{source:e}=y(),t=e.type==="simulated",{inMemoryApplePayParts:{buttonStatus:a,sessionLoadFailed:o},inMemoryPayPalParts:{acceleratedCheckoutButtonStatus:i},inMemoryVenmoParts:{buttonStatus:s},inMemoryGooglePayParts:{buttonStatus:r},inMemoryAmazonPayParts:{buttonStatus:l,buyWithPrimeButtonStatus:c},inMemoryShopPayParts:{buttonStatus:u},acceleratedWalletPaymentMethods:d}=Te(),p=d.value;return se(()=>p.flatMap(h=>{switch(h.name){case"PAYPAL_EXPRESS":return Ve(i,be.PayPalV6);case"VENMO":return Ve(s,be.Venmo);case"GOOGLE_PAY":return Ve(r,be.GooglePay);case"SHOP_PAY":return Ve(u,be.ShopifyPay);case Me.AmazonPay:return Ve(l,Me.AmazonPay);case Me.BuyWithPrime:return Ve(c,Me.BuyWithPrime);case"APPLE_PAY":return Ve(a,be.ApplePay,()=>!t&&!o.value);default:return[]}}),[a,o,p,l,c,r,t,i,u,s])}function Ve(e,t,a){return{walletName:t,isRendered:()=>e.value?.status==="rendered",isLoading:()=>e.value?.status==="not_rendered"&&(a?.()??!0),onTimeout:()=>{e.value={status:"error"}}}}function Jr(e){const{observability:t}=y(),a=te(performance.now()),o=se(()=>e.filter(({walletName:r})=>r!==be.ShopifyPay),[e]),i=te(new Set),s=de(o);Ae(()=>{s.value.forEach(r=>{r.isRendered()&&!i.current.has(r.walletName)&&(i.current.add(r.walletName),t.histogram({name:"wallet_express_button_ready_time",value:performance.now()-a.current,unit:"ms",attributes:{wallet_name:r.walletName,isPaymentMethodFlow:!1}}))})})}function Zr({buttonCount:e,children:t,walletPaymentMethods:a}){const[o,i]=le(performance.now()),[s,r]=le(!0),l=Qr(),c=Ze(),{inMemoryApplePayParts:{paymentSheetError:u}}=Te(),d=Mr().value,p=Xr();ys(p),Jr(p);const h=ue().managedByMarketsPro,v=gi(d,"base"),[m,g]=le(!1),_=vn(),{checkout:I,i18n:A,shop:{id:f},source:b,observability:N,userEvents:k}=y(),M=_i(),z=L(()=>c.value&&Oo({hasSubscription:Jt({checkout:I}),isApplePayAvailable:a.value.some(({name:C})=>C==="APPLE_PAY"),variant:M})==="full_express_agreement"),F=ds();ps(a.value,e);const T=j((C,D)=>{const W=parseInt($e(f),10),U=hs({state:D,shopId:W,nascarData:{...C,walletsRenderedCount:e},paymentMethods:a.value});U&&k.monorailEvent(U)},[f,k,e,a]),V=a.value.some(C=>C.name==="SHOP_PAY")&&l;!d&&!m&&(g(!0),i(C=>performance.now()-C)),K(()=>{m&&N.histogram({name:"wallets_container_render_time",value:o})},[m,N,o]);const P=te(!1);return K(()=>{b.type!=="simulated"&&v==="exited"&&!P.current&&(P.current=!0,performance.mark(xo))},[b,v]),n(Q,{children:[n(Wa,{buttonCount:e,footer:n(Q,{children:[n("div",{className:Z.DrawerLink,children:n(me,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{s?(r(!1),T(F.value,Un.NascarDrawerOpen)):(r(!0),T(F.value,Un.NascarDrawerClose))},children:n("div",{className:Z.InnerDrawerLink,children:[n(O,{children:s?A.translate("alternative_payment_method_banner.show_more_options"):A.translate("alternative_payment_method_banner.hide_more_options")}),n(oe,{type:s?"chevron-down":"chevron-up",size:"small-200"})]})})}),n(Y,{when:_,children:n(gs,{isForExpressCheckout:!0,showFullSubscriptionConsent:z})}),n(Y,{when:h,children:n(S,{gap:"base",padding:"large-100 none none none",children:n(Ps,{textProps:{color:"subdued",size:"small"}})})})]}
2),children:[n($a,{count:Math.min(e,4),transition:v,shopPayEmphasis:V,hideWallets:s}),n("ul",{id:Kr,role:"list",className:Pe(Z.Stack,Z.ButtonWrapper,{[Z.loading]:d,[Z.subsequentLoad]:d&&m,[Z.DrawerHideButtons]:s,[Z.ShopPayEmphasis]:V}),children:c.value&&t})]}),u?.value?.type==="payment_cancelled_while_processing"&&n(Ar,{})]})}function Ga(){const{i18n:e}=y(),{divider:{borderStyle:t,borderWidth:a}}=fi(),{main:{divider:{borderStyle:o=t,borderWidth:i=a}={},section:s,spacing:r}}=da(),l=Bo(s);return n(G,{padding:l?`@media (inline-size >= extraSmall) ${r?Pt(r):"large-200"} none, ${r?Pt(r):"base"} none`:"large-100 none large-300 none",children:n(Ue,{borderStyle:o,borderWidth:Fo(i),children:n(Ee,{textAlign:"center",children:n(O,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}const xt=3;function el(){return n(Q,{children:[n(ze,{accessibilityLabelledBy:lt,children:n(Wa,{buttonCount:xt,children:n($a,{count:xt,shopPayEmphasis:!0})})}),n(Ga,{})]})}const nl="_2SmAP",tl="eFu6h",Ka={MessageWrapper:nl,SimulatedWalletWrapper:tl},al=e=>e,wu=go(function(){const{i18n:t,source:a}=y(),o=a.type==="simulated",{acceleratedWalletPaymentMethods:i,buttonCount:s}=Te(),r=bi(),l=pr(),{setEditorShopPay:c}=za(),{expressCheckout:{button:{cornerRadius:u}={}}}=da(),d=xe("Checkout::Dynamic::Render","WALLETS1"),p=Pi(),h=o&&p.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return n(el,{})}const v=n("li",{className:Z.walletItem,children:n(G,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:Ka.MessageWrapper,children:n(O,{color:"subdued",children:t.translate("payment.simulated_express_checkout")})})});return n("div",{style:{...il(u)},children:[n(ze,{accessibilityLabelledBy:lt,children:n(nt,{sectionId:"expressCheckout",children:n(ki,{section:"expressCheckout",children:[n(Be,{customizations:d,gap:"large-200",render:al}),d.length>0&&n(pa,{blockSize:"large-200"}),n(Zr,{buttonCount:h?1:s,walletPaymentMethods:i,children:h?v:n(ol,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:o,preserveShopPay:!!c})})]})})}),n(Ga,{})]})});function ol({paymentMethods:e,triggerProgression:t,isSimulated:a,preserveShopPay:o}){const i=ha(),s=cs();return n(Q,{children:e.map(r=>{if(a&&r.name==="VENMO")return null;const l=a&&r.name==="SHOP_PAY"&&o;return n("li",{className:Z.walletItem,children:a&&!l?n(G,{className:Ka.SimulatedWalletWrapper,children:n(G,{className:Pe([Z.walletButton,Z.Stack,Z.SimulatedWalletStack]),inert:!0,children:n(Bt,{method:r,triggerProgression:t})})}):n(Bt,{method:r,triggerProgression:t})},`${r.name}-${i}-${s.value}`)})})}function il(e){return e&&{"--x-express-checkout-button-border-radius":ur(Ro.borderRadius)(e)}}function Bt({method:e,triggerProgression:t}){const a=ha();switch(e.name){case"APPLE_PAY":return n(gr,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return n(Lt,{progressToNextPage:t});case"VENMO":return n(Lt,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:t});case"SHOP_PAY":return n(Sr,{});case"GOOGLE_PAY":return n(us,{});case Me.AmazonPay:return n(ts,{});case Me.BuyWithPrime:return n(Pr,{wallet:Me.BuyWithPrime});default:return null}}const sl=["ApplePay","GooglePay","PayPal","Venmo"];function Nu({id:e}){return vs({id:e,stage:({pendingComponents:t})=>sl.some(o=>t.has(o))?It.Usable:It.Complete}),null}function Du(){const e=ue(),t=e.buyerIdentity.value?.customerProfile,{i18n:a}=y(),o=Ci().value,{value:i}=e.buyerIdentity,s=$().rememberMe,r=!!i?.rememberMe||s.value,l=ce(r),{negotiate:c}=ke(),d=Jn()?.saveShippingAddressCheckboxEnabled??!0,p=!!t,h=$().shippingAddress.value,v=!o&&d&&!p&&!h.oneTimeUse,m=j(g=>{l.value=g,s.value=g,c({})},[c,s,l]);return v?n(st,{id:"save_shipping_information",name:"save_shipping_information",checked:l.value,onChange:m,label:a.translate("customer_account.save_my_information_label")}):null}function rl(e,t){return t.some(a=>e.includes(a))}function ll({options:e,selected:t,select:a}){const{i18n:o,source:i}=y(),s=i.type==="simulated",r=ue(),l=r.deliveryNext,c=r.paymentLines,u=Ke("deliveryNext"),d=L(()=>{const p=Qn(l.value,"ONE_TIME_PURCHASE"),h=Zt(c?.value?.lines,"APPLE_PAY")!==void 0,v=p?.status==="available"&&!u.value&&p.hasDeliveryLineChange;return!h&&v});return n(Q,{children:[n(Y,{when:d,children:()=>n(qe,{tone:"warning",errorType:nn.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),s&&e.map(p=>n(nt,{sectionId:`deliveryMethods-${p.id}`},p.id)),n(rt,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:t,onChange:a,children:e.map(p=>n(In,{value:p.id,accessibilityLabel:p.label,secondaryContent:n(oe,{type:p.icon,tone:rl(t,p.value)?"accent":void 0}),children:p.label},p.id))})]})}const qa=_o(null);function cl(){return fo(qa)}var Le={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 ul({name:e,label:t,labelAccessibilityVisibility:a="visible",contentDirection:o="auto",selected:i,onChange:s,children:r}){const l=j(p=>s(p),[s]),c=se(()=>({name:e,selected:i,select:l,contentDirection:o}),[e,i,l,o]);let u;t&&a==="exclusive"?u=n("legend",{className:yn({screenReaders:"only"}),children:t}):t&&(u=n("legend",{className:Le.Legend,children:n(Ge,{level:3,accessibilityRole:"presentation",children:t})}));const d=n("div",{className:Le.Segments,"data-choice-list-segmented-part":"control",children:r});return n(qa.Provider,{value:c,children:t?n("fieldset",{className:Le.Fieldset,children:[u,d]}):d})}function dl({value:e,children:t,icon:a,secondaryContent:o,accessibilityLabel:i}){const s=cl(),r=Si();if(!s)return console.warn(`Unable to render ChoiceSegmented (value: "${e}"). Verify it is a child of ChoiceListSegmented.`),null;const{name:l,selected:c,select:u,contentDirection:d}=s,p=c===e;return n("label",{className:Pe(Le.ChoiceSegmented,p&&Le.ChoiceSegmentedSelected,r&&Le.inert),"data-choice-list-segmented-part":"segment",children:[n("input",{id:`${l}-${e}`,type:"radio",name:l,value:e,checked:p,disabled:r,"aria-label":i,"aria-hidden":r?!0:void 0,tabIndex:r?-1:void 0,className:Le.Input,onChange:()=>u(e)}),n("span",{className:Pe(Le.PrimaryContent,Le.contentDirectionVariant[d]),children:[a&&n(oe,{type:a,color:"strong"}),n(O,{type:"strong",children:t})]}),o&&n(O,{color:"subdued",children:o})]})}function pl(){const{i18n:e}=y(),t=ue(),a=Ke("deliveryNext").value,o=Qn(t.deliveryNext.value,"ONE_TIME_PURCHASE"),i=t.paymentLines?.value?.lines,s=Zt(i,"APPLE_PAY")!==void 0,r=o?.status==="available"&&!a&&o?.hasDeliveryLineChange;return!s&&r?n(qe,{tone:"warning",errorType:nn.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const hl="qX6SV",ml={Wrapper:hl},Dn="PICK_UP_AND_SHIP";function vl(e,t){switch(e){case"PICK_UP":return t.translate("split_delivery.pickup_all_items");case"SHIPPING":return t.translate("split_delivery.ship_all_items");default:bo(e)}}function yl(e){return e.id==="PICK_UP"||e.id==="SHIPPING"}function gl({options:e,selectedIndex:t,select:a}){const{i18n:o,observability:i}=y(),s=j(c=>{c!==Dn&&a([c])},[a]),r=e.filter(yl),l=te(!1);if(!l.current&&r.length<e.length){l.current=!0;
2const c=e.filter(({id:u})=>u!=="PICK_UP"&&u!=="SHIPPING").map(({id:u})=>u).join(", ");i.log("split_ship_pickup_delivery_method_selector","Unexpected delivery method options for split ship/pickup selector",{optionIds:c})}return n("div",{className:Pe(ml.Wrapper,yn({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":t},children:n(ma,{name:"delivery_strategies",value:Dn,onChange:s,children:[n(Vn,{value:Dn,children:o.translate("split_delivery.pickup_and_ship")}),r.map(({id:c})=>n(Vn,{value:c,children:vl(c,o)},c))]})})}function _l(e){const{source:t,userEvents:a,shop:{id:o},checkout:{identity:i}}=y(),s=i.current.value==="shopPay",r=ue().buyerIdentity.value?.customerProfile;function l(c){let u;switch(c){case"SHIPPING":u="checkout_shipping_tab_clicked";break;case"PICK_UP":u="checkout_pickup_tab_clicked";break;case"PICKUP_POINT":u="checkout_pickup_point_tab_clicked";break}if(!u)return;const d=e&&"methods"in e?e?.methods.length:void 0;a.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:t.checkoutSessionIdentifier||"",eventType:u,shopId:parseInt($e(o),10),numberLocationsFound:d,userId:r?.id?parseInt($e(r.id),10):void 0,checkoutSurface:s?"shop_pay":"guest_checkout"}})}return{deliveryMethodSelectorClickEvent:l}}const fl="SnB3D",bl="_207IL",Pl="wvTT8",On={Entrance:fl,SplitCollapse:bl,PillViewTransition:Pl},kl=16;function Cl({options:e,selected:t,select:a,showChangedBanner:o=!0}){const{i18n:i,source:s}=y(),r=s.type==="simulated",l=ue(),{value:c}=l.deliveryNext,u=tn(),d=Qn(c,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:p}=_l(d),h=L(()=>!u.value),v=ce(!1);Gn(()=>{let f=u.peek();return Po(()=>{const b=u.value;f&&!b&&(v.value=!0),f=b})},[u,v]);const m=j(()=>{v.value=!1},[v]),g=j(([f])=>{if(!f||t.value.includes(f))return;const b=e.value.findIndex(M=>M.id===t.value[0]),k=e.value.findIndex(M=>M.id===f)>b?"delivery-slide-end":"delivery-slide-start";rs(()=>{a([f])},[k]),p(f)},[a,t,p,e]),_=L(()=>e.value.findIndex(f=>f.id===t.value[0])),I=L(()=>e.value.length),A=L(()=>e.value.some(f=>f.label.length>kl));return n("div",{className:On.Entrance,children:[o&&n(pl,{}),r&&n(Bn,{each:e,getKey:f=>f.id,children:f=>n(nt,{sectionId:`deliveryMethods-${f.id}`})}),n(Y,{when:h,fallback:n(gl,{options:e.value,selectedIndex:_.value,select:a}),children:n("div",{style:{"--selected-index":_.value,"--option-count":I.value},className:Pe(On.PillViewTransition,{[On.SplitCollapse]:v.value}),onAnimationEnd:m,children:n(ul,{name:"delivery_method",label:i.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:t.value[0],onChange:f=>g([f]),contentDirection:A.value?"block":"auto",children:n(Bn,{each:e,getKey:f=>f.id,children:({id:f,label:b,icon:N})=>n(dl,{value:f,icon:N,children:b})})})})})]})}function Ou(){const e=Ii();if(!e)return null;const{variant:t,...a}=e;return t==="next"?n(Cl,{...a}):n(ll,{options:a.options.value,selected:a.selected.value,select:a.select})}function xu({name:e,variant:t="content",children:a}){return ko(()=>an(()=>Promise.resolve({}),__vite__mapDeps([64]))),n("div",{className:`delivery-transition-${t}`,style:{"--delivery-view-transition-name":e||void 0},children:a})}function Sl(e,t,a){function o(i){const s=t[i]??[];return a.some(r=>s.includes(r))}return e.flatMap(i=>i.lineComponents.length>0?i.lineComponents.filter(s=>!o(s.stableId)):o(i.stableId)?[]:[i])}function Il(e,t){return e.length===0?!1:t==="PICK_UP"?e.every(a=>a==="SHIPPING"||a==="LOCAL"):e.every(a=>a==="PICK_UP")}function Ll({violationLines:e,deliveryMethodType:t,proposedDeliveryLines:a,proposedMerchandiseLines:o}){const i=new Set(a.filter(r=>Il(r.value.deliveryMethodTypes,t)).flatMap(r=>r.value.targetMerchandiseLines??[]).map(r=>r.stableId)),s=o.length>0;return e.filter(r=>{const l=Vo(o,r.stableId),c=l?.stableId??r.stableId;return!(i.has(r.stableId)||i.has(c)||s&&l==null)})}const Ml=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function ja(e){const{shop:{shipPickupInOneOrderEnabled:t}}=y(),{allViolations:a,merchandiseLines:o,deliveryNext:i}=ue(),s=Fe(),r=tn(),{deliveryLines:l,merchandiseLines:c}=$();return L(()=>{const u=!!(i.value&&"supportsSplitDeliveryMethod"in i.value&&i.value.supportsSplitDeliveryMethod),d={allViolations:a.value,deliveryMethodsByMerchandise:s.value.deliveryMethodsByMerchandise,isSplitShipAndPickup:r.value,negotiatedMerchandiseLines:o.value,proposedDeliveryLines:l.value,proposedMerchandiseLines:c.value},p=t&&u;return e.mode==="localPickup"?Al({canUseDeliveryMethodScopedViolations:p,state:d}):p?El({deliveryMethodType:e.deliveryMethodType,state:d}):zn()})}function zn(){return{merchandiseLines:[],allowAlternativeAction:!1}}function Al({canUseDeliveryMethodScopedViolations:e,state:t}){if(e){const a=Wn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:t.isSplitShipAndPickup,state:t});if(a.length>0)return{merchandiseLines:a,allowAlternativeAction:!0}
2}return t.isSplitShipAndPickup||!Tl(t.negotiatedMerchandiseLines)?zn():{merchandiseLines:Wn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:t}),allowAlternativeAction:!1}}function El({deliveryMethodType:e,state:t}){return{merchandiseLines:Wn({deliveryMethodType:e,suppressUnscopedPickupViolations:e==="PICK_UP"&&t.isSplitShipAndPickup,state:t}),allowAlternativeAction:!0}}function Tl(e){return(e?.lines.filter(({requiresShipping:a})=>a).length??0)>1}function Wn({deliveryMethodType:e,suppressUnscopedPickupViolations:t,state:{allViolations:a,deliveryMethodsByMerchandise:o,negotiatedMerchandiseLines:i,proposedDeliveryLines:s,proposedMerchandiseLines:r}}){const l=a&&i?va(a,i,Ml)??[]:[],c=Sl(l,o,[e]),u=t?c.filter(d=>(o[d.stableId]??[]).length>0):c;return Ll({violationLines:u,deliveryMethodType:e,proposedDeliveryLines:s,proposedMerchandiseLines:r})}const ct={MILES:100,KILOMETERS:200},wl=100;function ut(e,t){const a=t&&(t.unit==="MILES"?"mi":"km"),o=t&&t.value<wl?1:0;return[t&&e.numberFormatter({minimumFractionDigits:0,maximumFractionDigits:o}).format(t.value),a].join(" ").trim()}function pn(e){const{pickupLocation:t}=e;return t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0}const Nl=e=>e.every(t=>{const a=pn(t);return a?.value&&a.value>ct[a.unit]}),Dl=e=>e.every(t=>pn(t)?.unit==="MILES");function Ol({postalCode:e,city:t,zoneCode:a}){const o=["address2","company","firstName","lastName","phone"];return e?[...o,"zoneCode","city","address1","countryCode"]:t?[...o,"zoneCode","address1","countryCode"]:a?[...o,"zoneCode"]:[...o,"address1"]}function Ya(e,t){const a=e.lastIndexOf(",");if(a===-1)return e.length>t?`${e.slice(0,t)}...`:e;const o=e.slice(0,a),i=e.slice(a);return o.length>t?`${o.slice(0,t)}...${i}`:e}function we(){const{locationAddress:e}=$(),t=e.peek(),{countryCode:a,postalCode:o,city:i}=t,s=!!(a&&!o&&!i),{details:r}=ea(a);return{isOnlyCountryAvailable:s,fullCountryName:r?.name||void 0,formattedAddress:Li(t,{hiddenFields:Ol(t),multiline:!1,countryFormat:"explicit"})}}const xl=13;function Qa({onClick:e,commandFor:t}){const{i18n:a}=y(),{formattedAddress:o}=we(),i=a.translate("local_pickup.toggle_location");return n(ye,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:o?`${i}, ${o}`:i,onClick:e,commandFor:t,children:o?n(S,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(oe,{type:"geolocation",size:"small-100"}),n(O,{children:Ya(o,xl)})]}):n(O,{children:i})})}const Bl="qIyj1",Fl="oCDzB",Ft={Distance:Bl,FromLocation:Fl};function dt({itemCount:e,methods:t,onChangeLocationClick:a}){const{i18n:o}=y(),{isOnlyCountryAvailable:i,formattedAddress:s}=we(),r=je({methods:t});if(K(()=>{i||r("pickup_long_distance_banner_rendered")},[r,i]),i)return null;const l=Dl(t)?"MILES":"KILOMETERS",c=ut(o,{value:ct[l],unit:l}),u=n("span",{className:Ft.FromLocation,children:s});function d(){r("pickup_long_distance_banner_change_location_click"),a?.()}return n(Cn,{children:n(O,{children:s?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:n("span",{className:Ft.Distance,children:c}),location:a?n(me,{tone:"monochrome",onClick:d,children:u}):u,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:c})})})}function pt(){const{i18n:e}=y();return n(qe,{autoFocus:!0,tone:"warning",errorType:nn.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:n(O,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function ht({allLocationsFarAway:e,selectedPickupOptionNoLongerAvailable:t}){const a=Ke("deliveryNext");return L(()=>e.value&&!t.value&&!a.value)}function Xa(){const{negotiate:e}=ke(),{deliveryLines:t,merchandiseLines:a,discountLines:o}=$();return i=>{na({deliveryLines:t,merchandiseLines:a,merchandiseStableIds:i,discountLines:o}),e({include:["deliveryNext","merchandiseLines"]})}}function Rl({allLinesAlternativeEligible:e,isPickupBanner:t,variantIds:a}){const{userEvents:o,shop:i,source:s,checkout:{identity:r}}=y(),{merchandiseLines:l}=ue();let c="remove_only";e&&(c=t?"remove_or_switch_to_shipping":"remove_or_switch_to_pickup");const u=t?"pick-up":"shipping",d=a.join(","),p=se(()=>a.map(h=>{if(h)try{return parseInt($e(h),10)}catch{return}}).filter(h=>h!==void 0),[d]);return j(h=>{const v={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt($e(i.id),10),checkoutToken:s.checkoutSessionIdentifier??"",productVariantIds:p,bannerType:c,buyerAction:h,deliveryMethodType:u,checkoutSurface:Vl(r),sourceName:"checkout_one",checkoutProductVariantsCount:l.value?.lines.length}};o.monorailEvent(v)},[c,u,r,l,o,p,i,s])}function Vl(e){return e.current.value==="shopPay"?"shop_pay":"guest_checkout"}function Rt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function $n({merchandiseLines:e,bannerType:t,allowAlternativeAction:a}){const{i18n:o}=y(),i=ya(),s=Xa(),r=Fe(),l=wa(),c=t==="pickup",u=Array.from(new Map(e.value.map(P=>[P.stableId,P])).values()),d=u.map(({stableId:P})=>P),p=new Map;for(const P of u){const C=p.get(P.digest);C?p.set(P.digest,{...C,quantity:C.quantity+P.quantity}):p.set(P.digest,P)}const h=Array.from(p.values()),v=u.reduce((P,{quantity:C})=>P+Math.max(1,C),0),m=c?"SHIPPING":"PICK_UP",{deliveryMethodsByMerchandise:g}=r.value,_=u.filter(({stableId:P})=>g[P]?.includes(m)),I=_.map(({stableId:P})=>P),A=_.reduce((P,{quantity:C})=>P+Math.max(1,C),0),f=(a?.value??!0)&&!l.value&&I.length===d.length&&A>0,b=Rl({allLinesAlternativeEligible:f,isPickupBanner:c,variantIds:u.map(P=>P.variantId)});if(u.length===0)return null;const N=c?o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_picked_up",{count:v}):o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_shipped",{count:v}),k=f?o.translate("split_delivery.inventory_issue_banner.remove_item",{count:v}):o.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:v}),M=c?o.translate("split_delivery.inventory_issue_banner.ship_separately",{count:A}):o.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:A}),z=h.map(({title:P,subtitle:C,quantity:D})=>{const W=C?`${P} / ${C}`:P;return D>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:W,quantity:D}):W}).join(", "),F=()=>
2{b("remove_items"),s(d),Rt(o.translate("split_delivery.accessibility.status.remove_items",{items:z}))},T=()=>{b("switch_delivery_method"),i({targetDeliveryMethodType:m,merchandiseStableIds:I}),Rt(c?o.translate("split_delivery.accessibility.status.ship_separately",{items:z}):o.translate("split_delivery.accessibility.status.pickup_in_store",{items:z}))},R=n(me,{onClick:F,children:k});let V=R;if(f){const P=n(me,{onClick:T,children:M});V=c?n(Q,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:P,remove_items_link:R})}):n(Q,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:P,remove_items_link:R})})}return n(qe,{tone:"critical",errorType:nn.DeliveryError,heading:N,children:n(S,{gap:"small-300",children:[n(ga,{gap:"small-300",children:h.map(({stableId:P,title:C,subtitle:D,quantity:W})=>{const U=D?`${C} / ${D}`:C;return n(_a,{children:W>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:U,quantity:W}):U},P)})}),n(O,{children:V})]})})}function Ln({hideText:e,singleItem:t}){const{i18n:a}=y(),i=en().value?.methods??[],s=t?1:i.length||2,r=Array.from({length:s},(l,c)=>`LocationSkeleton${(c+1).toString()}`);return n(Q,{children:[e?null:n(S,{gap:"base",padding:"small-400 none base none",children:n(pe,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),n(ks,{border:"none",background:"transparent",children:n(Cs,{name:"skeleton-loading",variant:"block",hideRadioControl:r.length===1,children:r.map(l=>n(In,{disabled:!0,value:l,accessibilityLabel:a.translate("general.loading"),secondaryContent:n(S,{gap:"small-400",alignItems:"end",children:[n(pe,{inlineSize:"small",size:"small"}),n(pe,{inlineSize:"base",size:"small"})]}),children:n(S,{gap:"small-400",children:[n(pe,{inlineSize:"small",size:"small"}),n(pe,{inlineSize:"base",size:"small"})]})},l))})})]})}const Hl={timeout:8e3,enableHighAccuracy:!0};class Ul extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}function zl(){const{observability:e}=y();return j(t=>$l(t,Wl,e),[e])}const Wl=e=>new Promise(t=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>t({reason:"granted",position:a}),a=>t({reason:Gl(a),error:a}),e):t({reason:"unsupported"})}),$l=async(e=Hl,t,a)=>{if("permissions"in navigator)try{switch((await navigator.permissions.query({name:"geolocation"})).state){case"granted":case"prompt":return t(e);case"denied":return Promise.resolve({reason:"denied"});default:throw new Ul('"geolocation" permission is not supported in this browser')}}catch{a.log("geolocation_permission_supported",'"geolocation" permission is supported in this browser. Using navigator.geolocation.getCurrentPosition instead.')}return t(e)};function Gl(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Vt({disabled:e,displayAsLink:t,onSuccess:a,onError:o,onLocateStart:i,options:s,sharingNotAllowedError:r}){const{i18n:l}=y(),c=zl(),u=ce(!1),d=ce(void 0),p=l.translate("pickup_point.geolocation.shared_location_button"),h=l.translate("pickup_point.geolocation.errors.unsuported_by_browser"),v=r||l.translate("pickup_point.geolocation.errors.permission_not_allowed"),m=l.translate("pickup_point.geolocation.errors.permission_denied");async function g(){d.value=void 0,u.value=!0,i?.();const _=await c(s);switch(u.value=!1,_.reason){case"granted":a(_.position);break;case"denied":d.value=v;break;case"timeout":case"unavailable":d.value=m;break;case"unsupported":d.value=h;break}"error"in _&&typeof _.error<"u"&&o?.(_.error)}return n(Q,{children:[u.value&&t?n(S,{direction:"inline",gap:"small-400",children:[n(et,{}),n(O,{color:"subdued",children:p})]}):n(ye,{disabled:e,inlineSize:t?void 0:"fill",onClick:g,loading:u.value,variant:t?"plain":void 0,textDecoration:t?"none":void 0,children:n(S,{direction:"inline",alignItems:"center",gap:"small-400",children:[n(oe,{type:"geolocation"}),n(Ee,{children:p})]})}),n(Y,{when:d,children:n(dn,{children:d})})]})}function Mn({heading:e,tryDifferentLocationOnClick:t}){const{i18n:a}=y(),o=Sn(),i=Fe(),s=L(()=>
2Ho(i.value.enabledDeliveryMethods)),r=L(()=>s.value.length>0),l=de(t),c=L(()=>r.value||!!l.value),u=en(),d=je({methods:u.value?.methods||[],selectedDeliveryMethodHandle:u.value?.selectedDeliveryMethodHandle});K(()=>{d("pickup_no_location_banner_rendered")},[d]);function p(){d("pickup_no_location_banner_ship_items_click"),o.setSelectedMethodTypes(s.value)}const h=n(me,{tone:"monochrome",onClick:p,children:a.translate("local_pickup.pickup_unavailable_banner_body.ship_items")});function v(){d("pickup_no_location_banner_search_click"),t?.()}const m=t?n(me,{tone:"monochrome",onClick:v,children:a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere")}):a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),g=t?n(me,{tone:"monochrome",onClick:v,children:a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone")}):a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone");return n(qe,{tone:"critical",errorType:nn.DeliveryError,heading:e,children:n(Y,{when:c,children:n(Ee,{children:n(Y,{when:r,fallback:g,children:a.translate("local_pickup.pickup_unavailable_banner_body.ship_items_or_search_elsewhere",{ship_items:h,search_elsewhere:m})})})})})}function An(){const{shop:e}=y();return!e.hasFlagEnabled(Uo)}function Kl(){const{shippingAddress:e}=$(),{shop:t}=y(),a=tn();return{syncShippingFromPickup:j(i=>{if(!a.value||!i)return;const s=e.value;s.countryCode===i||s.postalCode||s.address1||s.address2||s.city||!t.shippingCountries.some(l=>l.value===i)||(e.value={...s,countryCode:i,zoneCode:void 0,coordinates:void 0})},[a,e,t])}}const ql=fn("AutocompleteSingleAddressField");function Ht({address:e,onSelect:t,value:a,country:o,hiddenFields:i=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:s,...r}){const{value:l,setValue:c}=Ls({addressType:s,countryCode:o.code,initialAddressQuery:e.coordinates?Rn(e,o,i):a});function u(d){c(Rn(d,o,i)),t&&t(d)}return n(Ms,{addressType:s,id:_n(void 0,ql),onSelect:u,value:l,countryCode:o.code,...r})}const jl="_9uTul",Yl="_3zLFw",Ql="_9rPCU",Xl="FayGq",rn={SelectWrapper:jl,focus:Yl,FlagIcon:Ql,Select:Xl};function Jl({pickupCountries:e,selectedCountry:t,onCountryChange:a}){const{i18n:o}=y(),[i,s]=le(!1);return n(G,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:Pe(rn.SelectWrapper,i&&rn.focus),children:n(S,{direction:"inline",alignItems:"center",children:[n("div",{className:rn.FlagIcon,children:n(is,{countryCode:t.code.toLowerCase(),accessibilityLabel:t.name})}),n(oe,{type:"chevron-down",size:"small-200",tone:i?"accent":void 0}),n("select",{"aria-label":o.translate("contact.country_label"),className:rn.Select,value:t.code,onBlur:()=>s(!1),onFocus:()=>s(!0),name:"phone_country_select",onChange:r=>{a(r.target.value)},children:e.map(({label:r,value:l})=>n("option",{value:l,children:r},l))})]})})}const Zl=fn("AutocompleteSingleAddressField");function ec({onSearch:e,onBeforeCountryChange:t,onAfterCountryChange:a,sharedLocationAddress:o,searchOnSelect:i,pickupCountries:s,addressAutoFocus:r,onAddressBlur:l}){const c=ce(""),{i18n:u,observability:d}=y(),{geolocation:p}=fa(),{locationAddress:h}=$(),v=h.peek(),m=te(v),g=zo(),_=An(),I=se(()=>Wo(ac(v,p.country.code,s,g),{extendedAddressMode:null}),[]),A=se(()=>$o({countryCode:void 0,address:void 0}),[]),f=cn(I.fields.countryCode,A.countryCode),b=cn(I.fields.postalCode,A.address),{details:N,loading:k}=ea(f.value),M=se(()=>N??p.country,[N,p.country]),z=A.address.value,F=se(()=>s?.length?s:[{value:M.code,label:M.name}],[s,M.code,M.name]),T=j(E=>Rn(E,M,["company","firstName","lastName","phone","countryCode","zoneCode"]),[M]),R=M.zones,V=I.value,P=c.value,C=f.value?As(f.value):!1;tc(I,A);const D=ba(I),W=bn(),U=()=>{(f.error||b.error)&&(f.clearError(),b.clearError())};Ae(()=>{const E=o?.value;E?.countryCode&&Fn(()=>{We(()=>{D({countryCode:E.countryCode}),c.value="",U()})})}),Ae(()=>{const E=h.value;E!==m.current&&(m.current=E,E?.coordinates&&Fn(()=>{We(()=>{D(Go(E)),c.value=T(E),U()})}))}),K(()=>{const E=I.value;C?c.value=T(E):c.value=T({postalCode:E.postalCode})},[I,C,T,c]);const ie=(E=V)=>{E.coordinates?(R.length||(E.zoneCode=void 0),e(E)):A.address.value=u.translate("local_pickup.could_not_resolve_address")},re=E=>{const Re=()=>{a?.(E),D({countryCode:E}),f.onChange(E),U(),g("user-input",E,"pickup")};t?t({countryCode:E},Re):Re()},X=E=>{V.coordinates&&D({countryCode:f.value}),c.value=E,U()},w=E=>{!E.coordinates&&E.address1&&d.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:E.countryCode||f.value,hasAddress1:!!E.address1,hasPostalCode:!!E.postalCode});const Re=jo(E.countryCode),on=!!(E.countryCode&&!Re);
2on&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:E.countryCode,fallbackCountryCode:f.value});const sn=on?{...E,countryCode:f.value}:{...E,countryCode:Re};D(sn),i&&ie(sn),_&&W("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},B=i&&!_?{source:"magnify",position:"end"}:void 0,H=C&&i,ee=!V.coordinates||!P.length,x=H?null:n(ye,{variant:"primary",disabled:ee,onClick:ie,loading:k,children:u.translate("local_pickup.search_button")}),J={errors:A,state:{countryCode:I.fields.countryCode,address:C?c:I.fields.postalCode}},q=Ko(z)?z.message:z,Ce=C?"location address":"postalCode",ae=_n(void 0,Zl),_e=_?u.translate("local_pickup.location_address_search_placeholder",{postal_code_label:M.labels.postalCode}):u.translate("local_pickup.location_address_search_label"),fe=_||!!x;let ne;fe?ne=q?!0:void 0:ne=q;const Se={addressType:"pickup",country:M,address:V,error:ne,field:"address1",value:P,icon:B,autoFocus:r,onBlur:l,autocomplete:C?"shipping street-address":"shipping postal-code",label:C?_e:M.labels.postalCode,name:Ce,id:ae},En=C?n(Ht,{...Se,onSelect:w,onInput:X}):n(Ht,{...Se,onSelect:E=>{D(E),c.value=T(E)},required:!0,readOnly:k,onInput:E=>{E?U():c.value=""},onChange:E=>{c.value=E},allowAllCountries:!0}),Ye=n(G,{children:[n(nc,{autocomplete:Se.autocomplete,label:Se.label,name:Se.name}),En]}),Tn=Mi()?.checkoutProfile.hasOverrides.value;return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Zn,{...J,children:_?n(S,{gap:"small-300",children:[n(ge,{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:[n(Jl,{pickupCountries:F,selectedCountry:M,onCountryChange:re}),Ye,n(ye,{variant:"primary",onClick:ie,disabled:ee,"data-event-name":"local_pickup_search_button",accessibilityLabel:u.translate("local_pickup.search_button"),children:n(oe,{type:"search"})})]}),q?n(dn,{controlID:ae,children:kt(q)?q.textValue:q}):null]}):n(qt,{children:[n(So,{children:n(Es,{interactive:!Tn,children:n(ma,{name:"countryCode",label:M.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:k,value:M.code,onChange:E=>re(E),children:F.map(E=>n(Vn,{value:E.value,children:E.label},E.value))})})}),x?n(S,{gap:"small-300",children:[n(ge,{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:[Ye,x]}),q?n(dn,{controlID:ae,children:kt(q)?q.textValue:q}):null]}):Ye]})})})}function nc({autocomplete:e,label:t,name:a}){const o=Ai(),i=o?.nested?o.id:void 0;return n(G,{accessibilityVisibility:"exclusive",children:n("input",{type:"text",tabIndex:-1,"aria-hidden":!0,id:"autofill_localPickupAddress",name:a,autoComplete:e,form:i,"aria-label":t})})}function tc(e,t){const{i18n:a,observability:o,checkout:{wallets:i}}=y(),{inMemoryApplePayParts:{asPaymentMethod:s,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=Te();Qt(async({reason:c})=>{if(c==="negotiation"&&!r.value&&!l.value)return{behavior:"allow"};if(i.activeSession.value&&!s.value)return{behavior:"allow"};const u=e.peek(),d=new Map;return u.coordinates||d.set("address",a.translate("field_errors.address_address1_blank")),qo(u.countryCode)||d.set("countryCode",a.translate("field_errors.address_country_blank")),d.size?(o.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(d).map(([,p])=>p)}),{behavior:"block",reason:jn.InvalidLocalPickupAddress,perform:()=>{We(()=>{for(const[p,h]of d)t[p].value=h})}}):{behavior:"allow"}})}function ac(e,t,a,o){const i=!!(e.address1||e.postalCode||e.countryCode),s=a?.some(l=>l.value===e.countryCode),r=a?.some(l=>l.value===t);return i&&s?e:r||a.length===0?(o("auto-selected",t,"pickup"),{countryCode:t}):(o("auto-selected",a[0].value,"pickup"),{countryCode:a[0].value})}function Ja({locationFormVisible:e,toggleLocationFormVisibility:t,children:a,onLocationChange:o,pickupCountries:i}){const s=y().checkout.identity.current.value==="shopPay",r=()=>t(!1);return s?n(Q,{children:[a,n(oc,{open:e,onModalClose:r,onLocationChange:o,pickupCountries:i})]}):e?n(mt,{onLocationChange:o,pickupCountries:i}):a}function oc({open:e,onModalClose:t,onLocationChange:a,pickupCountries:o}){const{i18n:i}=y();return n(kn,{heading:i.translate("local_pickup.toggle_location"),open:e,onHide:t,children:n(Pa,{section:"delivery",children:[n(mt,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:o}),n(G,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),n(ye,{onClick:t,inlineSize:"fill",variant:"plain",size:"extraLarge",children:i.translate("local_pickup.cancel")})]})})}const mt=({onLocationChange:e,onBeforeLocationChange:t,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:o,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r})=>{const{geolocation:l}=fa(),{locationAddress:c}=$(),u=ba(c),{i18n:d}=y(),p=ce(!0),h=ce(),v=ce(void 0),m=An(),{syncShippingFromPickup:g}=Kl(),_=(b,N)=>{const k=()=>{g(b.countryCode),N()};t?t(b,k):k()},I=b=>{if(o&&(p.value=!1),!Yo(b)){h.value=d.translate("pickup_point.could_not_resolve_address");return}h.value=void 0;const N={zoneCode:l.zone?.code,countryCode:l.country.code,coordinates:{latitude:b.coords.latitude,longitude:b.coords.longitude}};_({countryCode:l.country.code},()=>{u(N),v.value=N,e(b)})},A=b=>{_(b,()=>{u(b),e(b)})};return n(S,{gap:m?"small-300":"base",children:[m?null:n(Vt,{onSuccess:I}),n(Y,{when:p,fallback:n(ye,{inlineAlignment:"start",variant:"plain",onClick:()=>{p.value=!0},children:d.translate("shipping.local_pickup.search_address")}),children:n(S,{gap:"base",children:[m?null:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[n(Ue,{direction:"inline"}),n(G,{padding:"none base",children:n(O,{color:"subdued",children:d.translate("local_pickup.or")}
2)}),n(Ue,{direction:"inline"})]}),n(ec,{sharedLocationAddress:v,searchOnSelect:a,onSearch:A,onBeforeCountryChange:t,onAfterCountryChange:g,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r}),n(Y,{when:h,children:b=>n(S,{gap:"base",padding:"small-200 none none none",children:n(Mn,{heading:b})})})]})}),m&&n(Vt,{onSuccess:I,displayAsLink:!0,sharingNotAllowedError:d.translate("local_pickup.geolocation.permission_not_allowed")})]})},ic={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},Za=Qo(({graphql:{coreGraphql:e},router:t,shop:a},{sellableDeliveryMethods:o})=>{const i=bt(()=>t.currentUrl.value.pathname.endsWith("/throttle")),s=e.query(ic,{skip:()=>i.value}),r=bt(()=>{const l=s.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:c,deliveryMethodsByMerchandise:u}=o.value;if(!(Object.keys(u).length>0&&rc(c))||!l)return l;const h=[...l],v=new Set(h.map(({value:m})=>m));for(const m of a.shippingCountries)v.has(m.value)||(h.push(m),v.add(m.value));return h});return{error:s.error,loading:s.loading,pickupCountries:r}}),sc=["SHIPPING","LOCAL"];function rc(e){const t=e.includes("PICK_UP"),a=e.some(o=>sc.includes(o));return t&&!a}function lc(e,t){return e.amount===0?{amount:t.translate("shipping.free_rate_label"),letterCase:"uppercase"}:{amount:t.formatCurrency(e.amount,{currency:e.currencyCode}),letterCase:void 0}}const eo=e=>e.every(({pickupLocation:t})=>{const a=t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0;return a?.value&&a.value>ct[a.unit]});function cc(e,t){const a=e.map(s=>pn(s)?.value).filter(s=>s!==void 0);if(a.length===0)return!0;const o=e.find(({handle:s})=>s===t),i=o?pn(o)?.value:void 0;return i===void 0?!0:i<=Math.min(...a)}const uc=(e,t,a,o,i={})=>{const s=e.length;return t?Oe(a,{oneItem:()=>o.translate("local_pickup.location_information_far_away_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:s})}):i.allLocationsFarAway?Oe(a,{oneItem:()=>o.translate("local_pickup.location_far_away_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_far_away_other_items",{count:s})}):s===1?Oe(a,{oneItem:()=>o.translate("local_pickup.location_nearby_short_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_nearby_short_other_items",{count:s})}):cc(e,i.selectedDeliveryMethodHandle)?Oe(a,{oneItem:()=>o.translate("local_pickup.location_closest_one_item"),otherItems:()=>o.translate("local_pickup.location_closest_other_items")}):o.translate("local_pickup.location_selected")};function Oe(e,t){return e===1?t.oneItem():t.otherItems()}const dc="KHJ3S",pc={Details:dc};function hc({distanceLabel:e,instructions:t}){return!e&&!t?null:n(S,{className:pc.Details,direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&n(S,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(O,{color:"subdued",children:n(oe,{type:"location",size:"small"})}),n(O,{fonts:"secondary",type:"small",children:e})]}),t&&n(S,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(O,{color:"subdued",children:n(oe,{type:"clock",size:"small"})}),n(O,{fonts:"secondary",type:"small",children:t})]})]})}function mc(){const{checkout:e,shop:t}=y(),{deliveryNext:a,merchandiseLines:o}=ue(),i=L(()=>{const s=Xo(o.value?.lines).filter(r=>!!r.sellingPlan?.subscriptionDetails);return a.value&&"lines"in a.value&&a.value.lines?a.value.lines.some(r=>r.type!=="SUBSCRIPTION"?!1:Jo(r)?.methodType==="PICK_UP"&&r.targetMerchandiseLines?.some(c=>s.some(u=>u.stableId===c.stableId))):!1});return L(()=>t.shipPickupInOneOrderEnabled?i.value:Jt({checkout:e}))}function no({variant:e="text"}){const{i18n:t}=y(),a=mc(),o=t.translate("delivery_options.subscription_pickup_information");return n(Y,{when:a,children:e==="banner"?n(Cn,{tone:"info",children:o}):n(Ee,{children:o})})}function to({method:e,subscriptionBanner:t}){const{i18n:a}=y(),{isOnlyCountryAvailable:o}=we(),{cost:i,pickupLocation:s}=e,{name:r,address:l,distanceFromBuyer:c}=s,u=s.instructions.trim(),d=lc(i,a),h=!o&&c?ut(a,c):void 0;return n(S,{direction:"block",gap:"small-400",children:[n(S,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(O,{type:"strong",children:r}),n(O,{type:"strong",letterCase:d.letterCase,children:d.amount})]}),n(Aa,{address:l,hiddenFields:["postalCode","countryCode","phone"]}),n(hc,{distanceLabel:h,instructions:u})]}),t?n(no,{variant:"banner"}):null]})}function vc({methods:e,selectedDeliveryMethodHandle:t,setSelectedDeliveryMethodHandle:a}){const o=se(()=>t?[t]:[],[t]),i=j(([r=""])=>a?.(r),[a]),s=xe("purchase.checkout.pickup-location-option-item.render-after");return n(rt,{name:"local_pickup_methods",values:o,onChange:i,hideRadioControl:e.length===1,children:e.map(r=>n(yc,{method:r,extensions:s},r.handle))})}function yc({method:e,extensions:t}){const a=e.handle,o=se(()=>({handle:a}),[a]);return n(In,{value:a,children:[n(to,{method:e,subscriptionBanner:!1}),n(Be,{marginBlockStart:"small100",customizations:t,options:o})]},a)}const gc="pickup-locations-modal";function _c({addressFocus:e,...t}){const a=ce(!1);return n(fc,{addressFocus:e??a,...t})}function fc({methods:e,open:t,type:a,addressFocus:o,onClose:i}){const{i18n:s,shop:r}=y(),[l,c]=ka({type:a,deliveryMethodType:"PICK_UP"}),u=ta(),{negotiate:d}=ke(),p=ue().merchandiseLines,h=de(tt(Xn).hasViolations),{fullCountryName:v,isOnlyCountryAvailable:m}=we(),g=ce(l),_=ce(!1),I=ce(!1),{setInverseGroupDeliveryMethodHandle:A,getInverseGroupDeliveryMethodHandle:f}=Ca(e||[],a||"ONE_TIME_PURCHASE"),b=Fe(),{pickupCountries:N,loading:k}=aa(Za,{sellableDeliveryMethods:b}),{deliveryLines:M,merchandiseLines:z,discountLines:F,shippingAddress:T}
2=$(),R=M.value,V=en(),{shouldGateCrossBorder:P,crossBorderGate:C}=Ss(),D=de(!!(e&&eo(e))),W=ht({allLocationsFarAway:D,selectedPickupOptionNoLongerAvailable:h}),U=(x,J)=>{const q=x.countryCode;if(!q||!P(q)){J();return}i(),C(()=>{T.fields.zoneCode.value=void 0,T.fields.coordinates.value=void 0,T.fields.countryCode.value=q})},ie=Xe(p.value?.lines),re=v?s.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:v,count:ie}):s.translate("local_pickup.pickup_unavailable_banner_title",{count:ie});K(()=>{(!_.value&&I.value||l!==void 0&&l!==g.value)&&(I.value&&(I.value=!1),g.value=l)},[_.value,l,I.value]);const X=()=>{!r.shipPickupInOneOrderEnabled||oa(M.value).some(({requiresShipping:J})=>J)||We(()=>{Zo({deliveryLines:M,merchandiseLines:z.value,deliveryMethodTypes:["PICK_UP"]})&&ei(F)})},w=()=>{const x=g.value;if(x!==l){if(c(x),u.value&&x){const J=f(x);A(J)}X(),d({include:["deliveryNext"]})}o.value=!1,i()},B=()=>{_.value=!0,I.value=!0,X();const x=R.find(J=>{const q=J.peek().id;return q&&q===V.value?.id});x&&(x.fields.deliveryMethodHandle.value=void 0),d({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete:()=>{_.value=!1}})},H=j(x=>{g.value=x},[g]),ee=()=>{if(I.value)return n(Ln,{hideText:!0});if(e){const x=Xe(V.value?.targetMerchandiseLines),J=m||D.value?Oe(x,{oneItem:()=>s.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>s.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}):Oe(x,{oneItem:()=>s.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>s.translate("local_pickup.location_nearby_other_items",{count:e.length})});return n(Q,{children:[n(Y,{when:W,children:n(dt,{itemCount:x,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),h.value&&n(pt,{}),n(O,{color:"subdued",children:J}),n(vc,{selectedDeliveryMethodHandle:g.value,setSelectedDeliveryMethodHandle:H,methods:e})]})}return n(Mn,{heading:re,tryDifferentLocationOnClick:()=>{o.value=!0}})};return n(kn,{id:gc,onHide:w,open:t,heading:s.translate("delivery_options.pick_up_locations"),primaryAction:n(Ti,{handleSubmit:w,submitText:s.translate("payment.add_credit_card_modal.save")}),children:n(Pa,{section:"delivery",children:n(Ei,{children:n(S,{gap:"base",children:[n(Y,{when:()=>k.value?null:N.value,children:x=>n(mt,{onLocationChange:B,onBeforeLocationChange:U,changeLocationOnSelect:!0,pickupCountries:x,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),ee()]})})})})}const vt="split-delivery-merchandise-modal",bc=6;function ao(e){return e.filter(t=>t.requiresShipping)}function Ut(e){return new Set(e.map(t=>t.digest)).size}function oo(e){return ao(ti(e))}function io(e){return ao(oa(e))}function Pc(e,t){return t==="PICK_UP"?oo(e):io(e)}function kc(e){return Ut(oo(e))+Ut(io(e))}function Cc(e){return e.filter(t=>t.requiresShipping).reduce((t,a)=>t+a.quantity,0)}function Sc(e){return Cc(e.filter(ni).flatMap(t=>t.lineComponents.length>0?t.lineComponents:[t]))}function so({targetMerchandiseLines:e,merchandiseLines:t}){const a=wi(e),o=Sc(t);return{targetMerchandiseQuantity:a,isAllItems:a===o}}function ro(){const{deliveryLines:e}=$(),t=L(()=>kc(e.value)),a=L(()=>t.value>=bc);return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function Je(e){const{deliveryLines:t}=$();return L(()=>Pc(t.value,e))}function Ic(e){const{merchandiseLines:t}=$(),a=Ke("deliveryNext"),o=L(()=>{const r=e.value,l=so({targetMerchandiseLines:r,merchandiseLines:t.value});if(l.targetMerchandiseQuantity!==0)return{merchandiseLines:r,totalItemCount:l.targetMerchandiseQuantity,isAllItems:l.isAllItems}}),i=te(),s=L(()=>{const r=o.value;return r?(i.current=r,r):i.current});return{currentSummary:o,visibleSummary:s,isNegotiating:a}}const Lc="HoMMS",Mc="_5tEP0",Ac="g9aTP",Ec="eWR8C",ln={TriggerButton:Lc,TriggerChevron:Mc,TriggerButtonText:Ac,MenuOptionButton:Ec},lo="split-delivery-method-menu";function co(e,t){return`${lo}-${encodeURIComponent(e)}-${t}`}function Tc(e,t){return`${co(e,t)}-trigger`}function wc(e){return`[id^="${lo}-${encodeURIComponent(e)}-"][id$="-trigger"]`}function uo(e,t){if(e!==0)return t>=0?t:0}function Nc({activeIndex:e,isOpen:t,menuOptionsLength:a,selectedOptionIndex:o,wasOpenRef:i}){return K(()=>
2{if(!t){e.value=void 0,i.current=!1;return}if(!i.current){e.value===void 0&&(e.value=uo(a,o)),i.current=!0;return}e.value!==void 0&&e.value>=a&&(e.value=a===0?void 0:a-1)},[e,t,a,o,i]),K(()=>()=>{e.value=void 0,i.current=!1},[e,i]),null}function zt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function Dc(e){const{getInteraction:t}=Di(),a=t(e);return a?.type==="command"&&a.kind==="overlay"&&a.active}function Oc({merchandiseStableIds:e,onMoveMerchandise:t,onRemoveMerchandise:a,selectedDeliveryMethodType:o,productTitle:i}){const s=Co(),{i18n:r}=y(),l=Fe(),c=ya(),u=Xa(),d=de(t??c),p=de(a??u),h=de(Ni().hideOverlay),v=te(null),m=te(!1),g=e[0],_=co(g,s),I=Tc(g,s),A=Dc(_),f=de(A),b=ce(void 0),N=de(o),k=de(i),M=de(e),z=L(()=>{const w={SHIPPING:{label:r.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>B("SHIPPING")},PICK_UP:{label:r.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>B("PICK_UP")}},B=H=>{h.value(_),H!==N.value&&(d.value({targetDeliveryMethodType:H,merchandiseStableIds:M.value}),zt(H==="SHIPPING"?r.translate("split_delivery.accessibility.status.ship_separately",{items:k.value}):r.translate("split_delivery.accessibility.status.pickup_in_store",{items:k.value})))};return w}),F=L(()=>z.value[N.value].label),T=L(()=>{const{deliveryMethodsByMerchandise:w}=l.value,B=M.value.map(x=>w[x]);if(B.length===0||B.some(x=>!x))return[];const[H,...ee]=B;return ee.reduce((x,J)=>x.filter(q=>J.includes(q)),H)}),R=L(()=>{const w=T.value,B=w.map(H=>({...z.value[H],selected:H===N.value})).sort((H,ee)=>Number(ee.selected)-Number(H.selected));return w.length===1&&B.push({label:r.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{h.value(_),p.value(M.value),zt(r.translate("split_delivery.accessibility.status.remove_items",{items:k.value}))}}),B}),V=L(()=>R.value.length),P=L(()=>R.value.findIndex(w=>w.selected)),C=w=>{const B=V.value;if(B===0||b.value===void 0)return;const H=Math.min(b.value,B-1);b.value=(H+w+B)%B},D=()=>{b.value=uo(V.value,P.value)},W=()=>{A||D()},U=()=>{requestAnimationFrame(()=>{document.querySelector(wc(g))?.focus()})},ie=w=>{w&&(w.onClick(),U())},re=w=>{if(!A){(w.key==="ArrowDown"||w.key==="ArrowUp")&&(w.preventDefault(),D(),v.current?.click());return}switch(w.key){case"ArrowDown":w.preventDefault(),C(1);break;case"ArrowUp":w.preventDefault(),C(-1);break;case"Home":w.preventDefault(),b.value=0;break;case"End":w.preventDefault(),b.value=V.value-1;break;case"Enter":case" ":w.preventDefault(),b.value!==void 0&&ie(R.value[b.value]);break;case"Tab":w.stopPropagation(),h.value(_);break}},X=L(()=>f.value&&b.value!==void 0&&R.value[b.value]!==void 0?`${_}-option-${b.value}`:void 0);return n(Y,{when:V,children:w=>n(Q,{children:[n(Nc,{activeIndex:b,isOpen:A,menuOptionsLength:w,selectedOptionIndex:P.value,wasOpenRef:m}),n(la,{ref:v,id:I,command:"--toggle",commandFor:_,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:ln.TriggerButton,accessibilityLabel:`${i}, ${r.translate("review.blocks.change_delivery_method_link_label")}`,onClick:W,role:"combobox",onKeyDown:re,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":X.value,children:n(S,{direction:"inline",gap:"small-500",alignItems:"center",children:[n("span",{className:ln.TriggerButtonText,children:F}),n("span",{className:ln.TriggerChevron,children:n(oe,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),n(ws,{id:_,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:n("div",{role:"listbox","aria-labelledby":I,children:n(Bn,{each:R,getKey:B=>B.value,children:(B,H)=>{const ee=b.value===H;return n("button",{id:`${_}-option-${H}`,type:"button",role:"option",tabIndex:-1,"aria-selected":B.selected,"data-active":ee||void 0,className:ln.MenuOptionButton,onClick:()=>{ie(B)},onMouseOver:()=>{b.value=H},children:n(S,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:B.icon,tone:ee?"accent":"auto"}),n(O,{type:"small",tone:B.value==="remove"?"critical":"auto",children:B.label})]})})}})})})]})})}function hn({onMoveMerchandise:e,onRemoveMerchandise:t,title:a,selectedDeliveryMethodType:o}){const s=Je(o).value,r=se(()=>{const u=new Map;for(const d of s){const p=d.digest,h=u.get(p);if(h){if(h.stableIds.includes(d.stableId))continue;h.stableIds.push(d.stableId),h.totalQuantity+=d.quantity}else u.set(p,{line:d,stableIds:[d.stableId],totalQuantity:d.quantity})}return Array.from(u.values())},[s]),l=Oi(r.map(({line:u})=>u.stableId)),c=Fi(o);return n(Q,{children:n(S,{accessibilityRole:"unordered-list",accessibilityLabel:a,gap:"small-100",children:r.map(({line:{stableId:u,image:d,title:p,subtitle:h,sellingPlan:v},stableIds:m,totalQuantity:g})=>
2{const _=[h,v?.name].filter(Boolean).join(` ${xi} `),I=l.has(u);return n(G,{accessibilityRole:"list-item",className:I?c:void 0,children:n(ge,{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:[n(Bi,{alt:d?.altText,size:"small",src:d?.url,totalItems:g>1?g:void 0}),n(G,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[n(O,{size:"base",children:n(St,{children:p})}),_&&n(O,{color:"subdued",size:"small",children:n(St,{children:_})})]}),n(G,{inlineAlignment:"end",children:n(Oc,{merchandiseStableIds:m,onMoveMerchandise:e,onRemoveMerchandise:t,selectedDeliveryMethodType:o,productTitle:p})})]})},u)})})})}function po(){const{i18n:e}=y(),t=tn(),a=te(null),o=Je("PICK_UP"),{shouldOpenModal:i}=ro(),{currentSummary:s,visibleSummary:r,isNegotiating:l}=Ic(o),c=L(()=>s.value?.totalItemCount===1),u=L(()=>{const v=r.value;return v?v.isAllItems?e.translate("split_delivery.pickup_all_items"):e.translate("split_delivery.pickup_items_count",{count:v.totalItemCount}):""}),d=L(()=>{const v=e.translate("review.blocks.change_delivery_method_link_label");return u.value?`${u.value}, ${v}`:v}),p=L(()=>u.value||e.translate("split_delivery.items_for_pickup")),h=ce(Fn(()=>i.value||!c.value&&!t.value));return Ae(()=>{h.value=i.value||!c.value&&!t.value}),n(G,{children:n(Is,{children:n(Y,{when:h,fallback:n("div",{ref:a,tabIndex:-1,children:n(hn,{title:e.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:n(ye,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:i.value?d.value:p.value,command:i.value?"--show":void 0,commandFor:i.value?vt:void 0,"aria-expanded":i.value?void 0:!1,disabled:l.value,onClick:i.value?void 0:()=>{h.value=!1,requestAnimationFrame(()=>{a.current?.focus()})},children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(Sa,{variant:"fan-legacy",sortByPrice:!0,merchandise:r.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),n(Y,{when:()=>!l.value&&r.value!==void 0,fallback:n(pe,{inlineSize:"base"}),children:n(O,{children:u})}),n(oe,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function ho(){const{shop:e}=y(),t=Fe(),{deliveryNext:a}=ue(),o=tn(),i=wa();return L(()=>{if(!e.shipPickupInOneOrderEnabled||!(a.value&&"supportsSplitDeliveryMethod"in a.value?a.value.supportsSplitDeliveryMethod:!1))return!1;const{enabledDeliveryMethods:r,deliveryMethodsByMerchandise:l}=t.value,c=r.includes("SHIPPING"),u=r.includes("PICK_UP");if(!c||!u||!o.value&&i.value)return!1;const d=Object.values(l);if(d.length<2)return!1;if(d.some(m=>m.includes("SHIPPING")&&m.includes("PICK_UP")))return!0;const h=d.some(m=>m.includes("SHIPPING")&&!m.includes("PICK_UP")),v=d.some(m=>m.includes("PICK_UP")&&!m.includes("SHIPPING"));return h&&v})}function xc({localPickupDeliveryLine:e,onShowModal:t}){const{i18n:a,shop:o}=y(),i=ho(),s=o.hasFlagEnabled(ia),{methods:r,selectedDeliveryMethodHandle:l}=e,c=r.find(_=>_.handle===l),u=r.length-1,d=je({methods:r,selectedDeliveryMethodHandle:l}),p=xe("purchase.checkout.pickup-location-option-item.render-after"),h=c?.handle??"",v=se(()=>({handle:h}),[h]);if(!c)return null;function m(){t(),d("checkout_pickup_buyer_reveal_more")}const g=n(Q,{children:[n(Y,{when:i,children:n(Q,{children:[n(G,{padding:"base",children:n(po,{})}),n(Ue,{accessibilityRole:"presentation"})]})}),n(G,{padding:"base",children:[n(to,{method:c,subscriptionBanner:!0}),n(Be,{marginBlockStart:"small100",customizations:p,options:v})]}),u>0?n(S,{children:[n(Ue,{accessibilityRole:"presentation"}),n(G,{padding:"base",children:n(ye,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:m,children:n(S,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[n(O,{type:"strong",children:a.translate("local_pickup.toggle_more_locations",{count:u})}),n(oe,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return n(S,{gap:"base",children:s?n(Na,{target:"edgeToEdgeCard",children:n(ze,{accessibilityRole:"presentation",children:g})}):n(G,{border:"base",borderRadius:"large",children:g})})}function xn(){const{shop:e}=y(),t=ho(),a=e.hasFlagEnabled(ia),o=n(Q,{children:[n(Y,{when:t,children:[n(G,{padding:"base",children:n(po,{})}),n(Ue,{accessibilityRole:"presentation"})]}),n(G,{padding:"base",children:n(S,{direction:"block",gap:"small-400",children:n(S,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(pe,{}),n(pe,{inlineSize:"small"})]}),n(pe,{inlineSize:"large"}),n(G,{paddingBlockStart:"small-500",children:n(pe,{size:"small"})})]})})}),n(Ue,{accessibilityRole:"presentation"}),n(G,{padding:"base",children:n(pe,{inlineSize:"small"})})]});return n(S,{gap:"base",children:[n(S,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(pe,{inlineSize:"large"}),n(pe,{inlineSize:"small"})]}),a?n(Na,{target:"edgeToEdgeCard",children:n(ze,{accessibilityRole:"presentation",children:o})}):n(G,{border:"base",borderRadius:"large",children:o})]})}function Bc({onShowModal:e,showLocationButton:t=!0}){const{i18n:a}=y(),{value:o}=ue().merchandiseLines;at({active:!0});const{fullCountryName:i,isOnlyCountryAvailable:s}=we(),r=je({methods:[],selectedDeliveryMethodHandle:void 0}),l=Xe(o?.lines),c=i?a.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:i,count:l}):a.translate("local_pickup.pickup_unavailable_banner_title",{count:l});return n(S,{gap:"small",children:[t&&n(Qa,{onClick:()=>{e(),r(s?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),n(Mn,{heading:c,tryDifferentLocationOnClick:()=>e(!0)})]})}const Wt={isLocationFormVisible:!1};function Bu(){const{i18n:e}=y(),{negotiating:t}=Sn(),a=en(),o=Ze(),i=Ke("deliveryNext"),{value:s}=Ia().value,{value:r}=La().value,l=!!(s||r),c=de(tt(Xn).hasViolations),u=ja({mode:"localPickup"}),d=L(()=>u.value.merchandiseLines),p=L(()=>u.value.allowAlternativeAction),h=L(()=>u.value.merchandiseLines.length>0),{isOnlyCountryAvailable:v}=we(),m=L(()=>{const T=a.value?.methods??[];return T.length>0&&eo(T)}),g=ht({allLocationsFarAway:m,selectedPickupOptionNoLongerAvailable:c}),_=je({methods:a.value?.methods||[],selectedDeliveryMethodHandle:a.value?.selectedDeliveryMethodHandle}),[I,A]=le(!1),f=ce(!1),b=xe("Checkout::PickupLocations::RenderBefore"),N=xe("Checkout::PickupLocations::RenderAfter"),k=T=>{A(!0),f.value=T??!1},M=()=>{A(!1),f.value=!1},z=()=>{k(),_(v?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},F=(()=>{const T=a.value,R=T?.methods.find(C=>C.handle===T.selectedDeliveryMethodHandle);if(!o.value||I)return n(xn,{});if(t.value&&!R)return n(xn,{});if(l)return n(Y,{when:h,fallback:n(Bc,{onShowModal:k}),children:n(Q,{children:[n($n,{bannerType:"pickup",merchandiseLines:d,allowAlternativeAction:p}),n(Fc,{})]})});if(!T)return n(xn,{});const{methods:V}=T,P=Xe(T.targetMerchandiseLines);return n(S,{gap:"base",children:[n(Y,{when:h,children:n($n,{bannerType:"pickup",merchandiseLines:d,allowAlternativeAction:p})}),n(Y,{when:c,children:n(pt,{})}),n(Y,{when:g,children:n(dt,{itemCount:P,methods:T.methods,onChangeLocationClick:k})}),n(S,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(Y,{when:i,fallback:n(O,{color:"subdued",children:uc(V,v,P,e,{selectedDeliveryMethodHandle:T.selectedDeliveryMethodHandle,allLocationsFarAway:m.value})}),children:n(pe,{inlineSize:"base"})}),n(Qa,{onClick:z})]}),n(Be,{customizations:b,options:Wt}),n(xc,{localPickupDeliveryLine:T,onShowModal:k}),n(Be,{customizations:N,options:Wt})]})})();return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ze,{accessibilityLabel:e.translate("local_pickup.pick_up_location"),children:[F,n(_c,{methods:a.value?.methods,type:a.value?.type,open:I,onClose:M,addressFocus:f})]})})}function Fc(){return at({active:!0}),null}const $t=5;function Rc(e,t){const a=je({methods:e,selectedDeliveryMethodHandle:t}),[o,i]=le($t),s=se(()=>e.slice(0,o),[e,o]);K(()=>{const u=e.findIndex(p=>p.handle===t);u>=o&&i(u+1)},[e,o,t]);const r=e.length-s.length,l=s.length>=e.length;return{revealedMethods:s,amountLeft:r,allRevealed:l,revealMore:()=>{l||(i(u=>u+$t),a("checkout_pickup_buyer_reveal_more"))}}}const Vc=13;function Fu(){const{i18n:e}=y(),[t,a]=le(!1),{formattedAddress:o}=we(),i=o?n(S,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(oe,{type:"geolocation",size:"small-100"}),n(O,{children:Ya(o,Vc)})]}):e.translate("local_pickup.toggle_location");return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ze,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:n(S,{gap:"small-500",children:[n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[n(Ge,{level:2,children:e.translate("delivery_options.pick_up_locations")}),n(me,{id:"change-pickup-location-button",textDecoration:"none",onClick:()=>a(s=>!s),accessibilityLabel:t?e.translate("local_pickup.cancel"):e.translate("local_pickup.toggle_location"),children:t?e.translate("local_pickup.cancel"):i})]}),n(Hc,{isLocationFormVisible:t,setIsLocationFormVisible:a})]})})})}function Hc({isLocationFormVisible:e,setIsLocationFormVisible:t}){const a=Ze(),{i18n:o}=y(),{negotiating:i}=Sn(),s=en(),r=Ke("deliveryNext"),{value:l}=La().value,c=!!l,{isOnlyCountryAvailable:u}=we(),d=An(),{deliveryLines:p}=$(),h=p.value,{negotiate:v}=ke(),m=Ri(),g=xe("Checkout::PickupLocations::RenderBefore"),_=xe("Checkout::PickupLocations::RenderAfter"),I=se(()=>({isLocationFormVisible:e}),[e]),A=()=>t(!1),f=()=>t(F=>!F),b=()=>{A();const F=h.find(T=>{const R=T.peek().id;return R&&R===s.value?.id});F&&(F.fields.deliveryMethodHandle.value=void 0),v({include:["deliveryNext"],fieldsToResolve:["deliveryNext"]})},N=Fe(),{pickupCountries:k,loading:M}=aa(Za,{sellableDeliveryMethods:N}),z=L(()=>!!(s.value&&Nl(s.value.methods)));if(c)return n(Gt,{isLocationFormVisible:e,setFormVisibilityFalse:A,handleLocationChange:b,pickupCountries:k.value??[],onToggleLocationFormClick:f});if(i.value||!a.value||M.value||!k.value)return n(Ln,{});if(s.value){const{methods:F,type:T}=s.value,R=m.value.PICK_UP??0,V=z.value&&d&&!u,P=u?Oe(R,{oneItem:()=>
2o.translate("local_pickup.location_information_far_away_one_item",{count:F.length}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:F.length})}):Oe(R,{oneItem:()=>o.translate("local_pickup.location_nearby_one_item",{count:F.length}),otherItems:()=>o.translate("local_pickup.location_nearby_other_items",{count:F.length})});return n(S,{gap:"base",children:[n(no,{}),n(Be,{customizations:g,options:I}),n(ge,{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:!V&&n(Ee,{color:"subdued",children:d?P:o.translate("local_pickup.location_information",{count:F.length})})}),n(Ja,{locationFormVisible:e,toggleLocationFormVisibility:A,onLocationChange:b,pickupCountries:k.value,children:n(Wc,{itemCount:R,methods:F,type:T,allLocationsFarAway:z,loading:r.value,onToggleLocationFormClick:f})}),n(Be,{customizations:_,options:I})]})}return n(Gt,{isLocationFormVisible:e,setFormVisibilityFalse:A,handleLocationChange:b,pickupCountries:k.value,onToggleLocationFormClick:f})}function Gt({isLocationFormVisible:e,setFormVisibilityFalse:t,handleLocationChange:a,pickupCountries:o,onToggleLocationFormClick:i}){const{value:s,loading:r}=Ia().value,l=ue().merchandiseLines,{i18n:c}=y(),{locationAddress:u}
2=$(),d=u.peek(),p=o.find(m=>m.value===d.countryCode)?.label,h=Xe(l.value?.lines),v=p?c.translate("order_summary.pickup_unavailable_banner_title_with_country",{count:h,country:p}):c.translate("order_summary.pickup_unavailable_banner_title",{count:h});return!r&&s?n(S,{gap:"base",children:[n(Ja,{locationFormVisible:e,toggleLocationFormVisibility:t,onLocationChange:a,pickupCountries:o,children:n(Mn,{heading:v,tryDifferentLocationOnClick:i})}),n(Uc,{})]}):n(Ln,{})}function Uc(){return at({active:!0}),null}function Kt({instructions:e}){return n(G,{maxInlineSize:"200px",children:n(Ee,{type:"small",children:e})})}function zc({handle:e,address:t,secondaryLabel:a,letterCase:o,showInstructionsLeft:i,showInstructionsRight:s,instructions:r,nameLabel:l,itemRenderAfterCustomizations:c}){const u=se(()=>({handle:e}),[e]);return n(In,{value:e,details:n(Q,{children:[n(Aa,{address:t,textSize:"small",hiddenFields:["phone"]}),i&&r&&n(Kt,{instructions:r})]}),secondaryContent:n(Q,{children:[n(O,{type:"strong",letterCase:o,children:n("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),s&&r&&n(Kt,{instructions:r})]}),tertiaryContent:c?.length>0&&n(Be,{customizations:c,options:u,render:d=>n(S,{padding:"small-100 none none none",gap:"small-100",children:d})}),children:n(O,{type:"strong",children:l})})}function Wc({itemCount:e,methods:t,allLocationsFarAway:a,type:o,loading:i,onToggleLocationFormClick:s}){const{i18n:r,checkout:{identity:l}}=y(),c=l.current.value==="shopPay",{negotiate:u}=ke(),d=ta(),{isOnlyCountryAvailable:p}=we(),h=An(),v=Ze(),m=Vi({base:!0,medium:!1}),g=v.value?m??!1:!0,[_,I]=ka({type:o,deliveryMethodType:"PICK_UP"}),{revealedMethods:A,amountLeft:f,allRevealed:b,revealMore:N}=Rc(t,_),{setInverseGroupDeliveryMethodHandle:k,getInverseGroupDeliveryMethodHandle:M}=Ca(t,o),z=j(([D=""])=>{if(I(D),d.value){const W=M(D);k(W)}u({include:["deliveryNext"]})},[I,d,u,M,k]),F=xe("purchase.checkout.pickup-location-option-item.render-after"),T=de(tt(Xn).hasViolations),R=ht({allLocationsFarAway:a,selectedPickupOptionNoLongerAvailable:T}),V=se(()=>_?[_]:[],[_]);if(i)return n(Ln,{hideText:!0});const P=(D,W)=>D===0?r.translate("shipping.free_rate_label"):r.formatCurrency(D,{currency:W}),C=({name:D="",proximityLabel:W,distance:U})=>{if(!(!p&&(U||W)))return D;const re=W||`(${ut(r,U)})`;return n(Q,{children:[D," ",n(O,{color:"subdued",children:re})]})};return n(S,{gap:"base",children:[n(Y,{when:R,children:n(dt,{itemCount:e,methods:t,onChangeLocationClick:s})}),T.value&&n(pt,{}),n(rt,{name:"local_pickup_methods",values:V,onChange:z,hideRadioControl:!c&&A.length===1,children:A.map(({handle:D,cost:{amount:W,currencyCode:U},pickupLocation:ie})=>{const{address:re,instructions:X,name:w,distanceFromBuyer:B,proximityLabel:H}=ie,ee=P(W,U),x=C({name:w,distance:B,proximityLabel:h?void 0:H}),J=ee===r.translate("shipping.free_rate_label")?"uppercase":void 0;return n(zc,{handle:D,address:re,secondaryLabel:ee,letterCase:J,showInstructionsLeft:!!(X&&(c||g)),showInstructionsRight:!!(X&&!c&&!g),instructions:X,nameLabel:x,itemRenderAfterCustomizations:F},D)})}),!b&&n(G,{inlineAlignment:"end",children:n(me,{onClick:N,children:r.translate("local_pickup.reveal_more_label",{count:f})})})]})}function $c({heading:e="auto"}){const{i18n:t}=y(),a=t.translate("pickup_point.title");return n(ze,{accessibilityLabel:a,children:n(S,{gap:"small-400",children:[e==="auto"&&n(Ge,{level:2,children:a}),n(pa,{blockSize:"small-500"}),n(Ts,{text:t.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const Ru=mn({displayName:"PickupPoint",load:()=>Kn(()=>an(()=>import("./component-PickupPoint.ClPZZS0v.js"),__vite__mapDeps([65,1,6,2,3,4,5,7,8,9,10,32,54,49,24,25,26,27,50,15,16,17,14,18,19,20,21,22,23,28,66,57,67,68,42,40,41,43,30,44,45,46,39,12,13,47,48,29,51,52,37,38,53,69]))),renderLoading:e=>n($c,{...e})});function Vu({selectedDeliveryMethodType:e}){const{i18n:t}=y(),{merchandiseLines:a}=$(),o=Je(e),{shouldOpenModal:i}=ro(),s=L(()=>{const l=so({targetMerchandiseLines:o.value,merchandiseLines:a.value});return l.isAllItems?e==="PICK_UP"?t.translate("split_delivery.pickup_all_items"):t.translate("split_delivery.ship_all_items"):e==="PICK_UP"?t.translate("split_delivery.pickup_items_count",{count:l.targetMerchandiseQuantity}):t.translate("split_delivery.ship_items_count",{count:l.targetMerchandiseQuantity})}),r=L(()=>`${s.value}, ${t.translate("review.blocks.change_delivery_method_link_label")}`);return i.value?n(ye,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:r.value,command:"--show",commandFor:vt,children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(Sa,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),n(O,{children:s}
2),n(oe,{type:"pen",size:"base",tone:"neutral"})]})}):n(hn,{title:e==="PICK_UP"?t.translate("split_delivery.items_for_pickup"):t.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})}function Gc({onClose:e}={}){const{negotiate:t}=ke(),{i18n:a}=y(),o=Hi(),{deliveryLines:i,merchandiseLines:s,discountLines:r}=$(),l=Fe(),c=te(!1),u=j(({targetDeliveryMethodType:h,merchandiseStableIds:v})=>{const{orphanedRemovedFromCartStableIds:m}=ai({deliveryLines:i,merchandiseLines:s,targetDeliveryMethodType:h,merchandiseStableIds:v,sellableDeliveryMethodsByStableId:l.value.deliveryMethodsByMerchandise,discountLines:r});m.length>0&&(c.current=!0)},[i,s,l,r]),d=j(h=>{na({deliveryLines:i,merchandiseLines:s,merchandiseStableIds:h,discountLines:r})},[i,s,r]),p=j(()=>{e?.(),t({include:["deliveryNext","merchandiseLines"]}),c.current&&(c.current=!1,o(a.translate("stock.removed_from_cart_notice")))},[t,e,o,a]);return{moveMerchandise:u,removeMerchandise:d,saveAndClose:p}}function Hu({id:e=vt,open:t}){const{i18n:a}=y(),o=Je("PICK_UP"),i=Je("SHIPPING"),{moveMerchandise:s,removeMerchandise:r,saveAndClose:l}=Gc(),c=a.translate("delivery_options.pickup"),u=a.translate("delivery_options.ship_to_address");return n(kn,{id:e,open:t,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:l,primaryAction:n(ye,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:n(S,{gap:"large-300",children:[o.value.length>0&&n(S,{gap:"base",children:[n(S,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:"marker"}),n(Ge,{level:2,children:c})]}),n(G,{border:"base",borderRadius:"large",padding:"base",children:n(hn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"PICK_UP",title:c})})]}),i.value.length>0&&n(S,{gap:"base",children:[n(S,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:"package-delivery"}),n(Ge,{level:2,children:u})]}),n(G,{border:"base",borderRadius:"large",padding:"base",children:n(hn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"SHIPPING",title:u})})]})]})})}function Kc(){const[e,t]=le(!1),a=Yn(),o=te(0);K(()=>{Date.now()<o.current||t(!1)},[a.lastNegotiation.value]);function i(){o.current=Date.now()+1e3,t(!0)}return{cartUpdated:e,setCartUpdated:i}}function qc(e){return e==="LOCAL"?"SHIPPING":e}function jc(e){const t=new Set(e.map(qc));return t.size===1?t.has("SHIPPING")||t.has("PICK_UP")||t.has("PICKUP_POINT"):t.size===2&&t.has("SHIPPING")&&t.has("PICK_UP")}function Uu(){const{violations:e}=Ui(Ct),{client:t,i18n:a,shop:o,source:i,observability:s,url:r,embed:l,checkout:c}=y(),{merchandiseLines:u,shippingAddress:d}=$(),{countryName:p,loading:h}=zi(d.value),{value:v}=ue().merchandiseLines,{negotiate:m}=ke(),g=Wi(),{negotiating:_,methods:I}=Sn(),{loading:A}=Yn(),f=te(g.peek()),b=te(A.peek().has("deliveryNext")),k=L(()=>{const ne=A.value.has("deliveryNext"),Se=b.current&&!ne;return g.value?f.current=!0:Se&&(f.current=!1),b.current=ne,f.current}).value,{cartUpdated:M,setCartUpdated:z}=Kc(),F=bn(),[T,R]=le(void 0),V=!!l;K(()=>{e.size>0&&R(p)},[e]);const P=ja({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),C=L(()=>P.value.merchandiseLines),D=L(()=>P.value.merchandiseLines.length>0);if(!v||v.lines.length===0||h||T!==p||k)return null;if(M)return n(Cn,{heading:a.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(e.size===0||o.shipPickupInOneOrderEnabled&&_.value&&jc(I.value))return null;const U=va(Array.from(e),v,Array.from(Ct)),ie=U?.map(({stableId:ne})=>ne),re=u.value.filter(({stableId:ne})=>!ie?.includes(ne)),X=re.length===0,w=n($n,{bannerType:"shipping",merchandiseLines:C});if(U==null)return D.value?w:null;const B=Array.from(e).some(({code:ne})=>ne==="MERCHANDISE_PRODUCT_NOT_PUBLISHED_IN_BUYER_LOCATION")?p??a.translate("merchandise_unavailable_in_buyer_location.missing_country_fallback"):a.translate("merchandise_unavailable_in_buyer_location.indeterminate_location_fallback");let H=null;X&&U.length===1?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:B}):X?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:B}):U.length===1?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:B}):H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:B});const ee=X?null:n(ga,{children:U.map(ne=>n(_a,{children:ne.subtitle?a.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:ne.title,variant_label:ne.subt
2itle}):ne.title},ne.stableId))}),x=U.length===1?a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),J=a.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");function q(){F("click",{element:{tagName:"a",textContent:J},section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:X,redirectSuccess:o.hasStorefront}),$i({client:t,url:r,source:i,configuration:c.configuration})}function Ce(){F("click",{element:{tagName:"a",textContent:x},section:"delivery",timestamp:new Date}),u.value=re,m({onComplete:z})}const _e=n(O,{children:X?X&&(V||!o.hasStorefront)?a.translate("merchandise_unavailable_in_buyer_location.change_address_only"):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(me,{onClick:q,children:J})}):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(me,{onClick:Ce,children:x})})}),fe=n(Ta,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(e).map(({code:ne})=>ne),children:n(qe,{heading:H,tone:"critical",children:n(S,{gap:"base",children:[ee,_e]})})});return n(Y,{when:D,fallback:fe,children:w})}function Yc({taxId:e}){const{negotiate:t}=ke(),a=Gi(),o=()=>{t({identifier:Symbol.for("vat-id-validation"),force:!0})},i=l=>{e.format.validate(l)&&(o(),a({vatId:l}))};K(()=>{e.validated.status===null&&i(e.value)},[]);const s=l=>{e.set(l),i(l)},r=()=>{e.value===e.validated.taxId&&e.validated.status||(o(),a({vatId:e.value}))};return{value:e.value,status:e.status,loading:e.status.type==="pending",onBlur:r,onInput:s}}function Qc({status:e}){const{i18n:t}=y(),{shippingAddress:a}=$(),o=de(e);return L(()=>{const i=a.value.countryCode?.toLowerCase(),s=o.value;return s.type==="invalid_format"&&i?{code:"invalid_format",details:{country:i},message:t.translate("taxes.vat_number.status.invalid_format",{scope:i})}:s.type==="resolved"&&s.validationStatus==="INVALID"&&i?{code:"invalid_number",details:{country:i},message:t.translate("taxes.vat_number.status.invalid_number",{scope:i})}:s.type==="resolved"&&s.validationStatus==="SERVICE_ERROR"?{code:"service_error",message:t.translate("taxes.vat_number.status.service_error")}:s.type==="resolved"&&s.validationStatus==="SERVICE_UNAVAILABLE"?{code:"service_unavailable",message:t.translate("taxes.vat_number.status.service_unavailable")}:null})}function Xc(e,t){const a=te(e.type),o=te(t);K(()=>{o.current=t},[t]);const i=e.type;K(()=>{const s=a.current;a.current=i,s==="pending"&&i==="resolved"&&o.current()},[i])}const Jc=fn("VatNumberFieldInfoTooltip");function Zc({status:e}){const{i18n:t}=y();return e.type==="pending"?n(et,{size:"small",accessibilityLabel:t.translate("taxes.vat_number.accessibility.status.validating")}):e.type==="invalid_format"?n(mo,{}):n(eu,{status:e})}function eu({status:{validationStatus:e}}){const{i18n:t}=y();return e==="VALID"?n(Q,{children:[n(oe,{tone:"success",size:"small",type:"check-circle"}),n(O,{accessibilityVisibility:"exclusive",children:t.translate("taxes.vat_number.accessibility.status.valid")})]}):n(mo,{})}function mo(){const{i18n:e}=y(),t=_n(void 0,Jc);return n(Q,{children:[n(oe,{size:"small",type:"question-circle",interestFor:t}),n(ca,{id:t,children:e.translate("taxes.vat_number.field.tooltip")})]})}function zu({taxId:e,applied:t,inputRef:a}){const{i18n:o}=y(),i=Yc({taxId:e}),s=Qc(i),r=L(()=>s.value&&{type:"warning",value:s.value.message}),l=e.warnings.includes("DOMESTIC_NOT_APPLICABLE");return Xc(i.status,()=>{if(i.status.type==="resolved"&&i.status.validationStatus==="VALID"&&t)return De({content:o.translate("taxes.vat_number.accessibility.status.applied"),role:"alert"});if(l)return De({content:o.translate("taxes.vat_number.accessibility.status.domestic"),role:"status"});const c=s.value;if(c)switch(c.code){case"invalid_number":return De({content:o.translate("taxes.vat_number.accessibility.status.invalid_number"),role:"alert"});case"service_error":return De({content:o.translate("taxes.vat_number.accessibility.status.service_error"),role:"alert"});case"service_unavailable":return De({content:o.translate("taxes.vat_number.accessibility.status.service_unavailable"),role:"alert"})}}),n(S,{direction:"block",gap:"base",children:[n("div",{"aria-busy":i.loading,children:n(ua,{ref:a,name:"vatNumber",label:o.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:n(Zc,{status:i.status}),error:r.value,...i})}),l&&n(Cn,{tone:"info",children:o.translate("taxes.vat_number.domestic_order")})]})}export{Ht as A,Qa as B,Tu as C,Ou as D,wu as E,dt as F,_c as G,mc as H,$n as I,ut as J,gc as K,vc as L,hc as M,Cl as N,oo as O,xa as P,io as Q,Ic as R,no as S,kc as T,Uu as U,zu as V,bc as W,vt as X,hn as Y,pl as Z,Oa as _,ja as a,Ln as b,Bc as c,pt as d,Du as e,ho as f,Ru as g,xu as h,Hu as i,An as j,Bu as k,Fu as l,Vu as m,Nu as n,pr as o,Vt as p,Mn as q,za as r,Dt as s,Pr as t,Ds as u,Ba as v,we as w,Nl as x,ht as y,uc 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.