import{Ft as e,Gt as a,Xt as t,nn as n,yt as o}from"./630ba094.L_X-5TXi.js";import{$m as r,AD as s,Gg as l,Kx as i,Qm as c,Uf as u,Ux as p,Vx as d,YE as h,Yx as P,_p as b,cs as v,lD as f,lE as m,xO as y}from"./6ec9a0fa.rdcQt2v8.js";import{n as E,t as O}from"./30df5a02.DqQMKMCs.js";var g=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","GF","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO","CH","GB"];function I(){const{checkout:{requestGeolocation:e}}=y();return a=e.country.code,g.includes(a);var a}function x(){const e=d.ShopPayRememberMeOptOut;return{storeOptOutPreference:t(a=>{a?P(e,a):i(e)},[e]),getOptOutPreference:t(()=>p(e),[e])}}function L(){const t=I(),{router:n,shop:o,checkout:{negotiator:s}}=y(),l=n.currentUrl.value,i=v(l.searchParams),u=s.parts.shopPayArtifact.value,p=o.hasFlagEnabled("17e7666e")&&Boolean(r(s.parts.paymentLines.value,o.hasFlagEnabled("d07bacfa")?c(s.context.delegatedPaymentInstrument.value):void 0)),{getOptOutPreference:d}=x(),h=e(!0);if(a(()=>{h.value=Boolean(d())},[d,h]),!(o.shopPayRememberMeAutoOptinEnabled??!0))return{autoOptIn:!1,isOptedIn:!1};const P=!(t||p||i||h.value);return{autoOptIn:P,isOptedIn:P&&!1!==u?.optIn}}function S({busy:e,children:a,title:t,compact:r}){return r?o(u,{accessibilityLabel:t,children:o(l,{gap:"base",children:o("div",{"aria-busy":e||void 0,children:a})})}):o(n,{children:[o("div",{"aria-busy":e||void 0,"aria-label":t,role:"group",children:a}),o(b,{blockSize:"large-300"})]})}function A({buyerPhone:e,isApplePayWalletSelected:a,requiresExplicitConsent:t,validatedProposedPhone:n}){return e?"standard":t?a?"gdprCheckboxOnly":n?"gdprCheckboxWithPhone":"standaloneGdprPhone":"noInputRow"}function C(e){const{shop:a,checkout:{negotiator:t}}=y(),n=!a.hasFlagEnabled("f9634b22")&&Boolean(m(t.parts.paymentLines.value,"APPLE_PAY")),o=I(),r=E(),s=O(e??r.value).value;return{kind:A({buyerPhone:t.parts.phone.value,isApplePayWalletSelected:n,requiresExplicitConsent:o,validatedProposedPhone:s}),isApplePayWalletSelected:n,requiresExplicitConsent:o,validatedProposedPhone:s}}export{x as i,S as n,L as r,C as t};