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