1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-ShopPayVerificationSwitch.B9MWXlPd.js","esnext-vendor.BDPAaZdq.js","hooks-useReplaceShopPayInHistory.C8UL-mAH.js","app.D1P6yWfp.js","assets/app.BuSMBobh.css","assets/useReplaceShopPayInHistory.BpuyvRSB.css","hydrate.B0xlt2dG.js","helpers-getNormalizedPaymentMethodName.B-mE5wnL.js","shared-permissions.BaDWlj5_.js","hooks-useShopPayExternalAppContext.DyGXtar4.js","assets/previous.SPd9u6sV.css","BillingAddressForm.aTSlVDrG.js","FormLayout.CMVyKzjL.js","amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js","assets/FormLayout.CrYq3At_.css","PhoneField.ykPh8SPx.js","hooks-useSuppressShopPayModalOnLoad.brztd70E.js","assets/PhoneField.uZEuHncj.css","Popover.BUTwaoOa.js","assets/Popover.Bi1nHaU-.css","AddressPresenter.B0qw2vWQ.js","Choice.BIzIW4rp.js","Checkbox.CiixBh9Z.js","assets/Checkbox.SrYMuQu4.css","assets/Choice.B7lVAtpz.css","assets/BillingAddressForm.BdwN7V1K.css","hooks-useShopPayNewSignupLoginExperiment.CrD2gvGR.js","hooks-useForceShopPayUrl.F3deeEs7.js","utilities-publishMessage.BORnEDuA.js","utilities-stable-ref.Dvd2X3ul.js","useShopPayButtonClassName.nv37ytUz.js","addresses-is-address-empty.Ch6V3XcM.js","hooks-useShouldRevealCustomization.wOAvQfO_.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","useAuthorizeUrl-index.u1UiJVIa.js","dist-v4.EwEgHOG0.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","component-ApplePayButton.DfYxt3Dn.js","TransitionHeight.M5zGQYzu.js","assets/TransitionHeight.CuRoM9zv.css","hooks-useWalletsTimeout.i08rvNYN.js","hooks-usePostPurchase.BPY08f0g.js","localization-index.Bo8bPuxq.js","helpers-credit-card-disabled.BnSr1GsQ.js","assets/index.CIy8uDiZ.css","ChangeCompanyLocationLink.Ci5U9F_D.js","shop-pay-installments-monorail.D0Myc1k_.js","ImpressionEventCapture.iMEQlBKs.js","ShopPayLogo.Cut4IRi6.js","hooks-useWalletsMonorailTrack.CvfUTPBc.js","EmptyState.b83C9ddY.js","assets/EmptyState.BEvzDDvy.css","cross-border-hooks.DVubeg9N.js","Section-SectionStyleOverride.CP0VFRId.js","AutocompleteField-hooks.D2O1AcIY.js","PendingShipping.2eopPL-C.js","assets/ApplePayButton.CTcryfIc.css","component-amazonWalletLazy.DHzdkYWT.js","hooks-useStableHostMethodsReferences.DLE4q0sj.js","WalletsSandbox-WalletSandbox.Dp4t7VmS.js","assets/WalletSandbox.BoV0vp4z.css","amazon-constants.CrSKDLZa.js","assets/amazonWalletLazy.D78LrA7v.css","assets/delivery-method-transitions.S-FSTp4Y.css","component-PickupPoint.Dm47aLjN.js","Map.kNoqIdtR.js","assets/Map.cbVP6Hp_.css","utilities-dates.ChO2GdxN.js","assets/PickupPoint.3rHQv8Px.css"])))=>i.map(i=>d[i]); 2import{f as I,_ as Xn,u as n,h as K,o as Ae,T as oe,d as vn,r as Qn,e as ce,A as ee,k as re,q as X,i as Q,n as qe,S as j,g as Pe,l as me,Q as Lo,X as Ao,x as Mo,a as Eo,j as To,p as Vn,aA as No,G as Hn,E as Lt,af as wo}from"./esnext-vendor.BDPAaZdq.js";import{F as Jt,a as Do}from"./FormLayout.CMVyKzjL.js";import{O as _,Q as z,a7 as yn,hY as Oo,hZ as xo,a$ as Bo,aS as _n,G as Ye,P as ue,iG as we,es as Zt,bg as ea,bh as Jn,bi as un,ad as tn,a5 as Ee,iH as na,ce as ta,a6 as Zn,iI as Fo,a8 as gn,iJ as Ro,N as fn,ay as aa,iK as Vo,eL as Ho,iL as Uo,_ as Le,cd as zo,aY as oa,iM as Wo,iN as $o,ac as Go,iO as At,d7 as Ko,ba as Xe,fP as et,X as ia,iP as sa,iQ as ra,fN as Fe,iR as qo,iS as Un,du as la,iT as ca,iU as Yo,ef as jo,iV as Xo,aa as ua,cE as an,iW as Qo,iX as Jo,E as zn,ev as Zo,eu as ei,H as ni,eX as ti,iY as Mt,cm as ai,ew as oi,ez as ii,aP as si,j as ri,n as li,cn as da,cH as nt,cc as pa,iZ as ha,i_ as ci,cL as ui,ab as di,i$ as pi,hT as hi,j0 as mi,j1 as vi}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{dl as ma,f as tt,dm as yi,h as ke,aa as bn,P as Me,c as C,e2 as _i,ct as at,I as ae,l as _e,hL as gi,bk as va,g7 as On,eR as dn,K as Pn,a as De,aw as ya,o as D,gF as _a,O as kn,bY as Sn,F as ge,T as ga,ad as pn,gD as fi,S as ot,L as pe,hM as bi,bZ as Pi,hD as ki,cU as Cn,cy as Si,gU as Ci,a9 as Ii,fF as Li,H as je,bB as In,cQ as Ai,B as Y,al as Mi,b7 as Ei,c7 as Ti,a4 as Ni,a2 as it,a5 as We,a3 as Ge,hN as wi,v as xe,hO as Di,dg as st,X as Oi,U as Be,b as fa,gv as ba,g as xi,W as Ke,E as Qe,M as Bi,bq as Pa,bp as W
2n,cp as on,eZ as Fi,fd as Ri,hP as rt,bP as Ie,g0 as ka,hQ as Sa,cv as Ca,cw as Ia,hR as La,fP as Vi,e_ as Ln,bH as An,hz as Hi,am as de,bx as Ui,cu as zi,hS as Je,cn as Aa,f6 as Ma,f7 as Wi,dz as $i,V as Ea,cq as Ta,bG as lt,cr as Na,hT as en,hU as Gi,fl as Ki,aK as qi,c8 as Yi,aF as ji,hV as Xi,b6 as Qi,ao as Ji,bv as Et,hW as Zi,aI as wa,a1 as ct,dc as Da,dd as Oa,eo as es,a6 as ns,c9 as ts,hX as as}from"./hydrate.B0xlt2dG.js";import{a as ut,v as $n,c as os,S as is}from"./useShopPayButtonClassName.nv37ytUz.js";import{b as dt,c as ss,d as rs,e as ls,i as xa,f as cs}from"./hooks-useForceShopPayUrl.F3deeEs7.js";import{u as us,A as Ba}from"./AddressPresenter.B0qw2vWQ.js";import{u as Fa,S as ds,a as ps,b as hs,A as ms}from"./ChangeCompanyLocationLink.Ci5U9F_D.js";import{C as pt}from"./Checkbox.CiixBh9Z.js";import{L as $e}from"./shop-pay-installments-monorail.D0Myc1k_.js";import{h as vs}from"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import{P as ys,u as _s,F as gs}from"./PhoneField.ykPh8SPx.js";import{_ as sn,j as fs,h as bs}from"./app.D1P6yWfp.js";import{I as Ra}from"./ImpressionEventCapture.iMEQlBKs.js";import{S as Ps,u as ks,G as Ss}from"./ShopPayLogo.Cut4IRi6.js";import{a as be,c as Cs,d as Gn,f as Is,h as Ls,i as As}from"./hooks-useWalletsMonorailTrack.CvfUTPBc.js";import{a as Ms,e as Es,S as Tt}from"./hooks-usePostPurchase.BPY08f0g.js";import{g as Ts,P as Ns,h as Nt}from"./hooks-useWalletsTimeout.i08rvNYN.js";import{S as ws}from"./addresses-is-address-empty.Ch6V3XcM.js";import{a as Ds}from"./hooks-useShouldRevealCustomization.wOAvQfO_.js";import{M as Os}from"./hooks-useShopPayNewSignupLoginExperiment.CrD2gvGR.js";import{b as Mn,C as xs,a as Bs}from"./Choice.BIzIW4rp.js";import{C as ht}from"./EmptyState.b83C9ddY.js";import{b as Va,u as Fs}from"./cross-border-hooks.DVubeg9N.js";import{S as Ha}from"./Section-SectionStyleOverride.CP0VFRId.js";import{T as Rs}from"./TransitionHeight.M5zGQYzu.js";import{u as Vs}from"./AutocompleteField-hooks.D2O1AcIY.js";import{a as Hs,s as Us,M as zs}from"./BillingAddressForm.aTSlVDrG.js";import{P as Ws}from"./PendingShipping.2eopPL-C.js";import{P as $s}
2from"./Popover.BUTwaoOa.js";function Gs(){const{i18n:e,shop:t,shopPay:a}=_(),{shippingAddress:o}=z(),i=yn();return I(()=>{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 Ua(){const{shop:e,checkout:t}=_(),{shippingAddress:a,billingAddress:o}=z(),i=ma();return I(()=>{const s=Oo({isShippingRequired:t.isShippingRequired.value,isPickupSelected:i.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:o.fields.countryCode.value});return xo(e,s)})}function Ks(){const{shop:e,source:t,checkout:a}=_(),o=tt(),i=z(),s=ma(),r=yi(),l=Ua();return I(()=>{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||Bo(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 za({origin:e="contact_info_page"}){const{acceptEmailMarketing:t}=z(),{negotiate:a}=ke(),{emailMarketingOptInShownSignal:o}=_n(),{i18n:i,userEvents:s,checkout:r,source:{checkoutSessionIdentifier:l,sourceId:c},shop:{id:u,myshopifyDomain:d}}=_(),p=r.configuration.layout.isOnePage.value;Xn(()=>{o.value=!0},[o]);function h(m){t.value=m,a({loading:["acceptEmailMarketing"]}),s.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:l||c,shopId:Number(Ye(u)),shopifyDomain:d,action:m?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:p?"checkout_one_redesign":"checkout_one"}})}const v=vs("marketing.disclaimer.description_html",i)?n(Me,{type:"small",color:"subdued",children:n(bn,{children:i.translate("marketing.disclaimer.description_html",{privacy_policy_link:n($e,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n($e,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return n(C,{gap:"small-200",children:[n(pt,{id:"marketing_opt_in",name:"marketing_opt_in",checked:t.value,onChange:h,label:qs({identity:r.identity,i18n:i})}),v]})}function qs({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")}}za.displayName="MarketingOptIn";const Ys=/<a\b(?<attributes>[^>]*)>(?<text>.*?)<\/a>/gi,js=/data-policy-handle=(["'])(?<handle>privacy-policy|terms-of-service)\1/i,wt=/<\/?[a-z][\s\S]*>/i;function Dt(e){return n(bn,{dangerouslySetInnerHTML:{__html:e}})}function Ot(e,t){return n("span",{dangerouslySetInnerHTML:{__html:e}},t)}function Xs(e){const t=[];let a=0,o=!1;for(const s of e.matchAll(Ys)){const r=s.index,l=Qs(s);if(r==null||!l)continue;const c=e.slice(a,r);if(wt.test(c))return Dt(e);c&&t.push(Ot(c,`text-before-${r}`)),t.push(n($e,{handle:l,tone:"monochrome"},`${l}-${r}`)),a=r+s[0].length,o=!0}const i=e.slice(a);return!o||wt.test(i)?Dt(e):(i&&t.push(Ot(i,"trailing-text")),n(bn,{children:t}))}function Qs(e){const a=(e.groups?.attributes??"").match(js)?.groups?.handle;return a==="privacy-policy"?"privacy-policy":a==="terms-of-service"?"terms-of-service":null}function xt(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function Js(e){return e?JSON.stringify([e.label,e.disclaimerHtml]):null}function Wa(){const{i18n:e,shop:t,checkout:a,embed:o}=_(),{marketingPhoneInputError:i,previousPhoneMarketingDisclosureKeySignal:s,smsMarketingOptInShownSignal:r}=_n(),{phone:l,acceptSmsMarketing:c,smsMarketingPhone:u,shippingAddress:d}=z(),p=dt(),h=Ua(),v=h.value,m=xt(v),f=!v&&t.smsMarketing!=="OFF",g=m?.label??(f?e.translate("marketing.accept_sms_checkbox_label"):void 0),k=!!g;Xn(()=>{k&&(r.value=!0)},[k,r]);const M=ue(),{handleSmsMarketingConsent:P}=ss(),b=I(()=>M.buyerIdentity.value?.customerProfile),S=I(()=>!l.value&&!a.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),E=I(()=>!l.value),T=I(()=>o?.isFlagshipPartner||b.value?!1:!E.value);K(()=>
2{if(!u.value){const y=S.value?d.fields.phone.value:l.value;u.value=y??""}},[]),Ae(()=>{const y=d.fields.phone.value;S.value&&!xt(h.value)&&t.smsMarketing==="OFF"&&(u.value=y||"")}),rs(),Ae(()=>{const y=Js(h.value),L=s.peek();s.value=y,L!=null&&y!=null&&L!==y&&c.value&&(c.value=!1)});function V(y){i.value=void 0,P(y)}Ae(()=>{l.value&&!b.value&&(u.value=l.value)});const W=e.translate("field_errors.sms_marketing_phone_invalid"),H=ls(W),x=oe(()=>({state:{phone:u},errors:{phone:i}}),[i,u]);if(!g)return null;const F=m?n(Me,{type:"small",color:"subdued",children:Xs(m.disclaimerHtml)}):n(Me,{type:"small",color:"subdued",children:n(bn,{children:e.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:n($e,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n($e,{handle:"terms-of-service",tone:"monochrome"})})})});return n(at,{...x,children:n(_i,{id:"smsMarketingOptInDisclosure",open:c.value,summary:n(pt,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:g,checked:c.value,onChange:V,"aria-controls":"smsMarketingOptInDisclosure"}),content:n(C,{gap:"base",paddingBlockStart:"base",children:[n(ys,{countryCode:p.value??"",label:e.translate("marketing.sms.mobile_phone_number"),disabled:T.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...c.value?H:{}}),F]})})})}Wa.displayName="PhoneMarketingOptIn";const $a=vn({displayName:"ShopPayVerificationSwitch",load:()=>Qn(()=>sn(()=>import("./component-ShopPayVerificationSwitch.B9MWXlPd.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,36])))}),Zs="rdvNk",er={MobilePhoneIcon:Zs};function nr({onClick:e}){const{i18n:t}=_();return n(_e,{variant:"primary",accessibilityLabel:t.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:n("div",{className:er.MobilePhoneIcon,children:n(ae,{type:"mobile",size:"large"})})})}function Ga(){const e=gi({key:"india_phone_autofill",variants:[we.Control,we.Treatment]}),t=Ka()===we.Treatment;return e||(t?we.Treatment:we.Control)}function tr(){const e=Ka();return e===we.Control||e===we.Treatment}function Ka(){const{client:e}=_();return e.unstable_getSerialization("experiments")?.find(({clientHandle:t})=>t===fs)?.variant}function ar(e,t,a="PHONE"){const{phone:o}=z(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:s,emailInputError:r}},wallets:l}}=_(),c=l.activeSession.value;va(p=>{if(a!=="EMAIL"&&p.type==="error"){for(const h of p.violations)if(!(h.__typename!=="UnprocessableTermViolation"||!Zt.has(h.code)||xa(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 ea(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),un(o,d,a==="PHONE"?e:void 0)}function or(){return document.cookie.includes("_tracking_consent=")}function ir(){const{email:e}=z();Ae(()=>{ut(e.value,"invalid")==="invalid"||or()})}function qa({emailInput:e,email:t,isShopPayUnauthenticatedUser:a}){const{shopPay:o}=_(),i=ee(""),s=a?dn.C1ModalShopPay:void 0,[r,l]=re(s),[c,u]=re(!1),[d,p]=re(!1),h=t.trim(),v=X((m,f)=>{f&&(i.current=f),a||p(!m),u(m)},[a,i]);return Ae(()=>{const m=o.session.verificationTrigger.value;m&&(v(!0),o.session.unstable_updateVerificationTrigger(null),a&&[On.LoginLink,On.ErrorModalClearEmail].includes(m.source)&&(l(dn.C1ModalShopPaySignIn),m.source===On.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 sr="iWrC7",rr="aDczq",lr="oMR3v",xn={AccessoryContainer:sr,TooltipTriggerHidden:rr,SavedLabel:lr},cr=kn("EmailFieldAccessory");function ur({saved:e}){const{i18n:t}=_(),a=Pn(void 0,cr),o=t.translate("contact.field_saved_label"),[i,s]=re(!1);return K(()=>{if(e)return De({content:o,role:"status"})},[e,o]),n("span",{className:xn.AccessoryContainer,children:[n(ya,{className:e?xn.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(ae,{type:"question"})}),e?n("span",{className:xn.SavedLabel,"aria-hidden":!0,children:n(D,{type:"small",tone:"neutral",children:o})}):null,n(_a,{id:a,children:t.translate("contact.field_tooltip_helper_text")})]})}const dr=2e3;function Bt(e){return(e??"").trim().toLowerCase()}function pr(e,t){const a=oe(()=>Bt(e),[e]),o=oe(()=>Bt(t),[t]),[i,s]=re(!1),r=ee(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),dr);return()=>clearTimeout(u)},[a,o]),i}function hr({fieldProps:e,countryCode:t,combinedFieldRendered:a,fieldIsEmpty:o}){const i=Sn(),s=Ga(),r=tr(),l=t==="IN"&&a,c=ee(void 0),u=ee(void 0);l&&(c.current??=e.autocomplete??"none",u.current??=o);const d=ee(!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 Ya="contact-information-text-field-container",mr=`#${Ya}`;function vr({onInputTypeChange:e,onInlineEmailValidation:t,onInlinePhoneValidation:a}){const o=tn(),{inMemoryPayPalParts:{accountStatus:i}}=Ee(),{i18n:s,observability:r,shop:l,shopPay:c,checkout:u,source:d}=_(),p=c.user.isUnauthenticatedUser.value,h=yn(),v=dt(),{email:m,phone:f,smsMarketingPhone:g}=z(),k=m.value,M=f.value,[P,b]=re(m.peek()??""),[S,E]=re(!h.value&&f.peek()!==""&&(m.peek()===""||!m.peek())&&!p?"PHONE":"EMAIL"),[T,V]=re(0),W=s.translate("contact.email_or_phone_label"),H=s.translate("field_errors.email_or_phone_invalid"),x=ar(a,H,S),F=na(l,v.value),y=h.value||p||!F.includes("PHONE"),L=Ga(),N=P===""&&!k,$=L===we.Treatment&&v.value==="IN"&&!y&&N?"tel":"email";function R(ve,ye){if(S==="EMAIL"&&(b(ve),p&&O(dn.C1ModalShopPay)),!y)if(ye!=null&&V(ye),ve==="")E("EMAIL"),qe(()=>{f.value="",m.value="",S==="PHONE"&&(g.value="")}
2),r?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const Se=/([A-Za-z]|\.|@)/.test(ve);Se&&S!=="EMAIL"?(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),qe(()=>{f.value="",m.value=ve,g.value=""}),E("EMAIL")):!Se&&S!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),m.value="",f.value=ve,E("PHONE"))}}K(()=>{r.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[r]),K(()=>{e&&e(S)},[e,S]),K(function(){if(y){S!=="EMAIL"&&E("EMAIL");return}const ye=k!=null&&k!=="",Se=M!=null&&M!=="";if(!ye&&!Se&&S!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),E("EMAIL");return}if(ye&&S!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),E("EMAIL");return}!ye&&Se&&S!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),E("PHONE"))},[k,S,r,y,M]);const ie=ee(!0);K(function(){const ye=ie.current;ie.current=!1,(!F.includes("PHONE")||p)&&S!=="EMAIL"&&(E("EMAIL"),k===""&&M!==""&&(f.value="",ye||(m.value=M)))},[F]),ta(async({reason:ve,parts:ye})=>ve!=="progression"?{behavior:"allow"}:{behavior:"allow",perform(){const Se=ye.phone.peek();Se!==""&&ye.deliveryLines.peek().forEach(Ct=>{const It=Ct.peek();Ct.value={...It,deliveryMethodOptions:{...It.deliveryMethodOptions,phone:Se}}})}});const se=Fa(),{modalUrlOrigin:ne,modalUpdatedOrigin:w,shopPayVerificationVisible:B,showShopPayVerificationToggle:U,showShopPayVerification:te,setModalUpdatedOrigin:O,setShowShopPayVerificationToggle:J}=qa({emailInput:P,email:m.value,isShopPayUnauthenticatedUser:p}),q=ee(null),fe=fr(y?void 0:H,S==="PHONE"?yr:t,S),Ve=Zn().current.value.contactInfo?.email,le=pr(k??"",Ve),G=d.isAbandonedCheckoutSupported&&S==="EMAIL"&&!(se.value&&U)?n(ur,{saved:le}):void 0,he=_s({countryCode:v.value??"",label:W,onInputValueChange:R,caretPosition:T,inputMode:"text",disableFormatting:!0,required:!0,...x}),wn=y?void 0:{label:W,type:"text",caretPosition:T,inputMode:"text"},Ze=_r({email:fe,ref:q,addressType:u.isShippingRequired.value?"shipping":"billing",disabled:i.value.status==="loading",required:!0,accessory:G,contactAutocompleteType:$,...wn,onInputValueChange:R}
2),Dn=S==="PHONE"?he:Ze,A=S==="PHONE"?M==null||M==="":N,{isEnabled:He,impressionFeatures:rn,fieldProps:Ne}=hr({fieldProps:Dn,countryCode:v.value,combinedFieldRendered:!y,fieldIsEmpty:A}),kt=se.value&&U?n(nr,{onClick:()=>{te(!0),p&&O(dn.C1ModalShopPay)}}):null,Co=se.value?n(Q,{when:o,children:n($a,{popoverActivator:q,popoverAnchorSelector:mr,email:P,onSetEmail:ve=>{fe.onInput(ve),R(ve),fe.onChange(ve)},open:B,showPopover:te,showToggle:J,urlOrigin:ne,updatedOrigin:w})}):null,St=S==="PHONE"?"phone":"email",Io=n(C,{gap:"small-400",children:[n(ge,{id:Ya,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[n(ga,{...Ne,id:St,error:!!Ne.error,segment:kt?"start":void 0}),kt]}),typeof Ne.error=="string"&&Ne.error?n(pn,{controlID:St,children:Ne.error}):null]});return n("div",{children:[n(Ra,{impressionType:"contact_autocomplete_hint",impressionFeatures:rn,enabled:He,children:Io}),Co]})}function yr(){}function _r({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}=_();K(()=>{if(l!==void 0&&e.current&&t?.value&&l<t.value.length)try{e.current.setSelectionRange(l,l)}catch{}},[t.value,l,e]),ir();function m(){return v.userVerification.value.status==="loading"?n(ot,{size:"small"}):p}return{label:s??h.translate("contact.email_label"),id:"email",name:"email",type:u,ref:e,autocomplete:fi([a,o]),disabled:i,inputMode:c,...t,onInput:async f=>{const g=f.trim();t.onInput(g),r?.(g,gr(e.current)??0)},error:t.error,autoCapitalize:u==="text"?"off":void 0,accessoryEnd:m(),required:d}}function gr(e){try{return e?.selectionStart}catch{}}function fr(e,t,a="EMAIL"){const{email:o}=z(),{i18n:i,checkout:{validation:{contactErrors:{emailInputError:s,phoneInputError:r}},wallets:l},observability:c}=_(),{inMemoryApplePayParts:{asPaymentMethod:u,isLoadingPaymentSheet:d},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=Ee();va(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 f of m.violations){if(f.__typename!=="UnprocessableTermViolation"||!Zt.has(f.code)||xa(f.target))continue;const g=e||(f.localizedMessage??f.nonLocalizedMessage);s.value=g,r.value=void 0}});const h=ce(void 0),v=l.activeSession.value?h:s;return ea(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 f=$n(m,i.translate("field_errors.email_blank")),g=ut(m,i.translate("field_errors.email_invalid"));return f||g},Jn.InvalidContactMethod),un(o,v,a==="EMAIL"?t:void 0)}const br="â¢";function ja({showLogoutLink:e,logoutUrl:t}){const{i18n:a,shopPay:o,observability:i,source:s}=_(),r=ue().buyerIdentity.value,{firstName:l,lastName:c,email:u,phone:d}=r?.customerProfile??{},p=r?.purchasingCompany?.company.name,h=Fa(),v=s.type==="simulated",m=l||c,{phone:f}=z(),g=u??d,k=!p&&g?` (${g})`:"",{modalUrlOrigin:M,modalUpdatedOrigin:P,shopPayVerificationVisible:b,showShopPayVerification:S}=qa({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return K(()=>{i.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${!!u}, hasPhone: ${!!d}`),r?.purchasingCompany||(f.value="")},[]),n(j,{children:[n(C,{direction:"inline",alignItems:"center",gap:"base",children:n(C,{gap:"small-400",children:[n(D,{children:m?`${a.translate("general.display_name",{firstName:l??"",lastName:c??""})}${k}`:k}),p?n(C,{direction:"inline",gap:"small-400",children:[n(D,{color:"subdued",type:"small",children:p}),u&&n(j,{children:[n(D,{color:"subdued",type:"small",children:br}),n(D,{color:"subdued",type:"small",children:u})]})]}):null,e&&!v?n(C,{direction:"inline",gap:"base",children:n(pe,{href:t,children:a.translate("customer_account.sign_out_link_label")})}):null]})}),u&&h.value&&n($a,{email:u,open:b,showPopover:S,urlOrigin:M,updatedOrigin:P})]})}ja.displayName="CustomerCard";function Pr(){const{i18n:e}=_();return n(D,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:n($e,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:n($e,{handle:"terms-of-service",tone:"monochrome"})})})}const kr="ZZ";function Qu({hideAllOptIns:e=!1,hideContactInfoEntry:t=!1,hideCustomerCard:a=!1,showEmailMarketingOptIn:o=!0,onValidateEmailInput:i}){const s=ue(),r=s.buyerIdentity.value?.customerProfile,l=bi().value,u=tt()?.smsMarketingEnabled===!1,{client:d,checkout:p,i18n:h,checkout:{validation:{contactErrors:{emailInputError:v,phoneInputError:m}},wallets:f},shop:g}=_(),{emailMarketing:k,contactInfoOptions:M}=g,P=d.unstable_getSerialization("logoutUrl")||"",{isContact:b}=Ks().value,{showEmailMarketing:S}=p.configuration.visibility,E=g.hasFlagEnabled(Fo),{value:T}=s.buyerIdentity,V=T?.countryCode,[W,H]=re(o&&Ft({emailMarketing:k,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:E,buyerCountryCode:V,customerProfile:r,showEmailMarketing:S})),[x,F]=re(!1),y=dt(),{validatePhoneNumber:L}=us(),{negotiate:N}=ke(),$=X(le=>{H(o&&Ft({emailMarketing:k,inputType:le,hideNonEuropeMarketingOptInFlagEnabled:E,buyerCountryCode:V,showEmailMarketing:S})),F(!1)},[k,E,V,o,S]),R=Gs(),ie=X(le=>{const G=$n(le,R.value),he=ut(le,h.translate("field_errors.email_invalid"));return G||he||i?.(le)},[R,i,h]),se=X(le=>{const G=$n(le,h.translate("field_errors.email_or_phone_blank"));if(G)return F(!G),G;const he=L(le,y.value??kr)?void 0:h.translate("field_errors.address_phone_blank");return F(!he),he},[h,L,y]),ne=Sn(),w=Pi(),B=X(({contact:le})=>{f.activeSession.value||N({silenceViolations:["all"],include:[],fieldsToResolve:[...ki]}),le.value=!0,ne("sectionComplete",{section:"contact",timestamp:new Date}),w({type:"section_complete",section:"contact"})},[f,N,ne,w]),U=X(({contact:le})=>{le.value=!1},[]),{email:te,phone:O}=z(),J=oe(()=>({state:{phone:O,email:te},errors:{phone:m,email:v}}),[te,v,O,m]),q=yn(),fe=g.hasFlagEnabled(gn)?na(g,y.value):M,Re=q.value||!fe.includes("PHONE"),Ve=!r?.email&&!r?.phone||Re&&!r?.email;return n(Jt,{children:n(Cn,{target:"cart.buyerIdentity",children:[r&&!a&&n(ja,{showLogoutLink:l,logoutUrl:P}),!t&&Ve&&n(at,{...J,children:n(ds,{onValid:B,onInvalid:U,children:n(vr,{onInputTypeChange:$,onInlineEmailValidation:ie,onInlinePhoneValidation:se})})}),!e&&n(j,{children:[x&&!u?n(Pr,{}):null,o&&W?n(za,{}):null,b&&n(Wa,{})]})]})})}
2function Ft(e){const{emailMarketing:t,inputType:a,hideNonEuropeMarketingOptInFlagEnabled:o,buyerCountryCode:i,customerProfile:s,showEmailMarketing:r}=e,l=o&&!Ro(i);return r&&t!=="OFF"&&a==="EMAIL"&&!l&&!s?.acceptsEmailMarketing}function Xa(){const e=Si(),{editorSetShopPaySignal:t}=_n(),a=X(o=>t.value?.setShopPay(o),[t]);return{setEditorShopPay:e&&t.value?a:void 0}}function Sr(e){return t=>t?e[t]:void 0}function Cr(){const{checkout:e}=_(),t=ps();return I(()=>t.value&&e.configuration.visibility.showExpressCheckout.value)}function Ir(){const e=Ci(),t=Cr();return I(()=>e.value?"wallets":t.value?"skeleton":"hidden")}const Lr="vT2w7",Ar="f1x20",Mr="hKWGx",Rt={ApplePayButton:Lr,dark:Ar,light:Mr},Er=vn({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>n(Nr,{...e}),useError:wr,load:()=>Qn(()=>sn(async()=>{const{ApplePayButton:e}=await import("./component-ApplePayButton.DfYxt3Dn.js");return{ApplePayButton:e}},__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,38,39,40,41,42,43,44,12,13,14,30,31,20,32,33,27,45,11,15,16,17,18,19,21,22,23,24,25,46,47,48,49,26,50,51,52,53,28,29,54,55,56])).then(({ApplePayButton:e})=>e))});function Tr(e){const{source:t}=_(),{buttonStatus:a,sessionLoadFailed:o}=Ee().inMemoryApplePayParts;return Ms("ApplePay",t.type!=="simulated"&&a.value.status==="not_rendered"&&!o.value),n(Er,{...e})}function Nr({color:e}){const{i18n:t}=_();return n("button",{className:Pe(Rt.ApplePayButton,Rt[e],aa.borderRadius,fn({focusRing:"base"})),lang:t.locale,disabled:!0,type:"button","aria-label":t.translate("brand.apple_pay")})}function wr(e){const{observability:t}=_(),{buttonStatus:a}=Ee().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 Dr=vn({displayName:"PortableWalletsPCIButtonContent",load:()=>sn(()=>import("./component-amazonWalletLazy.DHzdkYWT.js"),__vite__mapDeps([57,1,6,2,3,4,5,7,8,9,10,58,13,59,60,61,62])).then(e=>e.PortableWalletsPCIButtonContent),useError:hs});function Or(e){return n(Dr,{...e})}const xr="Xicuw",Vt={Button:xr,"Button--contrast":"oHCaH"},Br="shop-pay-button";function Fr(){const{shopPay:e,observability:t,checkout:{wallets:a}}=_(),o=e.app.config,i=Cs(be.ShopifyPay),s=os({foregroundColor:ws}),r=Ds(),l=Vo(o,r),c=cs(Ho.DirectCheckoutCheckout),u=Ii(),d=Li(be.ShopifyPay),{setEditorShopPay:p}=Xa();K(()=>{t.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})},[t]);const h=X(()=>{i(Gn.Success),d(),a.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),a.clearActiveSession({invokingWallet:"SHOP_PAY"})},[a,d,i]),v=X(f=>{if(p){f.preventDefault(),p(!0);return}h()},[h,p]),m=Pe(Vt.Button,{[Vt["Button--contrast"]]:!s&&!l},aa.borderRadius,fn({focusRing:"base"}));return n("a",{id:Br,href:c,ref:u("shop_pay"),className:m,onClick:v,children:e.logoBrand==="shop"?n(is,{size:"medium"}):n(Ps,{size:"medium"})})}function Rr(){const e=Ee();return I(()=>Uo.some(t=>Vr(e,t)))}function Vr(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 Le.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case Le.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();return a&&o?.status==="not_rendered"}function Hr(){const{source:e}=_(),t=Rr(),a=e.type==="simulated";return I(()=>!a&&t.value)}function Ur(){const{i18n:e}=_();return n(In,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:n(C,{gap:"large-200",padding:"large-200",children:[n(je,{level:1,children:e.translate("wallets.payment_in_progress_t
2itle")}),n(D,{children:e.translate("wallets.payment_in_progress_body")})]})})}const zr="o1z23",Wr="_4aXW0",$r="DUnBb",Gr="kTI19",Kr="JH5oc",qr="Athif",Yr="pUo2R",jr="_5SdgT",Xr="RKgRy",Qr="iRnuh",Jr="QKTth",Zr="Pnahu",el="OTERX",nl="WTXfy",tl="qLVAT",al="XHLFs",ol="xBRI9",Z={Header:zr,Text:Wr,Layout:$r,StackWrapper:Gr,SkeletonWrapper:Kr,SkeletonExited:qr,ButtonWrapper:Yr,loading:jr,subsequentLoad:Xr,Stack:Qr,SimulatedWalletStack:Jr,ShopPayEmphasis:Zr,Container:el,DrawerLink:nl,InnerDrawerLink:tl,DrawerHideButtons:al,walletItem:ol},mt="express-checkout-heading";function Qa({buttonCount:e,footer:t,children:a}){const{i18n:o}=_();return n(Y,{className:Z.Container,"data-count":e,children:[n("div",{className:Z.Header,children:n(Ai,{id:mt,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 Ja({count:e,transition:t,shopPayEmphasis:a=!1,hideWallets:o=!1}){const{client:i}=_(),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(Mi,{delay:s},r))})}const il="express-checkout-wallets-wrapper",sl=/(iPhone|iPod|iPad|Mac OS)/i,rl=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,ll=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function cl(){const{client:{userAgent:e},embed:t}=_(),a=rl.test(e),o=sl.test(e)&&ll.test(e),i=t!==void 0&&(t.platform==="SWIFT"||t.platform==="REACT_NATIVE_SWIFT");return!(o||a||i)}function ul(){const{source:e}=_(),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}=Ee(),p=d.value;return oe(()=>p.flatMap(h=>{switch(h.name){case"PAYPAL_EXPRESS":return Ue(i,be.PayPalV6);case"VENMO":return Ue(s,be.Venmo);case"GOOGLE_PAY":return Ue(r,be.GooglePay);case"SHOP_PAY":return Ue(u,be.ShopifyPay);case Le.AmazonPay:return Ue(l,Le.AmazonPay);case Le.BuyWithPrime:return Ue(c,Le.BuyWithPrime);case"APPLE_PAY":return Ue(a,be.ApplePay,()=>!t&&!o.value);default:return[]}}),[a,o,p,l,c,r,t,i,u,s])}function Ue(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 dl(e){const{observability:t}=_(),a=ee(performance.now()),o=oe(()=>e.filter(({walletName:r})=>r!==be.ShopifyPay),[e]),i=ee(new Set),s=me(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 pl({buttonCount:e,children:t,walletPaymentMethods:a}){const[o,i]=re(performance.now()),[s,r]=re(!0),l=cl(),c=tn(),{inMemoryApplePayParts:{paymentSheetError:u}}=Ee(),d=Hr().value,p=ul();Ts(p),dl(p);const h=ue().managedByMarketsPro,v=Ei(d,"base"),[m,f]=re(!1),g=yn(),{checkout:k,i18n:M,shop:{id:P},source:b,observability:S,userEvents:E}=_(),T=Ti(),V=I(()=>c.value&&zo({hasSubscription:oa({checkout:k}),isApplePayAvailable:a.value.some(({name:L})=>L==="APPLE_PAY"),variant:T})==="full_express_agreement"),W=Is();Ls(a.value,e);const H=X((L,N)=>{const $=parseInt(Ye(P),10),R=As({state:N,shopId:$,nascarData:{...L,walletsRenderedCount:e},paymentMethods:a.value});R&&E.monorailEvent(R)},[P,E,e,a]),F=a.value.some(L=>L.name==="SHOP_PAY")&&l;!d&&!m&&(f(!0),i(L=>performance.now()-L)),K(()=>{m&&S.histogram({name:"wallets_container_render_time",value:o})},[m,S,o]);const y=ee(!1);return K(()=>{b.type!=="simulated"&&v==="exited"&&!y.current&&(y.current=!0,performance.mark(Wo))},[b,v]),n(j,{children:[n(Qa,{buttonCount:e,footer:n(j,{children:[n("div",{className:Z.DrawerLink,children:n(pe,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{s?(r(!1),H(W.value,Gn.NascarDrawerOpen)):(r(!0),H(W.value,Gn.NascarDrawerClose))},children:n("div",{className:Z.InnerDrawerLink,children:[n(D,{children:s?M.translate("alternative_payment_method_banner.show_more_options"):M.translate("alternative_payment_method_banner.hide_more_options")}),n(ae,{type:s?"chevron-down":"chevron-up",size:"small-200"})]})})}),n(Q,{when:g,children:n(Ns,{isForExpressCheckout:!0,showFullSubscriptionConsent:V})}),n(Q,{when:h,children:n(C,{gap:"base",padding:"large-100 none none none",children:n(Os,{textProps:{color:"subdued",size:"small"}})})})]}
2),children:[n(Ja,{count:Math.min(e,4),transition:v,shopPayEmphasis:F,hideWallets:s}),n("ul",{id:il,role:"list",className:Pe(Z.Stack,Z.ButtonWrapper,{[Z.loading]:d,[Z.subsequentLoad]:d&&m,[Z.DrawerHideButtons]:s,[Z.ShopPayEmphasis]:F}),children:c.value&&t})]}),u?.value?.type==="payment_cancelled_while_processing"&&n(Ur,{})]})}function Za(){const{i18n:e}=_(),{divider:{borderStyle:t,borderWidth:a}}=Ni(),{main:{divider:{borderStyle:o=t,borderWidth:i=a}={},section:s,spacing:r}}=it(),l=$o(s);return n(Y,{padding:l?`@media (inline-size >= extraSmall) ${r?At(r):"large-200"} none, ${r?At(r):"base"} none`:"large-100 none large-300 none",children:n(We,{borderStyle:o,borderWidth:Go(i),children:n(Me,{textAlign:"center",children:n(D,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}const Ht=3;function hl(){return n(j,{children:[n(Ge,{accessibilityLabelledBy:mt,children:n(Qa,{buttonCount:Ht,children:n(Ja,{count:Ht,shopPayEmphasis:!0})})}),n(Za,{})]})}const ml="_2SmAP",vl="eFu6h",eo={MessageWrapper:ml,SimulatedWalletWrapper:vl},yl=e=>e,Ju=Lo(function(){const{i18n:t,source:a}=_(),o=a.type==="simulated",{acceleratedWalletPaymentMethods:i,buttonCount:s}=Ee(),r=wi(),l=Ir(),{setEditorShopPay:c}=Xa(),{expressCheckout:{button:{cornerRadius:u}={}}}=it(),d=xe("Checkout::Dynamic::Render","WALLETS1"),p=Di(),h=o&&p.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return n(hl,{})}const v=n("li",{className:Z.walletItem,children:n(Y,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:eo.MessageWrapper,children:n(D,{color:"subdued",children:t.translate("payment.simulated_express_checkout")})})});return n("div",{style:{...gl(u)},children:[n(Ge,{accessibilityLabelledBy:mt,children:n(st,{sectionId:"expressCheckout",children:n(Oi,{section:"expressCheckout",children:[n(Be,{customizations:d,gap:"large-200",render:yl}),d.length>0&&n(fa,{blockSize:"large-200"}),n(pl,{buttonCount:h?1:s,walletPaymentMethods:i,children:h?v:n(_l,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:o,preserveShopPay:!!c})})]})})}),n(Za,{})]})});function _l({paymentMethods:e,triggerProgression:t,isSimulated:a,preserveShopPay:o}){const i=ba(),s=ks();return n(j,{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(Y,{className:eo.SimulatedWalletWrapper,children:n(Y,{className:Pe([Z.walletButton,Z.Stack,Z.SimulatedWalletStack]),inert:!0,children:n(Ut,{method:r,triggerProgression:t})})}):n(Ut,{method:r,triggerProgression:t})},`${r.name}-${i}-${s.value}`)})})}function gl(e){return e&&{"--x-express-checkout-button-border-radius":Sr(Ko.borderRadius)(e)}}function Ut({method:e,triggerProgression:t}){const a=ba();switch(e.name){case"APPLE_PAY":return n(Tr,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return n(Nt,{progressToNextPage:t});case"VENMO":return n(Nt,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:t});case"SHOP_PAY":return n(Fr,{});case"GOOGLE_PAY":return n(Ss,{});case Le.AmazonPay:return n(ms,{});case Le.BuyWithPrime:return n(Or,{wallet:Le.BuyWithPrime});default:return null}}const fl=["ApplePay","GooglePay","PayPal","Venmo"];function Zu({id:e}){return Es({id:e,stage:({pendingComponents:t})=>fl.some(o=>t.has(o))?Tt.Usable:Tt.Complete}),null}function ed(){const e=ue(),t=e.buyerIdentity.value?.customerProfile,{i18n:a}=_(),o=xi().value,{value:i}=e.buyerIdentity,s=z().rememberMe,r=!!i?.rememberMe||s.value,l=ce(r),{negotiate:c}=ke(),d=tt()?.saveShippingAddressCheckboxEnabled??!0,p=!!t,h=z().shippingAddress.value,v=!o&&d&&!p&&!h.oneTimeUse,m=X(f=>{l.value=f,s.value=f,c({})},[c,s,l]);return v?n(pt,{id:"save_shipping_information",name:"save_shipping_information",checked:l.value,onChange:m,label:a.translate("customer_account.save_my_information_label")}):null}function bl(e,t){return t.some(a=>e.includes(a))}function Pl({options:e,selected:t,select:a}){const{i18n:o,source:i}=_(),s=i.type==="simulated",r=ue(),l=r.deliveryNext,c=r.paymentLines,u=Xe("deliveryNext"),d=I(()=>{const p=et(l.value,"ONE_TIME_PURCHASE"),h=ia(c?.value?.lines,"APPLE_PAY")!==void 0,v=p?.status==="available"&&!u.value&&p.hasDeliveryLineChange;return!h&&v});return n(j,{children:[n(Q,{when:d,children:()=>n(Ke,{tone:"warning",errorType:Qe.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),s&&e.map(p=>n(st,{sectionId:`deliveryMethods-${p.id}`},p.id)),n(ht,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:t,onChange:a,children:e.map(p=>n(Mn,{value:p.id,accessibilityLabel:p.label,secondaryContent:n(ae,{type:p.icon,tone:bl(t,p.value)?"accent":void 0}),children:p.label},p.id))})]})}const no=Ao(null);function kl(){return Mo(no)}var Ce={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 Sl({name:e,label:t,labelAccessibilityVisibility:a="visible",contentDirection:o="auto",selected:i,onChange:s,children:r}){const l=X(p=>s(p),[s]),c=oe(()=>({name:e,selected:i,select:l,contentDirection:o}),[e,i,l,o]);let u;t&&a==="exclusive"?u=n("legend",{className:fn({screenReaders:"only"}),children:t}):t&&(u=n("legend",{className:Ce.Legend,children:n(je,{level:3,accessibilityRole:"presentation",children:t})}));const d=n("div",{className:Ce.Segments,"data-choice-list-segmented-part":"control",children:r});return n(no.Provider,{value:c,children:t?n("fieldset",{className:Ce.Fieldset,children:[u,d]}):d})}function Cl({value:e,children:t,icon:a,secondaryContent:o,accessibilityLabel:i}){const s=kl(),r=Bi();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(Ce.ChoiceSegmented,p&&Ce.ChoiceSegmentedSelected,r&&Ce.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:Ce.Input,onChange:()=>u(e)}),n("span",{className:Pe(Ce.PrimaryContent,Ce.contentDirectionVariant[d]),children:[a&&n(ae,{type:a,color:"strong"}),n(D,{type:"strong",children:t})]}),o&&n(D,{color:"subdued",children:o})]})}function Il(){const{i18n:e}=_(),t=ue(),a=Xe("deliveryNext").value,o=et(t.deliveryNext.value,"ONE_TIME_PURCHASE"),i=t.paymentLines?.value?.lines,s=ia(i,"APPLE_PAY")!==void 0,r=o?.status==="available"&&!a&&o?.hasDeliveryLineChange;return!s&&r?n(Ke,{tone:"warning",errorType:Qe.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const Ll="qX6SV",Al={Wrapper:Ll},Bn="PICK_UP_AND_SHIP";function Ml(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:Eo(e)}}function El(e){return e.id==="PICK_UP"||e.id==="SHIPPING"}function Tl({options:e,selectedIndex:t,select:a}){const{i18n:o,observability:i}=_(),s=X(c=>{c!==Bn&&a([c])},[a]),r=e.filter(El),l=ee(!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(Al.Wrapper,fn({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":t},children:n(Pa,{name:"delivery_strategies",value:Bn,onChange:s,children:[n(Wn,{value:Bn,children:o.translate("split_delivery.pickup_and_ship")}),r.map(({id:c})=>n(Wn,{value:c,children:Ml(c,o)},c))]})})}function Nl(e){const{source:t,userEvents:a,shop:{id:o},checkout:{identity:i}}=_(),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(Ye(o),10),numberLocationsFound:d,userId:r?.id?parseInt(Ye(r.id),10):void 0,checkoutSurface:s?"shop_pay":"guest_checkout"}})}return{deliveryMethodSelectorClickEvent:l}}const wl="SnB3D",Dl="_207IL",Ol="wvTT8",Fn={Entrance:wl,SplitCollapse:Dl,PillViewTransition:Ol},xl=16;function Bl({options:e,selected:t,select:a,showChangedBanner:o=!0}){const{i18n:i,source:s}=_(),r=s.type==="simulated",l=ue(),{value:c}=l.deliveryNext,u=on(),d=et(c,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:p}=Nl(d),h=I(()=>!u.value),v=ce(!1);Xn(()=>{let P=u.peek();return To(()=>{const b=u.value;P&&!b&&(v.value=!0),P=b})},[u,v]);const m=X(()=>{v.value=!1},[v]),f=X(([P])=>{if(!P||t.value.includes(P))return;const b=e.value.findIndex(T=>T.id===t.value[0]),E=e.value.findIndex(T=>T.id===P)>b?"delivery-slide-end":"delivery-slide-start";bs(()=>{a([P])},[E]),p(P)},[a,t,p,e]),g=I(()=>e.value.findIndex(P=>P.id===t.value[0])),k=I(()=>e.value.length),M=I(()=>e.value.some(P=>P.label.length>xl));return n("div",{className:Fn.Entrance,children:[o&&n(Il,{}),r&&n(Vn,{each:e,getKey:P=>P.id,children:P=>n(st,{sectionId:`deliveryMethods-${P.id}`})}),n(Q,{when:h,fallback:n(Tl,{options:e.value,selectedIndex:g.value,select:a}),children:n("div",{style:{"--selected-index":g.value,"--option-count":k.value},className:Pe(Fn.PillViewTransition,{[Fn.SplitCollapse]:v.value}),onAnimationEnd:m,children:n(Sl,{name:"delivery_method",label:i.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:t.value[0],onChange:P=>f([P]),contentDirection:M.value?"block":"auto",children:n(Vn,{each:e,getKey:P=>P.id,children:({id:P,label:b,icon:S})=>n(Cl,{value:P,icon:S,children:b})})})})})]})}function nd(){const e=Fi();if(!e)return null;const{variant:t,...a}=e;return t==="next"?n(Bl,{...a}
2):n(Pl,{options:a.options.value,selected:a.selected.value,select:a.select})}function Kn({message:e}){return e?n(Ke,{errorType:Qe.DeliveryError,tone:"critical",children:n(C,{alignItems:"start",gap:"small-500",children:n(D,{children:e})})}):null}function Fl(){const{i18n:e,url:t,client:a}=_(),o=a.unstable_getSerialization("apiClientId"),i=ka(o),s=z().shippingAddress.value,{href:r,onClick:l}=Ri(),{countryName:c,loading:u}=rt(s),{hasViolations:d}=Ie(sa);if(!d)return null;if(i)return n(Kn,{message:n(j,{children:e.translate("merchant_redirect.shop_app_not_supported",{storefront_link:n(pe,{href:t.storefront(),children:e.translate("contact.storefront_link")})})})});const p=u?s.countryCode:c;return n(Kn,{message:n(j,{children:e.translate("payment_errors.payment_method_not_supported",{country:p,checkout_as_guest_link:n(pe,{href:r,onClick:l,children:e.translate("account_management.checkout_as_guest_link")})})})})}function to(){const{negotiate:e}=ke(),{deliveryLines:t,merchandiseLines:a,discountLines:o}=z();return i=>{ra({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}}=_(),{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=oe(()=>a.map(h=>{if(h)try{return parseInt(Ye(h),10)}catch{return}}).filter(h=>h!==void 0),[d]);return X(h=>{const v={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt(Ye(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 zt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function qn({merchandiseLines:e,bannerType:t,allowAlternativeAction:a}){const{i18n:o}=_(),i=Sa(),s=to(),r=Fe(),l=Va(),c=t==="pickup",u=Array.from(new Map(e.value.map(y=>[y.stableId,y])).values()),d=u.map(({stableId:y})=>y),p=new Map;for(const y of u){const L=p.get(y.digest);L?p.set(y.digest,{...L,quantity:L.quantity+y.quantity}):p.set(y.digest,y)}const h=Array.from(p.values()),v=u.reduce((y,{quantity:L})=>y+Math.max(1,L),0),m=c?"SHIPPING":"PICK_UP",{deliveryMethodsByMerchandise:f}=r.value,g=u.filter(({stableId:y})=>f[y]?.includes(m)),k=g.map(({stableId:y})=>y),M=g.reduce((y,{quantity:L})=>y+Math.max(1,L),0),P=(a?.value??!0)&&!l.value&&k.length===d.length&&M>0,b=Rl({allLinesAlternativeEligible:P,isPickupBanner:c,variantIds:u.map(y=>y.variantId)});if(u.length===0)return null;const S=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}),E=P?o.translate("split_delivery.inventory_issue_banner.remove_item",{count:v}):o.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:v}),T=c?o.translate("split_delivery.inventory_issue_banner.ship_separately",{count:M}):o.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:M}),V=h.map(({title:y,subtitle:L,quantity:N})=>{const $=L?`${y} / ${L}`:y;return N>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:$,quantity:N}):$}).join(", "),W=()=>{b("remove_items"),s(d),zt(o.translate("split_delivery.accessibility.status.remove_items",{items:V}))},H=()=>{b("switch_delivery_method"),i({targetDeliveryMethodType:m,merchandiseStableIds:k}),zt(c?o.translate("split_delivery.accessibility.status.ship_separately",{items:V}):o.translate("split_delivery.accessibility.status.pickup_in_store",{items:V}))},x=n(pe,{onClick:W,children:E});let F=x;if(P){const y=n(pe,{onClick:H,children:T});F=c?n(j,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:y,remove_items_link:x})}):n(j,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:y,remove_items_link:x})})}return n(Ke,{tone:"critical",errorType:Qe.DeliveryError,heading:S,children:n(C,{gap:"small-300",children:[n(Ca,{gap:"small-300",children:h.map(({stableId:y,title:L,subtitle:N,quantity:$})=>{const R=N?`${L} / ${N}`:L;return n(Ia,{children:$>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:R,quantity:$}):R},y)})}),n(D,{children:F})]})})}function Hl(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 Ul(e,t){return e.length===0?!1:t==="PICK_UP"?e.every(a=>a==="SHIPPING"||a==="LOCAL"):e.every(a=>a==="PICK_UP")}
2function zl({violationLines:e,deliveryMethodType:t,proposedDeliveryLines:a,proposedMerchandiseLines:o}){const i=new Set(a.filter(r=>Ul(r.value.deliveryMethodTypes,t)).flatMap(r=>r.value.targetMerchandiseLines??[]).map(r=>r.stableId)),s=o.length>0;return e.filter(r=>{const l=qo(o,r.stableId),c=l?.stableId??r.stableId;return!(i.has(r.stableId)||i.has(c)||s&&l==null)})}const Wl=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function ao(e){const{shop:{shipPickupInOneOrderEnabled:t}}=_(),{allViolations:a,merchandiseLines:o,deliveryNext:i}=ue(),s=Fe(),r=on(),{deliveryLines:l,merchandiseLines:c}=z();return I(()=>{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"?$l({canUseDeliveryMethodScopedViolations:p,state:d}):p?Gl({deliveryMethodType:e.deliveryMethodType,state:d}):Yn()})}function Yn(){return{merchandiseLines:[],allowAlternativeAction:!1}}function $l({canUseDeliveryMethodScopedViolations:e,state:t}){if(e){const a=jn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:t.isSplitShipAndPickup,state:t});if(a.length>0)return{merchandiseLines:a,allowAlternativeAction:!0}}return t.isSplitShipAndPickup||!Kl(t.negotiatedMerchandiseLines)?Yn():{merchandiseLines:jn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:t}),allowAlternativeAction:!1}}function Gl({deliveryMethodType:e,state:t}){return{merchandiseLines:jn({deliveryMethodType:e,suppressUnscopedPickupViolations:e==="PICK_UP"&&t.isSplitShipAndPickup,state:t}),allowAlternativeAction:!0}}function Kl(e){return(e?.lines.filter(({requiresShipping:a})=>a).length??0)>1}function jn({deliveryMethodType:e,suppressUnscopedPickupViolations:t,state:{allViolations:a,deliveryMethodsByMerchandise:o,negotiatedMerchandiseLines:i,proposedDeliveryLines:s,proposedMerchandiseLines:r}}){const l=a&&i?La(a,i,Wl)??[]:[],c=Hl(l,o,[e]),u=t?c.filter(d=>(o[d.stableId]??[]).length>0):c;return zl({violationLines:u,deliveryMethodType:e,proposedDeliveryLines:s,proposedMerchandiseLines:r})}function ql(){const[e,t]=re(!1),a=Zn(),o=ee(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 Yl(e){return e==="LOCAL"?"SHIPPING":e}function jl(e){const t=new Set(e.map(Yl));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 Xl(){const{violations:e}=Ie(Un),{client:t,i18n:a,shop:o,source:i,observability:s,url:r,embed:l,checkout:c}=_(),{merchandiseLines:u,shippingAddress:d}=z(),{countryName:p,loading:h}=rt(d.value),{value:v}=ue().merchandiseLines,{negotiate:m}=ke(),f=Vi(),{negotiating:g,methods:k}=Ln(),{loading:M}=Zn(),P=ee(f.peek()),b=ee(M.peek().has("deliveryNext")),E=I(()=>{const G=M.value.has("deliveryNext"),he=b.current&&!G;return f.value?P.current=!0:he&&(P.current=!1),b.current=G,P.current}).value,{cartUpdated:T,setCartUpdated:V}=ql(),W=Sn(),[H,x]=re(void 0),F=!!l;K(()=>{e.size>0&&x(p)},[e]);const y=ao({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),L=I(()=>y.value.merchandiseLines),N=I(()=>y.value.merchandiseLines.length>0);if(!v||v.lines.length===0||h||H!==p||E)return null;if(T)return n(An,{heading:a.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(e.size===0||o.shipPickupInOneOrderEnabled&&g.value&&jl(k.value))return null;const R=La(Array.from(e),v,Array.from(Un)),ie=R?.map(({stableId:G})=>G),se=u.value.filter(({stableId:G})=>!ie?.includes(G)),ne=se.length===0,w=n(qn,{bannerType:"shipping",merchandiseLines:L});if(R==null)return N.value?w:null;const B=Array.from(e).some(({code:G})=>G==="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 U=null;ne&&R.length===1?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:B}):ne?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:B}):R.length===1?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:B}):U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:B});const te=ne?null:n(Ca,{children:R.map(G=>n(Ia,{children:G.subtitle?a.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:G.title,variant_label:G.subtitle}):G.title},G.stableId))}),O=R.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(){W("click",{element:{tagName:"a",textContent:J}
2,section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:ne,redirectSuccess:o.hasStorefront}),Hi({client:t,url:r,source:i,configuration:c.configuration})}function fe(){W("click",{element:{tagName:"a",textContent:O},section:"delivery",timestamp:new Date}),u.value=se,m({onComplete:V})}const Ve=n(D,{children:ne?ne&&(F||!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(pe,{onClick:q,children:J})}):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(pe,{onClick:fe,children:O})})}),le=n(Ra,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(e).map(({code:G})=>G),children:n(Ke,{heading:U,tone:"critical",children:n(C,{gap:"base",children:[te,Ve]})})});return n(Q,{when:N,fallback:le,children:w})}function Ql({selectedAddress:e,shouldAddressModalSetAsDefault:t}){const{checkout:{address:a,identity:o},i18n:i}=_(),s=z().shippingAddress.value,r=rt(s),{createAddressParts:l}=_n(),c=X(k=>{l.addressModalState.value={status:"editing",address:la(k.address,{extendedAddressMode:a.extendedAddressMode}),addressType:"shipping",addressId:k.id,setAsDefault:t?"default":"disabled"}},[a.extendedAddressMode,l.addressModalState,t]),u=e?n(pe,{tone:"monochrome",onClick:()=>c(e),children:i.translate("shipping.address_update")}):i.translate("shipping.address_update"),{hasViolations:d}=Ie(ca),{hasViolations:p}=Ie(Yo),{hasViolations:h}=Ie(jo),{hasViolations:v}=Ie(sa),{hasViolations:m}=Ie(Un),f=Jl({identity:o,hasMerchandiseUnavailableInBuyerLocationViolations:m,hasUnsupportedPaymentMethodViolations:v});if(f)return f;let g=i.translate("shipping_errors.invalid_selected_address");return p?g=i.translate("customer_account.incomplete_address",{update_address_link:u}):d?g=r.loading?n(C,{children:[n(de,{inlineSize:"large"}),n(de,{inlineSize:"small"})]}):i.translate("shipping_errors.shipping_method_not_available_generic.one"):(h||e)&&(g=i.translate("shipping_errors.invalid_selected_address_with_update_link",{update_address_link:u})),n(Kn,{message:g})}function Jl({identity:e,hasMerchandiseUnavailableInBuyerLocationViolations:t,hasUnsupportedPaymentMethodViolations:a}){return e.current.value!=="shopPay"?null:t?n(Xl,{}):a?n(Fl,{}):null}function td(){const{checkout:e,client:t}=_(),a=e.addressManager.shipping.value.selectedAddress.value,o=!!a?.default,i=t.unstable_getSerialization("apiClientId"),s=Ui(),r=ee(!1),{hasViolations:l}=Ie(ca),{hasViolations:c}=Ie(Xo),u=ka(i);return K(()=>{(l||c)&&u&&!r.current&&(s.notify(l?{no_delivery_strategy_available:!0}:{out_of_stock_at_origin:!0}),r.current=!0)},[l,c,u,s]),n(Ql,{selectedAddress:a,shouldAddressModalSetAsDefault:o})}function ad({name:e,variant:t="content",children:a}){return No(()=>sn(()=>Promise.resolve({}),__vite__mapDeps([63]))),n("div",{className:`delivery-transition-${t}`,style:{"--delivery-view-transition-name":e||void 0},children:a})}const vt={MILES:100,KILOMETERS:200},Zl=100;function yt(e,t){const a=t&&(t.unit==="MILES"?"mi":"km"),o=t&&t.value<Zl?1:0;return[t&&e.numberFormatter({minimumFractionDigits:0,maximumFractionDigits:o}).format(t.value),a].join(" ").trim()}function hn(e){const{pickupLocation:t}=e;return t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0}const ec=e=>e.every(t=>{const a=hn(t);return a?.value&&a.value>vt[a.unit]}),nc=e=>e.every(t=>hn(t)?.unit==="MILES");function tc({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 oo(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 Te(){const{locationAddress:e}=z(),t=e.peek(),{countryCode:a,postalCode:o,city:i}=t,s=!!(a&&!o&&!i),{details:r}=ua(a);return{isOnlyCountryAvailable:s,fullCountryName:r?.name||void 0,formattedAddress:zi(t,{hiddenFields:tc(t),multiline:!1,countryFormat:"explicit"})}}const ac=13;function io({onClick:e,commandFor:t}){const{i18n:a}=_(),{formattedAddress:o}=Te(),i=a.translate("local_pickup.toggle_location");return n(_e,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:o?`${i}, ${o}`:i,onClick:e,commandFor:t,children:o?n(C,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(ae,{type:"geolocation",size:"small-100"}),n(D,{children:oo(o,ac)})]}):n(D,{children:i})})}const oc="qIyj1",ic="oCDzB",Wt={Distance:oc,FromLocation:ic};function _t({itemCount:e,methods:t,onChangeLocationClick:a}){const{i18n:o}=_(),{isOnlyCountryAvailable:i,formattedAddress:s}=Te(),r=Je({methods:t});if(K(()=>{i||r("pickup_long_distance_banner_rendered")},[r,i]),i)return null;const l=nc(t)?"MILES":"KILOMETERS",c=yt(o,{value:vt[l],unit:l}),u=n("span",{className:Wt.FromLocation,children:s});function d(){r("pickup_long_distance_banner_change_location_click"),a?.()}return n(An,{children:n(D,{children:s?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:n("span",{className:Wt.Distance,children:c}),location:a?n(pe,{tone:"monochrome",onClick:d,children:u}):u,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:c})})})}function gt(){const{i18n:e}=_();return n(Ke,{autoFocus:!0,tone:"warning",errorType:Qe.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:n(D,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function ft({allLocationsFarAway:e,selectedPickupOptionNoLongerAvailable:t}){const a=Xe("deliveryNext");return I(()=>e.value&&!t.value&&!a.value)}function En({hideText:e,singleItem:t}){const{i18n:a}=_(),i=an().value?.methods??[],s=t?1:i.length||2,r=Array.from({length:s},(l,c)=>`LocationSkeleton${(c+1).toString()}`);return n(j,{children:[e?null:n(C,{gap:"base",padding:"small-400 none base none",children:n(de,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),n(xs,{border:"none",background:"transparent",children:n(Bs,{name:"skeleton-loading",variant:"block",hideRadioControl:r.length===1,children:r.map(l=>n(Mn,{disabled:!0,value:l,accessibilityLabel:a.translate("general.loading"),secondaryContent:n(C,{gap:"small-400",alignItems:"end",children:[n(de,{inlineSize:"small",size:"small"}),n(de,{inlineSize:"base",size:"small"})]}),children:n(C,{gap:"small-400",children:[n(de,{inlineSize:"small",size:"small"}),n(de,{inlineSize:"base",size:"small"})]})},l))})})]})}const sc={timeout:8e3,enableHighAccuracy:!0};
2class rc extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}function lc(){const{observability:e}=_();return X(t=>uc(t,cc,e),[e])}const cc=e=>new Promise(t=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>t({reason:"granted",position:a}),a=>t({reason:dc(a),error:a}),e):t({reason:"unsupported"})}),uc=async(e=sc,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 rc('"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 dc(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function $t({disabled:e,displayAsLink:t,onSuccess:a,onError:o,onLocateStart:i,options:s,sharingNotAllowedError:r}){const{i18n:l}=_(),c=lc(),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 f(){d.value=void 0,u.value=!0,i?.();const g=await c(s);switch(u.value=!1,g.reason){case"granted":a(g.position);break;case"denied":d.value=v;break;case"timeout":case"unavailable":d.value=m;break;case"unsupported":d.value=h;break}"error"in g&&typeof g.error<"u"&&o?.(g.error)}return n(j,{children:[u.value&&t?n(C,{direction:"inline",gap:"small-400",children:[n(ot,{}),n(D,{color:"subdued",children:p})]}):n(_e,{disabled:e,inlineSize:t?void 0:"fill",onClick:f,loading:u.value,variant:t?"plain":void 0,textDecoration:t?"none":void 0,children:n(C,{direction:"inline",alignItems:"center",gap:"small-400",children:[n(ae,{type:"geolocation"}),n(Me,{children:p})]})}),n(Q,{when:d,children:n(pn,{children:d})})]})}function Tn({heading:e,tryDifferentLocationOnClick:t}){const{i18n:a}=_(),o=Ln(),i=Fe(),s=I(()=>Qo(i.value.enabledDeliveryMethods)),r=I(()=>s.value.length>0),l=me(t),c=I(()=>r.value||!!l.value),u=an(),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(pe,{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(pe,{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"),f=t?n(pe,{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(Ke,{tone:"critical",errorType:Qe.DeliveryError,heading:e,children:n(Q,{when:c,children:n(Me,{children:n(Q,{when:r,fallback:f,children:a.translate("local_pickup.pickup_unavailable_banner_body.ship_items_or_search_elsewhere",{ship_items:h,search_elsewhere:m})})})})})}function Nn(){const{shop:e}=_();return!e.hasFlagEnabled(Jo)}function pc(){const{shippingAddress:e}=z(),{shop:t}=_(),a=on();return{syncShippingFromPickup:X(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 hc=kn("AutocompleteSingleAddressField");function Gt({address:e,onSelect:t,value:a,country:o,hiddenFields:i=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:s,...r}){const{value:l,setValue:c}=Vs({addressType:s,countryCode:o.code,initialAddressQuery:e.coordinates?zn(e,o,i):a});
2function u(d){c(zn(d,o,i)),t&&t(d)}return n(Hs,{addressType:s,id:Pn(void 0,hc),onSelect:u,value:l,countryCode:o.code,...r})}const mc="_9uTul",vc="_3zLFw",yc="_9rPCU",_c="FayGq",ln={SelectWrapper:mc,focus:vc,FlagIcon:yc,Select:_c};function gc({pickupCountries:e,selectedCountry:t,onCountryChange:a}){const{i18n:o}=_(),[i,s]=re(!1);return n(Y,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:Pe(ln.SelectWrapper,i&&ln.focus),children:n(C,{direction:"inline",alignItems:"center",children:[n("div",{className:ln.FlagIcon,children:n(gs,{countryCode:t.code.toLowerCase(),accessibilityLabel:t.name})}),n(ae,{type:"chevron-down",size:"small-200",tone:i?"accent":void 0}),n("select",{"aria-label":o.translate("contact.country_label"),className:ln.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 fc=kn("AutocompleteSingleAddressField");function bc({onSearch:e,onBeforeCountryChange:t,onAfterCountryChange:a,sharedLocationAddress:o,searchOnSelect:i,pickupCountries:s,addressAutoFocus:r,onAddressBlur:l}){const c=ce(""),{i18n:u,observability:d}=_(),{geolocation:p}=Aa(),{locationAddress:h}=z(),v=h.peek(),m=ee(v),f=Zo(),g=Nn(),k=oe(()=>la(Sc(v,p.country.code,s,f),{extendedAddressMode:null}),[]),M=oe(()=>ei({countryCode:void 0,address:void 0}),[]),P=un(k.fields.countryCode,M.countryCode),b=un(k.fields.postalCode,M.address),{details:S,loading:E}=ua(P.value),T=oe(()=>S??p.country,[S,p.country]),V=M.address.value,W=oe(()=>s?.length?s:[{value:T.code,label:T.name}],[s,T.code,T.name]),H=X(A=>zn(A,T,["company","firstName","lastName","phone","countryCode","zoneCode"]),[T]),x=T.zones,F=k.value,y=c.value,L=P.value?Us(P.value):!1;kc(k,M);const N=Ma(k),$=Sn(),R=()=>{(P.error||b.error)&&(P.clearError(),b.clearError())};Ae(()=>{const A=o?.value;A?.countryCode&&Hn(()=>{qe(()=>{N({countryCode:A.countryCode}),c.value="",R()})})}),Ae(()=>{const A=h.value;A!==m.current&&(m.current=A,A?.coordinates&&Hn(()=>{qe(()=>{N(ni(A)),c.value=H(A),R()})}))}),K(()=>{const A=k.value;L?c.value=H(A):c.value=H({postalCode:A.postalCode})},[k,L,H,c]);const ie=(A=F)=>{A.coordinates?(x.length||(A.zoneCode=void 0),e(A)):M.address.value=u.translate("local_pickup.could_not_resolve_address")},se=A=>{const He=()=>{a?.(A),N({countryCode:A}),P.onChange(A),R(),f("user-input",A,"pickup")};t?t({countryCode:A},He):He()},ne=A=>{F.coordinates&&N({countryCode:P.value}),c.value=A,R()},w=A=>{!A.coordinates&&A.address1&&d.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:A.countryCode||P.value,hasAddress1:!!A.address1,hasPostalCode:!!A.postalCode});const He=oi(A.countryCode),rn=!!(A.countryCode&&!He);rn&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:A.countryCode,fallbackCountryCode:P.value});const Ne=rn?{...A,countryCode:P.value}:{...A,countryCode:He};N(Ne),i&&ie(Ne),g&&$("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},B=i&&!g?{source:"magnify",position:"end"}:void 0,U=L&&i,te=!F.coordinates||!y.length,O=U?null:n(_e,{variant:"primary",disabled:te,onClick:ie,loading:E,children:u.translate("local_pickup.search_button")}),J={errors:M,state:{countryCode:k.fields.countryCode,address:L?c:k.fields.postalCode}},q=ti(V)?V.message:V,fe=L?"location address":"postalCode",Re=Pn(void 0,fc),Ve=g?u.translate("local_pickup.location_address_search_placeholder",{postal_code_label:T.labels.postalCode}):u.translate("local_pickup.location_address_search_label"),le=g||!!O;let G;le?G=q?!0:void 0:G=q;const he={addressType:"pickup",country:T,address:F,error:G,field:"address1",value:y,icon:B,autoFocus:r,onBlur:l,autocomplete:L?"shipping street-address":"shipping postal-code",label:L?Ve:T.labels.postalCode,name:fe,id:Re},wn=L?n(Gt,{...he,onSelect:w,onInput:ne}):n(Gt,{...he,onSelect:A=>{N(A),c.value=H(A)},required:!0,readOnly:E,onInput:A=>{A?R():c.value=""},onChange:A=>{c.value=A},allowAllCountries:!0}),Ze=n(Y,{children:[n(Pc,{autocomplete:he.autocomplete,label:he.label,name:he.name}),wn]}),Dn=Wi()?.checkoutProfile.hasOverrides.value;return n(Cn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(at,{...J,children:g?n(C,{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(gc,{pickupCountries:W,selectedCountry:T,onCountryChange:se}),Ze,n(_e,{variant:"primary",onClick:ie,disabled:te,"data-event-name":"local_pickup_search_button",accessibilityLabel:u.translate("local_pickup.search_button"),children:n(ae,{type:"search"})})]}
2),q?n(pn,{controlID:Re,children:Mt(q)?q.textValue:q}):null]}):n(Jt,{children:[n(Do,{children:n(zs,{interactive:!Dn,children:n(Pa,{name:"countryCode",label:T.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:E,value:T.code,onChange:A=>se(A),children:W.map(A=>n(Wn,{value:A.value,children:A.label},A.value))})})}),O?n(C,{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:[Ze,O]}),q?n(pn,{controlID:Re,children:Mt(q)?q.textValue:q}):null]}):Ze]})})})}function Pc({autocomplete:e,label:t,name:a}){const o=$i(),i=o?.nested?o.id:void 0;return n(Y,{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 kc(e,t){const{i18n:a,observability:o,checkout:{wallets:i}}=_(),{inMemoryApplePayParts:{asPaymentMethod:s,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=Ee();ta(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")),ai(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:()=>{qe(()=>{for(const[p,h]of d)t[p].value=h})}}):{behavior:"allow"}})}function Sc(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 so({locationFormVisible:e,toggleLocationFormVisibility:t,children:a,onLocationChange:o,pickupCountries:i}){const s=_().checkout.identity.current.value==="shopPay",r=()=>t(!1);return s?n(j,{children:[a,n(Cc,{open:e,onModalClose:r,onLocationChange:o,pickupCountries:i})]}):e?n(bt,{onLocationChange:o,pickupCountries:i}):a}function Cc({open:e,onModalClose:t,onLocationChange:a,pickupCountries:o}){const{i18n:i}=_();return n(In,{heading:i.translate("local_pickup.toggle_location"),open:e,onHide:t,children:n(Ea,{section:"delivery",children:[n(bt,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:o}),n(Y,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),n(_e,{onClick:t,inlineSize:"fill",variant:"plain",size:"extraLarge",children:i.translate("local_pickup.cancel")})]})})}const bt=({onLocationChange:e,onBeforeLocationChange:t,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:o,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r})=>{const{geolocation:l}=Aa(),{locationAddress:c}=z(),u=Ma(c),{i18n:d}=_(),p=ce(!0),h=ce(),v=ce(void 0),m=Nn(),{syncShippingFromPickup:f}=pc(),g=(b,S)=>{const E=()=>{f(b.countryCode),S()};t?t(b,E):E()},k=b=>{if(o&&(p.value=!1),!ii(b)){h.value=d.translate("pickup_point.could_not_resolve_address");return}h.value=void 0;const S={zoneCode:l.zone?.code,countryCode:l.country.code,coordinates:{latitude:b.coords.latitude,longitude:b.coords.longitude}};g({countryCode:l.country.code},()=>{u(S),v.value=S,e(b)})},M=b=>{g(b,()=>{u(b),e(b)})};return n(C,{gap:m?"small-300":"base",children:[m?null:n($t,{onSuccess:k}),n(Q,{when:p,fallback:n(_e,{inlineAlignment:"start",variant:"plain",onClick:()=>{p.value=!0},children:d.translate("shipping.local_pickup.search_address")}),children:n(C,{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(We,{direction:"inline"}),n(Y,{padding:"none base",children:n(D,{color:"subdued",children:d.translate("local_pickup.or")})}),n(We,{direction:"inline"})]}),n(bc,{sharedLocationAddress:v,searchOnSelect:a,onSearch:M,onBeforeCountryChange:t,onAfterCountryChange:f,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r}),n(Q,{when:h,children:b=>n(C,{gap:"base",padding:"small-200 none none none",children:n(Tn,{heading:b})})})]})}),m&&n($t,{onSuccess:k,displayAsLink:!0,sharingNotAllowedError:d.translate("local_pickup.geolocation.permission_not_allowed")})]})},Ic={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},ro=si(({graphql:{coreGraphql:e},router:t,shop:a},{sellableDeliveryMethods:o})=>{const i=Lt(()=>t.currentUrl.value.pathname.endsWith("/throttle")),s=e.query(Ic,{skip:()=>i.value}),r=Lt(()=>{const l=s.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:c,deliveryMethodsByMerchandise:u}=o.value;if(!(Object.keys(u).length>0&&Ac(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}}),Lc=["SHIPPING","LOCAL"];function Ac(e){const t=e.includes("PICK_UP"),a=e.some(o=>Lc.includes(o));return t&&!a}function Mc(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 lo=e=>e.every(({pickupLocation:t})=>{const a=t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0;return a?.value&&a.value>vt[a.unit]});function Ec(e,t){const a=e.map(s=>hn(s)?.value).filter(s=>s!==void 0);if(a.length===0)return!0;const o=e.find(({handle:s})=>s===t),i=o?hn(o)?.value:void 0;return i===void 0?!0:i<=Math.min(...a)}const Tc=(e,t,a,o,i={})=>{const s=e.length;return t?Oe(a,{oneItem:()=>
2o.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})}):Ec(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 Nc="KHJ3S",wc={Details:Nc};function Dc({distanceLabel:e,instructions:t}){return!e&&!t?null:n(C,{className:wc.Details,direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&n(C,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(D,{color:"subdued",children:n(ae,{type:"location",size:"small"})}),n(D,{fonts:"secondary",type:"small",children:e})]}),t&&n(C,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(D,{color:"subdued",children:n(ae,{type:"clock",size:"small"})}),n(D,{fonts:"secondary",type:"small",children:t})]})]})}function Oc(){const{checkout:e,shop:t}=_(),{deliveryNext:a,merchandiseLines:o}=ue(),i=I(()=>{const s=ri(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:li(r)?.methodType==="PICK_UP"&&r.targetMerchandiseLines?.some(c=>s.some(u=>u.stableId===c.stableId))):!1});return I(()=>t.shipPickupInOneOrderEnabled?i.value:oa({checkout:e}))}function co({variant:e="text"}){const{i18n:t}=_(),a=Oc(),o=t.translate("delivery_options.subscription_pickup_information");return n(Q,{when:a,children:e==="banner"?n(An,{tone:"info",children:o}):n(Me,{children:o})})}function uo({method:e,subscriptionBanner:t}){const{i18n:a}=_(),{isOnlyCountryAvailable:o}=Te(),{cost:i,pickupLocation:s}=e,{name:r,address:l,distanceFromBuyer:c}=s,u=s.instructions.trim(),d=Mc(i,a),h=!o&&c?yt(a,c):void 0;return n(C,{direction:"block",gap:"small-400",children:[n(C,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(D,{type:"strong",children:r}),n(D,{type:"strong",letterCase:d.letterCase,children:d.amount})]}),n(Ba,{address:l,hiddenFields:["postalCode","countryCode","phone"]}),n(Dc,{distanceLabel:h,instructions:u})]}),t?n(co,{variant:"banner"}):null]})}function xc({methods:e,selectedDeliveryMethodHandle:t,setSelectedDeliveryMethodHandle:a}){const o=oe(()=>t?[t]:[],[t]),i=X(([r=""])=>a?.(r),[a]),s=xe("purchase.checkout.pickup-location-option-item.render-after");return n(ht,{name:"local_pickup_methods",values:o,onChange:i,hideRadioControl:e.length===1,children:e.map(r=>n(Bc,{method:r,extensions:s},r.handle))})}function Bc({method:e,extensions:t}){const a=e.handle,o=oe(()=>({handle:a}),[a]);return n(Mn,{value:a,children:[n(uo,{method:e,subscriptionBanner:!1}),n(Be,{marginBlockStart:"small100",customizations:t,options:o})]},a)}const Fc="pickup-locations-modal";function Rc({addressFocus:e,...t}){const a=ce(!1);return n(Vc,{addressFocus:e??a,...t})}function Vc({methods:e,open:t,type:a,addressFocus:o,onClose:i}){const{i18n:s,shop:r}=_(),[l,c]=Ta({type:a,deliveryMethodType:"PICK_UP"}),u=da(),{negotiate:d}=ke(),p=ue().merchandiseLines,h=me(lt(nt).hasViolations),{fullCountryName:v,isOnlyCountryAvailable:m}=Te(),f=ce(l),g=ce(!1),k=ce(!1),{setInverseGroupDeliveryMethodHandle:M,getInverseGroupDeliveryMethodHandle:P}=Na(e||[],a||"ONE_TIME_PURCHASE"),b=Fe(),{pickupCountries:S,loading:E}=pa(ro,{sellableDeliveryMethods:b}),{deliveryLines:T,merchandiseLines:V,discountLines:W,shippingAddress:H}=z(),x=T.value,F=an(),{shouldGateCrossBorder:y,crossBorderGate:L}=Fs(),N=me(!!(e&&lo(e))),$=ft({allLocationsFarAway:N,selectedPickupOptionNoLongerAvailable:h}),R=(O,J)=>{const q=O.countryCode;if(!q||!y(q)){J();return}i(),L(()=>{H.fields.zoneCode.value=void 0,H.fields.coordinates.value=void 0,H.fields.countryCode.value=q})},ie=en(p.value?.lines),se=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(()=>{(!g.value&&k.value||l!==void 0&&l!==f.value)&&(k.value&&(k.value=!1),f.value=l)},[g.value,l,k.value]);const ne=()=>{!r.shipPickupInOneOrderEnabled||ha(T.value).some(({requiresShipping:J})=>J)||qe(()=>{ci({deliveryLines:T,merchandiseLines:V.value,deliveryMethodTypes:["PICK_UP"]})&&ui(W)})},w=()=>{const O=f.value;if(O!==l){if(c(O),u.value&&O){const J=P(O);M(J)}ne(),d({include:["deliveryNext"]})}o.value=!1,i()},B=()=>{g.value=!0,k.value=!0,ne();const O=x.find(J=>{const q=J.peek().id;return q&&q===F.value?.id});O&&(O.fields.deliveryMethodHandle.value=void 0),d({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete:()=>{g.value=!1}})},U=X(O=>{f.value=O},[f]),te=()=>{if(k.value)return n(En,{hideText:!0});if(e){const O=en(F.value?.targetMerchandiseLines),J=m||N.value?Oe(O,{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(O,{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(j,{children:[n(Q,{when:$,children:n(_t,{itemCount:O,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),h.value&&n(gt,{}),n(D,{color:"subdued",children:J}),n(xc,{selectedDeliveryMethodHandle:f.value,setSelectedDeliveryMethodHandle:U,methods:e})]})}return n(Tn,{heading:se,tryDifferentLocationOnClick:()=>{o.value=!0}})};return n(In,{id:Fc,onHide:w,open:t,heading:s.translate("delivery_options.pick_up_locations"),primaryAction:n(Ki,{handleSubmit:w,submitText:s.translate("payment.add_credit_card_modal.save")}),children:n(Ea,{section:"delivery",children:n(Gi,{children:n(C,{gap:"base",children:[n(Q,{when:()=>E.value?null:S.value,children:O=>n(bt,{onLocationChange:B,onBeforeLocationChange:R,changeLocationOnSelect:!0,pickupCountries:O,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),te()]})})})})}function po(e,t="base"){const a=di(t);if(e==null)return a;let o;Array.isArray(e)?e.length===4?o=[ze(e[0],t),ze(e[1],t),ze(e[2],t),ze(e[3],t)]:o=[ze(e[0],t),ze(e[1],t)]:o=ze(e,t);const i=pi({padding:o}).padding;return i??a}function ze(e,t){return Hc(e)?e:t}function Hc(e){return e!=null&&e!=="none"}const Pt="split-delivery-merchandise-modal",Uc=6;function ho(e){return e.filter(t=>t.requiresShipping)}function Kt(e){return new Set(e.map(t=>t.digest)).size}function mo(e){return ho(mi(e))}function vo(e){return ho(ha(e))}function zc(e,t){return t==="PICK_UP"?mo(e):vo(e)}function Wc(e){return Kt(mo(e))+Kt(vo(e))}function $c(e){return e.filter(t=>t.requiresShipping).reduce((t,a)=>t+a.quantity,0)}function Gc(e){return $c(e.filter(hi).flatMap(t=>t.lineComponents.length>0?t.lineComponents:[t]))}function yo({targetMerchandiseLines:e,merchandiseLines:t}){const a=qi(e),o=Gc(t);return{targetMerchandiseQuantity:a,isAllItems:a===o}}function _o(){const{deliveryLines:e}=z(),t=I(()=>Wc(e.value)),a=I(()=>t.value>=Uc);return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function nn(e){const{deliveryLines:t}=z();return I(()=>zc(t.value,e))}function Kc(e){const{merchandiseLines:t}=z(),a=Xe("deliveryNext"),o=I(()=>{const r=e.value,l=yo({targetMerchandiseLines:r,merchandiseLines:t.value});if(l.targetMerchandiseQuantity!==0)return{merchandiseLines:r,totalItemCount:l.targetMerchandiseQuantity,isAllItems:l.isAllItems}}),i=ee(),s=I(()=>{const r=o.value;return r?(i.current=r,r):i.current});return{currentSummary:o,visibleSummary:s,isNegotiating:a}}const qc="HoMMS",Yc="_5tEP0",jc="g9aTP",Xc="eWR8C",cn={TriggerButton:qc,TriggerChevron:Yc,TriggerButtonText:jc,MenuOptionButton:Xc},go="split-delivery-method-menu";function fo(e,t){return`${go}-${encodeURIComponent(e)}-${t}`}function Qc(e,t){return`${fo(e,t)}-trigger`}
2function Jc(e){return`[id^="${go}-${encodeURIComponent(e)}-"][id$="-trigger"]`}function bo(e,t){if(e!==0)return t>=0?t:0}function Zc({activeIndex:e,isOpen:t,menuOptionsLength:a,selectedOptionIndex:o,wasOpenRef:i}){return K(()=>{if(!t){e.value=void 0,i.current=!1;return}if(!i.current){e.value===void 0&&(e.value=bo(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 qt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function eu(e){const{getInteraction:t}=ji(),a=t(e);return a?.type==="command"&&a.kind==="overlay"&&a.active}function nu({merchandiseStableIds:e,onMoveMerchandise:t,onRemoveMerchandise:a,selectedDeliveryMethodType:o,productTitle:i}){const s=wo(),{i18n:r}=_(),l=Fe(),c=Sa(),u=to(),d=me(t??c),p=me(a??u),h=me(Yi().hideOverlay),v=ee(null),m=ee(!1),f=e[0],g=fo(f,s),k=Qc(f,s),M=eu(g),P=me(M),b=ce(void 0),S=me(o),E=me(i),T=me(e),V=I(()=>{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=U=>{h.value(g),U!==S.value&&(d.value({targetDeliveryMethodType:U,merchandiseStableIds:T.value}),qt(U==="SHIPPING"?r.translate("split_delivery.accessibility.status.ship_separately",{items:E.value}):r.translate("split_delivery.accessibility.status.pickup_in_store",{items:E.value})))};return w}),W=I(()=>V.value[S.value].label),H=I(()=>{const{deliveryMethodsByMerchandise:w}=l.value,B=T.value.map(O=>w[O]);if(B.length===0||B.some(O=>!O))return[];const[U,...te]=B;return te.reduce((O,J)=>O.filter(q=>J.includes(q)),U)}),x=I(()=>{const w=H.value,B=w.map(U=>({...V.value[U],selected:U===S.value})).sort((U,te)=>Number(te.selected)-Number(U.selected));return w.length===1&&B.push({label:r.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{h.value(g),p.value(T.value),qt(r.translate("split_delivery.accessibility.status.remove_items",{items:E.value}))}}),B}),F=I(()=>x.value.length),y=I(()=>x.value.findIndex(w=>w.selected)),L=w=>{const B=F.value;if(B===0||b.value===void 0)return;const U=Math.min(b.value,B-1);b.value=(U+w+B)%B},N=()=>{b.value=bo(F.value,y.value)},$=()=>{M||N()},R=()=>{requestAnimationFrame(()=>{document.querySelector(Jc(f))?.focus()})},ie=w=>{w&&(w.onClick(),R())},se=w=>{if(!M){(w.key==="ArrowDown"||w.key==="ArrowUp")&&(w.preventDefault(),N(),v.current?.click());return}switch(w.key){case"ArrowDown":w.preventDefault(),L(1);break;case"ArrowUp":w.preventDefault(),L(-1);break;case"Home":w.preventDefault(),b.value=0;break;case"End":w.preventDefault(),b.value=F.value-1;break;case"Enter":case" ":w.preventDefault(),b.value!==void 0&&ie(x.value[b.value]);break;case"Tab":w.stopPropagation(),h.value(g);break}},ne=I(()=>P.value&&b.value!==void 0&&x.value[b.value]!==void 0?`${g}-option-${b.value}`:void 0);return n(Q,{when:F,children:w=>n(j,{children:[n(Zc,{activeIndex:b,isOpen:M,menuOptionsLength:w,selectedOptionIndex:y.value,wasOpenRef:m}),n(ya,{ref:v,id:k,command:"--toggle",commandFor:g,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:cn.TriggerButton,accessibilityLabel:`${i}, ${r.translate("review.blocks.change_delivery_method_link_label")}`,onClick:$,role:"combobox",onKeyDown:se,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":ne.value,children:n(C,{direction:"inline",gap:"small-500",alignItems:"center",children:[n("span",{className:cn.TriggerButtonText,children:W}),n("span",{className:cn.TriggerChevron,children:n(ae,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),n($s,{id:g,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:n("div",{role:"listbox","aria-labelledby":k,children:n(Vn,{each:x,getKey:B=>B.value,children:(B,U)=>{const te=b.value===U;return n("button",{id:`${g}-option-${U}`,type:"button",role:"option",tabIndex:-1,"aria-selected":B.selected,"data-active":te||void 0,className:cn.MenuOptionButton,onClick:()=>{ie(B)},onMouseOver:()=>{b.value=U},children:n(C,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(ae,{type:B.icon,tone:te?"accent":"auto"}),n(D,{type:"small",tone:B.value==="remove"?"critical":"auto",children:B.label})]})})}})})})]})})}function mn({onMoveMerchandise:e,onRemoveMerchandise:t,title:a,selectedDeliveryMethodType:o}){const s=nn(o).value,r=oe(()=>{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=Xi(r.map(({line:u})=>u.stableId)),c=Zi(o);return n(j,{children:n(C,{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:f})=>
2{const g=[h,v?.name].filter(Boolean).join(`Â ${Qi}Â `),k=l.has(u);return n(Y,{accessibilityRole:"list-item",className:k?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(Ji,{alt:d?.altText,size:"small",src:d?.url,totalItems:f>1?f:void 0}),n(Y,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[n(D,{size:"base",children:n(Et,{children:p})}),g&&n(D,{color:"subdued",size:"small",children:n(Et,{children:g})})]}),n(Y,{inlineAlignment:"end",children:n(nu,{merchandiseStableIds:m,onMoveMerchandise:e,onRemoveMerchandise:t,selectedDeliveryMethodType:o,productTitle:p})})]})},u)})})})}function Po(){const{i18n:e}=_(),t=on(),a=ee(null),o=nn("PICK_UP"),{shouldOpenModal:i}=_o(),{currentSummary:s,visibleSummary:r,isNegotiating:l}=Kc(o),c=I(()=>s.value?.totalItemCount===1),u=I(()=>{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=I(()=>{const v=e.translate("review.blocks.change_delivery_method_link_label");return u.value?`${u.value}, ${v}`:v}),p=I(()=>u.value||e.translate("split_delivery.items_for_pickup")),h=ce(Hn(()=>i.value||!c.value&&!t.value));return Ae(()=>{h.value=i.value||!c.value&&!t.value}),n(Y,{children:n(Rs,{children:n(Q,{when:h,fallback:n("div",{ref:a,tabIndex:-1,children:n(mn,{title:e.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:n(_e,{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?Pt: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(wa,{variant:"fan-legacy",sortByPrice:!0,merchandise:r.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),n(Q,{when:()=>!l.value&&r.value!==void 0,fallback:n(de,{inlineSize:"base"}),children:n(D,{children:u})}),n(ae,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function ko(){const{shop:e}=_(),t=Fe(),{deliveryNext:a}=ue(),o=on(),i=Va();return I(()=>{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 tu({localPickupDeliveryLine:e,onShowModal:t,sectionPadding:a}){const{i18n:o,shop:i}=_(),s=ko(),r=po(a),l=i.hasFlagEnabled(gn),{methods:c,selectedDeliveryMethodHandle:u}=e,d=c.find(M=>M.handle===u),p=c.length-1,h=Je({methods:c,selectedDeliveryMethodHandle:u}),v=xe("purchase.checkout.pickup-location-option-item.render-after"),m=d?.handle??"",f=oe(()=>({handle:m}),[m]);if(!d)return null;function g(){t(),h("checkout_pickup_buyer_reveal_more")}const k=n(j,{children:[n(Q,{when:s,children:n(j,{children:[n(Y,{padding:r,children:n(Po,{})}),n(We,{accessibilityRole:"presentation"})]})}),n(Y,{padding:r,children:[n(uo,{method:d,subscriptionBanner:!0}),n(Be,{marginBlockStart:"small100",customizations:v,options:f})]}),p>0?n(C,{children:[n(We,{accessibilityRole:"presentation"}),n(Y,{padding:r,children:n(_e,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:g,children:n(C,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[n(D,{type:"strong",children:o.translate("local_pickup.toggle_more_locations",{count:p})}),n(ae,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return n(C,{gap:"base",children:l?n(Ha,{target:"edgeToEdgeCard",children:n(Ge,{accessibilityRole:"presentation",children:k})}):n(Y,{border:"base",borderRadius:"large",children:k})})}function Rn({sectionPadding:e}){const{shop:t}=_(),a=ko(),o=po(e),i=t.hasFlagEnabled(gn),s=n(j,{children:[n(Q,{when:a,children:[n(Y,{padding:o,children:n(Po,{})}),n(We,{accessibilityRole:"presentation"})]}),n(Y,{padding:o,children:n(C,{direction:"block",gap:"small-400",children:n(C,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(de,{}),n(de,{inlineSize:"small"})]}),n(de,{inlineSize:"large"}),n(Y,{paddingBlockStart:"small-500",children:n(de,{size:"small"})})]})})}),n(We,{accessibilityRole:"presentation"}),n(Y,{padding:o,children:n(de,{inlineSize:"small"})})]});return n(C,{gap:"base",children:[n(C,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(de,{inlineSize:"large"}),n(de,{inlineSize:"small"})]}),i?n(Ha,{target:"edgeToEdgeCard",children:n(Ge,{accessibilityRole:"presentation",children:s})}):n(Y,{border:"base",borderRadius:"large",children:s})]})}function au({onShowModal:e,showLocationButton:t=!0}){const{i18n:a}=_(),{value:o}=ue().merchandiseLines;ct({active:!0});const{fullCountryName:i,isOnlyCountryAvailable:s}=Te(),r=Je({methods:[],selectedDeliveryMethodHandle:void 0}),l=en(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(C,{gap:"small",children:[t&&n(io,{onClick:()=>{e(),r(s?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),n(Tn,{heading:c,tryDifferentLocationOnClick:()=>e(!0)})]})}const Yt={isLocationFormVisible:!1};function od(){const{i18n:e,shop:t}=_(),{main:{section:a}}=it(),o=t.hasFlagEnabled(gn)?a?.padding:void 0,{negotiating:i}=Ln(),s=an(),r=tn(),l=Xe("deliveryNext"),{value:c}=Da().value,{value:u}=Oa().value,d=!!(c||u),p=me(lt(nt).hasViolations),h=ao({mode:"localPickup"}),v=I(()=>h.value.merchandiseLines),m=I(()=>h.value.allowAlternativeAction),f=I(()=>h.value.merchandiseLines.length>0),{isOnlyCountryAvailable:g}=Te(),k=I(()=>{const y=s.value?.methods??[];return y.length>0&&lo(y)}),M=ft({allLocationsFarAway:k,selectedPickupOptionNoLongerAvailable:p}),P=Je({methods:s.value?.methods||[],selectedDeliveryMethodHandle:s.value?.selectedDeliveryMethodHandle}),[b,S]=re(!1),E=ce(!1),T=xe("Checkout::PickupLocations::RenderBefore"),V=xe("Checkout::PickupLocations::RenderAfter"),W=y=>
2{S(!0),E.value=y??!1},H=()=>{S(!1),E.value=!1},x=()=>{W(),P(g?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},F=(()=>{const y=s.value,L=y?.methods.find(R=>R.handle===y.selectedDeliveryMethodHandle);if(!r.value||b)return n(Rn,{sectionPadding:o});if(i.value&&!L)return n(Rn,{sectionPadding:o});if(d)return n(Q,{when:f,fallback:n(au,{onShowModal:W}),children:n(j,{children:[n(qn,{bannerType:"pickup",merchandiseLines:v,allowAlternativeAction:m}),n(ou,{})]})});if(!y)return n(Rn,{sectionPadding:o});const{methods:N}=y,$=en(y.targetMerchandiseLines);return n(C,{gap:"base",children:[n(Q,{when:f,children:n(qn,{bannerType:"pickup",merchandiseLines:v,allowAlternativeAction:m})}),n(Q,{when:p,children:n(gt,{})}),n(Q,{when:M,children:n(_t,{itemCount:$,methods:y.methods,onChangeLocationClick:W})}),n(C,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(Q,{when:l,fallback:n(D,{color:"subdued",children:Tc(N,g,$,e,{selectedDeliveryMethodHandle:y.selectedDeliveryMethodHandle,allLocationsFarAway:k.value})}),children:n(de,{inlineSize:"base"})}),n(io,{onClick:x})]}),n(Be,{customizations:T,options:Yt}),n(tu,{localPickupDeliveryLine:y,onShowModal:W,sectionPadding:o}),n(Be,{customizations:V,options:Yt})]})})();return n(Cn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ge,{accessibilityLabel:e.translate("local_pickup.pick_up_location"),children:[F,n(Rc,{methods:s.value?.methods,type:s.value?.type,open:b,onClose:H,addressFocus:E})]})})}function ou(){return ct({active:!0}),null}const jt=5;function iu(e,t){const a=Je({methods:e,selectedDeliveryMethodHandle:t}),[o,i]=re(jt),s=oe(()=>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+jt),a("checkout_pickup_buyer_reveal_more"))}}}async function su({negotiate:e,proposedDeliveryLines:t,pickupDeliveryLineId:a,pending:o,deliveryNextLoading:i}){o.value=!0,ru(t,a);let s;try{await e({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete(l){s=l}})}catch(l){throw o.value=!1,l}if(s?.status!=="stale"||!i.value){o.value=!1;return}const r=i.subscribe(l=>{l||(o.value=!1,r())})}function ru(e,t){if(!t)return;const a=e.find(o=>o.value.id===t);a&&(a.fields.deliveryMethodHandle.value=void 0)}const lu=13;function id(){const{i18n:e}=_(),[t,a]=re(!1),{formattedAddress:o}=Te(),i=o?n(C,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(ae,{type:"geolocation",size:"small-100"}),n(D,{children:oo(o,lu)})]}):e.translate("local_pickup.toggle_location");return n(Cn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ge,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:n(C,{gap:"small-500",children:[n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[n(je,{level:2,children:e.translate("delivery_options.pick_up_locations")}),n(pe,{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(cu,{isLocationFormVisible:t,setIsLocationFormVisible:a})]})})})}function cu({isLocationFormVisible:e,setIsLocationFormVisible:t}){const a=tn(),{i18n:o,observability:i}=_(),{negotiating:s}=Ln(),r=an(),l=Xe("deliveryNext"),c=ce(!1),{value:u}=Oa().value,d=!!u,{isOnlyCountryAvailable:p}=Te(),h=Nn(),{deliveryLines:v}=z(),m=v.value,{negotiate:f}=ke(),g=es(),k=xe("Checkout::PickupLocations::RenderBefore"),M=xe("Checkout::PickupLocations::RenderAfter"),P=oe(()=>({isLocationFormVisible:e}),[e]),b=()=>t(!1),S=()=>t(x=>!x),E=()=>{b(),su({negotiate:f,proposedDeliveryLines:m,pickupDeliveryLineId:r.value?.id,pending:c,deliveryNextLoading:l}).catch(x=>i.error(x))},T=Fe(),{pickupCountries:V,loading:W}=pa(ro,{sellableDeliveryMethods:T}),H=I(()=>!!(r.value&&ec(r.value.methods)));if(d)return n(Xt,{isLocationFormVisible:e,setFormVisibilityFalse:b,handleLocationChange:E,pickupCountries:V.value??[],onToggleLocationFormClick:S});if(s.value||!a.value||W.value||!V.value)return n(En,{});if(r.value){const{methods:x,type:F}=r.value,y=g.value.PICK_UP??0,L=H.value&&h&&!p,N=p?Oe(y,{oneItem:()=>
2o.translate("local_pickup.location_information_far_away_one_item",{count:x.length}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:x.length})}):Oe(y,{oneItem:()=>o.translate("local_pickup.location_nearby_one_item",{count:x.length}),otherItems:()=>o.translate("local_pickup.location_nearby_other_items",{count:x.length})});return n(C,{gap:"base",children:[n(co,{}),n(Be,{customizations:k,options:P}),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:!L&&n(Me,{color:"subdued",children:h?N:o.translate("local_pickup.location_information",{count:x.length})})}),n(so,{locationFormVisible:e,toggleLocationFormVisibility:b,onLocationChange:E,pickupCountries:V.value,children:n(pu,{itemCount:y,methods:x,type:F,allLocationsFarAway:H,loading:c.value,onToggleLocationFormClick:S})}),n(Be,{customizations:M,options:P})]})}return n(Xt,{isLocationFormVisible:e,setFormVisibilityFalse:b,handleLocationChange:E,pickupCountries:V.value,onToggleLocationFormClick:S})}function Xt({isLocationFormVisible:e,setFormVisibilityFalse:t,handleLocationChange:a,pickupCountries:o,onToggleLocationFormClick:i}){const{value:s,loading:r}=Da().value,l=ue().merchandiseLines,{i18n:c}=_(),{locationAddress:u}=z(),d=u.peek(),p=o.find(m=>m.value===d.countryCode)?.label,h=en(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(C,{gap:"base",children:[n(so,{locationFormVisible:e,toggleLocationFormVisibility:t,onLocationChange:a,pickupCountries:o,children:n(Tn,{heading:v,tryDifferentLocationOnClick:i})}),n(uu,{})]}):n(En,{})}function uu(){return ct({active:!0}),null}function Qt({instructions:e}){return n(Y,{maxInlineSize:"200px",children:n(Me,{type:"small",children:e})})}function du({handle:e,address:t,secondaryLabel:a,letterCase:o,showInstructionsLeft:i,showInstructionsRight:s,instructions:r,nameLabel:l,itemRenderAfterCustomizations:c}){const u=oe(()=>({handle:e}),[e]);return n(Mn,{value:e,details:n(j,{children:[n(Ba,{address:t,textSize:"small",hiddenFields:["phone"]}),i&&r&&n(Qt,{instructions:r})]}),secondaryContent:n(j,{children:[n(D,{type:"strong",letterCase:o,children:n("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),s&&r&&n(Qt,{instructions:r})]}),tertiaryContent:c?.length>0&&n(Be,{customizations:c,options:u,render:d=>n(C,{padding:"small-100 none none none",gap:"small-100",children:d})}),children:n(D,{type:"strong",children:l})})}function pu({itemCount:e,methods:t,allLocationsFarAway:a,type:o,loading:i,onToggleLocationFormClick:s}){const{i18n:r,checkout:{identity:l}}=_(),c=l.current.value==="shopPay",{negotiate:u}=ke(),d=da(),{isOnlyCountryAvailable:p}=Te(),h=Nn(),v=tn(),m=ns({base:!0,medium:!1}),f=v.value?m??!1:!0,[g,k]=Ta({type:o,deliveryMethodType:"PICK_UP"}),{revealedMethods:M,amountLeft:P,allRevealed:b,revealMore:S}=iu(t,g),{setInverseGroupDeliveryMethodHandle:E,getInverseGroupDeliveryMethodHandle:T}=Na(t,o),V=X(([N=""])=>{if(k(N),d.value){const $=T(N);E($)}u({include:["deliveryNext"]})},[k,d,u,T,E]),W=xe("purchase.checkout.pickup-location-option-item.render-after"),H=me(lt(nt).hasViolations),x=ft({allLocationsFarAway:a,selectedPickupOptionNoLongerAvailable:H}),F=oe(()=>g?[g]:[],[g]);if(i)return n(En,{hideText:!0});const y=(N,$)=>N===0?r.translate("shipping.free_rate_label"):r.formatCurrency(N,{currency:$}),L=({name:N="",proximityLabel:$,distance:R})=>{if(!(!p&&(R||$)))return N;const se=$||`(${yt(r,R)})`;return n(j,{children:[N," ",n(D,{color:"subdued",children:se})]})};return n(C,{gap:"base",children:[n(Q,{when:x,children:n(_t,{itemCount:e,methods:t,onChangeLocationClick:s})}),H.value&&n(gt,{}),n(ht,{name:"local_pickup_methods",values:F,onChange:V,hideRadioControl:!c&&M.length===1,children:M.map(({handle:N,cost:{amount:$,currencyCode:R},pickupLocation:ie})=>
2{const{address:se,instructions:ne,name:w,distanceFromBuyer:B,proximityLabel:U}=ie,te=y($,R),O=L({name:w,distance:B,proximityLabel:h?void 0:U}),J=te===r.translate("shipping.free_rate_label")?"uppercase":void 0;return n(du,{handle:N,address:se,secondaryLabel:te,letterCase:J,showInstructionsLeft:!!(ne&&(c||f)),showInstructionsRight:!!(ne&&!c&&!f),instructions:ne,nameLabel:O,itemRenderAfterCustomizations:W},N)})}),!b&&n(Y,{inlineAlignment:"end",children:n(pe,{onClick:S,children:r.translate("local_pickup.reveal_more_label",{count:P})})})]})}function hu({heading:e="auto"}){const{i18n:t}=_(),a=t.translate("pickup_point.title");return n(Ge,{accessibilityLabel:a,children:n(C,{gap:"small-400",children:[e==="auto"&&n(je,{level:2,children:a}),n(fa,{blockSize:"small-500"}),n(Ws,{text:t.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const sd=vn({displayName:"PickupPoint",load:()=>Qn(()=>sn(()=>import("./component-PickupPoint.Dm47aLjN.js"),__vite__mapDeps([64,1,6,2,3,4,5,7,8,9,10,55,50,21,22,23,24,42,43,44,51,12,13,14,11,15,16,17,18,19,20,25,65,29,58,66,67,32,30,31,33,27,45,46,47,48,40,41,49,26,52,53,28,38,39,54,68]))),renderLoading:e=>n(hu,{...e})});function rd({selectedDeliveryMethodType:e}){const{i18n:t}=_(),{merchandiseLines:a}=z(),o=nn(e),{shouldOpenModal:i}=_o(),s=I(()=>{const l=yo({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=I(()=>`${s.value}, ${t.translate("review.blocks.change_delivery_method_link_label")}`);return i.value?n(_e,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:r.value,command:"--show",commandFor:Pt,children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(wa,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),n(D,{children:s}),n(ae,{type:"pen",size:"base",tone:"neutral"})]})}):n(mn,{title:e==="PICK_UP"?t.translate("split_delivery.items_for_pickup"):t.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})}function mu({onClose:e}={}){const{negotiate:t}=ke(),{i18n:a}=_(),o=ts(),{deliveryLines:i,merchandiseLines:s,discountLines:r}=z(),l=Fe(),c=ee(!1),u=X(({targetDeliveryMethodType:h,merchandiseStableIds:v})=>{const{orphanedRemovedFromCartStableIds:m}=vi({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=X(h=>{ra({deliveryLines:i,merchandiseLines:s,merchandiseStableIds:h,discountLines:r})},[i,s,r]),p=X(()=>{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 ld({id:e=Pt,open:t}){const{i18n:a}=_(),o=nn("PICK_UP"),i=nn("SHIPPING"),{moveMerchandise:s,removeMerchandise:r,saveAndClose:l}=mu(),c=a.translate("delivery_options.pickup"),u=a.translate("delivery_options.ship_to_address");return n(In,{id:e,open:t,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:l,primaryAction:n(_e,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:n(C,{gap:"large-300",children:[o.value.length>0&&n(C,{gap:"base",children:[n(C,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(ae,{type:"marker"}),n(je,{level:2,children:c})]}),n(Y,{border:"base",borderRadius:"large",padding:"base",children:n(mn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"PICK_UP",title:c})})]}),i.value.length>0&&n(C,{gap:"base",children:[n(C,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(ae,{type:"package-delivery"}),n(je,{level:2,children:u})]}),n(Y,{border:"base",borderRadius:"large",padding:"base",children:n(mn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"SHIPPING",title:u})})]})]})})}function vu({taxId:e}){const{negotiate:t}=ke(),a=as(),o=()=>
2{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 yu({status:e}){const{i18n:t}=_(),{shippingAddress:a}=z(),o=me(e);return I(()=>{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 _u(e,t){const a=ee(e.type),o=ee(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 gu=kn("VatNumberFieldInfoTooltip");function fu({status:e}){const{i18n:t}=_();return e.type==="pending"?n(ot,{size:"small",accessibilityLabel:t.translate("taxes.vat_number.accessibility.status.validating")}):e.type==="invalid_format"?n(So,{}):n(bu,{status:e})}function bu({status:{validationStatus:e}}){const{i18n:t}=_();return e==="VALID"?n(j,{children:[n(ae,{tone:"success",size:"small",type:"check-circle"}),n(D,{accessibilityVisibility:"exclusive",children:t.translate("taxes.vat_number.accessibility.status.valid")})]}):n(So,{})}function So(){const{i18n:e}=_(),t=Pn(void 0,gu);return n(j,{children:[n(ae,{size:"small",type:"question-circle",interestFor:t}),n(_a,{id:t,children:e.translate("taxes.vat_number.field.tooltip")})]})}function cd({taxId:e,applied:t,inputRef:a}){const{i18n:o}=_(),i=vu({taxId:e}),s=yu(i),r=I(()=>s.value&&{type:"warning",value:s.value.message}),l=e.warnings.includes("DOMESTIC_NOT_APPLICABLE");return _u(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(C,{direction:"block",gap:"base",children:[n("div",{"aria-busy":i.loading,children:n(ga,{ref:a,name:"vatNumber",label:o.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:n(fu,{status:i.status}),error:r.value,...i})}),l&&n(An,{tone:"info",children:o.translate("taxes.vat_number.domestic_order")})]})}export{mn as $,Gt as A,ec as B,Qu as C,nd as D,Ju as E,ft as F,Tc as G,_t as H,qn as I,io as J,Rc as K,xc as L,Oc as M,yt as N,Fc as O,En as P,Dc as Q,Bl as R,co as S,mo as T,Xl as U,cd as V,vo as W,Kc as X,Wc as Y,Uc as Z,Pt as _,au as a,Il as a0,za as a1,Fl as a2,gt as b,Ks as c,Wa as d,ed as e,td as f,ko as g,sd as h,ad as i,ld as j,Nn as k,od as l,id as m,rd as n,Zu as o,Ir as p,po as q,$t as r,Rt as s,Tn as t,ao as u,Xa as v,Or as w,Kn as x,$a as y,Te 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.