PageSourceSearch

https://nctofficial.com/cdn/shopifycloud/checkout-web/assets/c1/461aedcc.DT1ChOns.js

js nctofficial.com collected 2026-10-10 00:34:23 UTC 40,164 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["825eea7d.C0W0I2bZ.js","2c1ab0fe.qpvfywqb.js","4b4bc88f.DkycdxSK.js","app.DH8n-1bp.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BJvF0-q4.css","assets/TransitionProgress.DTpAQ56v.css","5fd968f2.CK-Xi3lg.js","f8eac2fc.BHf_mfkp.js","164ad2e3.DcJn775M.js","d0bb51ec.CWfbNPnY.js","f67abd2c.CNaB0QaR.js","e12db40c.DhbHW8sF.js","9dba8418.4R19B40l.js","60a453ce.DBFo6PRx.js","assets/hydrate.DDB053YN.css"])))=>i.map(i=>d[i]);
2import{v as e,w as t,y as n,M as a,s as i,g as s,h as o,T as r,u,i as l,j as c,k as d,C as p,q as h,D as m,m as v,a6 as y,S as f,z as g,p as _}from"./2c1ab0fe.qpvfywqb.js";import{e as b,aP as k,fD as S,d7 as C,c9 as P,I,bp as A,d6 as E,cK as M,aO as R,fE as N,bf as O,fF as x,v as T,fG as w,h as L,fH as B,fI as q,bB as F,bF as D,eC as U,l as V,J as j,y as H,aG as z,f9 as $,dt as G,B as J,fJ as K,fK as Y,fL as W,fM as Q,fN as Z,fO as X,fP as ee,fQ as te,dn as ne,fR as ae,bW as ie,bn as se,fS as oe,b4 as re,aF as ue,fT as le}from"./4b4bc88f.DkycdxSK.js";import{c as ce}from"./dada7e07.DLvpJNXh.js";import{d as de,e as pe,a as he,u as me}from"./bf513f9c.DfVLzm1y.js";import{aK as ve,A as ye,fO as fe,fP as ge,eX as _e,bW as be,fQ as ke,fR as Se,fS as Ce,B as Pe,M as Ie,S as Ae,fk as Ee,fd as Me,a1 as Re,j as Ne,eW as Oe,k as xe,X as Te,y as we,fT as Le,fU as Be,v as qe}from"./164ad2e3.DcJn775M.js";import{S as Fe,g as De}from"./f1968089.BiyF2g2x.js";import{t as Ue,a as Ve,u as je,b as He,c as ze}from"./2b89a178.DlMzn79y.js";import{t as $e}from"./87bfafec.CxwEzGHg.js";import{_ as Ge}from"./app.DH8n-1bp.js";import{a as Je}from"./f67abd2c.CNaB0QaR.js";import{S as Ke}from"./1d34c07e.h4dJAaCz.js";import{U as Ye,a as We,u as Qe}from"./24773686.NjNSWG1C.js";import{a as Ze,b as Xe,c as et,u as tt}from"./cc6ff67d.RYXq9KZi.js";import{a as nt,S as at,u as it}from"./8c0eaf27.C9Dbz7-c.js";import{u as st}from"./a25deb9a.B5l1rGH9.js";import{g as ot}from"./ac5a19ff.C1i8fdUP.js";import{a as rt}from"./78ab3dd0.DsAxQUAi.js";import{u as ut}from"./89e2d30a.C7YQuTRu.js";import"./d0bb51ec.CWfbNPnY.js";import"./e12db40c.DhbHW8sF.js";import"./9dba8418.4R19B40l.js";import"./60a453ce.DBFo6PRx.js";import"./08a3b809.BKNVX2Vm.js";import"./d25d1b95.CoPrVoCi.js";import"./e39bc11c.CaER5qTM.js";const lt={cashbackBanner:"COMPONENT_SHOP_CASH_CASHBACK_BANNER",minimumOrderValueBanner:"COMPONENT_SHOP_CAMPAIGN_MINIMUM_ORDER_VALUE_BANNER"};function ct(e){return"ShopCashCheckoutFlatAmountCashbackIncentive"===e.__typename}function dt(e){return"ShopCashCheckoutCashbackIncentive"===e.__typename&&e.expectedAmount.amount>0}function pt(e,[t,n]){return{type:e,rendered:!0,component:lt[t],displayLabel:n.displayLabel}}class ht extends Error{constructor(e){super("A non-Error value was thrown while recording a presentation",{cause:e}),this.name="IncentivePresentationUnknownError"}}class mt{#e;#t;#n=new Map;#a;#i=0;#s=!1;#o=!1;constructor({emit:e,observability:t}){this.#e=e,this.#t=t}recordPresentation(e,t){return this.#o?()=>{}:this.#r(()=>t.resolutionId?(this.#i+=1,this.#n.set(e.component,{displayLabel:e.displayLabel,sequence:this.#i,snapshot:t}),this.#u(),()=>{}):()=>{})??(()=>{})}dispose(){this.#o||(this.#o=!0)}#u(){this.#s||(this.#s=!0,Promise.resolve().then(()=>{this.#r(()=>{this.#s=!1,this.#l()})}).catch(e=>this.#c(e)))}#l(){if(this.#o)return;const e=function(e){const t=e.reduce((e,t)=>!e||t[1].sequence>e[1].sequence?t:e,void 0),n=t?.[1].snapshot;if(!n?.resolutionId)return;const a=e.filter(([,e])=>e.snapshot.resolutionId===n.resolutionId),i=a.find(([e])=>"cashbackBanner"===e),s=a.find(([e])=>"minimumOrderValueBanner"===e),o=n.incentives.find(ct),r=[];if(o){const e=o.minimumOrderValueSatisfied?i:s;e&&r.push(pt("INCENTIVE_TYPE_SHOP_CAMPAIGN_CASHBACK_OFFER",e))}return i&&n.incentives.some(dt)&&r.push(pt("INCENTIVE_TYPE_SHOP_CASH_CASHBACK_PROMOTION",i)),0!==r.length?{eventTypeName:"shopify.advertising.incentives.IncentivePresentedEvent",resolutionId:n.resolutionId,checkoutToken:n.
2checkoutToken,incentives:r}:void 0}([...this.#n.entries()]);if(!e)return;const t=JSON.stringify(e);t!==this.#a&&(this.#e(e),this.#a=t)}#r(e){try{return e()}catch(t){return void this.#c(t)}}#c(e){let t;try{t=e instanceof Error?e:new ht(e)}catch{t=new ht(e)}try{this.#t.error(t,{severity:"warning"})}catch{}}}const vt={id:"6ad2de4357fc9115d8c9c3d1f349fe7784cea96335888d8ec145d7a0bf08e79a",type:"query",name:"CheckoutCashbackIncentive",source:"query CheckoutCashbackIncentive($checkoutIdentifier:String!,$checkoutSourceId:ID,$shopifyShopId:ID!,$eligibleOrderTotal:MoneyInput!,$eligibleOrderSubtotal:MoneyInput!){shopCashCheckoutCashback(checkoutIdentifier:$checkoutIdentifier checkoutSourceId:$checkoutSourceId shopifyShopId:$shopifyShopId eligibleOrderTotal:$eligibleOrderTotal eligibleOrderSubtotal:$eligibleOrderSubtotal){resolutionId incentives{...on ShopCashCheckoutCashbackIncentive{campaignHandle ratePercentage maxApplicableOrderAmount{...MoneyFragment __typename}expectedAmount{...MoneyFragment __typename}remainingRewardLimit{...MoneyFragment __typename}displayName expiresAt __typename}...on ShopCashCheckoutFlatAmountCashbackIncentive{campaignHandle cashbackAmount{...MoneyFragment __typename}minimumOrderValue{...MoneyFragment __typename}minimumOrderValueSatisfied minimumOrderValueRemainder{...MoneyFragment __typename}__typename}__typename}expectedAmount{...MoneyFragment __typename}__typename}}fragment MoneyFragment on Money{value currency __typename}"},yt=ve(({checkout:i,graphql:s,shop:o,source:r},{cashbackState:u,eligibleOrderTotal:l,skip:c})=>{const d=e(()=>i.proposal.negotiated.fields.subtotalAfterMerchandiseDiscounts.value),p=e(()=>d.value?.amount),h=e(()=>d.value?.currencyCode),m=e(()=>l.value?.amount),v=e(()=>l.value?.currencyCode),y=e(()=>{const{checkoutSessionIdentifier:e,sourceId:t}=r;if(e&&t&&void 0!==m.value&&v.value&&void 0!==p.value&&h.value)return{checkoutIdentifier:e,checkoutSourceId:t,eligibleOrderTotal:$e({amount:m.value,currencyCode:v.value}),eligibleOrderSubtotal:$e({amount:p.value,currencyCode:h.value}),shopifyShopId:o.id}}),f=e(()=>c.value||void 0===y.value),g=s.shopPayGraphql.query(vt,{variables:()=>y.value,skip:()=>f.value});let _=p.peek();t(function(){const e=p.value;f.value||_===e||(_=e,g.refetch({deduplicate:!0}))}),t(function(){u?.stale.value&&!f.value&&(u.stale.value=!1,g.refetch({deduplicate:!0}))});const b=n(Date.now());let k=!1;return t(function(){const e=g.data.value?.shopCashCheckoutCashback,t=b.value,n=function(e,t=Number.NEGATIVE_INFINITY){let n,a=Number.POSITIVE_INFINITY;for(const i of e?.incentives??[]){if("ShopCashCheckoutCashbackIncentive"!==i?.__typename||!i.expiresAt)continue;const e=Date.parse(i.expiresAt);Number.isFinite(e)&&e>t&&e<a&&(n=i.expiresAt,a=e)}return n}(e,k?t:void 0);if(!e||!n)return;const i=Date.parse(n);if(!Number.isFinite(i))return;const s=()=>{k=!0,b.value=Date.now(),void 0!==y.peek()&&a(()=>g.refetch())},o=i-Date.now();if(o<=0)return void s();if(o>864e5)return;const r=setTimeout(s,o);return()=>{clearTimeout(r)}}),{cashback:e(()=>{const e=g.data.value?.shopCashCheckoutCashback,t=function(e,t=Date.now()){if(!e)return;const n=[];let a,i,s=!1;for(const r of e.incentives??[]){if(null==r)continue;if("ShopCashCheckoutCashbackIncentive"===r.__typename&&r.expiresAt&&Date.parse(r.expiresAt)<=t){s=!0;continue}const e=ft(r);e&&(n.push(e),"ShopCashCheckoutFlatAmountCashbackIncentive"===e.__typename&&(a??=e),"ShopCashCheckoutCashbackIncentive"===e.__typename&&(i??=e))}if(s&&0===n.length)return;const o=Ue(e.expectedAmount);return{resolutionId:e.resolutionId,expectedAmount:s?{...o,amount:n.reduce((e,t)=>e+function(e){return"ShopCashCheckoutCashbackIncentive"===e.__typename?e.expectedAmount.amount:e.minimumOrderValueSatisfied?e.cashbackAmount.amount:0}(t),0)}:o,incentive:a??i,incentives:n}}(e,b.value);return t&&u?{...t,state:u}:t}),error:g.error,loading:g.loading}});function ft(e){switch(e.__typename){case"ShopCashCheckoutCashbackIncentive":return{...e,ratePercentage:parseFloat(e.ratePercentage),maxApplicableOrderAmount:Ue(e.maxApplicableOrderAmount),expectedAmount:Ue(e.expectedAmount),remainingRewardLimit:Ve(e.remainingRewardLimit),displayName:e.displayName??null,expiresAt:e.expiresAt??null};case"ShopCashCheckoutFlatAmountCashbackIncentive":return{...e,cashbackAmount:Ue(e.cashbackAmount),minimumOrderValue:Ve(e.minimumOrderValue),minimumOrderValueRemainder:Ve(e.minimumOrderValueRemainder),ratePercentage:0};default:return}}function gt(e){const t=e?.incentive?[e.incentive]:[];return e?.incentives??t}function _t({children:e}){const{observability:t,userEvents:n,shop:a,source:l}=b(),c=ge({stale:!1}),{isEarningCashback:d,cashbackRate:p,cashback:h}=function(e={}){const{shop:t,shopPay:n,client:a,embed:r,i18n:u,checkout:{negotiator:l}}=b(),{recordRewardEligibilityEvent:c}=je(),d=n.user.isUnauthenticatedSession.value,{value:p}=k(),{value:h}=l.current.fields.subtotalAfterMerchandiseDiscounts,{value:m}=l.current.fields.shopCashBalance,{nonEligibleReason:v,serverConfirmed:y}=He().value,f="unavailable"===m?.status,g=y&&(function(e,t){return e?[null,Fe.ShopCashInvalidBillingAddress,Fe.
2ShopCashInvalidShippingAddress].includes(t):null==t}(d,v)||f),_=a.unstable_getSerialization("apiClientId"),A=t.hasFlagEnabled(S),E=function({apiClientId:e,embedder:t,shopCashBalanceFlagEnabled:n}){const a=fe(e),i=I(t);return a||n||i}({apiClientId:_,embedder:r?.embedder,shopCashBalanceFlagEnabled:A}),M=g&&E,R=M&&Number(p?.amount)>0,N=C(),O=i(!R),{cashback:x}=P(yt,{skip:O,eligibleOrderTotal:N,cashbackState:e.cashbackState}),T=x.value,w=s();o(()=>{const e=w.current;w.current=T,function(e,t){const n=gt(t),a=Date.now();return gt(e).some(e=>{if("ShopCashCheckoutCashbackIncentive"!==e.__typename||!e.expiresAt)return!1;const t=Date.parse(e.expiresAt);return!(!Number.isFinite(t)||t>a||n.some(t=>"ShopCashCheckoutCashbackIncentive"===t.__typename&&t.campaignHandle===e.campaignHandle&&t.expiresAt===e.expiresAt))})}(e,T)&&ye({content:u.translate("shop_cash.reward_expired_announcement"),role:"status"})},[T,u]);const L=M&&("ShopCashCheckoutFlatAmountCashbackIncentive"===T?.incentive?.__typename&&T.incentive.cashbackAmount.amount>0&&T.incentive.minimumOrderValueSatisfied||"ShopCashCheckoutCashbackIncentive"===T?.incentive?.__typename&&T.expectedAmount.amount>0),B=Boolean(T&&(R||L)),q=T?.incentive?.ratePercentage,F=s();return o(()=>{if(!p?.amount)return;const e=function(e,t){if(!e?.incentive)return{};const n=e.incentive,a={campaignHandle:n.campaignHandle??void 0,cashbackPercent:n.ratePercentage??void 0,cashbackValue:e.expectedAmount.amount,cashbackValueCurrency:e.expectedAmount.currencyCode};return"ShopCashCheckoutFlatAmountCashbackIncentive"===n.__typename&&(a.minimumOrderValue=n.minimumOrderValue?.amount,a.eligibleOrderSubtotal=t),a}(T,h?.amount),t={isTransactionCashbackEligible:R,totalPrice:Number(p.amount),totalPriceCurrency:p.currencyCode,...e},n=JSON.stringify(t);n!==F.current&&(F.current=n,c(t))},[R,p,c,T,h]),o(()=>{n.shopCashExpectedEarnings.value=B?T?.expectedAmount:void 0},[n,B,T?.expectedAmount]),{cashback:T,isEarningCashback:B,cashbackRate:q}}({cashbackState:c}),m=ge({applying:!1}),v=r(()=>new mt({emit:e=>n.refineryEvent(ce(e,{shopId:a.id,checkoutSessionIdentifier:e.checkoutToken,customerId:void 0})),observability:t}),[t,n,a.id]);o(()=>()=>v.dispose(),[v]);const y=r(()=>{const e=l.checkoutSessionIdentifier,t=h?.resolutionId;if(!e||!t)return;const n={checkoutToken:e,resolutionId:t,incentives:h?.incentives??[]};return{recordPresentation:e=>v.recordPresentation(e,n)}},[h?.incentives,h?.resolutionId,v,l.checkoutSessionIdentifier]);return u(de,{value:{redemption:m,cashback:h,cashbackState:c,isEarningCashback:d,cashbackRate:p,incentivePresentation:y},children:e})}function bt(){return Ge(()=>import("./825eea7d.C0W0I2bZ.js"),__vite__mapDeps([0,1,2,3,4,5,6]))}const kt=l({displayName:"TransitionProgress",suspense:!1,load:()=>c(bt),useError:_e("TransitionProgress")});function St(){return function(){const{checkout:e,shopPay:t,shop:{shippingCountries:n}}=b(),a=e.negotiator.parts.shippingAddress.value,i=be(a.countryCode,n),s=t.session.selectedShippingAddress.value,u=r(()=>function({errors:e,selectedShippingAddress:t}){const n=[...e.keys()].filter(e=>"phone"!==e),a=null!=t&&n.length>0&&n.every(e=>"firstName"===e);return n.length>0&&!a||!1===t?.valid&&!a}({errors:i(a),selectedShippingAddress:s}),[i,a,s]),l=e.installments;o(()=>{!function(e,t){e.unstable_setHasInvalidShippingAddress?.(t)}(l,u)},[l,u])}(),null}function Ct(){const{shopPay:e,checkout:t}=b(),n=function(){const{shopPay:e,checkout:t}=b(),n=e.user.creditCards;return d(()=>{const e=t.installments.paymentMethodMustSupportInterestBearingLoans.value;return n.value.filter(t=>!t.expired&&(!e||t.supportsInstallmentsInterestLoan))})}(),a=M();return d(()=>{const i=e.session.isLoading.value,s=e.user.addresses.value.length>0,o=t.isShippingRequired.value&&(i||s),r=!i&&!s,u=!r&&n.value.length>0;return{showShipping:o,showPayment:u,promptAddress:r,promptCreditCard:!(i||r||u||a.value),hasSubscriptions:t.negotiator.parts.deliveryLines.value.some(e=>"SUBSCRIPTION"===e.value.type)}})}class Pt extends Error{constructor(){super(...arguments),this.name="MissingCreditCardOnPaymentMethod"}}const It=l({displayName:"ShopPayCaptcha",load:()=>c(()=>Ge(()=>import("./5fd968f2.CK-Xi3lg.js"),__vite__mapDeps([7,1,8,9,2,3,4,5,10,11,12,13,14,15])))}),At={Button:"sYMP2",disabled:"aPplN",borderRadiusBase:"N5SeL",displayInlineBlock:"fdTMm",paddingInlineSmall400:"ekZTm",paddingInlineSmall300:"UmHzB",paddingInlineBase:"JPhUL",paddingBlockSmall400:"_7k6aq",paddingBlockSmall300:"CmqN5",paddingBlockBase:"Evr2B"},Et=m(function({children:e,displayInlineBlock:t=!1,borderRadiusBase:n=!1,paddingInline:a="small300",paddingBlock:i="small300",...s},o){return u("div",{className:v(At.Button,n&&At.borderRadiusBase,t&&At.dis
2playInlineBlock,s.disabled&&At.disabled,At[y("paddingInline",a)],At[y("paddingBlock",i)]),children:u(Pe,{variant:"plain",ref:o,...s,children:e})})});function Mt({open:e,blocking:t,title:n,description:a,onClose:i,cta:s,onClickCta:o,secondaryAction:r,onPressSecondaryAction:l,cancel:c,onPressCancel:d}){const p=r?u(Pe,{inlineSize:"fill",onClick:l,children:r}):null,h=c?u(Et,{borderRadiusBase:!0,inlineSize:"fill",onClick:d,paddingBlock:"base",children:c}):null,m=u(f,{children:[a,u(Ae,{gap:"small-200",padding:"base none none none",children:[u(Pe,{inlineSize:"fill",variant:"primary",onClick:o,children:s}),p,h]})]});return u(Ie,t?{blocking:!0,open:e,heading:n,children:m}:{open:e,heading:n,onHide:i,children:m})}const Rt={[Ye.Generic]:Ee.PaymentErrorModalGeneric,[Ye.SignInFailed]:Ee.PaymentErrorModalSignInFailed,[Ye.ContinueWithShopPay]:Ee.PaymentErrorModalContinueWithShopPay};function Nt(){const{i18n:e,userEvents:t,source:n,checkout:a,shop:i,shop:{name:s},shopPay:l,router:c}=b(),d=c.currentUrl.value,{buyerIdentity:m}=a.negotiator.current.fields,[v,y]=p(!1),[f,g]=p(null),_=Rt[f?.type??Ye.Generic],{href:k,redirectToGuestCheckout:S}=Me(_),C=h(()=>{l.session.unstable_setUnauthenticatedErrorModal(void 0)},[l.session]),P=h(()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...R(n,a,i),action:`${_}_close`}}),C()},[C,_,t,n,a,i]),I=h(()=>{k?S():C()},[k,C,S]),A=h(async()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...R(n,a,i),action:"change_email"}}),C(),setTimeout(()=>{Boolean(m.value?.customerProfile)?l.session.unstable_updateVerificationTrigger({source:Ke.ErrorModalClearEmail}):window.dispatchEvent(new Event("shop_pay_verification_reset"))},0)},[m,C,t,n,a,i,l.session]),E=h(async()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...R(n,a,i),action:"continue_with_shop_pay"}}),C(),l.session.unstable_updateVerificationTrigger({source:Ke.ErrorModalContinue})},[C,t,n,a,i,l.session]),M=l.session.unauthenticatedErrorModal.value;o(()=>{M?(g(M),y(!0)):y(!1)},[M]);const N=r(()=>{switch(f?.type){case Ye.Generic:return e.translate("unauthenticated_modals.generic.title");case Ye.SignInFailed:return e.translate("unauthenticated_modals.sign_in_failed.title");case Ye.ContinueWithShopPay:return e.translate("unauthenticated_modals.continue_with_shop_pay.title");default:return""}},[f,e]);if(!f)return null;const O=U(d.search)?u(Ae,{direction:"inline",gap:"small-500",alignItems:"center",children:[e.translate("unauthenticated_modals.continue_with_shop_pay.cancel",{shopName:s}),u(Re,{type:"external",size:"small"})]}):e.translate("unauthenticated_modals.generic.cta");switch(f.type){case Ye.Generic:return u(Mt,{blocking:!0,open:v,onClose:P,title:N,description:e.translate("unauthenticated_modals.generic.description",{shopName:s}),cta:O,onClickCta:I});case Ye.SignInFailed:return u(Mt,{open:v,onClose:P,title:N,description:e.translate("unauthenticated_modals.sign_in_failed.description",{shopName:s}),cta:O,onClickCta:I});case Ye.ContinueWithShopPay:return u(Mt,{blocking:!0,open:v,onClose:P,title:N,description:e.translate("unauthenticated_modals.continue_with_shop_pay.description",{email:u(Ne,{type:"strong",children:f.email}),shopName:s}),cta:e.translate("unauthenticated_modals.continue_with_shop_pay.cta"),onClickCta:E,secondaryAction:e.translate("unauthenticated_modals.continue_with_shop_pay.secondary"),onPressSecondaryAction:A,cancel:O,onPressCancel:I});default:return null}}function Ot(){const{checkout:e,router:t,shopPay:n}=b(),{currentDetour:a}=xe().value,i=Te(),s=we()&&!e.configuration.isUniversalCheckoutFinalizer&&!U(t.currentUrl.value.search)&&!i&&!a,r=t.currentUrl.value.normalizedPath;return o(()=>()=>e.checkoutExit.cancelRedirectProgress(),[e.checkoutExit,r]),u(f,{children:[u(g,{when:()=>s&&n.session.isInternalProgressing.value,children:u(kt.Preload,{})}),u(g,{when:()=>s&&"visible"===e.checkoutExit.progressPhase.value,children:u(kt,{})})]})}function xt({children:e}){const{checkout:t,source:n,observability:a,userEvents:i,shop:l,shopPay:c}=b(),m=t.latestReceipt.value,{promptCreditCard:v}=Ct().value,y=t.installments.paymentMethodMustSupportInterestBearingLoans.value,_=c.user.isUnauthenticatedSession.value,S=s(null),C=S.current?.id||"no-failed-receipt";return o(()=>{m&&"failed"===m.status&&(S.current=m)},[m]),o(()=>{v&&y&&i.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...R(n,t,l),action:"new_debit_card_form"}})},[y,v,i,n,t,l]),function(){const{userEvents:e,source:t,checkout:n,shop:a,shopPay:i,embed:s}=b(),r=n.installments.isCheckoutEligible.value,u=n.installments.isSupported.value,l=!i.user.installments.isRejected.value;o(()=>{u&&r&&e.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...De(t,n,a,{embedPlatform:s?.platform,shopAppSurface:i.app.c
2onfig.surface}),eventType:E.UserEligibility,success:l}})},[u,r,l,e,t,n,a,s?.platform,i.app.config.surface])}(),function(){const{userEvents:e,source:t,checkout:n,shop:a,shopPay:i,embed:s}=b(),r=n.installments.isSupported.value,u=n.installments.isCheckoutEligible.value,l=d(()=>{if(0!==n.installments.ineligibilityReasons.value.length)return JSON.stringify(n.installments.ineligibilityReasons.value)});o(()=>{r&&e.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...De(t,n,a,{embedPlatform:s?.platform,shopAppSurface:i.app.config.surface}),errorMessage:l.value,eventType:E.CheckoutEligibility,success:u}})},[l,r,u,e,t,n,a,s?.platform,i.app.config.surface])}(),function(){const{userEvents:e,source:t,checkout:n,shop:a,shopPay:i,embed:s}=b(),r=n.installments.isCheckoutEligible.value,u=i.session.selectedPaymentMethod.value,l=A(u),c=n.installments.isSupported.value&&r&&i.session.isInstallmentsSelected.value&&null!=l,d=null!=l&&(l.supportsInstallmentsSplitPayLoan||l.supportsInstallmentsInterestLoan);o(()=>{c&&e.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...De(t,n,a,{embedPlatform:s?.platform,shopAppSurface:i.app.config.surface}),errorMessage:d?void 0:JSON.stringify(["selected_card_unsupported"]),eventType:E.CheckoutEligibility,success:d}})},[e,t,n,a,s?.platform,i.app.config.surface,c,d])}(),function(){const{shop:e,source:t,checkout:n,checkout:{extensibility:a},observability:i,userEvents:u,shopPay:l}=b(),c=n.installments.isSupported.value,d=N(),m=l.app.config,v=l.user.flow.value,y=l.user.addresses.value,f=l.user.creditCards.value,g=l.session.selectedShippingAddress.value,_=s(g),[S,C]=p(0),P=s(0),{value:I}=n.negotiator.current.fields.deliveryNext,E=O("deliveryNext").value,M=l.session.showSessionRevalidator.value,U=n.negotiator.current.fields.shippingAddress,V=x(),j=l.user.shopAccountUuid,H=l.user.publicId.value,z=T(I,"ONE_TIME_PURCHASE"),$="available"===z?.status,G=$&&d.value.enabledDeliveryMethods.includes("PICK_UP"),J=$&&d.value.enabledDeliveryMethods.includes("LOCAL"),K=$?d.value.enabledDeliveryMethods.length:0,Y=$?z?.methods.find(({handle:e})=>z?.selectedDeliveryMethodHandle===e):null,{value:W}=k(),{value:Q}=n.negotiator.current.fields.discountLines,{value:Z}=n.negotiator.current.fields.taxes,X=O("taxes").value,{value:ee}=n.negotiator.current.fields.duties,te=O("duties").value,{hasSubscriptions:ne}=Ct().value,ae=n.installments.config.value,ie=l.session.isLoading.value,se=c&&!n.installments.isUnavailable.value,oe=ze(),re="available_total"===Z?.status?Z.totalTax:null,ue=n.proposal.facts.duty,le=ke(ue,ee),ce=r(()=>Q?.lines.reduce((e,t)=>{if(!Je(t))return e;const n=t.amount?.amount;return n?e+n:e},0),[Q]),de=Q?.lines.length||0,pe=ie||X||te||E,{value:he}=n.negotiator.current.fields.tipLines,me=he?.[0],ve=w(m),ye="cartNext"===t.type?t.sourceId:"",{value:fe=[]}=n.negotiator.current.fields.allViolations,ge=L(fe),_e=l.session.selectedPaymentMethod.value,be=A(_e),Pe=r(()=>Se(fe),[fe]),Ie=a.ui.search().value.length>0,Ae=l.user.installments.prequalifiedAmount.value,Ee=l.user.installments.credential.value,Me=Ce()?.trackingVisit;o(()=>{pe||(u.monorailEvent({schemaId:"shopify_pay_payment_page_checkout_state/5.8",payload:{...R(t,n,e),checkoutEligibleForLocalPickupBanner:!!U&&G,merchantHasLocalPickup:G,checkoutHasSubscriptionProduct:ne,totalLineItemsPrice:V.value?.toString()||"",paymentDue:W?.amount?.toString()||"",currency:W?.currencyCode||"",installmentsAvailable:n.installments.isSupported.value,requiresVerification:M,checkoutEligibleForInstallments:se,checkoutEligibleForSplitPayInstallments:Re("SPLIT_PAY"),checkoutEligibleForInterestBearingInstallments:se&&B(ae?.availableLoanTypes),counter:S+1,merchantHasLocalDelivery:J,taxAmount:re?.amount?.toString()||"",dutyAmount:le?.amount.toString()||"",numAppliedDiscounts:de,discountAmount:ce?.toString()||"",numShippingOptions:K,shippingAmount:Y?.cost?.amount?.toString()||"",tipAmount:me?.amount?.amount.toString()||"",shopAccountUuid:j.value,isFromShopApp:ve,cartToken:ye,merchandiseIssueType:ge?Pe:"",trackingVisit:Me,hasCheckoutExtension:Ie,requiresShipping:n.isShippingRequired.value,flow:v}}
2),C(e=>e+1))},[c,se,V.value,G,J,W,u,t,n,e,U,j.value,re,de,ce,K,Y,M,me,Pe,ye,ve,ge,Me,Ie,n.isShippingRequired.value,v]),o(()=>{if(pe)return;P.current++;const a=q(y)?.address,i=f.length;let s=0,o=0,r=0;f.forEach(e=>{"credit"===e.funding?s++:"debit"===e.funding&&o++,e.expired&&r++});const l=i>0&&i===r;u.monorailEvent({schemaId:"shopify_pay_payment_page_wallet_state/1.2",payload:{...R(t,n,e),shopAccountUuid:j.value,counter:P.current,numCreditCards:s,numDebitCards:o,numCards:i,numExpiredCards:r,isDefaultCardExpired:l,numShippingAddresses:y.length,defaultShippingAddressHasCompanyName:Boolean(a?.company?.trim()),defaultShippingAddressHasAddress2:Boolean(a?.address2?.trim()),defaultShippingAddressHasPhoneNumber:Boolean(a?.phone?.trim()),installmentsPrequalifiedAmount:Ae?.amount?.toString(),installmentsPrequalifiedCurrency:Ae?.currencyCode,isPrequalifiedForInstallments:Boolean(Ae),installmentsAdditionalInformationRequired:!Ee||Ee.requiresAdditionalInformation}})},[pe,P,y,f,j.value,u,t,n,e,Ae,Ee]);const Re=h(e=>!(!se||!ae?.availableLoanTypes)&&ae.availableLoanTypes.includes(e),[se,ae?.availableLoanTypes]),Ne=n.installments.ineligibilityReasons,Oe=l.user.installments.isRejected.value,xe=r(()=>{const e=Ne.value;return Oe||!c?JSON.stringify(["user_rejected"]):e.length>0?JSON.stringify(e):""},[Oe,c,Ne.value]);o(()=>{pe||W&&!isNaN(W.amount)&&u.monorailEvent({schemaId:"shop_pay_installments_eligibility/2.1",payload:{...R(t,n,e),userId:H,checkoutEligible:se,splitPayEligible:Re("SPLIT_PAY"),interestBearingEligible:Re("INTEREST"),zeroPercentEligible:Re("ZERO_PERCENT"),paymentDue:W.amount,currency:W.currencyCode,ineligibilityReason:xe,spiPreselected:oe.value.spiPreselected,preselectionReason:oe.value.preselectionReason}})},[se,H,xe,Re,pe,W,oe.value.spiPreselected,oe.value.preselectionReason,u,t,n,e]);const Te=h(()=>{u.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...R(t,n,e),action:"credit_card_select"}})},[u,t,n,e]),we=h(()=>{u.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...R(t,n,e),action:"payment_method_ideal"}})},[u,t,n,e]);o(()=>{_e?F(_e)?Te():D(_e)&&we():be&&(i.error(new Pt("Selected credit card and payment method misaligned"),{severity:"warning",metadata:{selectedCreditCard:{value:JSON.stringify(be)},selectedPaymentMethod:{value:JSON.stringify(_e)}}}),Te())},[be,Te,_e,we,i]);const Le=h((a,i)=>{const s="isEphemeralAddress"in a&&a.isEphemeralAddress;u.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_address/1.4",payload:{...R(t,n,e),previousAddressId:isNaN(Number(i?.id))?-1:Number(i?.id),previousAddressCountry:i?.address?.countryCode??"",currentAddressId:isNaN(Number(a.id))?-1:Number(a.id??-1),currentAddressCountry:a.address.countryCode??"",...i?.id&&isNaN(Number(i.id))?{previousAddressUuid:i.id}:{},...!s&&a.id&&isNaN(Number(a.id))?{currentAddressUuid:a.id}:{},ephemeral:s,previousAddressPreferred:i?.userPreferred,currentAddressPreferred:a.userPreferred}})},[u,t,n,e]);o(()=>{g&&_.current?.id!==g.id&&Le(g,_.current),_.current=g},[g,Le])}(),function(){const{userEvents:e,shop:t,source:n,checkout:a,shopPay:i}=b(),s=i.config.tracking.unique,r=i.user.shopAccountUuid;o(()=>{r.value&&s&&e.monorailEvent({schemaId:"shop_pay_session_tracking/2.0",payload:{...R(n,a,t),shopAppAccountUuid:r.value,uniqueToken:s}})},[e,n,a,t,r.value,s])}(),Oe({enabled:c.session.isLoading.value,onTimeout:e=>{a.counter({name:"shop_pay_root_loading_timeout",value:1}),a.log("shop_pay_root_loading_timeout","ShopPayRoot loading timeout",{timeout:e})}}),u(f,{children:[u(St,{}),u(f,{children:[u(Ot,{}),e,u(g,{when:c.user.isUnauthenticatedUser,children:u(Nt,{})}),_&&u(It,{})]},C)]})}const Tt={id:"106bc5f4e02c02f67b7793457d470ef1a1a5f331ebd88473a9eef17fca5cc643",type:"mutation",name:"PaymentMethodRequirementRemovalResolve",source:"mutation PaymentMethodRequirementRemovalResolve($checkoutContextInput:CheckoutContextInput!,$qualificationToken:String){paymentMethodRequirementRemovalResolve(checkoutContextInput:$checkoutContextInput qualificationToken:$qualificationToken){variant challenge requiresFreshQualification __typename}}"},wt=ve((e,i)=>{const{checkout:s,graphql:o,observability:r,router:u,shop:l,shopPay:c,source:d}=e,{installments:p}=c,h=n(void 0),m=n(void 0);let v=null,y=!1,f=0,g=0;const _=n(void 0);async function b(e,t){try{const{data:n,error:a}=await o.shopPayGraphql.mutate(Tt,{variables:{checkoutContextInput:{checkoutVersion:z({source:d}),checkoutIdentifier:t,shopifyDomain:l.myshopifyDomain,shopId:H(l.id)},qualificationToken:e??null}});if(a)return;return n?.paymentMethodRequirementRemovalResolve??void 0}catch{return}}let k=!1;return t(function(){const e="authenticated_user"===c.user.flow.value;k&&!e&&p.unstable_hydratePaymentMethodRequirementRemoval({variant:null,challenge:null}),k=e}),t(function(){return()=>{f+=1}}),t(function(){if("undefined"==typeof window)return;const e="authenticated_user"===c.user.flow.value?p.paymentMethodRequirementRemovalChallenge.value:null;e!==v&&(f+=1,v=e,y=!1,g=0,_.value=void 0,m.value=void 0);const t=function({proposal:e}){const{deliveryNext:t,shippingAddress:n,paymentDue:a}=e.negotiated.fields,i=n.value;return JSON.stringify([t.value?.status,i?.countryCode,i?.zoneCode,i?.postalCode,i?.city,a.value?.amount,a.value?.currencyCode])}(s),n=_.value;if(y||!e)return;if(t===n)return;if(g>=5)return;if(null!==p.paymentMethodRequirementRemovalVariant.value)return;if(c.isSimulated||j(d))return;if(Le(u))return;if(!p.isServiceAvailable.value)return;if(!s.installments.config.value)return;if(!pe({checkout:s,shopPay:c}))return;const o=d.checkoutSessionIdentifier;if(!o)return;y=!0,g+=1;const l=a(()=>function({creditCards:e,config:t,mustSupportInterestBearingLoans:n}){return e&&t?0===e.length?"no_saved_card":e.some(e=>!e.expired&&(!n||e.supportsInstallmentsInterestLoan)&&V(e,t))?"supported_card_available":"cards_unsupported":"unknown"}({creditCards:c.user.creditCards.value,config:s.installments.config.value,mustSupportInterestBearingLoans:s.installments.paymentMethodMustSupportInterestBearingLoans.value})),k=f;a(()=>{(async function({challenge:e,checkoutIdentifier:t,cardState:n,runGeneration:a,inputs:s}){const o=()=>a===f;let u=e,l=0,c="failed",d=null;for(;
2l<2;){l+=1;const e=await i(u).catch(()=>{});if(!o())return;if(!e&&2===l){c="evidence_unavailable";break}const n=await b(e,t);if(!o())return;if(!n){c="failed";break}if(e&&!n.requiresFreshQualification){d=n.variant??null,c=d?"assigned":"not_assigned";break}if(c=e?"stale_evidence":"evidence_unavailable",!n.challenge)break;u=n.challenge}r.log("spi_cardless_checkout_qualification","[CardlessCheckout] Qualification finished",{outcome:c,attempts:l,cardState:n,variant:Lt(d)}),r.counter({name:"spi_cardless_checkout_qualification",value:1,attributes:{outcome:c,cardState:n}}),h.value=c,"evidence_unavailable"===c&&(y=!1,_.value=s),d&&(m.value={variant:d,challenge:e})})({challenge:e,checkoutIdentifier:o,cardState:l,runGeneration:k,inputs:t}).catch(()=>{})})}),t(function(){const e=m.value;e&&!p.isModalOpen.value&&(m.value=void 0,"authenticated_user"===c.user.flow.value&&p.paymentMethodRequirementRemovalChallenge.value===e.challenge&&p.unstable_setPaymentMethodRequirementRemovalVariant(e.variant))}),{outcome:h}});function Lt(e){return null===e?"none":"treatment"===e||"control"===e?e:"other"}const Bt=["merchandiseLines","deliveryNext","discountLines","taxes","paymentLines","paymentMethods","availableRedeemables","buyerIdentity"];const qt={id:"8b0aa9c5a6b1f77d064216d93704ed01ecc60aca1a2317877fc6478cdfa553e8",type:"mutation",name:"CheckoutSessionUpdateSelections",source:"mutation CheckoutSessionUpdateSelections($checkoutContextInput:CheckoutContextInput!,$selectedPaymentMethodId:String,$selectedPaymentMethodOption:String){checkoutSessionUpdateSelections(checkoutContextInput:$checkoutContextInput selectedPaymentMethodId:$selectedPaymentMethodId selectedPaymentMethodOption:$selectedPaymentMethodOption){userErrors{message field __typename}__typename}}"};function Ft(e){return"customOnsite"===e.type?e.name:e.type}function Dt(e){return[...e].map(Ft).sort().join("|")}function Ut(){const{observability:e,userEvents:t,checkout:n,shop:a,shopPay:r,consentManager:u,checkout:{addressManager:{shipping:l}}}=b(),c=i(st()),p=xe(),m=d(()=>"shopPayLogin"===p.value.currentDetour?.type),v=nt(),y=d(()=>v()),{data:f,loading:g}=P(at,{isOnShopPayLoginDetour:m,newSignupLoginVariant:c,simulatedBuyerDetails:y}),_="undefined"==typeof window,k=he(),S=me(),C=G(),{updateCheckoutAddress:I}=Xe(),A=n.negotiator.current.fields.buyerIdentity.value?.customerProfile,E=n.negotiator.parts.shippingAddress.value,{value:M}=n.negotiator.current.fields.paymentMethods,R=J({managedByMarketsPro:n.negotiator.current.fields.managedByMarketsPro.value}),N=Ze(),{value:O}=et({isApplePayAvailable:N.value}),x=s(M?Dt(O):void 0),T=K({paymentRequiredMethod:S.value,isIdealEnabledForShopPay:R}),w=h(e=>Y(e,O),[O]);async function L(i){const s=l.value.immutableAddresses.value.filter(({id:e})=>e!==X),o=S.value,c=r.applyBuyerDetailsToCheckout(i,{checkout:n,observability:e,userEvents:t,shop:a,hydration:{negotiatedPaymentMethods:O,isApplePayAvailable:N.value,immutableAddresses:s,proposedShippingAddress:E,canUpdateDeliveryAddress:C.value,mustSelectProvidedAddress:n.negotiator.current.fields.mustSelectProvidedAddress.value??!1,paymentRequiredMethod:o,negotiatedCardUuid:te({proposedPaymentLines:n.negotiator.parts.paymentLines.value})},customerProfile:A,paymentExemptionReason:k.value,idealEnabledForShopPay:R});if("card_vaulting_disabled"===c.status)return;const{shippingAddress:d}=c.appliedAddresses;d&&!ne(E,d)&&e.log("shipping_address_auto_applied","[useShopPayParts] Shop Pay hydration applied a new shipping address to the proposal",{address_id:c.hydrationResult.selectedShippingAddress?.id}),!_&&i.userPrivacySettings&&u.setPrefetchedConsent(i.userPrivacySettings,i.shopAccountUuid)}o(()=>{const e=r.session.initialization.peek(),t=f.value,n="initialized"===e.status&&void 0===t;if(r.session.unstable_setLoading(!n&&g.value),g.value)return;const a=r.session.unstable_receiveBuyerDetailsResult(t);"initialize"===a.status&&L(a.buyerDetails)},[g.value,f.value]),o(()=>{if(!f.value||"success"!==f.value.status||void 0===M)return;const e=w(f.value.paymentMethods),t=W(e,f.value.creditCards);if(!(f.value.creditCards.length>0||t.some(Q)))return;const a=Dt(O);if(a===x.current)return;x.current=a,r.user.unstable_setApplePayAvailable(N.value),r.user.unstable_setPaymentMethodsFromBuyerDetails(t);const i=r.session.selectedPaymentMethod.value;if(!i)return;const s=Z({addressesForUI:f.value.addresses,immutableAddresses:l.value.immutableAddresses.value.filter(({id:e})=>e!==X),proposedShippingAddress:n.negotiator.parts.shippingAddress.value,mustSelectProvidedAddress:n.negotiator.current.fields.mustSelectProvidedAddress.value}),o=ee({paymentMethod:i,billingAddressToSelect:s,shouldUseLpmBillingAddress:T});o&&I({billingAddress:o},!0)},[l,w,f.value,N.value,n.negotiator.current.fields.mustSelectProvidedAddress,M,O,n.negotiator.parts.shippingAddress,r.session,T,r.user,I]),_&&f.value&&"success"===f.value.status&&"pending"===r.session.initialization.peek().status&&L(f.value)}function Vt(){const{observability:e,shopPay:t,checkout:{negotiator:n}}=b(),[,i]=tt({allowPreselect:!1}),o=s(void 0);_(()=>{const s=t.session.selectedPaymentMethod.value,r=n.current.fields.paymentMethods.value,u=t.user.paymentMethods.value,l=t.session.promotedPaymentMethods.value;a(()=>
2{if(!s){const e=o.current;if(void 0===e||ae(e.method,u)||ae(e.method,l))return;const t=n.parts.paymentLines.value,a=t.some(t=>ie(t.method)===e.primaryLineKey);if(o.current=void 0,!a)return;const i=t.filter(t=>se(t)||!e.lineKeys.includes(ie(t.method)));return void(i.length!==t.length&&(n.parts.paymentLines.value=i))}const t=oe({paymentMethod:s,negotiatedPaymentMethods:r,observability:e});if(void 0===t)return o.current=void 0,void(n.parts.paymentLines.value=n.parts.paymentLines.value.filter(se));"SHOP_PAY"===t&&void 0!==ot(n.parts.paymentLines.value)||(i(t),o.current={method:s,primaryLineKey:t,lineKeys:n.parts.paymentLines.value.filter(e=>!se(e)).map(e=>ie(e.method))})})})}const jt=["begin_page_load","first_meaningful_paint","page_loaded"];function Ht(){const{client:e,userEvents:t,source:n,checkout:i,shop:r,shopPay:u}=b(),l=s(new Set),c=h(e=>{l.current.has(e)||(l.current.add(e),t.monorailEvent({schemaId:"shopify_pay_payment_page_ready/2.1",payload:{...R(n,i,r),success:!0,status:e,clientTimestampMs:Date.now()}}))},[t,n,i,r]),d=h(e=>{for(const t of jt)if(c(t),t===e)return},[c]);_(()=>{const e=u.session.isLoading.value,t="initialized"===u.session.initialization.value.status;a(()=>{d("begin_page_load"),e&&d("first_meaningful_paint"),t&&d("page_loaded")})});const p="shopPayExternal"===n.type,m=Ce(),v=ut(rt.ShopifyPay,u.config.redirectSource,m?.trackingUnique,m?.trackingVisit),y=s(!1);o(()=>{y.current||p||(y.current=!0,v())},[v,p]);const f=Be().value,g=!0===e.unstable_getSerialization("shopPayConfig").shop_pay_sdk_without_shop_pay_eligible&&"shop_pay_disabled"===f,k=p||void 0===f||g,S=We(),C=p?S.analyticsTraceId.value:void 0,{checkoutSessionIdentifier:P="checkout_identifier_undefined"}=n,{redirectSource:I,tracking:A}=u.config;return o(()=>{if(!k)return;const a="shoppay_login"===window.location.pathname.split("/").pop();U()&&!a&&t.monorailEvent({schemaId:"shop_app_page_load/9.0",payload:{...R(n,i,r),platform:"web",locale:navigator.language,userToken:A.unique??e.cookies.get("_shopify_y")??"",webSessionToken:A.visit??e.cookies.get("_shopify_s")??"",pageType:"pay_payment_page",pageValue:P}}),t.monorailEvent({schemaId:"shopify_pay_page_load/2.6",payload:{...R(n,i,r),pageType:"payment_page",clientTimestampMs:Date.now(),redirectSource:I,analyticsTraceId:C}})},[P,e.cookies,t,n,i,r,I,k,C,A.unique,A.visit]),null}function zt({children:e}){const{observability:t,source:n,shopPay:{config:a,session:{initialization:i}}}=b(),{checkoutAsGuestUrl:s,redirectSource:r}=a,{detour:l}=qe(),{replaceShopPayInHistory:c}=Qe(),d="shopPayExternal"===n.type,p=i.value,h="pending"===p.status;it(h);const m="failed"===p.status,v="failed"===p.status&&"fetch"===p.reason?p.errors:void 0,y=Boolean(v?.some(e=>e.message===ue));if(o(()=>{m&&!y&&(t.counter({name:"shop_pay_failed_to_fetch_buyer_session_details",value:1}),t.log("shop_pay_provider_buyer_session_details_fetch_failed","Unexpected error fetching buyer session details",{errors:v}))},[m,y,v,t]),m){const e=function({hasUnauthorizedError:e,isShopPayExternal:t,redirectSource:n}){return e&&n!==re.CheckoutAutomaticRedirect&&n!==re.CheckoutUniversalRedirect?{type:"login"}:t?{type:"externalDetour",route:e?"shopPayLogin":"terminalError",replace:e}:{type:"guestCheckout"}}({hasUnauthorizedError:y,isShopPayExternal:d,redirectSource:r});return"login"===e.type?(l("shopPayLogin",{routerOptions:{replace:!0}}),null):"externalDetour"===e.type?(t.leaveErrorBreadcrumb("shouldRedirect=true",{route:e.route}),l(e.route,{routerOptions:{replace:e.replace}}),null):(t.error(new le("Failed to fetch buyer session details. Redirecting to guest checkout"),{severity:"warning"}),t.log("shop_pay_provider_guest_checkout_redirected","[ShopPayProvider] Redirecting to guest checkout"),c(s),null)}return u(f,{children:e})}function $t({simulated:e,children:t}){!function(){const{shopPay:e,graphql:{shopPayGraphql:t},source:n,shop:a}=b(),i=z({source:n}),o=s(void 0),r=s(!1);r.current||"initialized"!==e.session.initialization.peek().status||(r.current=!0,o.current={selectedPaymentMethodOption:e.session.paymentMethodOption.peek(),userSelectedPaymentMethod:e.session.selectedPaymentMethod.peek()}),_(()=>{if(e.session.isLoading.value)return;const s=e.session.selectedPaymentMethod.value,u={selectedPaymentMethodOption:e.session.paymentMethodOption.value,userSelectedPaymentMethod:s};if(!$(o.current,u)&&!(e=>Object.values(e).every(e=>!e))(u)){if(void 0===o.current)return r.current=!0,void(o.current=u);t.mutate(qt,{variables:{checkoutContextInput:{checkoutIdentifier:n.checkoutSessionIdentifier??"unknown",checkoutVersion:i,shopId:H(a.id),shopifyDomain:a.myshopifyDomain},selectedPaymentMethodId:u.userSelectedPaymentMethod?.id,selectedPaymentMethodOption:u.selectedPaymentMethodOption?.name}}),o.current=u}}
2)}();const{observability:n,shopPay:a,checkout:{negotiator:i}}=b(),o=i.current.fields.buyerIdentity.value?.purchasingCompany,{replaceShopPayInHistory:r}=Qe();return e?u(Jt,{children:t}):o?(n.log("shop_pay_shell_redirected","Shop Pay is not supported for B2B customers. Redirecting to guest checkout."),r(a.config.checkoutAsGuestUrl),null):u(f,{children:[u(Ht,{}),u(Gt,{children:t})]})}function Gt({children:e}){return Ut(),function(){const{shopPay:e}=b(),t=Ze(),n=e.session.initialization.value.status;o(()=>{"initialized"===n&&e.user.unstable_setApplePayAvailable(t.value)},[n,t.value,e])}(),Vt(),function(){const{checkout:{negotiator:e}}=b(),t=s(e);t.current=e;const n=s(e=>async function(e,t){const n=await e.negotiate({force:!0,loading:[],fieldsToResolve:Bt,negotiationStage:"negotiation",silenceViolations:["all"],customizeNegotiation:e=>({...e,cardlessCheckoutChallenge:t,includeCardlessCheckoutEligibility:!0})});return"success"===n.status||"error"===n.status?n.negotiated.cardlessCheckoutEligibilityToken:void 0}(t.current,e)).current;P(wt,n)}(),u(zt,{children:u(_t,{children:u(xt,{children:e})})})}function Jt({children:e}){return Ut(),Vt(),u(_t,{children:e})}export{$t as ShopPayCheckout};

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.