@zonos/elements 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +77 -0
- package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +74 -0
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +8 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/zonos-checkout.entry.js +77 -0
- package/dist/esm-es5/index.js +4 -4
- package/dist/esm-es5/zonos-checkout.entry.js +38 -13
- package/dist/scripts/index.d.ts +14 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.d.ts +11 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +14 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-0457f579.entry.js +1 -0
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-DPZSD7Kg.system.js → p-DCS8qcL6.system.js} +4 -4
- package/dist/zonos-elements/{p-5236c676.system.entry.js → p-be1237fc.system.entry.js} +68 -43
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-f8b50aa0.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,h as e,F as t,a as s}from"./p-_lt63o7c.js";import{s as n,a as i,b as c,i as r,c as a,g as d,d as l,e as u,f as h,p as m,h as p,j as g,k as f,l as w,m as v,n as z,o as k,t as y,q as C,r as b,u as S,v as x,w as I,x as T,y as A,z as O,A as B,B as L,C as _,D as E,E as P,F as D,G as U,H as j,I as N,J as R,K as $}from"./p-FRWZayxL.js";import{p as F,s as M,a as H,b as Z}from"./p-7abqRc9V.js";import{f as K,a as V,b as W,i as Q,l as G,c as q,d as Y,g as J,s as X,V as oo,e as eo,t as to,h as so,j as no}from"./p-clDfq9AL.js";import{z as io,g as co,m as ro}from"./p-W82paT5F.js";import{b as ao}from"./p-BycjkdlE.js";import{h as lo,g as uo,j as ho,l as mo,b as po,s as go,a as fo,i as wo}from"./p-DE4a-QD5.js";import{u as vo}from"./p-CUaf1cEg.js";import{l as zo,g as ko,b as yo}from"./p-BJmZPrZl.js";import{_ as Co,c as bo,d as So,a as xo,g as Io}from"./p-D5SpFsQJ.js";import{c as To}from"./p-BJHSB96f.js";import{c as Ao}from"./p-XQfWgQLB.js";import{g as Oo}from"./p-C_z9WL8a.js";import{i as Bo}from"./p-YdrG78th.js";import{s as Lo}from"./p-BTIeCf3T.js";import{R as _o}from"./p-C2QMVeWW.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";import"./p-Cxuiqv1I.js";import"./p-BpDCLBwW.js";const Eo="isInternationalCheckout",Po=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),uo()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(Eo,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),uo()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Do=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");return s&&e.searchParams.set("zonosQaUrl",s),"1"===t.get("zonosDebug")&&e.searchParams.set("zonosDebug","1"),uo()&&e.searchParams.set("zonosTestMode","1"),e.toString()},Uo={customerGroupId:null,shouldBypass:!1};let jo=null;const No=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Uo};const i=null===(e=io.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return io.loadedConfig?{conclusive:!0,result:Uo}:{conclusive:!1,result:Uo};const c=o?o.checkoutId:await V();if(!c)return zo("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Uo};const r=o?o.checkout:await W(c);if(!r)return zo("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Uo};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return zo("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Uo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return zo(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||jo!==t||(jo=null),e)));return jo=t,t},Ro=async(o={})=>o.forceRefresh||!jo?No(o.preFetched):jo,$o={guestCheckoutType:null},Fo="zonos--bc-checkout-settings",Mo={redirectUrl:null,shouldForceLogin:!1};let Ho=null;const Zo=()=>{if(!Ho){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return $o;const e=null===(o=io.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return zo("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),$o;const t=(o=>{try{const e=window.localStorage.getItem(Fo);if(!e)return null;const t=ho(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await lo("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return zo("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),$o;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(Fo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:(Ho===o&&(Ho=null),!1))).catch((()=>(Ho===o&&(Ho=null),!1)));Ho=o}return Ho},Ko=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Mo;if(!await Zo())return Mo;const e=o?o.checkoutId:await V();if(!e)return Mo;const t=o?o.checkout:await W(e);return t?Q(t)?Mo:(zo("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:Po(),shouldForceLogin:!0}):(zo("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Mo)},Vo="data-zonos-login-from-rewritten",Wo='a[href*="login.php?action=create_account"]:not(['+Vo+"])",Qo=()=>{const o=document.querySelectorAll(Wo);if(!o.length)return;const e=Po({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Vo,"true")}))},Go=(o,e)=>{if(!o.address1||!o.countryCode)return null;const t=[o.firstName,o.lastName].filter(Boolean).join(" ").trim();return{address:{city:o.city||"",country:o.countryCode,line1:o.address1,line2:o.address2||"",postal_code:o.postalCode||"",state:o.stateOrProvinceCode||o.stateOrProvince||""},email:e,name:t,phone:o.phone||""}},qo=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),Yo=(o=!0,e)=>{if(!G.localizationLoaded)return!1;if(e){const t=q(e);return o&&!t&&zo(`Checkout: ${e} is not a shippable country: ${t}`),t}return!!G.isShippableCountry||(o&&zo("Checkout: not shippable country"),!1)},Jo=["1","true","yes"];let Xo=null;const oe=()=>{var o;return!(!(null===(o=window.Zonos)||void 0===o?void 0:o.isBigCommerce)||!window.location.pathname.includes("/checkout"))&&(()=>{const{pathname:o,search:e}=window.location;if(Xo&&Xo.pathname===o&&Xo.search===e)return Xo.enabled;const t=new URLSearchParams(e);var s;if(null===(s=t.get("zBypass"))||!Jo.includes(s.trim().toLowerCase()))return Xo={enabled:!1,pathname:o,search:e},!1;t.delete("zBypass");const n=t.toString(),i=window.location.hash||"";window.history.replaceState(window.history.state,document.title,`${o}${n?`?${n}`:""}${i}`);const c=!0===(null===(a=null===(r=io.checkoutSettings.plugins)||void 0===r?void 0:r.bigcommerce)||void 0===a?void 0:a.allowBypassQuery);var r,a;return Xo={enabled:c,pathname:o,search:window.location.search},c})()},ee='select[name="shippingAddress.countryCode"]',te=({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;if(window.location.pathname.includes("/checkout")&&oe())return;const c=async o=>{var t;const s=document.querySelector((null===(t=io.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||ee),n=(null==s?void 0:s.value)||o;if(!n)return"noAction";if(!Yo(!1,n))return"noAction";const c=await V(),r={checkout:c?await W(c):null,checkoutId:c},{shouldBypass:a}=await Ro({forceRefresh:!0,preFetched:r});if(a)return zo("Bypass customer group detected on BC checkout, stopping interval","info"),"bypass";const d=await Ko({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,"redirected";e&&await e(),Y({isInitializing:!1,newSelectedCountryCode:n,persistOverride:!1});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=Do("/"),"redirected"};let r=!1,a=!1;let d=!1,l=!1,u=!1,h=!1,m=!1;const p=new MutationObserver((async()=>{var g;const f=document.querySelector(o),w=n();if(!f&&w){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(w),void p.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void p.disconnect();if(!h&&!u){u=!0,m=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await V();if(!m)return"noAction";const p=await W(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Ro({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const v=w.countryCode;if(!Yo(!1,v))return"noAction";if(zo(e?`Logged-in user has international shipping address: ${v}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${v}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return zo("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const z=await Ko({preFetched:g});return z.shouldForceLogin&&z.redirectUrl?(window.location.href=z.redirectUrl,"redirected"):(o&&await o(),Y({isInitializing:!1,newSelectedCountryCode:v,persistOverride:!1}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:v,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=Do("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void p.disconnect();"optedOut"===o&&(h=!0,(o=>{a||(a=!0,document.addEventListener("click",(e=>{if(r)return;const{target:t}=e;if(!(t instanceof Element))return;const s=t.closest("#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue");s&&(e.preventDefault(),e.stopImmediatePropagation(),(async(o,e)=>{let t=!0;try{let o=null;try{o=await(async()=>{var o,e,t,s;const n=await V();if(n){const s=await W(n),i=null===(t=null===(e=null===(o=null==s?void 0:s.consignments)||void 0===o?void 0:o[0])||void 0===e?void 0:e.shippingAddress)||void 0===t?void 0:t.countryCode;if(i)return i}const i=document.querySelector((null===(s=io.genericSettings)||void 0===s?void 0:s.bigcommerceDomesticCheckoutCountrySelector)||ee);return(null==i?void 0:i.value)||null})()}catch(o){mo("Error resolving selected shipping country on BC continue",o)}o&&Yo(!1,o)&&e.disconnect(),"redirected"===(o?await c(o):"noAction")&&(t=!1)}catch(o){mo("Error handling BC continue international redirect",o)}t&&(r=!0,o.click(),r=!1)})(s,o))}),!0))})(p))}catch(o){mo("Error checking logged-in user shipping address",o)}finally{u=!1,m=!1}}const v=document.querySelector((null===(g=io.genericSettings)||void 0===g?void 0:g.bigcommerceDomesticCheckoutCountrySelector)||ee);if(!v)return;if(zo("Domestic checkout found - Listening for shipping country change","info",{value:v.value}),l)return;l=!0,p.disconnect();const z=setInterval((async()=>{if(!d&&!m){d=!0;try{const o=await c();if("redirected"===o||"bypass"===o)return void clearInterval(z);d=!1}catch(o){d=!1}}}),1e3),k=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(k);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(k),e.on("change",(o=>{const e=o.value.address.country;e&&!m&&c(e)})))}),500)}));p.observe(document.body,{childList:!0,subtree:!0})};let se=0;const ne=o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},ie=async({cartId:o,retries:e})=>{const t=uo(),{errors:s,json:n}=await lo("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(zo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),ie({cartId:o,retries:e-1})):i?null:n};var ce='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';const re=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||io.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:F()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${bo}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return zo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(zo("Payment intent exist, checking stripe payment intent status"),!n)return zo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(zo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,X.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(zo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(zo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedOrderModificationSession=async o=>{X.checkoutSessionId=o;const{errors:e,json:t}=await d();if(e.length||!t)return!1;const{checkoutSession:s}=t;if(s.completedAt&&s.order)return this.setToFinishStep("succeeded"),!0;if(s.clientSecret){const{status:o}=await a({clientSecret:s.clientSecret});if("processing"===o||"succeeded"===o)return c.clientSecret=s.clientSecret,this.setToFinishStep(o),!0}return!1},this.initializeTestKeys=()=>{var o;X.enabledVariantTestKeys=(null==(o=X.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=io.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return eo(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof io.checkoutSettings.createCartId&&!!io.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;zo("[TEST] - Registering hosted vs native test");const o=ne("hosted_vs_native");if(o)return void zo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await lo("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:K(t)})({testKeys:["hosted_vs_native"]});if(!e)return void zo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:X.enabledVariantTestKeys||[],mergeTestObj:e});eo(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=ne("hosted_vs_native");if(zo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof io.checkoutSettings.createCartId)return zo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return zo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=io.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return zo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};zo('"createCartId" is provided, start building cart');const t=await io.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);zo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=J(o)||G.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:X.checkoutSessionId||void 0,hostedCheckoutUrl:io.genericSettings.hostedCheckoutUrl,isTestMode:uo(),isVariantTest:!0},i),n));return zo(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(l.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=l.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.prefillBigCommerceCustomerAddresses=async()=>{if(!window.Zonos.isBigCommerce)return;if(this.defaultCustomerProfileAddress.length)return;if(Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&"object"==typeof this.defaultAddress&&null!==this.defaultAddress)return;const o=await V();if(!o)return;const e=await W(o);if(!Q(e))return;const t=((o,e)=>{var t,s,n,i;if(!(null===(t=null==o?void 0:o.customer)||void 0===t?void 0:t.id))return[];const{isShippable:c,selectedCountryCode:r}=e,a=o.customer.email||"",d=null!==(n=null===(s=o.consignments)||void 0===s?void 0:s.flatMap((o=>o.shippingAddress?[o.shippingAddress]:[])))&&void 0!==n?n:[],l=null!==(i=o.customer.addresses)&&void 0!==i?i:[],u=new Set,h=[];for(const o of[...l,...d]){const e=Go(o,a);if(!e)continue;if(!c(e.address.country))continue;const t=qo(e);u.has(t)||(u.add(t),h.push(e))}return r?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===r;return t===(e.option.address.country===r)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>Yo(!1,o),selectedCountryCode:G.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,zo(`Prefilled ${String(t.length)} BigCommerce customer address(es) for logged-in shopper`,"info")))},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=io.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(X.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(X.checkoutSessionId=e);const t=X.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(ne("hosted_vs_native")?eo(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+oo,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),eo(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){u({adjustments:l.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,M({event:"zonos-checkout-close",metadata:{checkoutSessionId:X.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==l.step||h(),this.preview||m(),l.step="customer-info",p(),g(),null===(t=(e=io.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){var o;if("function"==typeof io.checkoutSettings.createCartId){zo('"createCartId" is provided, start building cart'),l.customMessage=[];const o=await io.checkoutSettings.createCartId();let e;"object"==typeof o?(zo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),l.customerAuthenticationToken=o.customerAuthenticationToken||null,l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((o=>"string"==typeof o)):[]):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=Co(o);if(!t&&!e)return mo("[ZONOS - loadZonos] invalid cart id"),null;const s=await ie({cartId:o,retries:5});return zo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(mo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return mo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=ao(s);await u({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){zo("tempCartUUID is provided, start building cart");const e=null===(o=window.Zonos.cartData.references)||void 0===o?void 0:o.checkoutSessionId;if(e){if(zo("Setting checkout session id from cart reference","info",e),await this.recoverCompletedOrderModificationSession(e))return c.isFetchingSession=!1,!0;X.checkoutSessionId=e}else zo("Clear checkout session id from storage so we start from a fresh session for this cart"),X.checkoutSessionId=null;const{adjustments:t,cartItems:s}=ao(window.Zonos.cartData);await u({adjustments:t,cartItems:s})}else if(io.checkoutSettings.buildCartDetail&&G.selectedCountryCode){zo("build cart detail");const o=await io.checkoutSettings.buildCartDetail({countryCode:G.selectedCountryCode,currencyCode:G.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));zo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await u({adjustments:s,cartItems:e})}if(!X.checkoutSessionId){const o=await f();if(zo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}l.isStagingMode||w(),await this.applyStripeTheme();const{successBehavior:e,successRedirectUrl:t}=io.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===e||"CLOSE_MODAL"===e&&!!t||!!l.externalConfirmationPageURL,v()&&(l.step="payment"),!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=ho(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;zo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return zo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,zo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){X.checkoutSessionId&&vo({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:X.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,X.checkoutSessionId&&vo({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:X.checkoutSessionId})}markTheSessionAsAbandonedCart(){X.checkoutSessionId&&vo({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:X.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||io.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=io.checkoutSettings.placeOrderButtonSelector,e=io.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${bo}`);if(zo(`attach checkout ${o}`,"info",{href:window.location.href}),zo(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${So}`,`#${bo}`,`#${xo}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(zo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${xo}`),d=t.matches(`#${So}`)||t.matches(`#${bo}`);if(!window.Zonos.isLegacyCheckout&&(!Yo()||((o=!0)=>!G.localizationLoaded||!!G.isDisabledCountry&&(o&&zo("Checkout: disabled country"),!0))())&&!r&&!a&&!d)return;o.preventDefault(),o.stopPropagation(),zo("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;zo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await lo("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),se++,se>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),io.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Ro();if(o)return zo("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Do("/checkout"));const e=await Ko();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");if(!window.Zonos.isLegacyCheckout){let o=null;try{o=await z()}catch(e){o=to("Unable to check inventory. Please try again.")}if(o)return l.inventoryCheckErrorMessage=o,c.isFetchingSession=!1,void(this.open=!1)}null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:X.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),k({isPreview:this.preview,sessionTimeout:54e5}),M({event:"zonos-checkout-start",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await lo("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(l.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=ko(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:yo},po()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};lo("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:yo},po()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};lo("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),Io()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,mo(o),this.isCartExpired)return void(c.isFetchingSession=!0);go({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:yo,cartId:window.Zonos.cartId,checkoutSessionBody:C(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||io.onlineStoreSettings.url}}),b({messages:[to("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:to("Error creating Checkout")})}}}),{capture:!0,passive:!1}),io.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${So}`)&&(t.dispatchEvent(Ao("click")),S(),t.remove()),t.matches(`#${bo}`)&&(t.dispatchEvent(Ao("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;zo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||J(h)||G.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);zo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=J(o)||G.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&G.shippingZoneCountries&&!(t in G.shippingZoneCountries)?zo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],zo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):zo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){l.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,l.isStagingMode=fo(),void 0!==this.overrideStagingMode&&(l.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=io.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&No()})(),window.Zonos.isBigCommerce&&Zo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Qo();const o=new MutationObserver((()=>{Qo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),te({domesticRedirectedBtnSelector:So,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(zo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):zo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(Eo))return;o.searchParams.delete(Eo),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!G.localizationLoaded||!G.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),zo("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${xo}`);if(o)return clearInterval(t),void o.dispatchEvent(Ao("click"));Date.now()-e>15e3&&(clearInterval(t),zo("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){l.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){x(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${xo}`);o&&o.dispatchEvent(Ao("click"))}async handleCustomerInfoContinue(){var o,e,t,s;M({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await I();n&&"stripe"===l.addressFormRenderType&&go({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===l.step?c.isFetchingLandedCost||(l.landedCostData&&(Z({currency:l.currency}),T()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){T()}handleInventoryCheckDialogConfirm(){l.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"===c.checkoutSettlementCurrency&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=A();try{if(H.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,l.inventoryCheckErrorMessage=null,!await O())return c.hasPaymentError=!0,c.customErrorMessage=to("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{l.inventoryCheckErrorMessage=await z()}catch(o){l.inventoryCheckErrorMessage=to("Unable to check inventory. Please try again.")}if(l.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if($()>0){const o=await B();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||to("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(L()){try{const o=await _();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await E();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||to("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await P({noLandedCostCheck:v()}),T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(D(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(U.locked=!1)}}async handleFinishClick(){if(j(),this.preview)return l.step="customer-info",void await this.init();if(h(),m(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||io.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=wo(this.mobile),this.applyStripeTheme(),zo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=wo(this.mobile),this.applyStripeTheme(),zo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=co(this.appearanceSettingsOverride.theme))}handleAddressChange(){j()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return zo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);zo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){zo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=wo(this.mobile),this.isIframed=window.self!==window.top,zo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[so("selectedLocale",(()=>{this.applyStripeTheme()})),N("selectedShippingOption",(()=>{var o,e,t,s;const n=l.selectedShippingOption;(null===(o=io.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),R("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=io.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==io.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&io.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,zo(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Do("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),zo(`mobile: ${this.isMobile}`)}disconnectedCallback(){j(),h(),m(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==l.step&&"error"!==l.step&&!c.stripeElements||c.isFetchingSession,d=v(),{colorPrimary:u,colorSecondary:h,logoUrl:m,style:p}=ro(io.appearance,this.appearanceSettingsOverride||null),g="ENABLED"===io.appearance.zonosAttribution,f=io.appearance.theme,w=u&&Bo(u)?"DARK":"LIGHT",z=this.isMobile?f:w,k=this.isMobile?void 0:h,{customMessages:y}=G,C=null===(o=y.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,b=this.getCurrentLocalePageEnum(),S=y.filter((o=>o.pageName===b)),x=this.getBaseCurrencySettlementInfo(),I=()=>{const o=this.preview?`${m}?timestamp=${Date.now()}`:m;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${io.organizationName} logo`,src:o}))},T=uo(),A=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||fo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},I(),T&&e("zonos-badge",{badgeColor:"orange",size:"small"},to("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},to("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),S.map((o=>e("zonos-custom-message",{icon:ce,message:o.message}))))},O=()=>l.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:to("Your checkout session has expired. Please reload the page to continue."),restStateTitle:to("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},to("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":Oo({overrideBorderStyle:p})}},"finish"!==l.step&&"error"!==l.step&&e(t,null,e("div",{class:"zonos--left","data-theme":z,style:Lo({"--zonos--primary-color":this.isMobile?void 0:u})},!this.isMobile&&A(),"customer-info"===l.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:k}),"shipping"===l.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:k}),"payment"===l.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:k})),e("div",{class:"zonos--right","data-theme":f},this.isMobile&&A(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:_o}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:k}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:ce,message:C})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:ce,message:C}))))),("finish"===l.step||"error"===l.step)&&e("div",{class:"zonos--done","data-theme":f},e("div",{class:"zonos--header"},I(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:_o}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:f})),e("zonos-checkout-finish",{borderRadius:p,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===l.step&&l.error?Object.assign(Object.assign({},l.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":f,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:To(["zonos--checkout zonos--elements","payment"===l.step&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?O():e("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":f,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},O()),e("zonos-dialog",{isLoading:!0,loadingText:to("You will be redirected to international checkout shortly."),loadingTitle:to("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:to("You will be redirected to domestic checkout shortly."),loadingTitle:to("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:to("Stay on this page"),dialogConfirmBtnText:to("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:to("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:to("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:to("Don't close"),dialogConfirmBtnText:to("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:to("Would you like to close checkout and return to the site?"),dialogTitle:to("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:to("Return to merchant site"),dialogConfirmBtnText:to("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?to("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):to("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:to("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:to("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,to("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},to("View GAA Form."))),dialogTitle:to("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:to("Return to cart"),dialogIntent:"danger",dialogOpen:!!l.inventoryCheckErrorMessage,dialogSubtitle:l.inventoryCheckErrorMessage,dialogTitle:to("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),x&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:to("Cancel"),dialogConfirmBtnText:to("Pay [orderTotal]",{orderTotal:no({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:to("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:to("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:to("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:to("You are being sent back to the shop to re-add items to your cart."),dialogTitle:to("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}}};re.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{re as zonos_checkout}
|
|
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(e,o,t,i){function n(e){return e ins
|
|
|
2
2
|
/*
|
|
3
3
|
Stencil Client Patch Browser v4.44.2 | MIT Licensed | https://stenciljs.com
|
|
4
4
|
*/
|
|
5
|
-
var e=this;var c=function(){if(i.isDev&&!i.isTesting){n("Running in development mode.")}if(i.cloneNodeFix){u(a.prototype)}var e=i.scriptDataOpts?s.document&&Array.from(s.document.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(r,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===r})):null;var l=o.meta.url;var d=i.scriptDataOpts?(e||{})["data-opts"]||{}:{};if(l!==""){d.resourcesUrl=new URL(".",l).href}return t(d)};var u=function(e){var o=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return o.call(this,e)}var t=o.call(this,false);var i=this.childNodes;if(e){for(var n=0;n<i.length;n++){if(i[n].nodeType!==2){t.appendChild(i[n].cloneNode(true))}}}return t}};c().then((function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,d()];case 1:e.sent();return[2/*return*/,l(JSON.parse('[["p-1bac5ac1.system",[[257,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-5236c676.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"hiddenMode":[4,"hidden-mode"],"mobile":[4],"overrideStagingMode":[4,"override-staging-mode"],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"defaultAddressParams":[32],"defaultCustomerProfileAddress":[32],"customerProfile":[32],"open":[32],"isOverlayLoading":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"shouldShowFedexShippingConsentDialog":[32],"detectedDomesticCheckoutDialogOpen":[32],"redirectToDomesticCheckoutDialogOpen":[32],"loggedInIntlAddressConfirmDialogOpen":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64],"triggerCheckoutInternational":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":[{"appearanceSettingsOverrideChanged":0},{"handleAppearanceSettingsOverrideChange":0}],"overrideStagingMode":[{"overrideStagingModeChanged":0}],"mobile":[{"handleMobileChange":0}],"defaultAddress":[{"handleAddressChange":0}],"customerProfile":[{"handleCustomerProfileChange":0}],"clientSecret":[{"handleClientSecretChange":0}],"stripeCustomerSessionClientSecret":[{"handleClientSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["p-7bd99479.system",[[2,"zonos-collect",{"mobile":[4],"tablet":[4],"stripe":[32],"showLanguageDialogMobile":[32],"submitLoading":[32],"collapseReview":[32],"isMobile":[32],"isTablet":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isOverlayLoading":[32],"isCartCollected":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"confirmationId":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32]},[[9,"resize","resizeListener"]]]]],["p-0b81f8b9.system",[[2,"zonos-invoice",{"mobile":[4],"tablet":[4],"stripe":[32],"showLanguageDialogMobile":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isMobile":[32],"isTablet":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isOverlayLoading":[32],"isCartCollected":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"confirmationId":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32]},[[9,"resize","resizeListener"]]]]],["p-69c3e367.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"desktopLocationOverride":[1,"desktop-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"showDialog":[{"showDialogHandler":0}],"appearanceSettingsOverride":[{"handleAppearanceSettingsOverrideChange":0}]}]]],["p-06030d3b.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"initCollectElement":[64],"initInvoiceElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-49e7bb1e.system",[[257,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-9b399685.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-0a4a7742.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-1409de3b.system",[[273,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"bold":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":[{"iconChangeHandler":0}]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-6db7c0b1.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":[{"isOpenHandler":0}]}]]],["p-5967a1c1.system",[[2,"zonos-airwallex-payment",{"hasError":[32],"clientSecret":[32]},null,{"clientSecret":[{"clientSecretWatcher":0}]}]]],["p-b5882fbb.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"isMobile":[4,"is-mobile"],"selectedItem":[16]}]]],["p-6abec43f.system",[[1,"zonos-store-credit",{"enabled":[4],"customAmountInput":[32]}],[1,"zonos-policy-consent"]]],["p-4ab1c533.system",[[257,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-249c1ee1.system",[[1,"zonos-invoice-cart-items",{"isMobile":[4,"is-mobile"],"errorImages":[32],"locale":[32]}],[1,"zonos-invoice-subtotal",{"isMobile":[4,"is-mobile"]}]]],["p-dfc87b10.system",[[257,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-244e0302.system",[[257,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-5b80aff2.system",[[2,"zonos-invoice-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-invoice-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}],"tablet":[{"handleTabletChange":0}]}],[1,"zonos-invoice-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":[{"handleCollapseChangeFromProp":0}],"collapseState":[{"handleCollapseChange":0}]}],[1,"zonos-invoice-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"confirmationId":[1,"confirmation-id"],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-invoice-review",{"mobile":[4],"tablet":[4],"collapsed":[4],"isMobile":[32],"isTablet":[32],"isLoading":[32]},[[9,"resize","handleWindowResize"]]]]],["p-4806b264.system",[[1,"zonos-collect-cart-items",{"errorImages":[32]}],[1,"zonos-skeleton",{"skeletonWidth":[1,"skeleton-width"],"skeletonHeight":[1,"skeleton-height"],"dismissHandler":[16]}],[257,"zonos-h-stack",{"spacing":[2]}]]],["p-155ed3d3.system",[[2,"zonos-collect-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-collect-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}],"tablet":[{"handleTabletChange":0}]}],[1,"zonos-collect-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":[{"handleCollapseChangeFromProp":0}],"collapseState":[{"handleCollapseChange":0}]}],[1,"zonos-collect-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"confirmationId":[1,"confirmation-id"],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-collect-review",{"mobile":[4],"tablet":[4],"collapsed":[4],"isMobile":[32],"isTablet":[32],"isLoading":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-collect-subtotal",{"subtotals":[32]}]]],["p-195f6e38.system",[[2,"zonos-stripe-input",{"name":[1],"autoComplete":[1,"auto-complete"],"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"error":[1],"inputPlaceholder":[1,"input-placeholder"],"value":[1025],"required":[4],"internalValue":[32]},null,{"inputValue":[{"onInputValueChange":0}],"value":[{"onValueChange":0}]}]]],["p-51400242.system",[[257,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"loadingTitle":[1,"loading-title"],"loadingText":[1,"loading-text"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}]]],["p-756d303f.system",[[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-474e8a92.system",[[257,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-c403f004.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":[{"onInputValueChange":0}]}]]],["p-9c33f7ed.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-92fe9a1f.system",[[257,"zonos-v-stack",{"spacing":[2]}]]],["p-11defdca.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"buffer":[2],"scrollTop":[32],"totalHeight":[32],"containerDimensions":[32]},null,{"itemHeights":[{"updateTotalHeight":0}],"fallbackItemHeight":[{"updateTotalHeight":0}]}]]],["p-a40fd99b.system",[[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-loading-overlay",{"open":[4],"spinnerColor":[1,"spinner-color"],"size":[2]}],[262,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"shortAddressCodeErrorMessage":[1,"short-address-code-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"checkoutSessionId":[32],"prevCountry":[32],"prevPostalCode":[32]},null,{"checkoutSessionId":[{"isAddressFilledChanged":0}],"isAddressFilled":[{"isAddressFilledChanged":0}],"stripe":[{"watchInitStripe":0}],"defaultAddress":[{"defaultAddressChanged":0}]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32],"isStagingMode":[32],"clientSecret":[32],"retriesInitializeLink":[32]},null,{"isStagingMode":[{"watchIsStagingMode":0}],"stripe":[{"watchInitStripe":0}],"clientSecret":[{"watchInitStripe":0}],"defaultEmail":[{"watchDefaultEmail":0}]}]]],["p-31043c2e.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":[{"watchTranslatedShippingAddress":0}],"translatedBillingAddress":[{"watchTranslatedBillingAddress":0}]}],[262,"zonos-custom-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"shortAddressCodeErrorMessage":[1,"short-address-code-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"isAddressLine1Entered":[32],"addressSuggestions":[32],"countryField":[32],"startGooglePlaceSuggestions":[32],"city":[32],"country":[32],"firstName":[32],"lastName":[32],"line1":[32],"line2":[32],"phone":[32],"postalCode":[32],"state":[32],"cityError":[32],"stateError":[32],"postalCodeError":[32],"phoneError":[32],"firstNameError":[32],"lastNameError":[32],"isFirstInitialization":[32],"addressService":[32],"checkoutSessionId":[32]},null,{"checkoutSessionId":[{"isAddressFilledChanged":0}],"isAddressFilled":[{"isAddressFilledChanged":0}],"defaultAddress":[{"defaultAddressChanged":0}],"line1":[{"line1Changed":0}],"city":[{"formFieldsChanged":0}],"country":[{"formFieldsChanged":0},{"countryChanged":0}],"firstName":[{"formFieldsChanged":0}],"lastName":[{"formFieldsChanged":0}],"line2":[{"formFieldsChanged":0}],"phone":[{"formFieldsChanged":0}],"postalCode":[{"formFieldsChanged":0}],"state":[{"formFieldsChanged":0}],"addressService":[{"shouldEnabledCustomAddressChanged":0}]}],[1,"zonos-address-completion-dialog",{"continueLoading":[4,"continue-loading"],"dialogOpen":[4,"dialog-open"],"isMobile":[4,"is-mobile"],"missingFields":[16],"shippingAddress":[16],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"values":[32],"showError":[32]},null,{"dialogOpen":[{"watchDialogOpen":0}]}],[1,"zonos-address-suggestions",{"type":[1],"suggestions":[16],"selectedSuggestionId":[32],"localSuggestions":[32],"lastHoveredSuggestionId":[32]},null,{"suggestions":[{"suggestionsChanged":0}]}],[2,"zonos-stripe-phone-input",{"autoComplete":[1,"auto-complete"],"countryOptions":[16],"disabled":[4],"error":[1],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"inputValue":[1,"input-value"],"countryCode":[1,"country-code"],"minWidth":[1,"min-width"],"selectedCountry":[32],"phoneNumber":[32],"isFocused":[32],"isSelectOpen":[32]},null,{"countryCode":[{"onCountryCodeChange":0}],"countryOptions":[{"onCountryOptionsChange":0}],"selectedCountry":[{"onSelectedCountryChange":0}],"inputValue":[{"onPhoneNumberChange":0}]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":[{"watchCurrentAddress":0}]}],[1,"zonos-stripe-select",{"name":[1],"selectedValue":[1,"selected-value"],"selectLabel":[1,"select-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"error":[1],"selectPlaceholder":[1,"select-placeholder"],"options":[16],"autoComplete":[1,"auto-complete"],"value":[1025],"required":[4],"isClearable":[4,"is-clearable"],"minWidth":[1,"min-width"],"internalValue":[32],"internalOptions":[32]},null,{"options":[{"onOptionsChange":0}],"selectedValue":[{"onSelectedValueChange":0}],"value":[{"onValueChange":0}]}]]],["p-17c7ea4a.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[257,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-23352709.system",[[1,"zonos-empty-state-payment",{"emptyStateText":[1,"empty-state-text"],"theme":[1]}],[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32],"isPaymentInfoFilled":[32]},null,{"isPaymentInfoFilled":[{"watchIsPaymentInfoFilled":0}],"stripeElements":[{"watchInitStripe":0}],"stripe":[{"watchInitStripe":0}]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}],[257,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-5016d71b.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"shouldUseCustomAddressFormOverride":[4,"should-use-custom-address-form-override"],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"taxIdErrorMessage":[32],"shortAddressCodeErrorMessage":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"openCompletionDialog":[32],"missingShippingFields":[32],"isEmailError":[32],"recordedFormTypeUsed":[32],"selectedCountryCode":[32],"genericSettings":[32],"addressFormRenderType":[32],"exceededCharacterLimitErrorFieldList":[32]},null,{"showErrorBanner":[{"watchShowErrorBanner":0}],"shouldUseCustomAddressFormOverride":[{"watchShouldEnabledCustomAddress":0}],"genericSettings":[{"watchShouldEnabledCustomAddress":0}],"selectedCountryCode":[{"watchShouldEnabledCustomAddress":0}]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"isMobile":[4,"is-mobile"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32],"shippingData":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32],"isImmediateRedirecting":[32]}],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[257,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),o)]}}))}))}))}}}));
|
|
5
|
+
var e=this;var c=function(){if(i.isDev&&!i.isTesting){n("Running in development mode.")}if(i.cloneNodeFix){u(a.prototype)}var e=i.scriptDataOpts?s.document&&Array.from(s.document.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(r,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===r})):null;var l=o.meta.url;var d=i.scriptDataOpts?(e||{})["data-opts"]||{}:{};if(l!==""){d.resourcesUrl=new URL(".",l).href}return t(d)};var u=function(e){var o=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return o.call(this,e)}var t=o.call(this,false);var i=this.childNodes;if(e){for(var n=0;n<i.length;n++){if(i[n].nodeType!==2){t.appendChild(i[n].cloneNode(true))}}}return t}};c().then((function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,d()];case 1:e.sent();return[2/*return*/,l(JSON.parse('[["p-1bac5ac1.system",[[257,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-be1237fc.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"hiddenMode":[4,"hidden-mode"],"mobile":[4],"overrideStagingMode":[4,"override-staging-mode"],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"defaultAddressParams":[32],"defaultCustomerProfileAddress":[32],"customerProfile":[32],"open":[32],"isOverlayLoading":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"shouldShowFedexShippingConsentDialog":[32],"detectedDomesticCheckoutDialogOpen":[32],"redirectToDomesticCheckoutDialogOpen":[32],"loggedInIntlAddressConfirmDialogOpen":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64],"triggerCheckoutInternational":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":[{"appearanceSettingsOverrideChanged":0},{"handleAppearanceSettingsOverrideChange":0}],"overrideStagingMode":[{"overrideStagingModeChanged":0}],"mobile":[{"handleMobileChange":0}],"defaultAddress":[{"handleAddressChange":0}],"customerProfile":[{"handleCustomerProfileChange":0}],"clientSecret":[{"handleClientSecretChange":0}],"stripeCustomerSessionClientSecret":[{"handleClientSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["p-7bd99479.system",[[2,"zonos-collect",{"mobile":[4],"tablet":[4],"stripe":[32],"showLanguageDialogMobile":[32],"submitLoading":[32],"collapseReview":[32],"isMobile":[32],"isTablet":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isOverlayLoading":[32],"isCartCollected":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"confirmationId":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32]},[[9,"resize","resizeListener"]]]]],["p-0b81f8b9.system",[[2,"zonos-invoice",{"mobile":[4],"tablet":[4],"stripe":[32],"showLanguageDialogMobile":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isMobile":[32],"isTablet":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isOverlayLoading":[32],"isCartCollected":[32],"isCartExpired":[32],"payInUsdConfirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"confirmationId":[32],"clientSecret":[32],"stripeCustomerSessionClientSecret":[32]},[[9,"resize","resizeListener"]]]]],["p-69c3e367.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"desktopLocationOverride":[1,"desktop-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"showDialog":[{"showDialogHandler":0}],"appearanceSettingsOverride":[{"handleAppearanceSettingsOverrideChange":0}]}]]],["p-06030d3b.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"initCollectElement":[64],"initInvoiceElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-49e7bb1e.system",[[257,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-9b399685.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-0a4a7742.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-1409de3b.system",[[273,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"bold":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":[{"iconChangeHandler":0}]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-6db7c0b1.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":[{"isOpenHandler":0}]}]]],["p-5967a1c1.system",[[2,"zonos-airwallex-payment",{"hasError":[32],"clientSecret":[32]},null,{"clientSecret":[{"clientSecretWatcher":0}]}]]],["p-b5882fbb.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"isMobile":[4,"is-mobile"],"selectedItem":[16]}]]],["p-6abec43f.system",[[1,"zonos-store-credit",{"enabled":[4],"customAmountInput":[32]}],[1,"zonos-policy-consent"]]],["p-4ab1c533.system",[[257,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-249c1ee1.system",[[1,"zonos-invoice-cart-items",{"isMobile":[4,"is-mobile"],"errorImages":[32],"locale":[32]}],[1,"zonos-invoice-subtotal",{"isMobile":[4,"is-mobile"]}]]],["p-dfc87b10.system",[[257,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-244e0302.system",[[257,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-5b80aff2.system",[[2,"zonos-invoice-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-invoice-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}],"tablet":[{"handleTabletChange":0}]}],[1,"zonos-invoice-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":[{"handleCollapseChangeFromProp":0}],"collapseState":[{"handleCollapseChange":0}]}],[1,"zonos-invoice-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"confirmationId":[1,"confirmation-id"],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-invoice-review",{"mobile":[4],"tablet":[4],"collapsed":[4],"isMobile":[32],"isTablet":[32],"isLoading":[32]},[[9,"resize","handleWindowResize"]]]]],["p-4806b264.system",[[1,"zonos-collect-cart-items",{"errorImages":[32]}],[1,"zonos-skeleton",{"skeletonWidth":[1,"skeleton-width"],"skeletonHeight":[1,"skeleton-height"],"dismissHandler":[16]}],[257,"zonos-h-stack",{"spacing":[2]}]]],["p-155ed3d3.system",[[2,"zonos-collect-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-collect-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}],"tablet":[{"handleTabletChange":0}]}],[1,"zonos-collect-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":[{"handleCollapseChangeFromProp":0}],"collapseState":[{"handleCollapseChange":0}]}],[1,"zonos-collect-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"confirmationId":[1,"confirmation-id"],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-collect-review",{"mobile":[4],"tablet":[4],"collapsed":[4],"isMobile":[32],"isTablet":[32],"isLoading":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-collect-subtotal",{"subtotals":[32]}]]],["p-195f6e38.system",[[2,"zonos-stripe-input",{"name":[1],"autoComplete":[1,"auto-complete"],"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"error":[1],"inputPlaceholder":[1,"input-placeholder"],"value":[1025],"required":[4],"internalValue":[32]},null,{"inputValue":[{"onInputValueChange":0}],"value":[{"onValueChange":0}]}]]],["p-51400242.system",[[257,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"loadingTitle":[1,"loading-title"],"loadingText":[1,"loading-text"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}]]],["p-756d303f.system",[[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-474e8a92.system",[[257,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-c403f004.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":[{"onInputValueChange":0}]}]]],["p-9c33f7ed.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-92fe9a1f.system",[[257,"zonos-v-stack",{"spacing":[2]}]]],["p-11defdca.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"buffer":[2],"scrollTop":[32],"totalHeight":[32],"containerDimensions":[32]},null,{"itemHeights":[{"updateTotalHeight":0}],"fallbackItemHeight":[{"updateTotalHeight":0}]}]]],["p-a40fd99b.system",[[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-loading-overlay",{"open":[4],"spinnerColor":[1,"spinner-color"],"size":[2]}],[262,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"shortAddressCodeErrorMessage":[1,"short-address-code-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"checkoutSessionId":[32],"prevCountry":[32],"prevPostalCode":[32]},null,{"checkoutSessionId":[{"isAddressFilledChanged":0}],"isAddressFilled":[{"isAddressFilledChanged":0}],"stripe":[{"watchInitStripe":0}],"defaultAddress":[{"defaultAddressChanged":0}]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32],"isStagingMode":[32],"clientSecret":[32],"retriesInitializeLink":[32]},null,{"isStagingMode":[{"watchIsStagingMode":0}],"stripe":[{"watchInitStripe":0}],"clientSecret":[{"watchInitStripe":0}],"defaultEmail":[{"watchDefaultEmail":0}]}]]],["p-31043c2e.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":[{"watchTranslatedShippingAddress":0}],"translatedBillingAddress":[{"watchTranslatedBillingAddress":0}]}],[262,"zonos-custom-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"shortAddressCodeErrorMessage":[1,"short-address-code-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"isAddressLine1Entered":[32],"addressSuggestions":[32],"countryField":[32],"startGooglePlaceSuggestions":[32],"city":[32],"country":[32],"firstName":[32],"lastName":[32],"line1":[32],"line2":[32],"phone":[32],"postalCode":[32],"state":[32],"cityError":[32],"stateError":[32],"postalCodeError":[32],"phoneError":[32],"firstNameError":[32],"lastNameError":[32],"isFirstInitialization":[32],"addressService":[32],"checkoutSessionId":[32]},null,{"checkoutSessionId":[{"isAddressFilledChanged":0}],"isAddressFilled":[{"isAddressFilledChanged":0}],"defaultAddress":[{"defaultAddressChanged":0}],"line1":[{"line1Changed":0}],"city":[{"formFieldsChanged":0}],"country":[{"formFieldsChanged":0},{"countryChanged":0}],"firstName":[{"formFieldsChanged":0}],"lastName":[{"formFieldsChanged":0}],"line2":[{"formFieldsChanged":0}],"phone":[{"formFieldsChanged":0}],"postalCode":[{"formFieldsChanged":0}],"state":[{"formFieldsChanged":0}],"addressService":[{"shouldEnabledCustomAddressChanged":0}]}],[1,"zonos-address-completion-dialog",{"continueLoading":[4,"continue-loading"],"dialogOpen":[4,"dialog-open"],"isMobile":[4,"is-mobile"],"missingFields":[16],"shippingAddress":[16],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"values":[32],"showError":[32]},null,{"dialogOpen":[{"watchDialogOpen":0}]}],[1,"zonos-address-suggestions",{"type":[1],"suggestions":[16],"selectedSuggestionId":[32],"localSuggestions":[32],"lastHoveredSuggestionId":[32]},null,{"suggestions":[{"suggestionsChanged":0}]}],[2,"zonos-stripe-phone-input",{"autoComplete":[1,"auto-complete"],"countryOptions":[16],"disabled":[4],"error":[1],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"inputValue":[1,"input-value"],"countryCode":[1,"country-code"],"minWidth":[1,"min-width"],"selectedCountry":[32],"phoneNumber":[32],"isFocused":[32],"isSelectOpen":[32]},null,{"countryCode":[{"onCountryCodeChange":0}],"countryOptions":[{"onCountryOptionsChange":0}],"selectedCountry":[{"onSelectedCountryChange":0}],"inputValue":[{"onPhoneNumberChange":0}]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":[{"watchCurrentAddress":0}]}],[1,"zonos-stripe-select",{"name":[1],"selectedValue":[1,"selected-value"],"selectLabel":[1,"select-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"error":[1],"selectPlaceholder":[1,"select-placeholder"],"options":[16],"autoComplete":[1,"auto-complete"],"value":[1025],"required":[4],"isClearable":[4,"is-clearable"],"minWidth":[1,"min-width"],"internalValue":[32],"internalOptions":[32]},null,{"options":[{"onOptionsChange":0}],"selectedValue":[{"onSelectedValueChange":0}],"value":[{"onValueChange":0}]}]]],["p-17c7ea4a.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[257,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-23352709.system",[[1,"zonos-empty-state-payment",{"emptyStateText":[1,"empty-state-text"],"theme":[1]}],[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32],"isPaymentInfoFilled":[32]},null,{"isPaymentInfoFilled":[{"watchIsPaymentInfoFilled":0}],"stripeElements":[{"watchInitStripe":0}],"stripe":[{"watchInitStripe":0}]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}],[257,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-5016d71b.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"shouldUseCustomAddressFormOverride":[4,"should-use-custom-address-form-override"],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"taxIdErrorMessage":[32],"shortAddressCodeErrorMessage":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"openCompletionDialog":[32],"missingShippingFields":[32],"isEmailError":[32],"recordedFormTypeUsed":[32],"selectedCountryCode":[32],"genericSettings":[32],"addressFormRenderType":[32],"exceededCharacterLimitErrorFieldList":[32]},null,{"showErrorBanner":[{"watchShowErrorBanner":0}],"shouldUseCustomAddressFormOverride":[{"watchShouldEnabledCustomAddress":0}],"genericSettings":[{"watchShouldEnabledCustomAddress":0}],"selectedCountryCode":[{"watchShouldEnabledCustomAddress":0}]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":[{"continueLoadingWatcher":0}],"hasStripePaymentError":[{"stripePaymentErrorWatcher":0}]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":[{"handleMobileChange":0}]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"isMobile":[4,"is-mobile"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32],"shippingData":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32],"isImmediateRedirecting":[32]}],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[257,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),o)]}}))}))}))}}}));
|
|
@@ -54,7 +54,7 @@ var n=new URL(e).searchParams;var t=n.get("zonosQaUrl");if(!t){return null}var r
|
|
|
54
54
|
* When developing, if the script load is from `dev.elements.zonos.com`,
|
|
55
55
|
* it would load script from that same domain instead of loading from cdn
|
|
56
56
|
*/
|
|
57
|
-
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=O(window.location.href);var t="https://v1.4.
|
|
57
|
+
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=O(window.location.href);var t="https://v1.4.2.js.zonos.com";
|
|
58
58
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
59
59
|
if(!n&&(t.includes("test.")||
|
|
60
60
|
// Vercel git domain
|
|
@@ -99,15 +99,15 @@ return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
|
99
99
|
e.sent();return[2/*return*/,F({cartId:w,retries:p-1})];case 3:if(m){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},f),{zonosMode:v})]}}))}))};var M=function(e){return __awaiter(v,void 0,void 0,(function(){var n,t,r,i;return __generator(this,(function(u){switch(u.label){case 0:n=d(e),t=n.isDgsCartId,r=n.isLegacyCartId;if(!r&&!t){s("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,F({cartId:e,retries:5})];case 1:i=u.sent();o("[ZONOS - loadZonos] getting temp cart data","info",i);if(!i){s("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=i.cartData.storeId;window.Zonos.zonosApiKey=i.cartData.credentialToken;window.Zonos.zonosMode=i.zonosMode;return[2/*return*/,{cartData:i.cartData,settings:i.settings,storeFavicon:i.storeFaviconUrl,storeId:i.cartData.storeId,storeLogo:i.storeLogoUrl,zonosApiKey:i.cartData.credentialToken}]}}))}))};var x;
|
|
100
100
|
/**
|
|
101
101
|
* Get the load version and url based on the loadScriptSrc, if the domain that used to load `zonos.js` is in white listed domains, use currentLoadScriptUrl as the load url instead, if zonosQaUrl exists, it would also fall under the white listed domain
|
|
102
|
-
*/var B=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=m({loadScriptSrc:e===null||e===void 0?void 0:e.src}),t=n.currentLoadScriptUrl,r=n.isWhiteListed;if(r){return t}return null}();var G=Date.now();var K="https://v1.4.
|
|
102
|
+
*/var B=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=m({loadScriptSrc:e===null||e===void 0?void 0:e.src}),t=n.currentLoadScriptUrl,r=n.isWhiteListed;if(r){return t}return null}();var G=Date.now();var K="https://v1.4.2.js.zonos.com";var V=B||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.4.2";var q="https://unpkg.com/@zonos/elements@1.4.2";var H="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.4.2";var W="https://fonts.googleapis.com";var Q=/^https:\/\/fonts\.googleapis\.com/;var Y=/** @class */function(){function e(){}return e}();e("Zonos",Y);x=Y;Y.doneInit=false;Y.cartSettings=null;
|
|
103
103
|
// if query 'zonosDebug=1' param from url, debug mode is on
|
|
104
|
-
Y.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Y.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Y._paypalMockResponse=null;Y.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Y.isBigCommerce=false;Y.releaseDate="
|
|
104
|
+
Y.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Y.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Y._paypalMockResponse=null;Y.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Y.isBigCommerce=false;Y.releaseDate="1792599810755";Y.isLegacyCheckout=false;Y.googleAnalyticId=null;Y.googleAnalyticReady=false;Y.facebookPixelId=null;Y.facebookPixelReady=false;Y.startLoadTime=G;Y.domain=typeof window!=="undefined"?// domain that embeds the iframe
|
|
105
105
|
window.location!=window.parent.location&&document.referrer||
|
|
106
106
|
// current domain
|
|
107
107
|
document.location.hostname:"";Y.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Y.overrideUseCustomAddressForm=false;Y.isCollect=false;Y.isInvoice=false;
|
|
108
108
|
/**
|
|
109
109
|
* By default, the package will load from npm
|
|
110
|
-
*/Y.isNpm=true;Y.zonosQaUrl=null;Y.zonosQaUrlApi=null;Y.trackEventLogs=[];Y.version="v".concat("1.4.
|
|
110
|
+
*/Y.isNpm=true;Y.zonosQaUrl=null;Y.zonosQaUrlApi=null;Y.trackEventLogs=[];Y.version="v".concat("1.4.2");Y.modeAlerted=false;Y.cartData=null;Y.paypal=null;Y.zonosMode=null;Y.IframeService=r;Y.getCurrentTimestamp=function(){return(new Date).getTime()};Y.zonosController=null;Y.loadTimeApiInfoList=[];Y.logIntervalId=null;Y.init=function(e){return __awaiter(v,void 0,void 0,(function(){var n,t,r,i,u,a,c,d,f,v,m,w,p,h,O;return __generator(this,(function(S){switch(S.label){case 0:n=e.appearance,t=e.checkoutSettings,r=e.currencyConverter,i=e.helloSettings,u=e.onCountryChange,a=e.overrideCurrencyFormat,c=e.storeId,d=e.zonosApiKey;x.cartId=D();
|
|
111
111
|
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
112
112
|
// gated on whether at least one of them is configured.
|
|
113
113
|
x.createCartId=t===null||t===void 0?void 0:t.createCartId;
|