@zonos/elements 1.3.229 → 1.3.231
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/{buildCartItemsByTempCart-309fcebf.js → buildCartItemsByTempCart-edddbf4b.js} +1 -0
- package/dist/cjs/{cart-ad82a680.js → cart-9b519566.js} +6 -2
- package/dist/cjs/hasInclusivePrice-12605be9.js +24 -0
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{localization-31e3dfe3.js → localization-38af974b.js} +118 -30
- package/dist/cjs/{paypal-88b5e878.js → paypal-e8fa2302.js} +3 -3
- package/dist/cjs/{placeTestOrder-6aefbf9c.js → placeTestOrder-6388881f.js} +11 -7
- package/dist/cjs/{renderFallback-87c908ad.js → renderFallback-bb2c4bce.js} +2 -2
- package/dist/cjs/{translationStore-b8b25e9d.js → translationStore-f2d5eae9.js} +420 -360
- package/dist/cjs/zonos-address_11.cjs.entry.js +21 -5
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +73 -13
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -6
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +12 -5
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -6
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +55 -45
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +68 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -1
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +54 -43
- package/dist/collection/components/main/zonos-controller.js +5 -2
- package/dist/collection/components/store/hello/localization.js +47 -16
- package/dist/collection/components/store/translationStore/strings.arabic.js +21 -18
- package/dist/collection/components/store/translationStore/strings.base.js +21 -18
- package/dist/collection/components/store/translationStore/strings.chinese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.danish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.dutch.js +21 -18
- package/dist/collection/components/store/translationStore/strings.french.js +21 -18
- package/dist/collection/components/store/translationStore/strings.german.js +21 -18
- package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -18
- package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.italian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.japanese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.korean.js +21 -18
- package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.polish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.russian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.spanish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.swedish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.turkish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -18
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +18 -2
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +1 -0
- package/dist/collection/components/utils/api/{getInclusivePricing.js → getInclusivePriceConfigurations.js} +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +2 -5
- package/dist/collection/components/utils/api/getZonosSettings.js +5 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +6 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -5
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +4 -1
- package/dist/collection/components/utils/getOverridenZCountry.js +11 -0
- package/dist/collection/components/utils/hasInclusivePrice.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusivePrice.js +39 -0
- package/dist/collection/components/utils/hello/currencyConversion/calculateInclusivePrice.js +32 -0
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +11 -6
- package/dist/collection/constants/key.js +9 -0
- package/dist/collection/types/InclusivePricing.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +87 -3
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/utils/performBlurCurrency.js +38 -5
- package/dist/esm/{buildCartItemsByTempCart-c4488f73.js → buildCartItemsByTempCart-a117f75d.js} +1 -0
- package/dist/esm/{cart-c74f9aaa.js → cart-bc0e1598.js} +6 -2
- package/dist/esm/hasInclusivePrice-706cc09d.js +20 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/{localization-106476cb.js → localization-53f67640.js} +117 -31
- package/dist/esm/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +3 -3
- package/dist/esm/{placeTestOrder-891295e8.js → placeTestOrder-917731cf.js} +11 -7
- package/dist/esm/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +2 -2
- package/dist/esm/{translationStore-766b7521.js → translationStore-d241dcf7.js} +420 -360
- package/dist/esm/zonos-address_11.entry.js +21 -5
- package/dist/esm/zonos-cart-items_13.entry.js +73 -13
- package/dist/esm/zonos-checkout.entry.js +9 -6
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +12 -5
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +9 -6
- package/dist/esm/zonos-empty-state-payment_4.entry.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +55 -45
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/buildCartItemsByTempCart-a117f75d.js +1 -0
- package/dist/esm-es5/cart-bc0e1598.js +1 -0
- package/dist/esm-es5/hasInclusivePrice-706cc09d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/localization-53f67640.js +1 -0
- package/dist/esm-es5/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +1 -1
- package/dist/esm-es5/placeTestOrder-917731cf.js +1 -0
- package/dist/esm-es5/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +1 -1
- package/dist/esm-es5/translationStore-d241dcf7.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/scripts/blurCurrencyOnInit.js +1 -1
- package/dist/scripts/index.d.ts +39 -6
- 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/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +3 -0
- package/dist/types/components/store/hello/localization.d.ts +14 -3
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.base.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.french.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.german.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -15
- package/dist/types/components/utils/api/getInclusivePriceConfigurations.d.ts +2 -0
- package/dist/types/components/utils/getOverridenZCountry.d.ts +5 -0
- package/dist/types/components/utils/hasInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/calculateInclusivePrice.d.ts +27 -0
- package/dist/types/constants/key.d.ts +9 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/InclusivePricing.d.ts +13 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +1 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +192 -51
- package/dist/types/types/generated/graphql.internal.types.ts +229 -50
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +2 -0
- package/dist/types/utils/performBlurCurrency.d.ts +12 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-c89e9d56.system.js → p-0047fecf.system.js} +1 -1
- package/dist/zonos-elements/{p-bd373de0.system.entry.js → p-0bc8e55c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-964a4d85.js → p-2008df67.js} +1 -1
- package/dist/zonos-elements/{p-2db90c99.system.entry.js → p-22338b4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3d2925c5.system.entry.js → p-2eaa5013.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-288f5a5b.system.entry.js → p-304bdbc2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-30981f80.entry.js +1 -0
- package/dist/zonos-elements/{p-69451a50.system.js → p-398d9022.system.js} +1 -1
- package/dist/zonos-elements/p-3a242dfc.system.js +1 -0
- package/dist/zonos-elements/{p-5608ac9d.entry.js → p-3eda5c2c.entry.js} +1 -1
- package/dist/zonos-elements/p-3f0ca5f9.js +1 -0
- package/dist/zonos-elements/{p-23f6a2fb.system.entry.js → p-3f35b8b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de984173.system.js → p-419c292c.system.js} +1 -1
- package/dist/zonos-elements/{p-7a97e1cf.system.entry.js → p-4697f061.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4f5be8f0.entry.js +1 -0
- package/dist/zonos-elements/p-516a9666.system.js +1 -0
- package/dist/zonos-elements/p-55c6ff14.system.entry.js +1 -0
- package/dist/zonos-elements/p-6d563f33.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9c728733.system.js → p-7730879e.system.js} +1 -1
- package/dist/zonos-elements/p-7920d79c.system.js +1 -0
- package/dist/zonos-elements/p-7c96a585.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/{p-29c80a34.js → p-83666056.js} +1 -1
- package/dist/zonos-elements/{p-2b84039a.entry.js → p-91fa43ef.entry.js} +1 -1
- package/dist/zonos-elements/p-9a444a82.system.entry.js +1 -0
- package/dist/zonos-elements/p-9bdad585.system.entry.js +1 -0
- package/dist/zonos-elements/p-abc0fb80.js +1 -0
- package/dist/zonos-elements/{p-b0a75761.entry.js → p-ac26a931.entry.js} +1 -1
- package/dist/zonos-elements/p-bb707dfd.system.js +1 -0
- package/dist/zonos-elements/{p-10894d36.entry.js → p-bc963b03.entry.js} +1 -1
- package/dist/zonos-elements/p-c0e080e3.js +1 -0
- package/dist/zonos-elements/p-c20429ea.entry.js +1 -0
- package/dist/zonos-elements/p-c28da00e.entry.js +1 -0
- package/dist/zonos-elements/p-c9be03e0.entry.js +1 -0
- package/dist/zonos-elements/{p-6c8e4f01.system.entry.js → p-cb70de13.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cec35a21.entry.js +1 -0
- package/dist/zonos-elements/{p-cf56b990.entry.js → p-d15cd138.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f1024de.system.entry.js → p-d852d6da.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d9486c57.entry.js +1 -0
- package/dist/zonos-elements/p-db73c11a.entry.js +1 -0
- package/dist/zonos-elements/{p-203c7fda.js → p-e27a9450.js} +1 -1
- package/dist/zonos-elements/{p-76f924b3.entry.js → p-ede9e968.entry.js} +1 -1
- package/dist/zonos-elements/p-ee8fcde6.js +1 -0
- package/dist/zonos-elements/p-f688d7a4.system.js +1 -0
- package/dist/zonos-elements/{p-236e0144.system.entry.js → p-ff1722d0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ff522088.system.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -3
- package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +0 -1
- package/dist/esm-es5/cart-c74f9aaa.js +0 -1
- package/dist/esm-es5/localization-106476cb.js +0 -1
- package/dist/esm-es5/placeTestOrder-891295e8.js +0 -1
- package/dist/esm-es5/translationStore-766b7521.js +0 -1
- package/dist/types/components/utils/api/getInclusivePricing.d.ts +0 -6
- package/dist/zonos-elements/p-053a042e.entry.js +0 -1
- package/dist/zonos-elements/p-0d3767ec.entry.js +0 -1
- package/dist/zonos-elements/p-1d15662c.js +0 -1
- package/dist/zonos-elements/p-21b251f0.system.entry.js +0 -1
- package/dist/zonos-elements/p-225a61c4.system.entry.js +0 -1
- package/dist/zonos-elements/p-462f8857.entry.js +0 -1
- package/dist/zonos-elements/p-57ee34aa.system.entry.js +0 -1
- package/dist/zonos-elements/p-595668d7.system.js +0 -1
- package/dist/zonos-elements/p-62803534.entry.js +0 -1
- package/dist/zonos-elements/p-6497ce22.entry.js +0 -1
- package/dist/zonos-elements/p-65db3219.entry.js +0 -1
- package/dist/zonos-elements/p-94853366.system.entry.js +0 -1
- package/dist/zonos-elements/p-9972941a.entry.js +0 -1
- package/dist/zonos-elements/p-ad7be556.system.entry.js +0 -1
- package/dist/zonos-elements/p-b4fe3604.system.js +0 -1
- package/dist/zonos-elements/p-b8293509.js +0 -1
- package/dist/zonos-elements/p-c3c3cd98.js +0 -1
- package/dist/zonos-elements/p-cdaf52f4.system.js +0 -1
- package/dist/zonos-elements/p-cef1e888.system.js +0 -1
- package/dist/zonos-elements/p-eea0d8af.js +0 -1
- package/dist/zonos-elements/p-f4085c23.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as s,H as e,F as c}from"./p-b30c2ad9.js";import{c as t,i as l,d as n,e as i,o as a,f as r,k as z,l as d,u as h,w as m,B as p,y as u,g}from"./p-1d15662c.js";import{i as f,a as b,c as x,b as w,d as v,e as y,r as k}from"./p-203c7fda.js";import{p as C,a as S}from"./p-964a4d85.js";import{s as I,c as j,d as L,l as O}from"./p-c3c3cd98.js";import{t as T}from"./p-eea0d8af.js";import{z as U}from"./p-7af39c98.js";import{b as E}from"./p-29c80a34.js";import{h as P,s as N,l as _,g as A}from"./p-41dd1cb8.js";import{c as D}from"./p-b4b7f705.js";import{l as B}from"./p-0a377722.js";import{l as F}from"./p-97aceb11.js";import"./p-e688e493.js";import"./p-0ffd710e.js";const H=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=t.clientSecret,this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=i.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=U.appearance.theme;await l({overrideTheme:this.isMobile?o:void 0,paypalEnabled:C()})},this.fetchCheckoutSession=async o=>{const{json:s}=await P("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,c=e.get("payment_intent_client_secret"),l=e.get("zonosCheckoutSessionId");if(B("Payment intent exist, checking stripe payment intent status"),!c)return B("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:i,status:a}=await n({clientSecret:c});if(new URLSearchParams(window.location.search).get("redirect_status")&&l){B(i?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(l);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,I.checkoutSessionId=l,t.clientSecret=c,this.setToFinishStep(a),{shouldAllowOrder:!1}}return s?(B("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(B("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=f(this.mobile),this.isTablet=b(this.tablet)}async setToFinishStep(o){t.stripe=window.Zonos.stripe,i.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,c,t,l,h,m,p,u,g;if(!window.Zonos.cartData)return;const f=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;f&&(i.currency=f);const b=null===(c=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===c?void 0:c.checkoutSessionId,v=null===(l=null===(t=window.Zonos.cartData)||void 0===t?void 0:t.references)||void 0===l?void 0:l.landedCostId;if(!v)return void a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")});b?(B("Setting checkout session id from cart reference","info",b),I.checkoutSessionId=b):(B("Clear checkout session id from storage so we start from a fresh session for the collect cart"),I.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:s}=E(window.Zonos.cartData);if(await r({adjustments:o,cartItems:s,landedCostId:v,shouldInitSessionOnFailure:!1}),!I.checkoutSessionId&&!b){const o=await z();if(B(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!i.checkoutSession||(null===(h=i.checkoutSession)||void 0===h?void 0:h.completedAt))&&b){const o=await this.fetchCheckoutSession(b);if(this.confirmationId=(null===(m=null==o?void 0:o.checkoutSession.landedCost)||void 0===m?void 0:m.shortId)||null,null==o?void 0:o.checkoutSession.completedAt)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:s}=await n({clientSecret:o.checkoutSession.clientSecret});if("processing"===s||"succeeded"===s)return void this.setToFinishStep(s)}throw N({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:b,cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:v}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!i.checkoutSession)throw N({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:b||"N/A",cartId:null===(u=window.Zonos.cartData)||void 0===u?void 0:u.id,cartLandedCostId:v||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");d();const e=null===(g=i.checkoutSession)||void 0===g?void 0:g.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await x(Object.assign(Object.assign({},i.checkoutSession),{id:I.checkoutSessionId||""})),w({landedCostId:e.id}),this.applyStripeTheme()}catch(o){_(o),a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,c;if(null===(o=t.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=t.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=t.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==t.checkoutSettlementCurrency||!t.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,S.paypalErrorMessage=null,t.hasPaymentError=!1,this.submitLoading=!0,i.inventoryCheckErrorMessage=null,!await h())return t.hasPaymentError=!0,t.customErrorMessage=T("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:t.checkoutSettlementCurrency}),void(this.submitLoading=!1);await v();try{return await m({noLandedCostCheck:!0}),i.step="finish",void(this.confirmationId=y.landedCostShortId||(null===(c=i.selectedLandedCost)||void 0===c?void 0:c.landedCostId)||null)}catch(o){_(o),t.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){t.stripe=window.Zonos.stripe,i.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[p("clientSecret",(()=>{this.applyStripeTheme()})),j("selectedLocale",(()=>{this.applyStripeTheme()}))],B(`mobile: ${this.isMobile}`)}disconnectedCallback(){u(),g(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=t.clientSecret,t.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=U.appearance,a=()=>{const o=`${l}?timestamp=${Date.now()}`;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${U.organizationName} logo`,src:o}))},r=A(),z=()=>{var o;const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl"),l=e.get("zonosDebug"),n=null===(o=F.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(c,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},T("Test mode")),"1"===l&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&s("zonos-badge",{badgeColor:"purple",size:"small"},t)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},n,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:D(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),k({content:s("zonos-text",{class:"zonos--header-title",type:"header"},y.originCompanyName?T("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:y.originCompanyName}):T("Customs charges from your recent purchase are available for payment")),isLoading:y.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:D(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||t.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==i.step&&"error"!==i.step&&s(c,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},T("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"})),s("zonos-collect-payment",{class:D(["zonos--collect-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===i.step||"error"===i.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===i.step&&i.error?Object.assign(Object.assign({},i.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===i.step||"error"===i.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:T("Cancel"),dialogConfirmBtnText:T("Pay [orderTotal]",{orderTotal:L({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:T("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:T("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};H.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-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-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{H as zonos_collect}
|
|
1
|
+
import{r as o,h as s,H as e,F as c}from"./p-b30c2ad9.js";import{c as t,i as l,d as n,e as i,o as a,f as r,k as z,l as d,u as h,w as m,B as p,y as u,g}from"./p-abc0fb80.js";import{i as f,a as b,c as x,b as w,d as v,e as y,r as k}from"./p-e27a9450.js";import{p as C,a as S}from"./p-2008df67.js";import{s as I,c as j,d as L,l as O}from"./p-7c96a585.js";import{t as T}from"./p-c0e080e3.js";import{z as U}from"./p-7af39c98.js";import{b as E}from"./p-83666056.js";import{h as P,s as N,l as _,g as A}from"./p-41dd1cb8.js";import{c as D}from"./p-b4b7f705.js";import{l as B}from"./p-0a377722.js";import{l as F}from"./p-97aceb11.js";import"./p-e688e493.js";import"./p-0ffd710e.js";const H=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=t.clientSecret,this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=i.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=U.appearance.theme;await l({overrideTheme:this.isMobile?o:void 0,paypalEnabled:C()})},this.fetchCheckoutSession=async o=>{const{json:s}=await P("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,c=e.get("payment_intent_client_secret"),l=e.get("zonosCheckoutSessionId");if(B("Payment intent exist, checking stripe payment intent status"),!c)return B("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:i,status:a}=await n({clientSecret:c});if(new URLSearchParams(window.location.search).get("redirect_status")&&l){B(i?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(l);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,I.checkoutSessionId=l,t.clientSecret=c,this.setToFinishStep(a),{shouldAllowOrder:!1}}return s?(B("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(B("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=f(this.mobile),this.isTablet=b(this.tablet)}async setToFinishStep(o){t.stripe=window.Zonos.stripe,i.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,c,t,l,h,m,p,u,g;if(!window.Zonos.cartData)return;const f=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;f&&(i.currency=f);const b=null===(c=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===c?void 0:c.checkoutSessionId,v=null===(l=null===(t=window.Zonos.cartData)||void 0===t?void 0:t.references)||void 0===l?void 0:l.landedCostId;if(!v)return void a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")});b?(B("Setting checkout session id from cart reference","info",b),I.checkoutSessionId=b):(B("Clear checkout session id from storage so we start from a fresh session for the collect cart"),I.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:s}=E(window.Zonos.cartData);if(await r({adjustments:o,cartItems:s,landedCostId:v,shouldInitSessionOnFailure:!1}),!I.checkoutSessionId&&!b){const o=await z();if(B(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!i.checkoutSession||(null===(h=i.checkoutSession)||void 0===h?void 0:h.completedAt))&&b){const o=await this.fetchCheckoutSession(b);if(this.confirmationId=(null===(m=null==o?void 0:o.checkoutSession.landedCost)||void 0===m?void 0:m.shortId)||null,null==o?void 0:o.checkoutSession.completedAt)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:s}=await n({clientSecret:o.checkoutSession.clientSecret});if("processing"===s||"succeeded"===s)return void this.setToFinishStep(s)}throw N({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:b,cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:v}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!i.checkoutSession)throw N({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:b||"N/A",cartId:null===(u=window.Zonos.cartData)||void 0===u?void 0:u.id,cartLandedCostId:v||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");d();const e=null===(g=i.checkoutSession)||void 0===g?void 0:g.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await x(Object.assign(Object.assign({},i.checkoutSession),{id:I.checkoutSessionId||""})),w({landedCostId:e.id}),this.applyStripeTheme()}catch(o){_(o),a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,c;if(null===(o=t.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=t.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=t.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==t.checkoutSettlementCurrency||!t.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,S.paypalErrorMessage=null,t.hasPaymentError=!1,this.submitLoading=!0,i.inventoryCheckErrorMessage=null,!await h())return t.hasPaymentError=!0,t.customErrorMessage=T("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:t.checkoutSettlementCurrency}),void(this.submitLoading=!1);await v();try{return await m({noLandedCostCheck:!0}),i.step="finish",void(this.confirmationId=y.landedCostShortId||(null===(c=i.selectedLandedCost)||void 0===c?void 0:c.landedCostId)||null)}catch(o){_(o),t.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){t.stripe=window.Zonos.stripe,i.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[p("clientSecret",(()=>{this.applyStripeTheme()})),j("selectedLocale",(()=>{this.applyStripeTheme()}))],B(`mobile: ${this.isMobile}`)}disconnectedCallback(){u(),g(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=t.clientSecret,t.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=U.appearance,a=()=>{const o=`${l}?timestamp=${Date.now()}`;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${U.organizationName} logo`,src:o}))},r=A(),z=()=>{var o;const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl"),l=e.get("zonosDebug"),n=null===(o=F.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(c,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},T("Test mode")),"1"===l&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&s("zonos-badge",{badgeColor:"purple",size:"small"},t)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},n,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:D(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),k({content:s("zonos-text",{class:"zonos--header-title",type:"header"},y.originCompanyName?T("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:y.originCompanyName}):T("Customs charges from your recent purchase are available for payment")),isLoading:y.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:D(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||t.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==i.step&&"error"!==i.step&&s(c,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},T("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"})),s("zonos-collect-payment",{class:D(["zonos--collect-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===i.step||"error"===i.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===i.step&&i.error?Object.assign(Object.assign({},i.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===i.step||"error"===i.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:T("Cancel"),dialogConfirmBtnText:T("Pay [orderTotal]",{orderTotal:L({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:T("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:T("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};H.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-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-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{H as zonos_collect}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as r}from"./p-abc0fb80.js";import{o,d as s,s as n}from"./p-7c96a585.js";import{l as i,h as e}from"./p-41dd1cb8.js";const t=({amount:n,isForeign:i})=>{var e,t;const a=(null===(e=r.exchangeRate)||void 0===e?void 0:e.rate)||1,d=i?n:o(n),u=r.currency;if((null===(t=r.items[0])||void 0===t?void 0:t.currencyCode)===u)return s({amount:d,currency:u});const l=r.displayBaseCurrency,c=(()=>{var o,s;return r.displayBaseCurrency&&(null===(o=r.exchangeRate)||void 0===o?void 0:o.sourceCurrencyCode)?null===(s=r.exchangeRate)||void 0===s?void 0:s.sourceCurrencyCode:r.currency})();return s(i?{amount:l?d/a:d,currency:c}:{amount:l?d:d*a,currency:c})},a=async()=>{var o,s;const t=null===(o=r.partiesData.find((r=>"DESTINATION"===r.type)))||void 0===o?void 0:o.id,a=null===(s=r.partiesData.find((r=>"PAYOR"===r.type)))||void 0===s?void 0:s.id,d=n.checkoutSessionId;if(!d||!a||!t)return i("Missing required data",{billToPartyId:a,checkoutSessionId:d,shipToPartyId:t}),{errors:["Missing required data"],json:null};const u={billToPartyId:a,checkoutSessionId:d,shipToPartyId:t},{errors:l,json:c}=await e("/api/zonos-elements/place-test-order",{body:u,method:"POST"});return l.length||!c?(i("Error occurs when placing test order",l),{errors:l.map((r=>r.message)),json:null}):{errors:[],json:c}};export{a as p,t as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,t,r){function o(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r["throw"](e))}catch(e){i(e)}}function d(e){e.done?t(e.value):o(e.value).then(a,s)}d((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return d([e,n])}}function d(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(t=0)),t)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;o=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=n.call(e,t)}catch(e){s=[6,e];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var r=0,o=n.length,i;r<o;r++){if(i||!(r in n)){if(!i)i=Array.prototype.slice.call(n,0,r);i[r]=n[r]}}return e.concat(i||Array.prototype.slice.call(n))};System.register(["./p-89c5164b.system.js","./p-bb707dfd.system.js","./p-7920d79c.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-24e26a2c.system.js","./p-433d76b4.system.js"],(function(e){"use strict";var n,t,r,o,i,a,s,d,u,l,c,v,f,m,p,h,w,g,y;return{setters:[function(e){n=e.z;t=e.c},function(e){r=e.s;o=e.l;i=e.e;a=e.f;s=e.b},function(e){d=e.t},function(e){u=e.f;l=e.h;c=e.g;v=e.a;f=e.s;m=e.l;p=e.j},function(e){h=e.l;w=e.b},function(e){g=e.i},function(e){y=e.g}],execute:function(){var b=this;var _=e("K",(function(e){var n=e.firstName,t=e.lastName,r=e.name;var o;if(!r&&!n&&!t){return{firstName:"",lastName:""}}var i=(r===null||r===void 0?void 0:r.split(/\s+/))||[];var a=(n===null||n===void 0?void 0:n.trim())||((o=i[0])===null||o===void 0?void 0:o.trim())||"";var s=(t===null||t===void 0?void 0:t.trim())||i.slice(1).join(" ").trim()||"";return{firstName:a,lastName:s}}));var S=function(e){var n=e.currentAddress,t=e.translatedAddress;var r,o,i,a,s,d;var u=n.value.address,l=u.city,c=u.country,v=u.line1,f=u.line2,m=u.postal_code,p=u.state;var h=n.value.name||[n.value.firstName,n.value.lastName].join(" ");return{city:((r=t.city)===null||r===void 0?void 0:r[l])||l,country:c,line1:((o=t.line1)===null||o===void 0?void 0:o[v])||v,line2:((i=t.line2)===null||i===void 0?void 0:i[f||""])||f||"",name:((a=t.name)===null||a===void 0?void 0:a[h])||h,phone:n.value.phone||"",postal_code:((s=t.postal_code)===null||s===void 0?void 0:s[m])||m,state:((d=t.state)===null||d===void 0?void 0:d[p])||p}};var O=function(e){var n;var t=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";var a=J.stripeLinkEventData;var s=J.stripeAddressEventData;var d=J.stripeShippingSameAsBilling?J.stripeAddressEventData:J.stripeBillingAddressEventData;if(!s||!d){throw new Error("Missing stripe address data")}var u=S({currentAddress:s,translatedAddress:J.translatedAddress.address});var l=_({name:u.name}),c=l.firstName,v=l.lastName;var f=S({currentAddress:d,translatedAddress:J.translatedAddress.address});var m=_({name:f.name}),p=m.firstName,h=m.lastName;var w=i()||"US";return{billingAddress:{addressLine1:f.line1,addressLine2:f.line2||"",city:f.city,country:f.country,postalCode:f.postal_code,state:f.state},billingContact:{firstName:p,lastName:h,phone:f.phone},cartCurrencyCode:(n=Oe.items[0])===null||n===void 0?void 0:n.currencyCode,cartId:e,checkoutSessionCountry:w||o.selectedCountryCode||undefined,checkoutSessionId:r.checkoutSessionId||"",contact:{companyName:J.companyName,email:a===null||a===void 0?void 0:a.value.email,firstName:c,lastName:v,phone:u.phone},isTest:!!t,landedCostAdjustments:Oe.promoCode?[{amount:0,productId:null,promoCode:Oe.promoCode,sku:null,type:"PROMO_CODE"}]:[],shipToTaxId:J.taxId,shippingAddress:{addressLine1:u.line1,addressLine2:u.line2,city:u.city,country:u.country,postalCode:u.postal_code,state:u.state}}};var C=function(){var e=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";var n=J.stripeLinkEventData;var t=J.stripeAddressEventData;var o=J.stripeShippingSameAsBilling?J.stripeAddressEventData:J.stripeBillingAddressEventData;h({stripeAddressData:t,stripeBillingAddressData:o},"info");if(!t||!o){throw new Error("Missing stripe address data")}var i=S({currentAddress:t,translatedAddress:J.translatedAddress.address});var a=_({name:i.name}),s=a.firstName,d=a.lastName;var u=S({currentAddress:o,translatedAddress:J.translatedAddress.address});var l=_({name:u.name}),c=l.firstName,v=l.lastName;var f=Oe.adjustments.map((function(e){return{amount:e.amount,name:e.description||null,productId:e.productId,sku:e.sku,type:e.type}}));var m=Oe.promoCode?__spreadArray([{amount:0,productId:null,promoCode:Oe.promoCode,sku:null,type:"PROMO_CODE"}],f,true):f;return{billingAddress:{addressLine1:u.line1,addressLine2:u.line2||"",city:u.city,country:u.country,postalCode:u.postal_code,state:u.state},billingContact:{firstName:c,lastName:v,phone:u.phone},checkoutSessionId:r.checkoutSessionId||"",contact:{companyName:J.companyName,email:n===null||n===void 0?void 0:n.value.email,firstName:s,lastName:d,phone:i.phone},isTest:e,items:Oe.items,landedCostAdjustments:m,shipToTaxId:J.taxId,shippingAddress:{addressLine1:i.line1,addressLine2:i.line2,city:i.city,country:i.country,postalCode:i.postal_code,state:i.state}}};var k=function(e){return __awaiter(b,void 0,void 0,(function(){var n,t,r,o,i,a,s,d,c,v;return __generator(this,(function(f){switch(f.label){case 0:a=C();return[4,e({billingAddress:a.billingAddress,billingContact:a.billingContact,checkoutSessionId:a.checkoutSessionId,contact:a.contact,landedCostAdjustments:a.landedCostAdjustments,publicCredential:window.Zonos.zonosApiKey||"",shippingAddress:a.shippingAddress,zonosApiRoute:u["vercel"]})];case 1:s=f.sent();if(!s||!((n=s.checkoutSessionWorkflow)===null||n===void 0?void 0:n.length)&&((t=s.errors)===null||t===void 0?void 0:t.length)){throw new Error("Failed to build landed cost: ".concat(((o=(r=s===null||s===void 0?void 0:s.errors)===null||r===void 0?void 0:r[0])===null||o===void 0?void 0:o.message)||"Unknown error"))}return[4,l("/api/zonos-elements/validate-landed-cost",{body:s,headers:{"Content-Type":"application/json"},method:"POST"})];case 2:d=f.sent(),c=d.errors,v=d.json;if(!v||c.length){throw new Error("Invalid landed cost object: ".concat(((i=c.find(Boolean))===null||i===void 0?void 0:i.message)||"Unknown error"))}return[2,s]}}))}))};var A=function(e){return __awaiter(b,void 0,void 0,(function(){var t,r,o,i,a,s,d;return __generator(this,(function(u){switch(u.label){case 0:r=n.checkoutSettings.buildLandedCost;if(!r)return[3,2];return[4,k(r)];case 1:o=u.sent();return[2,o];case 2:return[4,l("/api/zonos-elements/calculate-landed-cost",{body:C(),method:"POST",signal:e===null||e===void 0?void 0:e.signal})];case 3:i=u.sent(),a=i.errors,s=i.json;if(a.length||!s){d=((t=a[0])===null||t===void 0?void 0:t.message)==="The user aborted a request.";if(d){throw new Error("The landed cost calculation request was aborted to initiate a new one.")}a.forEach((function(e){console.warn("Error calculating landed cost: ".concat(e.message))}));if(!s){throw new Error("Failed to calculate landed cost")}return[2,s]}return[2,s]}}))}))};var I=function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,r,o,i,a,s,d,u,c;var v=e.abortController,f=e.cartId;return __generator(this,(function(e){switch(e.label){case 0:return[4,l("/api/zonos-elements/cart-calculate-landed-cost",{body:O(f),method:"POST",signal:v===null||v===void 0?void 0:v.signal})];case 1:a=e.sent(),s=a.errors,d=a.json;if(s.length||!d){u=typeof((n=s[0])===null||n===void 0?void 0:n.message)==="string"&&(((t=s[0])===null||t===void 0?void 0:t.message)==="The user aborted a request."||((r=s[0])===null||r===void 0?void 0:r.message.includes("signal is aborted"))||((o=s[0])===null||o===void 0?void 0:o.message.includes("The operation was aborted"))||((i=s[0])===null||i===void 0?void 0:i.message.includes("Fetch is aborted")));c=u?"The landed cost calculation request was aborted to initiate a new one.":"Failed to calculate landed cost";throw new Error(c)}return[2,d]}}))}))};var T=undefined&&undefined.__rest||function(e,n){var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0)t[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++){if(n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o]))t[r[o]]=e[r[o]]}return t};var E=function(e){return __awaiter(b,void 0,void 0,(function(){var n,t,r,o,i;return __generator(this,(function(a){switch(a.label){case 0:n=window.Zonos.cartId;if(!!n)return[3,2];return[4,A(e)];case 1:t=a.sent();return[2,t];case 2:return[4,I({abortController:e,cartId:n})];case 3:r=a.sent(),o=r.cartWorkflow,i=T(r,["cartWorkflow"]);return[2,Object.assign(Object.assign({},i),{itemCreateWorkflow:o.items})]}}))}))};var N=e("t",(function(e){return __awaiter(b,[e],void 0,(function(e){var t,r,i,a,s,d,u,m,p;var h=e.checkoutSessionId,g=e.eventName,y=e.metadata;return __generator(this,(function(e){switch(e.label){case 0:i=Date.now();a=__spreadArray([],window.Zonos.trackEventLogs,true);window.Zonos.trackEventLogs.push({checkoutSessionId:h,eventCreated:i,eventName:g});s=window.location.href.includes("zonos.com")&&!window.location.href.includes("checkout.zonos.com")||!!((t=window.Zonos)===null||t===void 0?void 0:t.zonosQaUrl)||!!((r=window.Zonos)===null||r===void 0?void 0:r.debug);d=c()||v();if((d||s)&&!window.Zonos.zonosConversionTest){return[2]}u=o.selectedCountryCode;m=n.organizationId;if(!h){void f({endpoint:"trackConversionEventMetric",errors:['Event "'.concat(g,'" - No checkout session id found')],metadata:{allLogs:w,checkoutSessionId:h,eventName:g,metadata:y,organizationId:m,trackEventLogs:a}});return[2]}if(!m){void f({endpoint:"trackConversionEventMetric",errors:['Event "'.concat(g,'" - No organization id found')],metadata:{allLogs:w,checkoutSessionId:h,eventName:g,metadata:y,organizationId:m,trackEventLogs:a}})}p={checkoutSessionId:h,countryCode:u,eventCreated:i,eventName:g,metadata:Object.assign(Object.assign({},y),{trackEventLogs:a}),organizationId:m};return[4,l("/api/zonos-elements/track-conversion-event",{body:p,method:"POST"})];case 1:e.sent();return[2]}}))}))}));var j=function(e){var n=e.address,t=e.invalidAdddressList;if(!n){return}if(!t){return}var r={};if(t.city){r.city=n.city}if(t.line1){r.line1=n.line1}if(t.line2){r.line2=n.line2}if(t.postal_code){r.postal_code=n.postal_code}if(t.state){r.state=n.state}if(t.name){r.name=n.name}return Object.keys(r).length?r:undefined};var P=function(e){var n=e.addressInvalidCharactersList,t=e.billingAddressInvalidCharactersList,r=e.stripeAddressEventData,o=e.stripeBillingAddressEventData,i=e.stripeShippingSameAsBilling;var a=!!(r===null||r===void 0?void 0:r.complete);var s=i?a:!!(o===null||o===void 0?void 0:o.complete);if(!a||!s){return null}if(!n&&!t){return null}var d=r.value;var u=(o===null||o===void 0?void 0:o.value)||null;var l=_({firstName:d.firstName,lastName:d.lastName,name:d.name}),c=l.firstName,v=l.lastName;var f="".concat(c," ").concat(v);var m=_({firstName:u===null||u===void 0?void 0:u.firstName,lastName:u===null||u===void 0?void 0:u.lastName,name:(u===null||u===void 0?void 0:u.name)||""}),p=m.firstName,h=m.lastName;var w=p&&h?"".concat(p," ").concat(h):"";var g=d.address;var y=u===null||u===void 0?void 0:u.address;return{address:j({address:Object.assign(Object.assign({},g),{name:f}),invalidAdddressList:n}),billingAddress:!i?j({address:y?Object.assign(Object.assign({},y),{name:w}):null,invalidAdddressList:t}):undefined,destinationCountry:g.country}};var D=e("O",(function(e){var n=e.sort((function(e,n){return e.amount-n.amount}));return n}));var L=function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,o;return __generator(this,(function(i){switch(i.label){case 0:if(!r.checkoutSessionId){return[2,{errors:[{message:"No checkout session id found"}],json:null}]}e=new URLSearchParams;e.set("checkoutSessionId",r.checkoutSessionId);return[4,l("/api/zonos-elements/get-checkout-session?".concat(e.toString()))];case 1:n=i.sent(),t=n.errors,o=n.json;return[2,{errors:t,json:o}]}}))}))};var x=e("A",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,r;return __generator(this,(function(o){switch(o.label){case 0:return[4,L()];case 1:n=o.sent(),t=n.errors,r=n.json;if(t.length||!r){m("Failed to retrieve checkout session info before confirming payment ",t);void f({endpoint:"validateCheckoutSession",errors:t.map((function(e){return e.message})),metadata:{allLogs:w}});return[2,{errorMessage:d("Unable to retrieve the checkout session at the moment. Please try again or contact our support team."),valid:false}]}if(!((e=r.checkoutSession.landedCost)===null||e===void 0?void 0:e.id)){m("Landed cost is not found in the checkout session before confirming payment.");void f({endpoint:"validateCheckoutSession",errors:["No landed cost found before confirming payment"],metadata:{allLogs:w}});return[2,{errorMessage:d('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),valid:false}]}return[2,{errorMessage:"",valid:true}]}}))}))}));var R=function(e){var t=e.theme;var r={".AccordionItem":{color:"var(--colorText)"},".AccordionItem--selected":{color:"var(--colorText)"},".Action":{color:"var(--colorText)"},".Input":{boxShadow:"none",fontSize:n.appearance.fontSizeInputValue?"".concat(n.appearance.fontSizeInputValue,"px"):undefined,padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"},".Label--resting":{fontSize:n.appearance.fontSizeInputLabel?"".concat(n.appearance.fontSizeInputLabel,"px"):undefined},".PickerItem--highlight":{boxShadow:"0 0 0 2px var(--colorBackground)"},".PickerItem--highlight:hover":{backgroundColor:"var(--colorBackground)",boxShadow:"none"},".PickerItem--new":{color:"var(--colorText)"},".Tab--selected":{borderStyle:"solid",borderWidth:"1px"}};switch(t){case"DARK":{return Object.assign(Object.assign({},r),{".Action":Object.assign(Object.assign({},r[".Action"]),{color:"white"}),".PickerItem--new":Object.assign(Object.assign({},r[".PickerItem--new"]),{color:"white"})})}default:return r}};var U=function(e){var n=e.borderStyle,t=e.theme;switch(t){case"DARK":return{borderRadius:y({overrideBorderStyle:n}),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"};default:return{borderRadius:y({overrideBorderStyle:n}),iconMenuColor:"var(--colorText)",iconMenuHoverColor:"var(--colorText)"}}};var z=t((function(){return{checkoutSettlementCurrency:"USD",clientSecret:sessionStorage.getItem("zonos--client-secret")||"",companyName:"",companyNameUsedWhenAsyncAddressUpdate:"",customAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:false,state:""},customBillingAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:false,state:""},customErrorMessage:null,customerProfile:null,fetchingLandedCostAbortController:null,hasPaymentError:false,isFetchingLandedCost:false,isFetchingSession:false,partyBillingId:null,partyShippingId:null,shouldInventoryRefund:false,shouldRenderPayInUsdButton:false,skipPaymentIntent:new URLSearchParams(window.location.search).get("skipPaymentIntent")==="0"?false:true,stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenAsyncAddressUpdate:null,stripeAddressUsedWhenFetchingLC:null,stripeAddressUsedWhenValidatingAddress:null,stripeBillingAddressElement:null,stripeBillingAddressEventData:null,stripeBillingAddressUsedWhenAsyncAddressUpdate:null,stripeBillingAddressUsedWhenFetchingLC:null,stripeBillingAddressUsedWhenValidatingAddress:null,stripeCustomerSessionClientSecret:null,stripeElements:null,stripeElementsForBillingAddress:null,stripeElementsOptions:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null,stripeShippingSameAsBilling:true,taxId:"",taxIdUsedWhenAsyncAddressUpdate:"",translatedAddress:{address:{},billingAddress:{},firstName:{},lastName:{},name:{}}}})),B=z.onChange,F=z.reset,J=z.state;e({B:B,c:J});var M=function(e){var t=e.clientSecret,r=e.overrideBorderRadius,i=e.overridePrimaryColor,a=e.overrideSecondaryColor,s=e.overrideTheme,d=e.paypalEnabled;var u=i||n.appearance.colorPrimary;var l=a||n.appearance.colorSecondary;var c=u&&g(u)?"night":"flat";var v=s==="DARK"?"night":"flat";var f=d?["external_paypal"]:[];return{appearance:{labels:"floating",rules:Object.assign({},R({theme:s||"LIGHT"})),theme:s?v:c,variables:Object.assign(Object.assign({},U({borderStyle:r,theme:"LIGHT"})),{colorPrimary:l})},clientSecret:t||undefined,customerSessionClientSecret:J.stripeCustomerSessionClientSecret||undefined,externalPaymentMethodTypes:__spreadArray([],f,true),locale:o.selectedLocale}};var q=e("a",(function(){window.sessionStorage.removeItem("zonos--bigcommerce-domestic-checkout-shipping")}));var W=e("b",(function(e){window.sessionStorage.setItem("zonos--bigcommerce-domestic-checkout-shipping",JSON.stringify(e))}));var Y=e("s",(function(){var e=window.sessionStorage.getItem("zonos--bigcommerce-domestic-checkout-shipping");return p(e)}));var H=e("i",(function(e){return __awaiter(b,void 0,void 0,(function(){var n,t,r,o,i;return __generator(this,(function(a){r=J.clientSecret;if(!J.stripe){h("Skip. Stripe is not initialized");return[2]}o=M({clientSecret:r,overrideBorderRadius:e===null||e===void 0?void 0:e.overrideBorderRadius,overridePrimaryColor:e===null||e===void 0?void 0:e.overridePrimaryColor,overrideSecondaryColor:e===null||e===void 0?void 0:e.overrideSecondaryColor,overrideTheme:e===null||e===void 0?void 0:e.overrideTheme,paypalEnabled:e===null||e===void 0?void 0:e.paypalEnabled});i=JSON.stringify(o)===JSON.stringify(J.stripeElementsOptions);if(!J.stripeElements||!J.stripeElementsForBillingAddress){J.stripeElementsForBillingAddress=(n=J.stripe)===null||n===void 0?void 0:n.elements(o);h("Stripe elements for billing address initialized");J.stripeElements=(t=J.stripe)===null||t===void 0?void 0:t.elements(o);J.stripeElementsOptions=o;h("Stripe elements initialized");return[2]}if(!i){J.stripeElements.update(o);J.stripeElementsForBillingAddress.update(o);J.stripeElementsOptions=o;void J.stripeElements.fetchUpdates()}h("Stripe elements updated");return[2]}))}))}));var K=e("y",(function(){sessionStorage.removeItem("zonos--client-secret");F();J.stripe=window.Zonos.stripe}));var G=function(){var e,n,t,r;var o=JSON.stringify((e=J.stripeAddressUsedWhenValidatingAddress)===null||e===void 0?void 0:e.value)!==JSON.stringify((n=J.stripeAddressEventData)===null||n===void 0?void 0:n.value);var i=!J.stripeShippingSameAsBilling&&JSON.stringify((t=J.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)!==JSON.stringify((r=J.stripeBillingAddressUsedWhenValidatingAddress)===null||r===void 0?void 0:r.value);return o||i};var V=function(){var e,n,t,r,o,i;var a=JSON.stringify((e=J.stripeLinkUsedWhenFetchingLC)===null||e===void 0?void 0:e.value)!==JSON.stringify((n=J.stripeLinkEventData)===null||n===void 0?void 0:n.value);var s=JSON.stringify((t=J.stripeAddressUsedWhenAsyncAddressUpdate)===null||t===void 0?void 0:t.value)!==JSON.stringify((r=J.stripeAddressEventData)===null||r===void 0?void 0:r.value);var d=!J.stripeShippingSameAsBilling&&JSON.stringify((o=J.stripeBillingAddressUsedWhenAsyncAddressUpdate)===null||o===void 0?void 0:o.value)!==JSON.stringify((i=J.stripeBillingAddressEventData)===null||i===void 0?void 0:i.value);var u=J.taxIdUsedWhenAsyncAddressUpdate!==J.taxId;var l=J.companyNameUsedWhenAsyncAddressUpdate!==J.companyName;return a||s||d||u||l};var Z=e("C",(function(e){var n=e.address,t=e.firstName,o=e.lastName,i=e.name,a=e.phone;var s=_({firstName:t,lastName:o,name:i}),d=s.firstName,u=s.lastName;if(!d||!u){void f({endpoint:"PARTY_CREATE_NO_NAME_FOUND",errors:["No name found"],metadata:{allLogs:w,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId,firstName:t,lastName:o,name:i}})}if(!a){void f({endpoint:"PARTY_CREATE_NO_PHONE_FOUND",errors:["No phone found"],metadata:{allLogs:w,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId,phone:a}})}return{city:n.city,country:n.country,firstName:d,lastName:u,line1:n.line1,line2:n.line2,phone:a||"",postal_code:n.postal_code,state:n.state}}));var Q=e("L",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,o,i,a,s,d,u,c,v,p;return __generator(this,(function(h){switch(h.label){case 0:if(!((e=J.stripeAddressEventData)===null||e===void 0?void 0:e.complete)||!J.stripeShippingSameAsBilling&&!((n=J.stripeBillingAddressEventData)===null||n===void 0?void 0:n.complete)||!J.stripeBillingAddressEventData){return[2,{partiesCreated:false}]}if(!Oe.landedCostData){return[2,{partiesCreated:false}]}i=(t=Oe.landedCostData.find(Boolean))===null||t===void 0?void 0:t.landedCost.rootId;if(!i){void f({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:w,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId}});return[2,{partiesCreated:false}]}a=V();if(!a){return[2,{partiesCreated:false}]}s=Z({address:J.stripeAddressEventData.value.address,firstName:J.stripeAddressEventData.value.firstName,lastName:J.stripeAddressEventData.value.lastName,name:J.stripeAddressEventData.value.name,phone:J.stripeAddressEventData.value.phone});d=J.stripeShippingSameAsBilling?s:Z({address:J.stripeBillingAddressEventData.value.address,firstName:J.stripeBillingAddressEventData.value.firstName,lastName:J.stripeBillingAddressEventData.value.lastName,name:J.stripeBillingAddressEventData.value.name,phone:J.stripeBillingAddressEventData.value.phone});u=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";return[4,l("/api/zonos-elements/create-parties",{body:{address:s,billingAddress:d,companyName:J.companyName,email:((o=J.stripeLinkEventData)===null||o===void 0?void 0:o.value.email)||"",isTest:u,rootId:i,taxId:J.taxId},method:"POST"})];case 1:c=h.sent(),v=c.errors,p=c.json;if(v.length||!p){m("Error occurs when creating parties",JSON.stringify(v,null,2));void f({endpoint:"PF_PARTY_CREATE_FAILED",errors:["Failed to create parties"],metadata:{allLogs:w,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId,errors:v,json:p}});return[2,{partiesCreated:false}]}J.companyNameUsedWhenAsyncAddressUpdate=J.companyName;J.stripeAddressUsedWhenAsyncAddressUpdate=J.stripeAddressEventData;J.stripeBillingAddressUsedWhenAsyncAddressUpdate=J.stripeBillingAddressEventData;J.taxIdUsedWhenAsyncAddressUpdate=J.taxId;J.partyBillingId=p.billToPartyId;J.partyShippingId=p.shipToPartyId;return[2,{partiesCreated:true}]}}))}))}));var X=function(e){return{countryCode:e.address.country,postalCode:e.address.postal_code,state:e.address.state}};var $=function(){var e,n;var t=JSON.stringify((e=J.stripeLinkUsedWhenFetchingLC)===null||e===void 0?void 0:e.value)!==JSON.stringify((n=J.stripeLinkEventData)===null||n===void 0?void 0:n.value);var r=J.stripeAddressEventData&&JSON.stringify(X(J.stripeAddressEventData.value))!==JSON.stringify(J.stripeAddressUsedWhenFetchingLC);var o=!J.stripeShippingSameAsBilling&&J.stripeBillingAddressEventData&&JSON.stringify(X(J.stripeBillingAddressEventData.value))!==JSON.stringify(J.stripeBillingAddressUsedWhenFetchingLC);return t||r||o};var ee=function(){var e;var n=Oe.landedCostData&&((e=Oe.landedCostData.find(Boolean))===null||e===void 0?void 0:e.subtotals.items)!==Oe.subtotal;var t=$();h("isPrefetchInfoOutdated","info",{isAddressOutdated:t});return!Oe.landedCostData&&!J.isFetchingLandedCost||t||n};var ne=function(e){var t,r;var o=(t=n.genericSettings)===null||t===void 0?void 0:t.countryFields;var i=(r=n.genericSettings)===null||r===void 0?void 0:r.stripeCountryFieldLabels;var a=i&&e in i?i[e]:null;var s=o&&e in o?o[e]:null;if(Oe.addressFormRenderType==="stripe"){return a||s}return s};var te=function(){var e,n,t,r;var o=!!((e=J.stripeLinkEventData)===null||e===void 0?void 0:e.complete);var i=!!((n=J.stripeAddressEventData)===null||n===void 0?void 0:n.complete);var a=J.stripeShippingSameAsBilling?i:!!((t=J.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete);var s=((r=J.stripeAddressEventData)===null||r===void 0?void 0:r.value.address.country)||"US";var d=ne(s);if(i&&a&&o){return true}if(!d||!J.stripeAddressEventData){return i&&a&&o}var u=J.stripeAddressEventData.value.address.line1.length>0;var l=J.stripeAddressEventData.value.firstName&&J.stripeAddressEventData.value.lastName;var c=!d.stateRequired||d.stateRequired&&J.stripeAddressEventData.value.address.state.length>0;var v=!d.zipRequired||d.zipRequired&&J.stripeAddressEventData.value.address.postal_code.length>=3;var f=J.stripeAddressEventData.value.phone&&J.stripeAddressEventData.value.phone.length>0;return o&&l&&u&&c&&v&&f};var re=function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,o,i,a,s,d,u,l,c;return __generator(this,(function(v){switch(v.label){case 0:n=new AbortController;J.fetchingLandedCostAbortController=n;Be();return[4,E(n)];case 1:t=v.sent(),o=t.checkoutSessionWorkflow,i=t.errors,a=t.itemCreateWorkflow,s=t.landedCostCalculateWorkflow,d=t.partyCreateWorkflow,u=t.shipmentRatingCalculateWorkflow;Oe.customQuotingError=((e=i===null||i===void 0?void 0:i.find((function(e){var n;return((n=e.extensions)===null||n===void 0?void 0:n.ruleMessageType)==="CUSTOM"})))===null||e===void 0?void 0:e.message)||null;Oe.shippingData=D((u===null||u===void 0?void 0:u.filter(Boolean))||[]);Ie(a);J.fetchingLandedCostAbortController=null;Oe.partiesData=(d===null||d===void 0?void 0:d.filter(Boolean))||[];Oe.landedCostData=(o===null||o===void 0?void 0:o.map((function(e){var n=s===null||s===void 0?void 0:s.find((function(n){return(n===null||n===void 0?void 0:n.id)===e.landedCostId}));if(!n){return null}return Object.assign(Object.assign({},e),{landedCost:n})})).filter(Boolean))||[];l=r.checkoutSessionId;if(o===null||o===void 0?void 0:o.length){void N({checkoutSessionId:l,eventName:"checkout_quoteReceived"})}c=Oe.promoCodeApplied&&!Oe.landedCostData.find((function(e){var n;return(n=e.landedCost.appliedAdjustments)===null||n===void 0?void 0:n.find((function(e){return e.type==="PROMO_CODE"}))}));Oe.promoCodeError=c;if(!c){sessionStorage.setItem("zonos--promo-code",Oe.promoCode)}return[2]}}))}))};var oe=e("q",(function(e){return __awaiter(b,void 0,void 0,(function(){var n,t,r,o,i,a,s,d,u,l,c,v,p,h;return __generator(this,(function(w){switch(w.label){case 0:i=(e===null||e===void 0?void 0:e.retries)||0;a=!!(e===null||e===void 0?void 0:e.applyingPromocode);s=ee();d=te();if(!d){return[2,{isRequestNotReady:true}]}if(s){(n=J.fetchingLandedCostAbortController)===null||n===void 0?void 0:n.abort();J.fetchingLandedCostAbortController=null}if(!s&&!a){return[2,{isRequestNotReady:false}]}if(i){J.isFetchingLandedCost=false;setTimeout((function(){J.isFetchingLandedCost=true}),300)}else{J.isFetchingLandedCost=true}if(J.stripeAddressEventData){J.stripeAddressUsedWhenFetchingLC={countryCode:J.stripeAddressEventData.value.address.country,postalCode:J.stripeAddressEventData.value.address.postal_code,state:J.stripeAddressEventData.value.address.state}}if(J.stripeBillingAddressEventData){J.stripeBillingAddressUsedWhenFetchingLC={countryCode:J.stripeBillingAddressEventData.value.address.country,postalCode:J.stripeBillingAddressEventData.value.address.postal_code,state:J.stripeBillingAddressEventData.value.address.state}}if(J.stripeLinkEventData){J.stripeLinkUsedWhenFetchingLC=Object.assign({},J.stripeLinkEventData)}w.label=1;case 1:w.trys.push([1,3,,7]);Be();return[4,re()];case 2:w.sent();u=(t=Oe.shippingData)===null||t===void 0?void 0:t.find(Boolean);l=(r=Oe.landedCostData)===null||r===void 0?void 0:r.find((function(e){return e.landedCost.shipmentRating.id===(u===null||u===void 0?void 0:u.id)}));c=!!l?l.subtotals:null;if(c){Ne({method:(l===null||l===void 0?void 0:l.landedCost.method)||"DDP",subtotals:c})}return[3,7];case 3:v=w.sent();Oe.landedCostData=[];Oe.shippingData=[];p=["The landed cost calculation request was aborted to initiate a new one."];if(!(v instanceof Error&&v.message&&!p.includes(v.message)))return[3,6];if(!(i<1))return[3,5];return[4,oe(Object.assign(Object.assign({},e),{retries:(i||0)+1}))];case 4:w.sent();return[2,{isRequestNotReady:false}];case 5:h=(o=J.stripeAddressEventData)===null||o===void 0?void 0:o.value;void f({endpoint:"Failed to fetch landed cost (".concat(i," retries)"),errors:[v.message],metadata:{cartId:window.Zonos.cartId,shipToAddress:h}});w.label=6;case 6:m(v);return[3,7];case 7:J.isFetchingLandedCost=false;return[2,{isRequestNotReady:false}]}}))}))}));var ie=e("F",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,r;return __generator(this,(function(o){switch(o.label){case 0:return[4,oe({applyingPromocode:true})];case 1:o.sent();if(Oe.step==="payment"){Me()}return[4,Q()];case 2:o.sent();t=(e=Oe.shippingData)===null||e===void 0?void 0:e.find(Boolean);r=(n=Oe.landedCostData)===null||n===void 0?void 0:n.find((function(e){return e.landedCost.id===(t===null||t===void 0?void 0:t.id)}));if(!t||!r){return[2]}return[4,xe({applySubtotalsOnly:false,landedCostId:r.landedCostId,selectedShippingOption:t})];case 3:o.sent();return[2]}}))}))}));var ae=e("H",(function(){Oe.promoCode="";sessionStorage.removeItem("zonos--promo-code");Oe.promoCodeError=false;Oe.promoCodeApplied=false}));var se=e("G",(function(){return __awaiter(b,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(Oe.step==="payment"){Me()}ae();return[4,ie()];case 1:e.sent();return[2]}}))}))}));var de=e("I",(function(e){var n=[];var t=true;var r=window.Zonos.isCollect;switch(e){case"succeeded":{n=[d("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"",d("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")];if(r){n=[d("Thank you for submitting your payment. We appreciate your prompt attention."),"",d("A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.")]}t=false;break}case"requires_capture":case"processing":{n=[d("Payment processing. We'll update you when payment is received.")];t=false;break}case"requires_payment_method":{n=[d("Payment failed. Please try another payment method.")];if(r){n=[d("Payment failed. Please reload the page and try another payment method.")]}break}case"requires_action":{t=false;n=[d("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.")]}default:{n=[d("Something went wrong.")];break}}return{isError:t,messages:n}}));var ue=e("v",(function(){return __awaiter(b,void 0,void 0,(function(){var e,t,r,o,i,a,s,u,c,u;return __generator(this,(function(v){switch(v.label){case 0:r=n.checkoutSettings.onInventoryCheck;o=!!((t=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.metadata.find((function(e){return e.key==="referenceId"})))===null||t===void 0?void 0:t.value);if(!(window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&o))return[3,2];return[4,l("/api/zonos-elements/legacy/inventory-check",{body:{cartData:window.Zonos.cartData},method:"POST"})];case 1:i=v.sent(),a=i.errors,s=i.json;if(a.length||!s){m("Error occurs when handling inventory refund","warn",JSON.stringify(a));return[2,null]}if(!s.available||s.status===204){return[2,d("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.")]}if(s.available||s.status===200){J.shouldInventoryRefund=true;return[2,null]}return[2,null];case 2:if(typeof r!=="function"){return[2,null]}v.label=3;case 3:v.trys.push([3,5,,6]);return[4,r({items:Oe.items})];case 4:u=v.sent();return[2,u];case 5:c=v.sent();u=c instanceof Error?c.message:"Unknown error";void f({endpoint:"onInventoryCheck",errors:["cartId: ".concat(window.Zonos.cartId," - ").concat(u)],metadata:{cartId:window.Zonos.cartId,href:window.location.href,items:Oe.items}});throw c;case 6:return[2]}}))}))}));var le=e("x",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t;return __generator(this,(function(r){switch(r.label){case 0:t=!!((n=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.metadata.find((function(e){return e.key==="referenceId"})))===null||n===void 0?void 0:n.value);if(!window.Zonos.isLegacyCheckout||!window.Zonos.cartData||!t){return[2]}return[4,l("/api/zonos-elements/legacy/inventory-refund",{body:{cartData:window.Zonos.cartData},method:"POST"})];case 1:r.sent();return[2]}}))}))}));var ce=e("d",(function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,r,o,i,a,s,u,l;var c=e.clientSecret,v=e.storybookForceStatus;return __generator(this,(function(e){switch(e.label){case 0:if(v){n=de(v),t=n.isError,r=n.messages;return[2,{error:t,messages:r}]}o=c||J.clientSecret;if(!J.stripe||!o){m("Failed to retrieve payment intent. Stripe is not initialized");return[2,{error:true,message:[d("Something went wrong.")]}]}return[4,J.stripe.retrievePaymentIntent(o)];case 1:i=e.sent().paymentIntent;a=i===null||i===void 0?void 0:i.status;s=de(a),u=s.isError,l=s.messages;return[2,{error:u,messages:l,paymentIntentId:i===null||i===void 0?void 0:i.id,paymentMethod:i===null||i===void 0?void 0:i.payment_method,status:a}]}}))}))}));var ve=e("w",(function(e){return __awaiter(b,void 0,void 0,(function(){var n,t,o,i,a,s,u,l,c,v,f,m;return __generator(this,(function(p){switch(p.label){case 0:o=!!((n=J.stripePaymentEventData)===null||n===void 0?void 0:n.complete);i=J.stripeElements;a=J.stripe;s=J.clientSecret;J.customErrorMessage=null;if(!((t=Oe.selectedLandedCost)===null||t===void 0?void 0:t.landedCost.id)&&!(e===null||e===void 0?void 0:e.noLandedCostCheck)){throw new Error("Attempted to confirm the payment when no landed cost is found in store")}return[4,x()];case 1:u=p.sent();if(!u.valid){J.customErrorMessage=u.errorMessage;throw new Error(u.errorMessage)}l=r.checkoutSessionId;if(!(a&&i&&o&&s&&l))return[3,3];c=new URL(window.location.href);c.searchParams.set("payment_intent_client_secret",s);c.searchParams.set("zonosCheckoutSessionId",l);void N({checkoutSessionId:l,eventName:"checkout_paymentInfoCompleted"});return[4,a.confirmPayment({confirmParams:{return_url:c.toString()},elements:i,redirect:"if_required"})];case 2:v=p.sent(),f=v.error,m=v.paymentIntent;h("Payment intent confirmed","info",{error:f,paymentIntent:m});if((m===null||m===void 0?void 0:m.status)==="requires_action"){throw new Error(d("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction."))}if(f){if(f.type==="card_error"||f.type==="validation_error"){throw new Error(f.message)}if(f.type==="invalid_request_error"){if(f.code==="payment_intent_unexpected_state"){return[2]}}throw new Error("An unexpected error occurred.")}if(m.status==="requires_payment_method"){throw new Error(d("Payment failed. Please try another payment method."))}p.label=3;case 3:return[2]}}))}))}));var fe=e("n",(function(){var e;var n=Oe.items.reduce((function(e,n){return e+n.amount*n.quantity}),0);var t=r.enabledVariantTestKeys||[];var i={adjustmentsAmount:Oe.adjustments.reduce((function(e,n){return e+n.amount}),0),cartId:window.Zonos.cartId,currency:((e=Oe.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"",customerAuthenticationToken:Oe.customerAuthenticationToken||undefined,isCollect:window.Zonos.isCollect,itemsAmount:n,metadata:[{key:"language",value:o.selectedLocale}],presentmentCountryCode:o.selectedCountryCode,skipPaymentIntent:J.skipPaymentIntent,varianceTestInput:t};return i}));var me=e("l",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,o,i;return __generator(this,(function(a){switch(a.label){case 0:if(!r.checkoutSessionId){void f({endpoint:"Error creating payment intent",errors:["No checkout session id found when retrieving payment intent"],metadata:{allLogs:w,cartId:window.Zonos.cartId}});Ee({messages:[d("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:d("Error creating Checkout")});return[2]}return[4,l("/api/zonos-elements/create-payment-intent",{body:{checkoutSessionId:r.checkoutSessionId},method:"POST"})];case 1:n=a.sent(),t=n.errors,o=n.json;i=(e=o===null||o===void 0?void 0:o.checkoutSessionPaymentIntentCreate)===null||e===void 0?void 0:e.clientSecret;if(t.length||!i){m("Error occurs when getting payment intent",JSON.stringify(t,null,2));void f({endpoint:"Error creating payment intent",errors:t.map((function(e){return e.message})),metadata:{allLogs:w,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId,clientSecret:i}});Ee({messages:[d("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:d("Error creating Checkout")});return[2]}Pe(o.checkoutSessionPaymentIntentCreate);return[2]}}))}))}));var pe=e("k",(function(){return __awaiter(b,void 0,void 0,(function(){var e,n,t,r,i,a,s,d;return __generator(this,(function(u){switch(u.label){case 0:if(!o.targetCurrency){m("Failed to create checkout session - missing localizationStore.targetCurrency");return[2,false]}J.isFetchingSession=true;t=fe();h("Checkout session body","info",t);return[4,l("/api/zonos-elements/create-checkout-session",{body:t,method:"POST"})];case 1:r=u.sent(),i=r.errors,a=r.json;J.isFetchingSession=false;if(i.length||!a){s=(e=i.find((function(e){return e.message})))===null||e===void 0?void 0:e.message;if(Array.isArray(s)&&s.some((function(e){return e.message==="Cart is expired."}))){throw new Error("Cart is expired.")}m("Error occurred when creating checkout session",JSON.stringify(i,null,2));return[2,false]}d=a.checkoutSessionCreate;Pe(d);Ne({method:((n=d.landedCost)===null||n===void 0?void 0:n.method)||"DDP",subtotals:d.subtotals});h("Exchange rate updated for cart items (checkout session create)","info",Oe.exchangeRate);h("done-init-checkout-session");return[2,true]}}))}))}));var he=e("u",(function(){return __awaiter(b,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(i){switch(i.label){case 0:e=r.checkoutSessionId;if(!e){m("Failed to update checkout session base currency");return[2,false]}if(n.checkoutSettings.allowedSettlementCurrencies==="LOCAL"){h('allowedSettlementCurrencies: "LOCAL". Skip updating checkout session base currency');return[2,true]}return[4,l("/api/zonos-elements/update-checkout-session-base-currency",{body:{checkoutSessionId:e,currencyCode:J.checkoutSettlementCurrency},method:"POST"})];case 1:t=i.sent().json;o=t===null||t===void 0?void 0:t.checkoutSessionBaseCurrencyUpdate.subtotals.presentmentCurrencyCode;if(!t||o!==J.checkoutSettlementCurrency){m("Failed to update checkout session base currency");return[2,false]}h('Updated checkout session to settlement currency "'.concat(o,'".'));return[2,true]}}))}))}));var we=function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,i,a;var s=e.adjustmentsAmount,d=e.cartId,u=e.currency,c=e.id,v=e.itemsAmount,f=e.landedCostId,p=e.presentmentCountryCode;return __generator(this,(function(e){switch(e.label){case 0:n=r.enabledVariantTestKeys||[];return[4,l("/api/zonos-elements/update-checkout-session",{body:{adjustmentsAmount:s,billToPartyId:J.partyBillingId,cartId:d,currency:u,customerAuthenticationToken:Oe.customerAuthenticationToken||undefined,id:c,itemsAmount:v,landedCostId:f,metadata:[{key:"language",value:o.selectedLocale}],presentmentCountryCode:p,shipToPartyId:J.partyShippingId,skipPaymentIntent:J.skipPaymentIntent,varianceTestInput:n},method:"POST"})];case 1:t=e.sent(),i=t.errors,a=t.json;if(i.length||!a){m("Error occurs when updating checkout session",JSON.stringify(i,null,2));return[2,{errors:i,json:a}]}return[2,{errors:[],json:a}]}}))}))};var ge=function(e){var n,t,r,o,i,a;var s=e.currentAddress,d=e.translatedAddressResult;var u={};if(!d){return u}var l=d.city,c=d.line1,v=d.line2,f=d.name,m=d.postal_code,p=d.state;if(s.city&&l){u.city=(n={},n[s.city]=l,n)}if(s.line1&&c){u.line1=(t={},t[s.line1]=c,t)}if(s.line2&&v){u.line2=(r={},r[s.line2]=v,r)}if(s.postal_code&&m){u.postal_code=(o={},o[s.postal_code]=m,o)}if(s.state&&p){u.state=(i={},i[s.state]=p,i)}if(s.name&&f){u.name=(a={},a[s.name]=f,a)}return u};var ye=e("J",(function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,r,o,i,a,s,d,u,c,v;var f=e.addressInvalidCharactersList,p=e.billingAddressInvalidCharactersList;return __generator(this,(function(e){switch(e.label){case 0:i=P({addressInvalidCharactersList:f,billingAddressInvalidCharactersList:p,stripeAddressEventData:J.stripeAddressEventData,stripeBillingAddressEventData:J.stripeBillingAddressEventData,stripeShippingSameAsBilling:J.stripeShippingSameAsBilling});if(!i){J.translatedAddress={address:{},billingAddress:{}};return[2]}a=G();if(!a){return[2]}return[4,l("/api/zonos-elements/validate-address",{body:i,method:"POST"})];case 1:s=e.sent(),d=s.errors,u=s.json;if(d.length||!u){m("Error occurs when translating address to latin",JSON.stringify(d,null,2));J.translatedAddress={address:{},billingAddress:{}};return[2]}J.stripeAddressUsedWhenValidatingAddress=J.stripeAddressEventData;J.stripeBillingAddressUsedWhenValidatingAddress=J.stripeBillingAddressEventData;c=(n=J.stripeAddressEventData)===null||n===void 0?void 0:n.value.address;v=(t=J.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value.address;J.translatedAddress={address:c?ge({currentAddress:Object.assign(Object.assign({},c),{name:(r=J.stripeAddressEventData)===null||r===void 0?void 0:r.value.name}),translatedAddressResult:u.address||null}):{},billingAddress:!J.stripeShippingSameAsBilling?ge({currentAddress:Object.assign(Object.assign({},v),{name:(o=J.stripeBillingAddressEventData)===null||o===void 0?void 0:o.value.name}),translatedAddressResult:u.billingAddress||null}):{}};return[2]}}))}))}));B("clientSecret",(function(e){if(e&&J.stripe){sessionStorage.setItem("zonos--client-secret",e)}if(!e){sessionStorage.removeItem("zonos--client-secret")}}));var be=t((function(){return{addressFormRenderType:"stripe",adjustmentTotal:0,adjustments:[],checkoutSession:null,checkoutSessionTimeoutShow:false,checkoutTimeoutInterval:null,currency:"USD",customQuotingError:null,customerAuthenticationToken:null,displayBaseCurrency:false,dutiesTaxesFees:null,dutiesTaxesFeesEstimate:null,error:null,exchangeRate:null,externalConfirmationPageURL:null,inventoryCheckErrorMessage:null,isSelectedShippingAboveDeminimis:false,isSelectedShippingGuarantee:false,isStagingMode:v(),items:[],landedCostData:null,landedCostMethod:"DDP",partiesData:[],promoCode:sessionStorage.getItem("zonos--promo-code")||"",promoCodeApplied:!!sessionStorage.getItem("zonos--promo-code"),promoCodeError:false,restrictedItems:[],selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,shouldHideDiscountInput:false,step:"customer-info",subtotal:0,tabItems:{"customer-info":{index:1,isDone:false,label:"Customer",value:"customer-info"},shipping:{index:2,isDone:false,label:"Shipping",value:"shipping"},payment:{index:3,isDone:false,label:"Payment",value:"payment"}},total:0}})),_e=be.onChange,Se=be.reset,Oe=be.state;e({z:_e,e:Oe});var Ce=function(e){switch(e){case"DAYS":return d("days");case"WEEKS":return d("weeks");case"BUSINESS_DAYS":default:return d("business days")}};var ke=e("M",(function(e){var n;var t=(n=e.shippingProfile)===null||n===void 0?void 0:n.transitTime;if(!(t===null||t===void 0?void 0:t.min)||!(t===null||t===void 0?void 0:t.max)||!(t===null||t===void 0?void 0:t.type)){return null}return{maxTransit:t.max,minTransit:t.min,unit:Ce(t.type)}}));var Ae=function(e){var n=e.item1,t=e.item2;if(!n||!t){return false}return t.sku&&n.sku&&n.sku===t.sku||t.description&&n.description&&n.description===t.description||n.name&&t.name&&n.name===t.name};var Ie=function(e){h("Checking item restrictions");var n=e.map((function(e){if(!e.restriction){return null}var n=e.restriction;var t=Oe.items.find((function(n){return Ae({item1:n,item2:e})}));return Object.assign(Object.assign({matchedItem:t},e),{restriction:n})})).filter(Boolean);Oe.restrictedItems=n;Oe.items=Oe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:!!n.find((function(n){return Ae({item1:n,item2:e})}))})}));return{cartItems:Oe.items,restrictedItems:n}};var Te=e("g",(function(){r.checkoutSessionId=null;Se()}));var Ee=e("o",(function(e){var n=e.messages,t=e.title;Te();K();Oe.step="error";Oe.error={messages:n,title:t}}));var Ne=function(e){var n=e.dutiesTaxesFeesEstimate,t=e.method,r=e.subtotals;Oe.exchangeRate=r.exchangeRate;Oe.adjustmentTotal=r.adjustments;Oe.dutiesTaxesFees=t==="DAP"?null:r.landedCostTotal;Oe.subtotal=r.items;Oe.total=r.total;Oe.currency=r.presentmentCurrencyCode;Oe.dutiesTaxesFeesEstimate=n||null};var je=e("E",(function(){var e=Oe.items.filter((function(e){return e.amount>0}));return!!e.find((function(e){return!e.isRestricted}))}));var Pe=e("p",(function(e){var n,t,o,i,d;J.clientSecret=e.clientSecret;J.stripeCustomerSessionClientSecret=e.customerSessionClientSecret;J.customerProfile=e.customerProfile;Oe.checkoutSession=e;if(!e.id){void f({endpoint:"cartStoreSetCheckoutSession",errors:["Missing checkout session id in checkout session"],metadata:{allLogs:w,checkoutSession:e}})}if(e.id){r.checkoutSessionId=e.id}var u=a(e.varianceTestResults||[]);s(u);var l=((o=(t=(n=Oe.checkoutSession)===null||n===void 0?void 0:n.metadata)===null||t===void 0?void 0:t.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||o===void 0?void 0:o.value)||((d=(i=window.Zonos.cartData)===null||i===void 0?void 0:i.metadata.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||d===void 0?void 0:d.value)||null;if(l){h("Found externalConfirmationPageURL: ".concat(l));Oe.externalConfirmationPageURL=l}}));var De=function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,i,a,s,u;var l=e.adjustmentsAmount,c=e.cartId,v=e.currency,f=e.dutiesTaxesFeesEstimate,p=e.itemsAmount,w=e.landedCostId,g=e.shouldInitSessionOnFailure;return __generator(this,(function(e){switch(e.label){case 0:if(w&&Oe.selectedLandedCost){t=Oe.selectedLandedCost.subtotals;Ne({dutiesTaxesFeesEstimate:f,method:Oe.landedCostMethod,subtotals:t});h("Exchange rate updated for cart items (landed cost subtotal)","info",Oe.exchangeRate)}if(!r.checkoutSessionId){h("Could not update cart total without checkout session id","info");return[2,false]}return[4,we({adjustmentsAmount:l,billToPartyId:J.partyBillingId,cartId:c,currency:v,id:r.checkoutSessionId,itemsAmount:p,landedCostId:w,presentmentCountryCode:o.selectedCountryCode,shipToPartyId:J.partyShippingId,varianceTestInput:r.enabledVariantTestKeys||[]})];case 1:i=e.sent(),a=i.errors,s=i.json;if(!(a.length>0||!s))return[3,4];m("Error occurs when updating checkout session.");if(!g)return[3,3];h("Initiating checkout session on failure","info");return[4,pe()];case 2:u=e.sent();h("stripeStoreInitCheckoutSession: ".concat(u));if(!u){Ee({messages:[d("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:d("Error creating Checkout")});return[2,false]}return[2,true];case 3:return[2,false];case 4:if(!w){Ne({method:((n=s.checkoutSessionUpdate.landedCost)===null||n===void 0?void 0:n.method)||"DDP",subtotals:s.checkoutSessionUpdate.subtotals});h("Exchange rate updated for cart items (checkout session update)","info",Oe.exchangeRate)}Pe(s.checkoutSessionUpdate);return[2,true]}}))}))};var Le=e("N",(function(e){var t,r,o;if(e.method==="DAP"&&((r=(t=n.genericSettings)===null||t===void 0?void 0:t.domesticCountries)===null||r===void 0?void 0:r.includes(((o=J.stripeAddressEventData)===null||o===void 0?void 0:o.value.address.country)||"US"))){return"DDP"}if(e.method==="DAP"&&e.remittance.length&&e.landedCostGuaranteeCode==="ZONOS"){return"DDP"}return e.method}));var xe=e("D",(function(e){return __awaiter(b,[e],void 0,(function(e){var t,o,i,a,s,d,u,l,c,v,f,m,p,w,g,y,b,_,S,O,C,k,A,I,T;var E=e.applySubtotalsOnly,N=e.landedCostId,j=e.selectedShippingOption;return __generator(this,(function(e){switch(e.label){case 0:h("Updating selected shipping option","info",{landedCostId:N,selectedShippingOption:j});Oe.selectedShippingOption=j;m=ke(Oe.selectedShippingOption);if(m){p=m.maxTransit,w=m.minTransit,g=m.unit;Oe.selectedShippingOptionTransitTime="".concat(w,"-").concat(p," ").concat(g)}else{Oe.selectedShippingOptionTransitTime=""}y=(t=Oe.landedCostData)===null||t===void 0?void 0:t.find((function(e){return e.landedCostId===N}));Oe.selectedLandedCost=y||null;if(!y){return[2,false]}b=((o=y.landedCost.amountSubtotals)===null||o===void 0?void 0:o.landedCostTotal)||0;_=y.subtotals.exchangeRate.rate;S=b*_;if(S){h("DAP quote, using estimate: ".concat(S),"info")}Oe.landedCostMethod=Le(y.landedCost);Oe.shipping=y.subtotals.shipping;O=((i=y===null||y===void 0?void 0:y.landedCost)===null||i===void 0?void 0:i.landedCostGuaranteeCode)==="ZONOS";C=!!((s=(a=y===null||y===void 0?void 0:y.landedCost)===null||a===void 0?void 0:a.deMinimis)===null||s===void 0?void 0:s.find((function(e){return["DUTY","TAX"].includes(e.type)&&e.threshold==="ABOVE"})));Oe.isSelectedShippingAboveDeminimis=C;Oe.isSelectedShippingGuarantee=O;k=false;if(!E)return[3,1];A=y.subtotals;Ne({dutiesTaxesFeesEstimate:S,method:Oe.landedCostMethod,subtotals:A});h("Exchange rate updated for cart items (landed cost subtotal)","info",Oe.exchangeRate);k=true;return[3,3];case 1:return[4,De({adjustmentsAmount:Oe.adjustmentTotal,billToPartyId:J.partyBillingId,cartId:window.Zonos.cartId,dutiesTaxesFeesEstimate:S,landedCostId:(d=y.landedCost)===null||d===void 0?void 0:d.id,shipToPartyId:J.partyShippingId,varianceTestInput:r.enabledVariantTestKeys||[]})];case 2:k=e.sent();e.label=3;case 3:I=(u=Oe.items.find(Boolean))===null||u===void 0?void 0:u.currencyCode;T=((l=J.stripeAddressEventData)===null||l===void 0?void 0:l.value.address.country)||"US";J.shouldRenderPayInUsdButton=I==="USD"&&n.checkoutSettings.allowedSettlementCurrencies==="LOCAL_AND_USD"&&((c=Oe.checkoutSession)===null||c===void 0?void 0:c.subtotals.presentmentCurrencyCode)!=="USD"&&!!((f=(v=n.genericSettings)===null||v===void 0?void 0:v.usdSettlementCountryEnabled)===null||f===void 0?void 0:f.includes(T));return[2,k]}}))}))}));var Re=e("m",(function(e){var n=e.isPreview,t=e.sessionTimeout;if(n){return}var r=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout");var o=r&&!isNaN(parseInt(r,10))?parseInt(r,10):t;h("==START CHECKOUT TIMEOUT - ".concat(o,"=="));Oe.checkoutTimeoutInterval=setTimeout((function(){Oe.checkoutSessionTimeoutShow=true}),o)}));var Ue=e("j",(function(){if(Oe.checkoutTimeoutInterval){clearTimeout(Oe.checkoutTimeoutInterval);Oe.checkoutTimeoutInterval=null}}));var ze=function(e){return e.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}))};var Be=function(){Oe.items=Oe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}));Oe.restrictedItems=[]};var Fe=e("f",(function(e){return __awaiter(b,[e],void 0,(function(e){var n,t,o,i;var a=e.adjustments,s=e.cartItems,d=e.landedCostId,u=e.shouldInitSessionOnFailure,l=u===void 0?true:u;return __generator(this,(function(e){switch(e.label){case 0:Oe.adjustments=a;Oe.items=ze(s);t=(n=s.find(Boolean))===null||n===void 0?void 0:n.currencyCode;o=s.reduce((function(e,n){return e+n.amount*n.quantity}),0);i=a.reduce((function(e,n){return e+n.amount}),0);if(!t||!o){return[2]}Oe.currency=t;J.isFetchingSession=true;return[4,De({adjustmentsAmount:i,billToPartyId:J.partyBillingId,cartId:window.Zonos.cartId,currency:t,dutiesTaxesFeesEstimate:0,itemsAmount:o,landedCostId:d,shipToPartyId:J.partyShippingId,shouldInitSessionOnFailure:l,varianceTestInput:r.enabledVariantTestKeys||[]})];case 1:e.sent();J.isFetchingSession=false;return[2]}}))}))}));var Je=function(){Oe.selectedShippingOption=null;Oe.isSelectedShippingAboveDeminimis=false;Oe.isSelectedShippingGuarantee=false;Oe.selectedShippingOptionTransitTime="";Oe.dutiesTaxesFees=0;Oe.dutiesTaxesFeesEstimate=0;Oe.shipping=0;Oe.total=Oe.subtotal};var Me=function(){if(Oe.step==="shipping"){Oe.step="customer-info";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{"customer-info":Object.assign(Object.assign({},Oe.tabItems.shipping),{isDone:false})})}else if(Oe.step==="payment"){Oe.step="shipping";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{shipping:Object.assign(Object.assign({},Oe.tabItems.shipping),{isDone:false})})}else if(Oe.step==="finish"){Oe.step="payment";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{payment:Object.assign(Object.assign({},Oe.tabItems.payment),{isDone:false})})}};var qe=e("r",(function(){if(Oe.step==="customer-info"){Oe.step="shipping";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{"customer-info":Object.assign(Object.assign({},Oe.tabItems["customer-info"]),{isDone:true})})}else if(Oe.step==="shipping"){Oe.step="payment";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{shipping:Object.assign(Object.assign({},Oe.tabItems.shipping),{isDone:true})})}else if(Oe.step==="payment"){Oe.step="finish"}}));var We=e("h",(function(){Oe.step="customer-info";Oe.tabItems=Object.assign(Object.assign({},Oe.tabItems),{"customer-info":Object.assign(Object.assign({},Oe.tabItems["customer-info"]),{isDone:false}),payment:Object.assign(Object.assign({},Oe.tabItems.payment),{isDone:false}),shipping:Object.assign(Object.assign({},Oe.tabItems.shipping),{isDone:false})});Je()}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-5fc34563.system.js","./p-89c5164b.system.js","./p-23e7c655.system.js","./p-433d76b4.system.js","./p-cdaf52f4.system.js","./p-cef1e888.system.js","./p-01174496.system.js","./p-c89e9d56.system.js","./p-d938f42f.system.js","./p-b4fe3604.system.js","./p-24e26a2c.system.js"],(function(t){"use strict";var n,o,e,s,a,i,r,c,h,l,p,f,y,m,u;return{setters:[function(t){n=t.r;o=t.h;e=t.H;s=t.a;a=t.c},function(t){i=t.f},function(t){r=t.c},function(t){c=t.g},function(t){h=t.c;l=t.t},function(t){p=t.s},function(t){f=t.l},function(t){y=t.d;m=t.e},function(t){u=t.l},function(){},function(){}],execute:function(){var d='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var z='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var g=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var x=g;var b=t("zonos_empty_state_payment",function(){function t(t){n(this,t);this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=d}else{this.el.shadowRoot.innerHTML=z}return o(e,{class:"zonos--elements",style:{"--zonos--font-family":i(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());b.style=x;var w=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var k=w;var v=t("zonos_notification",function(){function t(t){n(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o;var e=this;return __generator(this,(function(s){n="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},t),{id:n,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:n,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(n)}),o.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var n=t.id,o=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===n){return Object.assign(Object.assign({},t),{transitionClass:o})}return t}))};t.prototype.removeNotification=function(t){var n=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){n.notificationArray=n.notificationArray.filter((function(n){return n.id!==t}))}),300)};t.prototype.render=function(){var t=this;return o(e,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(n){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",n.type,n.transitionClass]),key:n.id,onClick:function(){t.removeNotification(n.id)}},o("zonos-text",{textColor:"gray-0"},n.message))}))))};return t}());v.style=k;var _=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var I=_;var j=t("zonos_payment",function(){function t(t){n(this,t);this.stripe=h.stripe;this.stripeElements=h.stripeElements;this.isPaymentInfoFilled=false;this.trackingSent=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var n=p.checkoutSessionId;void l({checkoutSessionId:n,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=h.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){var t=this;var n;if(!this.stripeElements){return}var o=h.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:(n=h.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country}}},layout:"tabs"});var e=this.el.querySelector(".zonos--payment-component");if(!e){f("Cannot find container element for paymentElement");return}o.mount(e);o.on("change",(function(n){if(n.complete){t.isPaymentInfoFilled=true}h.stripePaymentEventData=n}));h.stripePaymentElement=o};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return o(e,{key:"c0b27f25785a9f6de2705e16d97f1bf5f7bcb0a4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"1cfdb16f94a5219882da9da013a6e2de6a6b3c3f",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"bb5ac07b4c32f2469f4825426160542d9729d332",class:"zonos--payment-component"}),o("div",{key:"34f805b56fa151e8a3102361df9fb8b3e636dc75",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}());j.style=I;var S=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var O=S;var C=t("zonos_paypal_payment",function(){function t(t){n(this,t);this.paypalSessionDone=a(this,"paypalSessionDone",7);this.paypalSessionFail=a(this,"paypalSessionFail",7);this.storeUnsubscribeList=[]}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){u("Paypal is not available");return[2]}t=y({onPaypalFail:function(){u("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var n=t.orderId;u("onPaypalSessionDone","info",{orderId:n});o.paypalSessionDone.emit({orderId:n})}});if(!(t===null||t===void 0?void 0:t.length)){u("There are no paypal buttons available");return[2]}n=this.el.querySelector(".zonos--payment-paypal-container");if(!n){u("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,t.render(n)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[m("paypal",this.loadPaypal.bind(this))]};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return o(e,{key:"bcf11ef0ceab1d847c237ec26ec604440983c16f",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"ce5033f39b2e9644e30fc1e0e35f64e5d9b9730d",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());C.style=O}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-5fc34563.system.js","./p-89c5164b.system.js","./p-23e7c655.system.js","./p-433d76b4.system.js","./p-f688d7a4.system.js","./p-bb707dfd.system.js","./p-01174496.system.js","./p-0047fecf.system.js","./p-d938f42f.system.js","./p-7920d79c.system.js","./p-24e26a2c.system.js"],(function(t){"use strict";var n,o,e,s,a,i,r,c,h,l,p,f,y,m,u;return{setters:[function(t){n=t.r;o=t.h;e=t.H;s=t.a;a=t.c},function(t){i=t.f},function(t){r=t.c},function(t){c=t.g},function(t){h=t.c;l=t.t},function(t){p=t.s},function(t){f=t.l},function(t){y=t.d;m=t.e},function(t){u=t.l},function(){},function(){}],execute:function(){var d='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var z='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var g=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var b=g;var x=t("zonos_empty_state_payment",function(){function t(t){n(this,t);this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=d}else{this.el.shadowRoot.innerHTML=z}return o(e,{class:"zonos--elements",style:{"--zonos--font-family":i(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());x.style=b;var w=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var k=w;var v=t("zonos_notification",function(){function t(t){n(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o;var e=this;return __generator(this,(function(s){n="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},t),{id:n,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:n,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(n)}),o.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var n=t.id,o=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===n){return Object.assign(Object.assign({},t),{transitionClass:o})}return t}))};t.prototype.removeNotification=function(t){var n=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){n.notificationArray=n.notificationArray.filter((function(n){return n.id!==t}))}),300)};t.prototype.render=function(){var t=this;return o(e,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(n){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",n.type,n.transitionClass]),key:n.id,onClick:function(){t.removeNotification(n.id)}},o("zonos-text",{textColor:"gray-0"},n.message))}))))};return t}());v.style=k;var _=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var I=_;var j=t("zonos_payment",function(){function t(t){n(this,t);this.stripe=h.stripe;this.stripeElements=h.stripeElements;this.isPaymentInfoFilled=false;this.trackingSent=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var n=p.checkoutSessionId;void l({checkoutSessionId:n,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=h.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){var t=this;var n;if(!this.stripeElements){return}var o=h.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:(n=h.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country}}},layout:"tabs"});var e=this.el.querySelector(".zonos--payment-component");if(!e){f("Cannot find container element for paymentElement");return}o.mount(e);o.on("change",(function(n){if(n.complete){t.isPaymentInfoFilled=true}h.stripePaymentEventData=n}));h.stripePaymentElement=o};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return o(e,{key:"c0b27f25785a9f6de2705e16d97f1bf5f7bcb0a4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"1cfdb16f94a5219882da9da013a6e2de6a6b3c3f",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"bb5ac07b4c32f2469f4825426160542d9729d332",class:"zonos--payment-component"}),o("div",{key:"34f805b56fa151e8a3102361df9fb8b3e636dc75",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}());j.style=I;var S=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var O=S;var C=t("zonos_paypal_payment",function(){function t(t){n(this,t);this.paypalSessionDone=a(this,"paypalSessionDone",7);this.paypalSessionFail=a(this,"paypalSessionFail",7);this.storeUnsubscribeList=[]}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){u("Paypal is not available");return[2]}t=y({onPaypalFail:function(){u("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var n=t.orderId;u("onPaypalSessionDone","info",{orderId:n});o.paypalSessionDone.emit({orderId:n})}});if(!(t===null||t===void 0?void 0:t.length)){u("There are no paypal buttons available");return[2]}n=this.el.querySelector(".zonos--payment-paypal-container");if(!n){u("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,t.render(n)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[m("paypal",this.loadPaypal.bind(this))]};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return o(e,{key:"bcf11ef0ceab1d847c237ec26ec604440983c16f",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"ce5033f39b2e9644e30fc1e0e35f64e5d9b9730d",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());C.style=O}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function u(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(s,u)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return c([t,n])}}function c(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,o&&(r=u[0]&2?o["return"]:u[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;if(o=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-5fc34563.system.js","./p-f688d7a4.system.js","./p-bb707dfd.system.js","./p-89c5164b.system.js","./p-4160bbc2.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-7920d79c.system.js","./p-24e26a2c.system.js","./p-433d76b4.system.js"],(function(t){"use strict";var n,e,i,o,r,s,u,c,a,f,l,d,h,v,w,p,g,m,_;return{setters:[function(t){n=t.r;e=t.c;i=t.h;o=t.H},function(t){r=t.c},function(t){s=t.e;u=t.i;c=t.h;a=t.s;f=t.a},function(t){l=t.z;d=t.e;h=t.f},function(t){v=t.g;w=t.i;p=t.a},function(t){g=t.h;m=t.l},function(t){_=t.l},function(){},function(){},function(){}],execute:function(){var b=this;var y=function(){return __awaiter(b,void 0,void 0,(function(){var t,n,e,i,o,r,u;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){_("Reusing cached zonos settings");return[2,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=v();n=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){n.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}e=s();if(e){n.set("zCountry",e)}return[4,g("/api/zonos-elements/zonos-settings?".concat(n.toString()))];case 1:i=c.sent(),o=i.errors,r=i.json,u=i.zonosMode;if(o.length){m("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:o,json:null,zonosMode:u}]}return[2,{errors:[],json:r,zonosMode:u}]}}))}))};var S=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var z=function(t){if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!u(t.placeOrderButtonSelector)){m('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!u(t.alwaysTriggerInternationalCheckoutSelector)){m('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}S()};var j=function(){var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var O=function(){if(!window.Zonos.cartData){return}j()};var I=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var k=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var A=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return i};var C=function(t){return __awaiter(b,void 0,void 0,(function(){var n,e,i,o,r;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){_("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){i=A({position:"bottom-right"});e=i}if(!e||!u(e)){m('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}_("Hello init complete");o=I(e);if(!o){r=new MutationObserver((function(){var t=I(e);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){I(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){_("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=A({position:k(t.notFoundElementFallback)});I(n)}}),3e3)}return[2]}))}))};var T=function(){function t(t,n){var e=this;this.targetId=t;this.allowedEvents=n;this.listeners=new Map;this.handleMessage=function(t){var n,i,o;var r=t.data;var s=((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||((o=(i=e.iframe)===null||i===void 0?void 0:i.contentDocument)===null||o===void 0?void 0:o.defaultView);if(t.source!==s){return}if(!e.isValidMessage(r)){return}var u=e.listeners.get(r.type);u===null||u===void 0?void 0:u.forEach((function(t){try{t(r.payload)}catch(t){m("Error in event listener:",t)}}))};this.initializeEventListeners();this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}_("[CheckoutAddressService] listening to ".concat(t),"info");var i=n;var o=this.listeners.get(t);if(o){o.add(i)}return function(){var n=e.listeners.get(t);if(n){n.delete(i)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();var E=function(t){__extends(n,t);function n(){_("=== [Google Places Service] Initializing","info");return t.call(this,w.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}n.prototype.sendMessage=function(t,n){var e;if(!((e=this.iframe)===null||e===void 0?void 0:e.contentWindow)){return}var i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:n,type:t};_("GooglePlacesService] parent --\x3e ".concat(t),"info",n);this.iframe.contentWindow.postMessage(i,"*")};n.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};n.prototype.fetchSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!n){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[n],input:e},type:i})};n.prototype.selectPlace=function(t){var n=t.placeId,e=t.type;this.sendMessage("placeSelected",{placeId:n,type:e})};return n}(T);var P=function(){function t(){var t=this;this.googlePlaceInitialized=false;_("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new E;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.getAddressSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:n,query:e,type:i})};t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var x=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var L=x;var F=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7)}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}r.stripe=t;void z(l.checkoutSettings);_("init checkout element");return[2]}))}))};t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2]}r.stripe=t;void O();_("init Collect element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,s,u,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||h();if(i==="Inter"){if(!t){return[2]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4,g("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:r=a.sent(),s=r.errors,u=r.json;if(s.length>0){_("Failed to load font ".concat(i),"warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"});return[2]}c=u===null||u===void 0?void 0:u.fontUrl;if(c){(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,c)}if(!t){return[2]}_("[FONT] ".concat(t," font override applied"));l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void C(l.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect){_("=== Skip injecting custom HTML for hosted checkout","info");return}_("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var e=n.content.querySelectorAll("script");e.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}))};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t===null||t===void 0?void 0:t.genericSettings;if(!n){return[2]}e=n.signedTokenGooglePlaces;if(!e){return[2]}p({id:w.GOOGLE_PLACES,onload:function(){l.checkoutAddressService=new P},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(e)});return[2]}))}))};t.prototype.buildBaseConfig=function(t){var n,e;var i=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:undefined,captureDelay:undefined,subscriptionStatus:undefined});if(window.Zonos.isCollect){return Object.assign(Object.assign({},this.config),{checkoutSettings:i,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})})}if(!this.config.checkoutSettings){return Object.assign(Object.assign({},this.config),{checkoutSettings:undefined})}var o=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((n=this.config.checkoutSettings)===null||n===void 0?void 0:n.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();l.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,s,u,a,f,h,v,w;var p=this;return __generator(this,(function(g){switch(g.label){case 0:return[4,y()];case 1:o=g.sent(),r=o.errors,s=o.json,u=o.zonosMode;if(((n=(t=r[0])===null||t===void 0?void 0:t.type)===null||n===void 0?void 0:n.toString())==="403"){_("Failed to load zonos settings. This domain may not have access","warn");return[2]}a=((e=s===null||s===void 0?void 0:s.checkoutSettings)===null||e===void 0?void 0:e.customHTML)||"";this.injectCustomHTML(a);this.initZonosNotification();f=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){return((t=s===null||s===void 0?void 0:s.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=p.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(e=p.config.appearance)===null||e===void 0?void 0:e.logoUrl};h=this.buildBaseConfig(s);v=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:f()})}),h);d({overrideSettings:v,zonosSettings:s});l.zonosMode=u;void this.setupGoogleFont();if(l.helloSettings.visibilityStatus==="DISABLED"){_("=== Hello is disabled by store owner ===","warn")}if(l.helloSettings&&l.helloSettings.visibilityStatus==="ENABLED"){_("Initializing hello");void C(l.helloSettings)}return[4,c()];case 2:g.sent();w=((i=s===null||s===void 0?void 0:s.checkoutSettings)===null||i===void 0?void 0:i.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!w||!this.stripeInitEvent){_("Checkout failed to load -- missing publishable key","warn");return[2]}if(window.Zonos.isCollect){this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(s);return[2]}if(l.checkoutSettings.subscriptionStatus==="INACTIVE"){_('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");_("zonos controller loaded");return[2]}if(l.checkoutSettings.visibilityStatus==="DISABLED"){_("=== Checkout is disabled by store owner ===","warn");_("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(s);return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){_("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;r.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){_("Override country code to ".concat(t));void f({isInitializing:false,newSelectedCountryCode:t});return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,l.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(o,{key:"c3c33e5e4422b4b05f68fc876a23eb30c9b0f11d",class:"zonos--elements"})};return t}());F.style=L}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-b30c2ad9.js";export{s as setNonce}from"./p-b30c2ad9.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o(JSON.parse('[["p-0d3767ec",[[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],"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","handleAppearanceSettingsOverrideChange"],"overrideStagingMode":["overrideStagingModeChanged"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"customerProfile":["handleCustomerProfileChange"],"clientSecret":["handleClientSecretChange"],"stripeCustomerSessionClientSecret":["handleClientSecretChange"],"open":["handleOpenChange"]}]]],["p-76f924b3",[[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-f4085c23",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-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"],"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-65db3219",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"initCollectElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-fa90adb8",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-cbb01de9",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-6bab9096",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-c998e4ed",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-9972941a",[[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"]}]]],["p-f912e9c3",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-b658c28a",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-10894d36",[[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]}]]],["p-2dc38ef3",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-d2f7ea09",[[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"]}]]],["p-b0a75761",[[1,"zonos-collect-cart-items",{"errorImages":[32]}],[1,"zonos-h-stack",{"spacing":[2]}],[1,"zonos-skeleton",{"skeletonWidth":[1,"skeleton-width"],"skeletonHeight":[1,"skeleton-height"],"dismissHandler":[16]}]]],["p-6d423364",[[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"],"value":["onValueChange"]}]]],["p-d96545ae",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-2b84039a",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-c81f6387",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-cf56b990",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-b4bf2f03",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-6497ce22",[[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"],"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-4523b982",[[17,"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"]}],[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-5608ac9d",[[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"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-collect-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"],"tablet":["handleTabletChange"]}],[1,"zonos-collect-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":["handleCollapseChangeFromProp"],"collapseState":["handleCollapseChange"]}],[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-62803534",[[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"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-053a042e",[[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"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-custom-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"isAddressLine1Entered":[32],"addressSuggestions":[32],"countryField":[32],"startGooglePlaceSuggestions":[32],"shipToCountries":[32],"shippingZones":[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"],"isAddressFilled":["isAddressFilledChanged"],"defaultAddress":["defaultAddressChanged"],"line1":["line1Changed"],"city":["formFieldsChanged"],"country":["formFieldsChanged","countryChanged"],"firstName":["formFieldsChanged"],"lastName":["formFieldsChanged"],"line2":["formFieldsChanged"],"phone":["formFieldsChanged"],"postalCode":["formFieldsChanged"],"state":["formFieldsChanged"],"addressService":["shouldEnabledCustomAddressChanged"],"shippingZones":["shippingZonesChanged"]}],[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-address-suggestions",{"type":[1],"suggestions":[16],"selectedSuggestionId":[32],"localSuggestions":[32],"lastHoveredSuggestionId":[32]},null,{"suggestions":["suggestionsChanged"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"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"]]],[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,{"countryOptions":["onCountryOptionsChange"],"selectedCountry":["onSelectedCountryChange"],"inputValue":["onPhoneNumberChange"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"checkoutSessionId":[32],"prevCountry":[32],"prevPostalCode":[32]},null,{"checkoutSessionId":["isAddressFilledChanged"],"isAddressFilled":["isAddressFilledChanged"],"stripe":["watchInitStripe"],"defaultAddress":["defaultAddressChanged"]}],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}],[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"],"stripe":["watchInitStripe"],"clientSecret":["watchInitStripe"],"defaultEmail":["watchDefaultEmail"]}],[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"],"selectedValue":["onSelectedValueChange"],"value":["onValueChange"]}]]],["p-462f8857",[[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],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32],"recordedFormTypeUsed":[32],"selectedCountryCode":[32],"genericSettings":[32],"addressFormRenderType":[32]},null,{"showErrorBanner":["watchShowErrorBanner"],"shouldUseCustomAddressFormOverride":["watchShouldEnabledCustomAddress"],"genericSettings":["watchShouldEnabledCustomAddress"],"selectedCountryCode":["watchShouldEnabledCustomAddress"]}],[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"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32],"shippingData":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[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]}],[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]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}],[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]]]'),e))));
|
|
1
|
+
import{p as e,b as o}from"./p-b30c2ad9.js";export{s as setNonce}from"./p-b30c2ad9.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o(JSON.parse('[["p-c28da00e",[[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],"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","handleAppearanceSettingsOverrideChange"],"overrideStagingMode":["overrideStagingModeChanged"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"customerProfile":["handleCustomerProfileChange"],"clientSecret":["handleClientSecretChange"],"stripeCustomerSessionClientSecret":["handleClientSecretChange"],"open":["handleOpenChange"]}]]],["p-ede9e968",[[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-c20429ea",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-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"],"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-d9486c57",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"initCollectElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-fa90adb8",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-cbb01de9",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-6bab9096",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-c998e4ed",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-c9be03e0",[[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"]}]]],["p-f912e9c3",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-b658c28a",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-bc963b03",[[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]}]]],["p-2dc38ef3",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-d2f7ea09",[[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"]}]]],["p-ac26a931",[[1,"zonos-collect-cart-items",{"errorImages":[32]}],[1,"zonos-h-stack",{"spacing":[2]}],[1,"zonos-skeleton",{"skeletonWidth":[1,"skeleton-width"],"skeletonHeight":[1,"skeleton-height"],"dismissHandler":[16]}]]],["p-6d423364",[[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"],"value":["onValueChange"]}]]],["p-d96545ae",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-91fa43ef",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-c81f6387",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-d15cd138",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-b4bf2f03",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-30981f80",[[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"],"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-4523b982",[[17,"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"]}],[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-3eda5c2c",[[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"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-collect-footer",{"mobile":[4],"tablet":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32],"isTablet":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"],"tablet":["handleTabletChange"]}],[1,"zonos-collect-order-details",{"mobile":[4],"collapsed":[4],"landedCostId":[1,"landed-cost-id"],"isMobile":[32],"collapseState":[32]},[[9,"resize","handleWindowResize"]],{"collapsed":["handleCollapseChangeFromProp"],"collapseState":["handleCollapseChange"]}],[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-cec35a21",[[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"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-4f5be8f0",[[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"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-custom-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"isAddressLine1Entered":[32],"addressSuggestions":[32],"countryField":[32],"startGooglePlaceSuggestions":[32],"shipToCountries":[32],"shippingZones":[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"],"isAddressFilled":["isAddressFilledChanged"],"defaultAddress":["defaultAddressChanged"],"line1":["line1Changed"],"city":["formFieldsChanged"],"country":["formFieldsChanged","countryChanged"],"firstName":["formFieldsChanged"],"lastName":["formFieldsChanged"],"line2":["formFieldsChanged"],"phone":["formFieldsChanged"],"postalCode":["formFieldsChanged"],"state":["formFieldsChanged"],"addressService":["shouldEnabledCustomAddressChanged"],"shippingZones":["shippingZonesChanged"]}],[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-address-suggestions",{"type":[1],"suggestions":[16],"selectedSuggestionId":[32],"localSuggestions":[32],"lastHoveredSuggestionId":[32]},null,{"suggestions":["suggestionsChanged"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"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"]]],[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,{"countryOptions":["onCountryOptionsChange"],"selectedCountry":["onSelectedCountryChange"],"inputValue":["onPhoneNumberChange"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"taxIdErrorMessage":[1,"tax-id-error-message"],"stripe":[32],"isDirtyAddress":[32],"isAddressFilled":[32],"checkoutSessionId":[32],"prevCountry":[32],"prevPostalCode":[32]},null,{"checkoutSessionId":["isAddressFilledChanged"],"isAddressFilled":["isAddressFilledChanged"],"stripe":["watchInitStripe"],"defaultAddress":["defaultAddressChanged"]}],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}],[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"],"stripe":["watchInitStripe"],"clientSecret":["watchInitStripe"],"defaultEmail":["watchDefaultEmail"]}],[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"],"selectedValue":["onSelectedValueChange"],"value":["onValueChange"]}]]],["p-db73c11a",[[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],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32],"recordedFormTypeUsed":[32],"selectedCountryCode":[32],"genericSettings":[32],"addressFormRenderType":[32]},null,{"showErrorBanner":["watchShowErrorBanner"],"shouldUseCustomAddressFormOverride":["watchShouldEnabledCustomAddress"],"genericSettings":["watchShouldEnabledCustomAddress"],"selectedCountryCode":["watchShouldEnabledCustomAddress"]}],[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"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32],"shippingData":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[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]}],[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]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}],[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]]]'),e))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zonos/elements",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.231",
|
|
4
4
|
"description": "Zonos component UI for Stripe elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"storybook:open": "open https://dev.storybook.elements.zonos.com",
|
|
57
57
|
"storybook": "storybook dev -p 7013 --no-open --quiet",
|
|
58
58
|
"test": "stencil test --spec --detectOpenHandles --watchAll",
|
|
59
|
-
"test:prod": "stencil test --spec
|
|
59
|
+
"test:prod": "stencil test --spec",
|
|
60
60
|
"tsc": "tsc --noEmit",
|
|
61
61
|
"tsc:prod": "pnpm tsc && pnpm demo:exec tsc",
|
|
62
62
|
"version:major": "pnpm build && pnpm version major -m 'Bump version %s' && pnpm version:save && pnpm push:tags",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@types/tinycolor2": "^1.4.6",
|
|
113
113
|
"@types/turndown": "^5.0.5",
|
|
114
114
|
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
115
|
-
"@typescript-eslint/parser": "^8.
|
|
115
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
116
116
|
"@vitejs/plugin-react": "^4.3.4",
|
|
117
117
|
"caniuse-lite": "^1.0.30001689",
|
|
118
118
|
"clean-css-cli": "^5.6.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var buildCartItemsByTempCart=function(t){var e=t.items.map((function(t){return{amount:t.amount,attributes:t.attributes||[],countryOfOrigin:t.countryOfOrigin||undefined,currencyCode:t.currencyCode,description:t.description||"",imageUrl:t.imageUrl||"",itemType:t.itemType||"PHYSICAL_GOOD",measurements:t.measurements||[],name:t.name||t.description||"",productId:t.productId||"",quantity:t.quantity||0,sku:t.sku||""}}))||[];return{adjustments:t.adjustments,cartItems:e}};export{buildCartItemsByTempCart as b};
|