@zonos/elements 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-CiXlehwQ.js → cart-BJpqPdFU.js} +13 -13
- package/dist/cjs/{collect-Drr8fY-q.js → collect-CyUttsvB.js} +3 -3
- package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-DEbNbRAZ.js} +1 -1
- package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
- package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
- package/dist/cjs/index.cjs.js +104 -12
- package/dist/cjs/{invoice-5hVfSXpb.js → invoice-DzRkkpLu.js} +3 -3
- package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
- package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-DCSqbdjW.js} +4 -4
- package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-Bkip4PUT.js} +3 -3
- package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-BDvEZ3Hv.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
- package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
- package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-e4OCgr8K.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +5 -5
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -3
- package/dist/collection/components/main/zonos-controller.js +3 -2
- package/dist/collection/components/store/checkout/cart.js +3 -2
- package/dist/collection/components/store/checkout/stripe.js +10 -9
- package/dist/collection/components/store/storageStore.js +7 -6
- package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
- package/dist/collection/components/utils/handleFetch.js +19 -9
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
- package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
- package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
- package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
- package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
- package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
- package/dist/collection/components/utils/safeStorage.js +39 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
- package/dist/collection/scripts/_zonosBase.js +6 -2
- package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
- package/dist/collection/types/generated/graphql.internal.types.js +215 -1
- package/dist/esm/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +13 -13
- package/dist/esm/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +3 -3
- package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
- package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
- package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
- package/dist/esm/index.js +104 -12
- package/dist/esm/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +3 -3
- package/dist/esm/{localization-DHM91diu.js → localization-CXHiWcJp.js} +24 -48
- package/dist/esm/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +4 -4
- package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +3 -3
- package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
- package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +5 -5
- package/dist/esm/zonos-address-display_2.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +4 -4
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
- package/dist/esm/zonos-card_5.entry.js +5 -5
- package/dist/esm/zonos-cart-items_12.entry.js +18 -18
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
- package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
- package/dist/esm/zonos-invoice.entry.js +6 -6
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
- package/dist/esm-es5/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +58 -58
- package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
- package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
- package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
- package/dist/esm-es5/index.js +26 -8
- package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +1 -1
- package/dist/esm-es5/{localization-DHM91diu.js → localization-CXHiWcJp.js} +6 -9
- package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
- package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
- package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
- package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +6 -6
- package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
- package/dist/esm-es5/zonos-checkout.entry.js +3 -3
- 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 +6 -6
- package/dist/esm-es5/zonos-controller.entry.js +5 -5
- 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-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +3 -3
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +6 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
- package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
- package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
- package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
- package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
- package/dist/types/components/utils/safeStorage.d.ts +4 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
- package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
- package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
- package/dist/types/types/generated/graphql.internal.types.ts +341 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-08b01c96.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e705c9b.entry.js → p-0909ef77.entry.js} +1 -1
- package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-13015d34.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2d513aa3.entry.js → p-13d5b2f9.entry.js} +1 -1
- package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-150047b3.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-6e691736.entry.js → p-1986cc37.entry.js} +1 -1
- package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
- package/dist/zonos-elements/{p-189cc594.system.entry.js → p-30bf4700.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4917b74d.entry.js → p-3466bcba.entry.js} +1 -1
- package/dist/zonos-elements/{p-12b24ebb.entry.js → p-383343c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-5585db86.system.entry.js → p-3a506614.system.entry.js} +36 -36
- package/dist/zonos-elements/{p-46b9f0cf.entry.js → p-43c0ebe9.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e76348.entry.js → p-4b65f192.entry.js} +1 -1
- package/dist/zonos-elements/{p-216a908d.system.entry.js → p-573a4e7c.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-5a296dbc.system.entry.js} +87 -87
- package/dist/zonos-elements/{p-960070d0.system.entry.js → p-68325c5a.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-6db7317a.system.entry.js} +13 -13
- package/dist/zonos-elements/{p-1199baef.system.entry.js → p-709d1561.system.entry.js} +1 -1
- package/dist/zonos-elements/p-71d29603.entry.js +1 -0
- package/dist/zonos-elements/{p-064d8829.system.entry.js → p-7214c953.system.entry.js} +23 -23
- package/dist/zonos-elements/{p-65817880.entry.js → p-7fe83919.entry.js} +1 -1
- package/dist/zonos-elements/p-8ac26831.entry.js +1 -0
- package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-8f9f859f.system.entry.js} +9 -9
- package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-96b250d8.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-678b9214.entry.js → p-97729873.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-9b3668a4.system.entry.js} +144 -144
- package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-9df31243.system.entry.js} +1 -1
- package/dist/zonos-elements/p-BI6VAB5B.js +1 -0
- package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
- package/dist/zonos-elements/p-BJ_kE5rM.js +1 -0
- package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-BKUlQxBd.system.js} +1 -1
- package/dist/zonos-elements/{p-DprOoI2W.system.js → p-BUfCTQXY.system.js} +154 -154
- package/dist/zonos-elements/{p-CBUz18kA.system.js → p-BnQyot7Y.system.js} +23 -23
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CMo3ZweU.js → p-C-zdj7MK.js} +1 -1
- package/dist/zonos-elements/{p-iAIzUA4k.js → p-C5fs3rIR.js} +1 -1
- package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
- package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-CMneHjck.system.js} +39 -39
- package/dist/zonos-elements/p-CP7KnfR3.system.js +245 -0
- package/dist/zonos-elements/p-CVRbGFV3.js +1 -0
- package/dist/zonos-elements/p-Cl5yV0ak.js +1 -0
- package/dist/zonos-elements/{p-CGNVm52g.system.js → p-Cp1IAJvW.system.js} +5 -5
- package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-D-Lnf8mS.system.js} +50 -53
- package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
- package/dist/zonos-elements/p-D4xpkSsK.js +1 -0
- package/dist/zonos-elements/p-DATNIakn.js +1 -0
- package/dist/zonos-elements/{p-CbhN65lj.system.js → p-DC1OPJDq.system.js} +1 -1
- package/dist/zonos-elements/{p-CHKKvuiz.js → p-DKnphvmJ.js} +1 -1
- package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
- package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-DrS-0mk7.system.js} +1 -1
- package/dist/zonos-elements/{p-DpwmHU8R.js → p-DrbN3rPL.js} +2 -2
- package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Dv5a-V6w.system.js} +3 -3
- package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-a3c147d2.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-DiMEP3mh.js → p-aK18R41t.js} +1 -1
- package/dist/zonos-elements/p-af4ad54b.entry.js +1 -0
- package/dist/zonos-elements/{p-1e6db427.entry.js → p-af741506.entry.js} +1 -1
- package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-b540c636.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-636b71d4.entry.js → p-bac94956.entry.js} +1 -1
- package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-bb1b414a.system.entry.js} +5 -5
- package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-bfa9e32a.entry.js} +1 -1
- package/dist/zonos-elements/p-cf6bf7a4.entry.js +1 -0
- package/dist/zonos-elements/p-dJcbnNlE.system.js +7 -0
- package/dist/zonos-elements/{p-7dc7f328.entry.js → p-db40b9c3.entry.js} +1 -1
- package/dist/zonos-elements/{p-d3345b2c.entry.js → p-dd003161.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef5344ea.entry.js → p-e374aaa4.entry.js} +1 -1
- package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-e43470f7.system.entry.js} +22 -22
- package/dist/zonos-elements/{p-fda89981.system.entry.js → p-ebc7ea54.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-f2ed52bc.system.entry.js} +16 -16
- package/dist/zonos-elements/p-gEViRqvf.js +1 -0
- package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-yv7ekcdG.system.js} +2 -2
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
- package/dist/zonos-elements/p-107f287b.entry.js +0 -1
- package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
- package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
- package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
- package/dist/zonos-elements/p-C70h5mKA.js +0 -1
- package/dist/zonos-elements/p-CTiqplrr.js +0 -1
- package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
- package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
- package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
- package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
- package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
- package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
- package/dist/zonos-elements/p-U33isUJG.js +0 -1
- package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
- package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
|
@@ -0,0 +1,245 @@
|
|
|
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 u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r["throw"](e))}catch(e){i(e)}}function s(e){e.done?t(e.value):o(e.value).then(u,a)}s((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,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=a(0),u["throw"]=a(1),u["return"]=a(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(e){return function(n){return s([e,n])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(t=0)),t)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;o=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[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-CzKlS3E-.system.js","./p-DBOI98r5.system.js","./p-CKhl__Kc.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C29tlYn0.system.js","./p-DsBuZ6ob.system.js"],(function(e){"use strict";var n,t,r,o,i,u,a,s,c,d,l,f,v,w,m,p;return{setters:[function(n){e({curpRegex:n.c,isMexicoTaxIdType:n.i,isPeruTaxIdType:n.a,peruTaxIdTypeFromValue:n.p,stripTaxIdSeparators:n.s})},function(e){n=e.c},function(e){t=e.g;r=e.I},function(e){o=e.t;i=e.s;u=e.g;a=e.a;s=e.h;c=e.l;d=e.b;l=e.c},function(n){f=n.l;e("availableTestKeys",n.a)},function(n){v=n.g;w=n._;m=n.c;p=n.a;e({checkoutHiddenBtnSelector:n.c,checkoutHiddenInternationalBtnSelector:n.a,domesticRedirectedBtnSelector:n.d})},function(n){e("countryRequireShortAddressCode",n.c)},function(n){e({checkoutTaxIdTypeValues:n.a,countryRequireTaxId:n.c,euCountryCodes:n.e,isCountryRequireTaxId:n.i,peruTaxIdDigitLength:n.p,peruTaxIdFormatError:n.b,shipToTaxIdLabels:n.s,taxIdTypeOptions:n.t})}],execute:function(){var h=this;var y=/^Constructor for .+ was not found/;var O=/^Constructor for "?([^#"]+)#/;var g=function(e){var n;var t=o(e,"");if(!t||!y.test(t)){return}if(typeof window.Zonos==="undefined"){return}var r=window.__zonosConstructorCapture;if(!r){return}var u=O.exec(t);var a=(n=u===null||u===void 0?void 0:u[1])!==null&&n!==void 0?n:"";if(r.reported.has(a)){return}r.reported.add(a);void i({endpoint:"stencil://constructor",errors:[t],metadata:{shape:"constructor-not-found",tag:a}})};
|
|
2
|
+
/**
|
|
3
|
+
* Copy a missing-constructor failure onto the existing error log.
|
|
4
|
+
* Stencil catches `Constructor for "tag#mode" was not found` and passes that
|
|
5
|
+
* Error to `console.error`. One report is sent per tag, then the original
|
|
6
|
+
* console.error still runs. This does not request the chunk again.
|
|
7
|
+
*/var S=function(){if(window.__zonosConstructorCapture){return}var e=function(e){g(e.reason)};window.__zonosConstructorCapture={listener:e,reported:new Set};window.addEventListener("unhandledrejection",e);
|
|
8
|
+
// eslint-disable-next-line no-console -- Stencil reports the missing constructor here
|
|
9
|
+
var n=console.error.bind(console);
|
|
10
|
+
// eslint-disable-next-line no-console -- record the Stencil diagnostic, then forward it
|
|
11
|
+
console.error=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}g(e[0]);n.apply(void 0,e)}};var b=function(e){
|
|
12
|
+
// sendErrorLog prints only when zonosDebug is on. Keep the failure in the
|
|
13
|
+
// merchant console without leaving an unhandled rejection.
|
|
14
|
+
// eslint-disable-next-line no-console -- the page console is the support signal
|
|
15
|
+
console.error(e);if(typeof window.Zonos==="undefined"){return}void i({endpoint:"zonos://init",errors:[o(e,"Unknown init rejection")],metadata:{shape:"init-rejection"}})};
|
|
16
|
+
/**
|
|
17
|
+
* Run an init that the caller is not waiting on. The rejection is recorded
|
|
18
|
+
* and not rethrown, so startup does not become an unhandled rejection.
|
|
19
|
+
*/var _=function(e){var n;try{n=e()}catch(e){b(e);return}void n.catch((function(e){b(e)}))};
|
|
20
|
+
/**
|
|
21
|
+
* Get the load version and url based on the loadScriptSrc and version
|
|
22
|
+
* @returns
|
|
23
|
+
*/var j=function(e){var n=e.loadScriptSrc;if(!n){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=[
|
|
24
|
+
// local domain
|
|
25
|
+
"dev.elements.zonos.com","dev.assets-checkout.zonos.com",
|
|
26
|
+
// any domain with prefix , no need to version it
|
|
27
|
+
".js.zonos.com",
|
|
28
|
+
// vercel git domain
|
|
29
|
+
"zonos-elements-test-git","zonos-elements-git"];var r=[
|
|
30
|
+
// force load version for qa domain, this is to test the load version behavior
|
|
31
|
+
"qa.js.zonos.com"];
|
|
32
|
+
// get the domain that's used to load the loadZonos.js
|
|
33
|
+
var o=new URL(n).origin;var i=t.some((function(e){
|
|
34
|
+
// check if the current domain is in the white listed domains
|
|
35
|
+
return o.includes(e)}));var u=r.some((function(e){
|
|
36
|
+
// check if the current domain is in the force load version domains list
|
|
37
|
+
return o.includes(e)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var z=["jsdelivr","cdnjs","unpkg","vercel"];var k="jsdelivr";
|
|
38
|
+
/**
|
|
39
|
+
* Get the next cdn type in the fallback list
|
|
40
|
+
* @param currentCdnType The current cdn type that want to get the next fallback url
|
|
41
|
+
*/var I=function(e){
|
|
42
|
+
// get current index of the current fail cdn type in the fallback list
|
|
43
|
+
var n=z.indexOf(e);
|
|
44
|
+
// get the next fallback cdn type
|
|
45
|
+
var t=z[n+1];return t||null};
|
|
46
|
+
/**
|
|
47
|
+
* Attempt to get test public credential to window.Zonos.zonosApiKey if needed
|
|
48
|
+
*/var T=function(){return __awaiter(h,void 0,void 0,(function(){var e,n,t,r,o,i;return __generator(this,(function(d){switch(d.label){case 0:e=u();n=a();
|
|
49
|
+
// Do nothing if the test mode is not enabled or the public credential
|
|
50
|
+
if(!e&&!n||!window.Zonos.zonosApiKey){return[2/*return*/,null]}f("[ZONOS - loadZonos] Attempt test public credential","info");
|
|
51
|
+
// Try to get the test public credential if the test mode is enabled and the public credential key is not a test key
|
|
52
|
+
if(!!window.Zonos.zonosApiKey.includes("credential_test")){f("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2/*return*/,null]}return[4/*yield*/,s("/api/get-test-public-credential")];case 1:t=d.sent(),r=t.errors,o=t.json;if(r.length||!o){c("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r);return[2/*return*/,null]}i=o.publicCredential;if(!i){c("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2/*return*/,null]}
|
|
53
|
+
// Set the test public credential to the window object
|
|
54
|
+
f("[ZONOS - loadZonos] Retrieve new test public token ".concat(i),"info");return[2/*return*/,i]}}))}))};
|
|
55
|
+
/**
|
|
56
|
+
* Extracts the zonosQaUrl from the url
|
|
57
|
+
*
|
|
58
|
+
* @param url - url to extract zonosQaUrl from
|
|
59
|
+
*
|
|
60
|
+
* **NOTE**: value of zonosQaUrl param should be without protocol, allowed characters are: a-z, A-Z, 0-9, -, _
|
|
61
|
+
* @example
|
|
62
|
+
* valid: https://www.zonos.com/?zonosQaUrl=some-feature-v988
|
|
63
|
+
* invalid: https://www.zonos.com/?zonosQaUrl=https://zonos-something
|
|
64
|
+
*/var N=function(e){if(!e){return null}
|
|
65
|
+
// get params from url
|
|
66
|
+
var n=new URL(e).searchParams;var t=n.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};
|
|
67
|
+
/**
|
|
68
|
+
* Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
|
|
69
|
+
*/var A=function(){
|
|
70
|
+
/**
|
|
71
|
+
* This is flag to force load cdn for testing purpose
|
|
72
|
+
* When developing, if the script load is from `dev.elements.zonos.com`,
|
|
73
|
+
* it would load script from that same domain instead of loading from cdn
|
|
74
|
+
*/
|
|
75
|
+
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=N(window.location.href);var t="https://v1.5.2.js.zonos.com";
|
|
76
|
+
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
77
|
+
if(!n&&(t.includes("test.")||
|
|
78
|
+
// Vercel git domain
|
|
79
|
+
t.includes("test-"))){return t}
|
|
80
|
+
// when local demo app is running, it needs to use the local dev script unless the qaUrl is set
|
|
81
|
+
if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!n){return null}
|
|
82
|
+
// If the qaUrl, use the dev-elements domain to forward the request to the dev server to quickly debug the issue
|
|
83
|
+
if(n==="dev-elements"){return"https://dev.elements.zonos.com"}
|
|
84
|
+
// The worker alias selects the API host only. Scripts stay on the normal CDN.
|
|
85
|
+
if(n==="worker"){return null}var r="preview.js.zonos.com";var o="https://".concat(n,".").concat(r);f("[ZONOS-WARNING] using '".concat(o,"' for loading elements script"),"warn");
|
|
86
|
+
// request to the url and check if the request has an error
|
|
87
|
+
void fetch(o).then((function(){
|
|
88
|
+
// cleanup checkout session to avoid using the prod session in preview domain
|
|
89
|
+
d("session","zonos--checkout-session-id");d("session","zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(o,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));
|
|
90
|
+
// remove the zonosQaUrl param from url
|
|
91
|
+
var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=window.location.pathname;var t="".concat(n,"?").concat(e.toString());
|
|
92
|
+
/**
|
|
93
|
+
* Setting the state to null in window.history.replaceState can cause issues with rendering when using next/link and pressing the back button.
|
|
94
|
+
* @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
|
|
95
|
+
**/window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return o};
|
|
96
|
+
/* eslint-disable no-console */
|
|
97
|
+
/** Loading stripe script extracted from stripe.js repository */var R="2025-02-24.acacia";var Z="https://js.stripe.com/v3";var E=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var C=3;var U="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var L=function(){var e=document.querySelectorAll('script[src^="'.concat(Z,'"]'));for(var n=0;n<e.length;n++){var t=e[n];if(!t){continue}if(!E.test(t.src)){continue}return t}return null};var x=null;var P=function(e){var n="";var t=document.createElement("script");t.src="".concat(Z).concat(n);var r=document.head||document.body;if(!r){c("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(t);return t};var D=function(e){
|
|
98
|
+
// Ensure that we only attempt to load Stripe.js at most once
|
|
99
|
+
if(x!==null){return x}x=new Promise((function(n,t){if(typeof window==="undefined"||typeof document==="undefined"){
|
|
100
|
+
// Resolve to null when imported server side. This makes the module
|
|
101
|
+
// safe to import in an isomorphic code base.
|
|
102
|
+
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var r=L();if(r&&e){console.warn(U)}else if(!r){r=P()}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){t(e);return}}));return x};var F=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var M=function(e){if(!("version"in e)){return}var n=e.version;return typeof n==="number"||typeof n==="string"?n:undefined};var B=function(e,n,t){if(e===null){return null}var r=n[0],o=n[1];var i=Object.assign({},o);var u=M(e);var a=typeof u==="string"&&u!==C.toString();if(a){delete i.apiVersion}else{i.apiVersion=R}var s=e(r,i);F(s,t);return s};
|
|
103
|
+
// Execute our own script injection after a tick to give users time to do their
|
|
104
|
+
// own script injection.
|
|
105
|
+
var K=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var G=Promise.resolve().then((function(){
|
|
106
|
+
// Skip eagerly loading Stripe when no checkout cart callback is configured
|
|
107
|
+
// (e.g. a Hello-only integration). Stripe is loaded on demand instead.
|
|
108
|
+
if(!K()){return null}return D(null)}));var V=false;G.catch((function(e){if(!V){
|
|
109
|
+
// eslint-disable-next-line no-console
|
|
110
|
+
console.warn(e)}}));var q=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(h,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(i){switch(i.label){case 0:V=true;t=Date.now();return[4/*yield*/,G];case 1:if(!((n=i.sent())!==null&&n!==void 0))return[3/*break*/,2];o=n;return[3/*break*/,4];case 2:return[4/*yield*/,D(null)];case 3:o=i.sent();i.label=4;case 4:r=o;return[2/*return*/,B(r,e,t)]}}))}))};var H="tempCartUUID";
|
|
111
|
+
/**
|
|
112
|
+
* Simple function to get the cart id from the query param.
|
|
113
|
+
*/var W=function(){var e=new URLSearchParams(window.location.search);var n=e.get(H);return n};var Q=function(e){return __awaiter(h,[e],void 0,(function(e){var n,r,o,i,a,c,d,l,w;var m=e.cartId,p=e.retries;return __generator(this,(function(e){switch(e.label){case 0:n=u();r=t();o=v()||undefined;i=new URLSearchParams;if(r.overrideShouldEnabledCustomAddress){i.set("overrideShouldEnabledCustomAddress",r.overrideShouldEnabledCustomAddress)}return[4/*yield*/,s("/api/zonos-elements/get-cart?".concat(i.toString()),{body:{isTestMode:n,renewCartExpirationToken:o,tempCartUUID:m},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:a=e.sent(),c=a.errors,d=a.json,l=a.zonosMode;w=!d||c.length;if(!(w&&p))return[3/*break*/,3];f("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:p});
|
|
114
|
+
// wait 1 second before retrying
|
|
115
|
+
return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
116
|
+
// wait 1 second before retrying
|
|
117
|
+
e.sent();return[2/*return*/,Q({cartId:m,retries:p-1})];case 3:if(w){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},d),{zonosMode:l})]}}))}))};var Y=function(e){return __awaiter(h,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(i){switch(i.label){case 0:n=w(e),t=n.isDgsCartId,r=n.isLegacyCartId;if(!r&&!t){c("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,Q({cartId:e,retries:5})];case 1:o=i.sent();f("[ZONOS - loadZonos] getting temp cart data","info",o);if(!o){c("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=o.cartData.storeId;window.Zonos.zonosApiKey=o.cartData.credentialToken;window.Zonos.zonosMode=o.zonosMode;return[2/*return*/,{cartData:o.cartData,settings:o.settings,storeFavicon:o.storeFaviconUrl,storeId:o.cartData.storeId,storeLogo:o.storeLogoUrl,zonosApiKey:o.cartData.credentialToken}]}}))}))};var J;
|
|
118
|
+
/**
|
|
119
|
+
* Get the load version and url based on the loadScriptSrc, if the domain that used to load `zonos.js` is in white listed domains, use currentLoadScriptUrl as the load url instead, if zonosQaUrl exists, it would also fall under the white listed domain
|
|
120
|
+
*/var $=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=j({loadScriptSrc:e===null||e===void 0?void 0:e.src}),t=n.currentLoadScriptUrl,r=n.isWhiteListed;if(r){return t}return null}();var X=Date.now();var ee="https://v1.5.2.js.zonos.com";var ne=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.5.2";var te="https://unpkg.com/@zonos/elements@1.5.2";var re="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.5.2";var oe="https://fonts.googleapis.com";var ie=/^https:\/\/fonts\.googleapis\.com/;var ue=/** @class */function(){function e(){}return e}();e("Zonos",ue);J=ue;ue.doneInit=false;ue.cartSettings=null;
|
|
121
|
+
// if query 'zonosDebug=1' param from url, debug mode is on
|
|
122
|
+
ue.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);ue.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);ue._paypalMockResponse=null;ue.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;ue.isBigCommerce=false;ue.releaseDate="1793899893283";ue.isLegacyCheckout=false;ue.googleAnalyticId=null;ue.googleAnalyticReady=false;ue.facebookPixelId=null;ue.facebookPixelReady=false;ue.startLoadTime=X;ue.domain=typeof window!=="undefined"?// domain that embeds the iframe
|
|
123
|
+
window.location!=window.parent.location&&document.referrer||
|
|
124
|
+
// current domain
|
|
125
|
+
document.location.hostname:"";ue.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");ue.overrideUseCustomAddressForm=false;ue.isCollect=false;ue.isInvoice=false;
|
|
126
|
+
/**
|
|
127
|
+
* By default, the package will load from npm
|
|
128
|
+
*/ue.isNpm=true;ue.zonosQaUrl=null;ue.zonosQaUrlApi=null;ue.trackEventLogs=[];ue.version="v".concat("1.5.2");ue.modeAlerted=false;ue.cartData=null;ue.paypal=null;ue.zonosMode=null;ue.IframeService=r;ue.getCurrentTimestamp=function(){return(new Date).getTime()};ue.zonosController=null;ue.loadTimeApiInfoList=[];ue.logIntervalId=null;ue.init=function(e){return __awaiter(h,void 0,void 0,(function(){var n,t,r,o,i,u,a,s,d,v,w,p,h,y,O;return __generator(this,(function(g){switch(g.label){case 0:S();n=e.appearance,t=e.checkoutSettings,r=e.currencyConverter,o=e.helloSettings,i=e.onCountryChange,u=e.overrideCurrencyFormat,a=e.storeId,s=e.zonosApiKey;J.cartId=W();
|
|
129
|
+
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
130
|
+
// gated on whether at least one of them is configured.
|
|
131
|
+
J.createCartId=t===null||t===void 0?void 0:t.createCartId;
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
|
|
133
|
+
J.buildCartDetail=t===null||t===void 0?void 0:t.buildCartDetail;if(J.doneInit){
|
|
134
|
+
// do nothing if zonos is already initialized
|
|
135
|
+
return[2/*return*/]}f("====== ZONOS DEBUG MODE: on (".concat(J.version,") ======"));J.zonosApiKey=s;J.storeId=a;
|
|
136
|
+
// When not in iframe, providers are ready (gtag/fbq work directly). When in iframe, relay sets these after parent configures.
|
|
137
|
+
if(typeof window!=="undefined"&&window.parent===window){J.googleAnalyticReady=true;J.facebookPixelReady=true}if(!J.isNpm)return[3/*break*/,4];f("====== ZONOS LOADING FROM NPM ======");d=A();
|
|
138
|
+
// if zonosQaUrl is available, inject the script from the zonosQaUrl and then call init again
|
|
139
|
+
if(d&&!window.isZonosPreview){f('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(d," ======"),"info");v=document.createElement("script");v.src="".concat(d,"/dist/scripts/zonos.js");document.head.appendChild(v);v.addEventListener("load",(function(){window.Zonos.isNpm=J.isNpm;window.Zonos.isBigCommerce=J.isBigCommerce;window.Zonos.isLegacyCheckout=J.isLegacyCheckout;window.Zonos.zonosMode=J.zonosMode;
|
|
140
|
+
// call init again after the script is loaded
|
|
141
|
+
_((function(){return window.Zonos.init(e)}))}));v.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(d))}));
|
|
142
|
+
// Set so won't inject the preview script again
|
|
143
|
+
window.isZonosPreview=true;return[2/*return*/]}
|
|
144
|
+
// zonosApiKey is required if tempCartUUID in query params are not provided
|
|
145
|
+
if(!s&&!J.cartId){c("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2/*return*/]}if(!(!J.cartData&&J.cartId))return[3/*break*/,2];f("Initialize cart data");return[4/*yield*/,Y(J.cartId)];case 1:w=g.sent();if(!w){c("Failed to get cart data");return[2/*return*/]}J.cartData=w.cartData;J.zonosApiKey=w.zonosApiKey;J.cartSettings=w.settings;g.label=2;case 2:return[4/*yield*/,T()];case 3:p=g.sent();if(p){J.zonosApiKey=p}g.label=4;case 4:h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||l("session","zonos--client-secret");y=J.cartId&&J.cartData||!!h;
|
|
146
|
+
// inject hidden button to body to trigger checkout right away if we have cartData or stripe client secret
|
|
147
|
+
if(y){f("Cart data or stripe client secret is available, inject hidden button and trigger checkout");O=document.createElement("button");O.style.display="none";O.id="".concat(m);document.body.appendChild(O)}f("init zonos");J.restoreNativeBrowserFunctions();
|
|
148
|
+
// inject custom script for hosted checkout if can find it in metadata
|
|
149
|
+
J.injectCustomScriptForHostedCheckout();
|
|
150
|
+
// inject zonos cdn
|
|
151
|
+
J.injectZonosCdn();
|
|
152
|
+
// inject css for zonos elements
|
|
153
|
+
J.injectZonosCss();
|
|
154
|
+
// inject fonts for zonos elements
|
|
155
|
+
J.injectFonts();
|
|
156
|
+
// inject checkout international button
|
|
157
|
+
J.injectCheckoutInternationalButton();
|
|
158
|
+
// init zonos controller
|
|
159
|
+
J.injectController({config:{appearance:n,checkoutSettings:t,currencyConverter:r,helloSettings:o,onCountryChange:i,overrideCurrencyFormat:u}});J.doneInit=true;return[2/*return*/]}}))}))};
|
|
160
|
+
/**
|
|
161
|
+
* Inject the hidden international checkout button to trigger checkout regardless of shipping zones
|
|
162
|
+
*/ue.injectCheckoutInternationalButton=function(){if(!document.querySelector("#".concat(p))){
|
|
163
|
+
// inject the hidden international checkout button
|
|
164
|
+
var e=document.createElement("button");e.id=p;e.style.display="none";document.body.appendChild(e)}};ue.injectCustomScriptForHostedCheckout=function(){var e=J.cartData;var n=(e===null||e===void 0?void 0:e.metadata)||[];var t=n.find((function(e){return e.key==="customHeaderScript"}));var r=n.find((function(e){return e.key==="customFooterScript"}));
|
|
165
|
+
// googleAnalyticId / facebookPixelId are set by customHTML in checkoutSettings (e.g. <script>window.Zonos.googleAnalyticId = "G-XXX"; window.Zonos.facebookPixelId = "1234567890";<\/script>), injected by zonos-controller
|
|
166
|
+
// Only inject the script if checkout is on Zonos hosted checkout and custom script is available
|
|
167
|
+
if(!window.Zonos.isLegacyCheckout||!t&&!r){f("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){f("Injecting custom header script");var o=document.createElement("script");o.textContent=t.value;document.head.appendChild(o)}if(r){f("Injecting custom footer script");var o=document.createElement("script");o.textContent=r.value;document.body.appendChild(o)}};ue.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};ue.triggerCheckoutInternational=function(){return __awaiter(h,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.querySelector("#".concat(p));setTimeout((function(){if(e){e.dispatchEvent(n("click"))}}),10);return[2/*return*/]}))}))};
|
|
168
|
+
// Called openHelloDialog because the main use case is to simply open the dialog
|
|
169
|
+
ue.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};ue.showNotification=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.showNotification(e))};ue.updateOrganizationName=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};ue.disablePlaceOrderButtons=function(e){var n=e.autoEnable,t=n===void 0?true:n,r=e.config,o=e.disable,i=e.placeOrderButtonSelector;var u;
|
|
170
|
+
// if disablePlaceOrderButtonActivation is true, do nothing
|
|
171
|
+
if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}
|
|
172
|
+
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
173
|
+
if(i){var a=document.querySelectorAll(i);var s=function(e){var n=e.target;
|
|
174
|
+
// prevent default and propagation when the item has disabled attribute
|
|
175
|
+
if(n.getAttribute("disabled")){e.preventDefault();e.stopPropagation()}};a.forEach((function(e){var n=e.getAttribute("data-zonos-checkout-attached");if(n){
|
|
176
|
+
// do nothing if event is already attached
|
|
177
|
+
return}if(o){e.setAttribute("disabled","true");
|
|
178
|
+
// prevent the selector to perform default action when it's disabled
|
|
179
|
+
e.addEventListener("click",s)}else{e.removeAttribute("disabled");
|
|
180
|
+
// clean up the event listener
|
|
181
|
+
e.removeEventListener("click",s)}}));
|
|
182
|
+
// only auto enable if autoEnable is true and we are setting button disable
|
|
183
|
+
if(t&&o){setTimeout((function(){
|
|
184
|
+
// release it if zonos is not initialized after 5 seconds (this is to prevent the place order button from being disabled forever due to api)
|
|
185
|
+
a.forEach((function(e){e.removeAttribute("disabled");
|
|
186
|
+
// clean up the event listener if exists
|
|
187
|
+
e.removeEventListener("click",s)}))}),5e3)}}};
|
|
188
|
+
/**
|
|
189
|
+
* Zonos elements and its dependencies are using the native browser functions.
|
|
190
|
+
* This function will restore the native browser functions that are overridden by the merchant's polyfills.
|
|
191
|
+
* If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions. This allows testing checkout compatibility with merchant polyfills.
|
|
192
|
+
*/ue.restoreNativeBrowserFunctions=function(){var e;
|
|
193
|
+
// If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions.
|
|
194
|
+
var n=new URL(window.location.href).searchParams.get("useMerchantPolyfill")==="1";if(n){return}var t="zonos---native-browser";var r=document.querySelector("iframe#".concat(t));if(!r){
|
|
195
|
+
// add a hidden iframe
|
|
196
|
+
r=document.createElement("iframe");r.id=t;r.style.display="none";r.style.opacity="0";r.style.position="absolute";r.style.top="-9999px";r.style.left="-9999px";r.style.width="1px";r.style.height="1px";r.style.border="none";r.style.overflow="hidden";r.style.visibility="hidden";document.body.appendChild(r)}
|
|
197
|
+
/**
|
|
198
|
+
* Override Array.from if the site is using the obsolete prototype.js (last updated 2015).
|
|
199
|
+
* If old browser is being used and Array.from is not available, just use Array from the prototype.js polyfill
|
|
200
|
+
*/var o=((e=r.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=o;document.body.removeChild(r)};ue.injectController=function(e){var n=e.config;var t,r;if(document.querySelector("zonos-controller")){return}
|
|
201
|
+
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
202
|
+
if((t=n.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var o=n.checkoutSettings.placeOrderButtonSelector;J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:o});
|
|
203
|
+
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
204
|
+
var i=new MutationObserver((function(){J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:o})}));i.observe(document.body,{childList:true,subtree:true})}
|
|
205
|
+
// if alwaysTriggerInternationalCheckoutSelector is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
206
|
+
if((r=n.checkoutSettings)===null||r===void 0?void 0:r.alwaysTriggerInternationalCheckoutSelector){var u=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:u});
|
|
207
|
+
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
208
|
+
var i=new MutationObserver((function(){J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:u})}));i.observe(document.body,{childList:true,subtree:true})}var a=document.createElement("zonos-controller");a.config=n;a.zonosApiKey=J.zonosApiKey||"";a.addEventListener("stripeInitEvent",(function(e){return __awaiter(h,void 0,void 0,(function(){var n,t;return __generator(this,(function(r){switch(r.label){case 0:n=e.detail;f("loading Stripe");return[4/*yield*/,q(n.publishableKey)];case 1:t=r.sent();if(!t){c("API seems to be invalid or missing. Failed to load Stripe");return[2/*return*/]}window.Zonos.stripe=t;if(window.Zonos.isCollect){void a.initCollectElement(t)}else if(window.Zonos.isInvoice){void a.initInvoiceElement(t)}else{void a.initCheckoutElement(t)}return[2/*return*/]}}))}))}));document.body.appendChild(a);
|
|
209
|
+
// set zonos controller to be global
|
|
210
|
+
J.zonosController=a;f("Zonos controller injected!")};ue.injectScript=function(e){var n=e.cdnType,t=e.isModule,r=e.theRestUrl;var o=J.getZonosUrl(n);var i="".concat(o,"/").concat(r);var u=function(){var e=document.querySelector('script[src="'.concat(i,'"]'));return!!e};if(u()){f('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var a=document.head||document.body;
|
|
211
|
+
// init zonos elements when the zonosKey is valid
|
|
212
|
+
// inject esmodule cdn for zonos elements
|
|
213
|
+
var s=document.createElement("script");if(!!t){s.type="module"}else{s.noModule=true}s.src=i;s.crossOrigin="anonymous";s.onerror=function(){c("Failed to load ".concat(s.src));var e=I(n);
|
|
214
|
+
// if next fallback cdn type exists, inject the script with the next fallback cdn type
|
|
215
|
+
if(!e){return}J.injectScript({cdnType:e,isModule:t,theRestUrl:r})};a.appendChild(s)};
|
|
216
|
+
/**
|
|
217
|
+
* We now support loading Zonos via npm. For clients using npm, `zonosBase` will always load from the server side. Therefore, the `zonosLoadUrl` defined earlier won't work since it lacks access to client-side APIs such as `window` and `document`.
|
|
218
|
+
*/ue.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return ne;case"unpkg":return te;case"cdnjs":return re;case"vercel":return ee}};
|
|
219
|
+
// To ensure that sites using zonos-elements load the script from a specific domain when using npm, we need to check for zonosQaUrl and use it if available. Otherwise it will always load from the compiled versioned domain
|
|
220
|
+
if(J.isNpm){var t=A();
|
|
221
|
+
// Default to hard coded domain if zonosQaUrl is not available
|
|
222
|
+
return t||n()}return n()};ue.injectZonosCdn=function(){
|
|
223
|
+
// init zonos elements when the zonosKey is valid
|
|
224
|
+
// inject esmodule cdn for zonos elements
|
|
225
|
+
J.injectScript({cdnType:k,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});
|
|
226
|
+
// inject non module cdn for zonos elements
|
|
227
|
+
J.injectScript({cdnType:k,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});f("Zonos cdn script injected!")};ue.injectStylesheet=function(e){var n=e.cdnType,t=e.theRestUrl;var r=J.getZonosUrl(n);var o=document.head||document.body;
|
|
228
|
+
// inject preconnect css for zonos elements
|
|
229
|
+
var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ee,"/");o.appendChild(i);
|
|
230
|
+
// inject css for zonos elements
|
|
231
|
+
var u=document.createElement("link");u.rel="stylesheet";u.href="".concat(r,"/").concat(t);u.onerror=function(){c("Failed to load ".concat(u.href));var e=I(n);
|
|
232
|
+
// if the css failed to load, try to load the next fallback cdn if exists
|
|
233
|
+
if(!e){return}J.injectStylesheet({cdnType:e,theRestUrl:t})};o.appendChild(u)};ue.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){f("Zonos style links already injected","warn");return}
|
|
234
|
+
// inject css for zonos elements
|
|
235
|
+
J.injectStylesheet({cdnType:k,theRestUrl:"dist/zonos-elements/zonos-elements.css"});f("Zonos style css injected!")};ue.injectFonts=function(){var e=function(){var e=document.fonts.check("1em Inter");if(e){f("Inter font already loaded","warn");return}var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(oe,'"]'));for(var t=0;t<n.length;t++){var r=n[t];if(!r){continue}if(ie.test(r.href)){continue}return r}return null};if(e()){f("Inter font already injected","warn");return}var n=document.head||document.body;
|
|
236
|
+
// inject font css for zonos elements
|
|
237
|
+
var t=document.createElement("link");t.rel="preconnect";t.href=oe;n.appendChild(t);
|
|
238
|
+
// inject font css for zonos elements
|
|
239
|
+
var r=document.createElement("link");r.rel="stylesheet";r.href="".concat(oe,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");n.appendChild(r);f("Zonos font injected!")};
|
|
240
|
+
// apply font for zonos elements and inject font if needed
|
|
241
|
+
ue.setupGoogleFont=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};
|
|
242
|
+
// this function is to inject google font to the browser, not apply the font for zonos elements, to apply the font and inject font if needed, use `setupGoogleFont` instead
|
|
243
|
+
ue.injectSupportGoogleFont=function(e){var n;f("[FONT] injecting ".concat(e));var t=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var r=document.head||document.body;
|
|
244
|
+
// inject font css for zonos elements
|
|
245
|
+
if(!document.querySelector('link[rel="preconnect"][href^="'.concat(oe,'"]'))){var o=document.createElement("link");o.rel="preconnect";o.href=oe;r.appendChild(o)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){f("[FONT] ".concat(t," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=e;r.appendChild(i);f("[FONT] ".concat(t," font injected!"))};var ae=e("checkoutSessionMutableAttributeKeys",["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"]);var se=e("checkoutSessionImmutableAttributeKeys",["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"]);var ce=e("checkoutSessionAttributeKeys",__spreadArray(__spreadArray([],ae,true),se,true))}}}));
|