const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["05aacf00.Dwg2T_Le.js","630ba094.L_X-5TXi.js","6ec9a0fa.rdcQt2v8.js","f025431a.BlsbPO0-.js","4509beb0.BguNH--m.js","app.BAntcNCf.js","assets/app.CGRs8DQS.css","assets/deferred-boot.Drpcgh6C.css","70676095.CM6VjasN.js","19286c78.BbePfvbV.js","a45fed45.Dr0zbZ6C.js","c328865d.BCB1O5to.js","f1384cc2.BX1JbjgR.js","486c3fda.B832TPZj.js","cb6adac5.Bl30j75Z.js","assets/90ea855f49.uZEuHncj.css","c7b92b97.keF148le.js","30df5a02.DqQMKMCs.js","5c763189.BB2jx7E0.js","ed37d3c3.BSYzaRvO.js","assets/RememberMe.MsPKp1YY.css"])))=>i.map(i=>d[i]); import{Ft as e,It as a,Jt as t,Pt as n,Wt as r,Xt as i,ct as l,ft as s,jt as o,nn as c,ot as d,pt as p,yt as u}from"./630ba094.L_X-5TXi.js";import{f as m}from"./app.BAntcNCf.js";import{$m as h,AO as _,Ac as v,Ad as y,Bp as b,CO as f,EE as g,Gg as C,Io as I,Jp as k,Op as w,Xg as O,Xm as P,Yf as E,dx as D,fx as S,gp as A,hx as M,iv as N,jO as R,pw as x,qf as B,qg as T,qv as j,v_ as L,xO as V,xc as z,yg as q}from"./6ec9a0fa.rdcQt2v8.js";import{t as U}from"./0f5b1987.BrdnjeT6.js";import{F as W,M as F,N as K,a as X,u as G,v as J}from"./b2ef26e8.DM1tmxzK.js";import{c as Y}from"./674595ba.CBCkPO6g.js";import{n as $,r as H,t as Q}from"./ed37d3c3.BSYzaRvO.js";import{t as Z}from"./e32a8416._vyIvrX9.js";import{t as ee}from"./eb0f242a.DWYM7CpL.js";import{t as ae}from"./109c16d9.BY7dYu7s.js";function te({title:e,compact:a}){const{i18n:t,shop:{name:n},checkout:{negotiator:r}}=V(),{shopPayArtifact:i}=r.parts,{isOptedIn:l}=H(),s=Boolean(i.value?.optIn)||l,o=N().value??!1,{kind:c}=Q(),d={terms_href:t.translate("shop_pay_remember_me.terms"),privacy_href:t.translate("shop_pay_remember_me.privacy_policy")},p=o?t.translate("shop_pay_remember_me.consent_by_completing_order",d):t.translate("shop_pay_remember_me.consent_by_paying",d),m=t.translate("shop_pay_remember_me.value_prop_shop_name_verbose",{shop_name:n}),h=t.translate("shop_pay_remember_me.consent_with_phone",d),v=t.translate("shop_pay_remember_me.consent_with_email",d),y=t.translate("shop_pay_remember_me.consent_with_checkbox_only",d),b=t.translate("shop_pay_remember_me.label"),g=t.translate("shop_pay_remember_me.mobile_phone_optional"),I=t.translate("shop_pay_remember_me.email_label_optional");let O;return O="standaloneGdprPhone"===c?u(C,{gap:"base",children:[u(_,{children:b}),u(w,{contentDisplay:"block",inlineSize:"100%",children:u(f,{label:g})}),u(B,{content:h,size:"small"})]}):"gdprCheckboxWithPhone"===c?u(C,{gap:"base",children:[u(R,{gridTemplateColumns:"auto minmax(0, 1fr)",gap:"base",alignItems:"start",children:[u(w,{children:u(k,{accessibilityLabel:b})}),u(_,{children:b})]}),u(w,{contentDisplay:"block",inlineSize:"100%",children:u(f,{label:g})}),u(B,{content:y})]}):"gdprCheckboxOnly"===c?u(R,{gridTemplateColumns:"auto minmax(0, 1fr)",gap:"base",alignItems:"start",children:[u(w,{children:u(k,{accessibilityLabel:b})}),u(C,{children:[u(_,{children:b}),u(B,{content:y,size:"small"})]})]}):"standard"===c?u(C,{gap:"base",children:[u(_,{children:b}),u(w,{contentDisplay:"block",inlineSize:"100%",children:u(f,{label:I})}),u(B,{content:v,size:"small"})]}):u(R,{gridTemplateColumns:"minmax(0, 1fr) auto",gap:"base",alignItems:"center",children:[u(C,{children:[u(_,{children:b}),u(B,{content:s?p:m,size:"small"})]}),u(w,s?{contentDisplay:"block",children:u(T,{variant:"secondary",children:t.translate("shop_pay_remember_me.not_now")})}:{contentDisplay:"block",children:u(T,{variant:"secondary",children:t.translate("shop_pay_remember_me.save")})})]}),u($,{busy:!0,title:e,compact:a,children:O})}var ne=d({displayName:"RememberMe",renderLoading:e=>u(te,{...e}),renderError:()=>null,load:()=>l(()=>m(()=>import("./05aacf00.Dwg2T_Le.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))).then(({RememberMeSurface:e})=>e)});function re({compact:e}){const{i18n:t,checkout:{negotiator:r}}=V(),i=g(),l=ae(),s=t.translate("shop_pay_remember_me.title"),o=n(()=>r.parts.shopPayRememberMeVisible.value?s:"");return a(()=>{l.value||(r.parts.shopPayRememberMeVisible.value=!1)}),i.value&&l.value?u(c,{children:[u(O,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:o}),u(ne,{title:s,compact:e})]}):null}function ie(){const{checkout:e,i18n:a}=V(),{paymentMethods:t}=e.negotiator.current.fields,r=L(),i=U(),l=n(()=>function({identity:e}){return["guest","customerAccount"].includes(e.current.value)}({identity:e.identity})&&i.value&&r.value&&v(t.value));return u(p,{when:l,children:u(O,{paddingBlockStart:"small-200",children:u(A,{tone:"info",children:a.translate("payment.shop_pay_hsa.login_message")})})})}function le(e,{forceDebit:a,showCreditOrDebitCardTitle:t}){return a?e.translate("payment.pay_with_debit_card"):t?e.translate("payment.pay_with_credit_or_debit_card"):e.translate("payment.pay_with_credit_card")}function se({headingId:a,autoFocus:r}){const{i18n:l}=V(),o=y().value?`${l.translate("payment.billing_must_match_shipping_notice")} `:"",c=l.translate("payment.card_security_notice"),d=function(){const{i18n:e,checkout:a}=V(),{identity:t}=a,{displayedPaymentMethods:r}=J(),i=s(r),l=X(r),o=s(F()),c=Y(),d=I();return n(()=>{const n=function(e,a){return"shopPay"===e.current.value&&a}(t,a.installments.paymentMethodMustSupportDebitCardOnly.value),r=o.value&&!function(e){return"shopPay"===e.current.value}(t),s=!(null!==G(t,d.value)||c.value.freeOrder||c.value.giftCard||c.value.storeCredit||c.value.redeemables)&&"singlePaymentMethodCreditCard"===l.value.mode;return function(e,a,{isSingleCreditCardInline:t,forceDebit:n,showCreditOrDebitCardTitle:r}){const i={title:a.translate("payment.title")};if(!t)return i;const[l]=e;return"direct"!==l?.type?i:{title:le(a,{forceDebit:n,showCreditOrDebitCardTitle:r}),creditCardInline:{paymentBrands:l.paymentBrands,cardNetworkStateKey:x(l)}}}(i.value,e,{isSingleCreditCardInline:s,forceDebit:n,showCreditOrDebitCardTitle:r})})}(),{ref:p,isMultiline:m}=function(){const a=e(!1),n=t(null);return{ref:i(e=>{if(n.current?.disconnect(),n.current=null,!e)return;const t=()=>{const t=e.ownerDocument.createRange();t.selectNodeContents(e);const n=t.getClientRects;a.value="function"==typeof n&&Array.from(n.call(t)).filter(({width:e})=>e>0).length>1};if(t(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(t);r.observe(e),n.current=r},[a]),isMultiline:a}}();return u(C,{gap:d.value.creditCardInline?"small-300":"small-400",children:[u(C,{direction:"inline",gap:"small-200",alignItems:"end",className:"zA7WO",children:[u("div",{className:"bIqDC",children:u(b,{id:a,level:1,autoFocus:r,children:u("span",{ref:p,className:"jGvwB",children:d.value.title})})}),d.value.creditCardInline&&u(oe,{cardNetworkStateKey:d.value.creditCardInline.cardNetworkStateKey,availableBrands:d.value.creditCardInline.paymentBrands,headingIsMultiline:m.value})]}),u(E,{color:"subdued",children:o+c}),u(ie,{})]})}function oe({cardNetworkStateKey:e,availableBrands:a,headingIsMultiline:t=!1}){const{checkout:{cardNetworkSelection:r}}=V(),i=r.forMethod(e),l=s(i),c=n(()=>l.value.bankIdNumberLength.value>=6),d=a.filter(P),p=i.networkSelectionEnabled.value&&i.selectableBrands.value.length>1,{ref:m,overflowIndicatorRef:h,maxVisibleBrands:_}=K(d.length);return 0===d.length?null:u("div",{ref:m,className:o("haX3x",p&&"_5Jkpa",t&&"iq64C"),children:u(C,{direction:"inline",gap:"none",alignItems:"center",justifyContent:"end",className:"_1OE8N",children:u(W,{animate:!0,availableBrands:a,selectableBrands:i.selectableBrands.value,activeBrand:i.activeBrand.value,savedCardBrand:i.selectedSavedCreditCardBrand.value,onSelectBrand:i.setSelectedNetwork,networkSelectionEnabled:i.networkSelectionEnabled.value,binLength:c.value?6:0,maxVisibleBrands:_.value,overflowIndicatorRef:h,announceNetworkSelector:!0,announceOverflowBrands:!0})})})}var ce="shop_pay_approval_id";function de(){const{checkout:{negotiator:e}}=V(),{paymentMethods:a}=e.current.fields;return n(()=>z(a.value))}function pe(){const{consentManager:e,observability:n,shop:l,source:s,userEvents:o,checkout:{negotiator:c}}=V(),{checkoutProtocolModalEventSignal:d}=c.context,p=q(),m=t(null),_=t(""),v=t(""),y=i((a,t)=>{if(!ee({analyticsProcessingAllowed:e.analyticsProcessingAllowed.peek(),marketingAllowed:e.marketingAllowed.peek()}))return;const n=j(s);if(!n)return;const r=function(e,a){const t="shopify.checkout.payment_approvals.AgentPaymentApprovalEnteredEvent";return"OUTCOME_APPLIED"===a.outcome?{eventTypeName:t,approvalId:e,outcome:"OUTCOME_APPLIED",shopPayVerificationOpen:a.shopPayVerificationOpen}:"payment_not_required"===a.discardReason?{eventTypeName:t,approvalId:e,outcome:"OUTCOME_DISCARDED",discardReason:"DISCARD_REASON_PAYMENT_NOT_REQUIRED"}:void 0}(a,t);r&&o.refineryEvent(Z(r,{shopId:l.id,checkoutSessionIdentifier:n,customerId:void 0}),{exportImmediately:!0})},[e,l,s,o]),b=i(()=>{const e=m.current?.value.trim()??"";if(!e||e===_.current)return;const a=function(e,a){return M(e)?D(e)?a?void 0:"payment_not_required":"uuid_v7_required":"malformed_uuid"}(e,p.value);if(a)return void(v.current!==e&&(v.current=e,n.counter({name:"shop_pay_approval_id_field_discarded",value:1,attributes:{reason:a}}),n.histogram({name:"shop_pay_approval_id_field_discarded_length",value:e.length,attributes:{reason:a}}),n.log("shop_pay_approval_id_field_discarded","Shop Pay approval id discarded before negotiation",{reason:a,valueLength:e.length}),y(e,{outcome:"OUTCOME_DISCARDED",discardReason:a})));_.current=e;const t="shopPayVerification"===d.peek();n.counter({name:"shop_pay_approval_id_field_applied",value:1,attributes:{verificationOpen:t}});const r={method:{type:"shopWallet",shopPayApprovalId:e}};c.parts.paymentLines.value=S(c.parts.paymentLines.value,r),c.parts.generalPaymentError.value=void 0,c.parts.generalPaymentErrorCode.value=void 0,c.negotiate({withResultHandling:!0}),y(e,{outcome:"OUTCOME_APPLIED",shopPayVerificationOpen:t})},[d,y,c,n,p]);return r(()=>{const e=setInterval(b,250);return()=>clearInterval(e)},[b]),a(()=>{const e=h(c.parts.paymentLines.value),a="shopWallet"===e?.method.type?e.method.shopPayApprovalId:void 0,t=m.current;t&&a&&!t.value&&!_.current&&(t.value=a,_.current=a)}),u(O,{accessibilityVisibility:"exclusive",children:u("input",{ref:m,type:"text",tabIndex:-1,"aria-hidden":!0,id:ce,name:ce,autoComplete:"off",onInput:b})})}export{re as i,de as n,se as r,pe as t};