import{q as d}from"./dist-vendor.a3kfnPsb.js";import{a as l}from"./shop-pay-FullScreenBackground.Bxb6RI8a.js";const S={id:"4e99c51c5187daa6375cfd7696d3f3580e3ab58fd003c6f48fc55555907904f6",type:"mutation",name:"PaymentSession",source:"mutation PaymentSession($addressId:ID,$creditCardId:ID!,$checkoutSessionIdentifier:String!,$shopifyDomain:String!,$installmentsAgreements:InstallmentsAgreementsInput,$unvaultedShippingAddress:AddressInput,$checkoutClientSource:CheckoutClientSourceEnum,$batchCheckouts:[BatchCheckoutsInput!],$batchOnly:Boolean,$publicCvvSessionId:String){paymentSessionGenerate(addressId:$addressId creditCardId:$creditCardId checkoutIdentifier:$checkoutSessionIdentifier shopifyDomain:$shopifyDomain installmentsAgreements:$installmentsAgreements unvaultedShippingAddress:$unvaultedShippingAddress checkoutClientSource:$checkoutClientSource batchCheckouts:$batchCheckouts batchOnly:$batchOnly publicCvvSessionId:$publicCvvSessionId){userErrors{message field __typename}sessionId batchCheckoutSessionIds{sessionId shopId __typename}__typename}}"},u=["Session source not found","Invalid session token","Internal error. Looks like something went wrong on our end","server_unavailable"];function f(e){return u.some(t=>e.includes(t))}const E=["Load failed","Failed to fetch","when attempting to fetch resource","SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#3"],I=["TranslationNotStringError","MissingReplacementError","CardFieldsSetupError","CardFieldsLoadError","IFrameNotFoundError","CardFieldsFetchFailureError","CardFieldsOperationalError","PayPalAPIError","WalletProviderFailureError","AbortedSessionError","AbortError","GraphQLFetchNetworkError","MonorailRequestError","BreadcrumbsPluginFetchError","InsecurePageError","GraphQLFetchHttpBadRequestError","GraphQLFetchHttpStatusError","GraphQLFetchHttpContentTypeError","GraphQLFetchJsonParseError","SettingsCreateError","MerchantCommunicationError","PostPurchase::ClientJsonParseError","MissingAppContextError"],_="Permission denied to access property",m=["Failed to execute 'appendChild' on 'Node': Identifier 'CURRENCY_LIST' has already been declared","Identifier 'CURRENCY_LIST' has already been declared","Failed to execute 'appendChild' on 'Node': Identifier 'change_ua' has already been declared","Identifier 'change_ua' has already been declared"],C=["Skipped ViewTransition due to another transition starting","Skipped ViewTransition due to document being hidden"];function b(e,t){let r=e;const s=t.split(".");for(const o of s){if(r==null)return;r=r[o]}return r}function A(e,t,r){const s={...e},o=t.split("."),a=o.pop();if(!a)return e;let n=s;for(const i of o)n[i]={...n[i]},n=n[i];return r==null?delete n[a]:n[a]=r,s}function p(e,...t){const r={...e};for(const s of t)for(const o of Object.keys(s)){const a=r[o],n=s[o];c(a)&&c(n)?r[o]=p(a,n):n!=null&&(r[o]=n)}return r}function c(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}const g=()=>{const{shop:{hasStorefront:e},observability:t,url:r}=l();return{replaceShopPayInHistory:d(o=>{o?window.location.replace(o):e?(t.log("shop_pay_in_history_storefront_redirected","[Shop Pay] Redirecting to storefront url, as replacementUrl is not provided"),window.location.replace(r.storefront())):(t.counter({name:"shop_pay_cannot_replace_browser_history",value:1}),t.log("shop_pay_cannot_replace_browser_history","[Shop Pay] Unable to replace Shop Pay in browser history",{replacementUrl:o,storefrontUrl:r.storefront()}))},[e,t,r])}};export{I as U,A as a,C as b,_ as c,p as d,E as e,m as f,b as g,f as i,S as s,g as u};
