@zonos/elements 1.3.136 → 1.3.138
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-0f32f556.js → cart-efd80d55.js} +81 -3
- package/dist/cjs/index.cjs.js +13 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-fd50c7d5.js → paypal-50e03778.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +25 -10
- package/dist/cjs/zonos-checkout.cjs.entry.js +76 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +19 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +76 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +4 -2
- package/dist/collection/components/store/checkout/cart.js +1 -0
- package/dist/collection/components/store/checkout/stripe.js +20 -3
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
- package/dist/collection/components/store/translationStore/strings.base.js +3 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
- package/dist/collection/components/store/translationStore/strings.french.js +3 -0
- package/dist/collection/components/store/translationStore/strings.german.js +3 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
- package/dist/collection/scripts/_zonosBase.js +6 -3
- package/dist/collection/types/generated/graphql.frontend.types.js +2 -3
- package/dist/collection/types/generated/graphql.internal.types.js +1 -0
- package/dist/esm/{cart-3e0e4d5c.js → cart-f0bf7202.js} +82 -4
- package/dist/esm/index.js +13 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-b4af6cc0.js → paypal-65d40ba3.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_13.entry.js +25 -10
- package/dist/esm/zonos-checkout.entry.js +77 -10
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/cart-f0bf7202.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-b4af6cc0.js → paypal-65d40ba3.js} +1 -1
- package/dist/esm-es5/zonos-address_7.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-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-elements.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/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +15 -3
- 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-checkout-finish/zonos-checkout-finish.d.ts +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +5 -0
- package/dist/types/components/store/checkout/cart.d.ts +1 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/calculateLandedCost.d.ts +2 -2
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -2
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +2 -2
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +3 -7
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +21 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +3 -23
- package/dist/types/types/generated/graphql.frontend.types.ts +3 -36
- package/dist/types/types/generated/graphql.internal.types.d.ts +1 -0
- package/dist/types/types/generated/graphql.internal.types.ts +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-09636917.js +1 -0
- package/dist/zonos-elements/p-128b1b70.system.entry.js +1 -0
- package/dist/zonos-elements/{p-05826697.system.entry.js → p-1af0a800.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f2ea446.entry.js → p-37a127fc.entry.js} +1 -1
- package/dist/zonos-elements/p-4628832d.system.js +1 -0
- package/dist/zonos-elements/{p-c52a8369.system.entry.js → p-47efac28.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9db73d9.entry.js → p-4ab4ba81.entry.js} +1 -1
- package/dist/zonos-elements/{p-4b680c1e.system.entry.js → p-52a5bd4c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-58983c97.entry.js +1 -0
- package/dist/zonos-elements/{p-3a5fb01a.system.entry.js → p-59d0f69b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-18cb1aee.system.js → p-6e24b0cf.system.js} +1 -1
- package/dist/zonos-elements/{p-887b05eb.system.entry.js → p-7b34be6e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e1ac8cd8.js → p-845ad2b8.js} +1 -1
- package/dist/zonos-elements/{p-b6fea87a.entry.js → p-8880d648.entry.js} +1 -1
- package/dist/zonos-elements/p-8e25910c.entry.js +1 -0
- package/dist/zonos-elements/{p-37991f24.entry.js → p-b088f65a.entry.js} +1 -1
- package/dist/zonos-elements/p-b6005449.system.entry.js +1 -0
- package/dist/zonos-elements/{p-49cecdf9.system.entry.js → p-ba26fc96.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b8db2d3.entry.js → p-bad5200e.entry.js} +1 -1
- package/dist/zonos-elements/{p-16e5df29.system.entry.js → p-c48e735d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-897c809a.entry.js → p-c5bff157.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-85fbb5f0.entry.js → p-c9c4e557.entry.js} +1 -1
- package/dist/zonos-elements/{p-a28f3298.system.entry.js → p-d2a77699.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e309e4a3.system.js +1 -0
- package/dist/zonos-elements/{p-bec4d2c7.entry.js → p-f0ce4d90.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-3e0e4d5c.js +0 -1
- package/dist/zonos-elements/p-69045ca3.js +0 -1
- package/dist/zonos-elements/p-af3ecd9d.system.entry.js +0 -1
- package/dist/zonos-elements/p-b776e39e.system.js +0 -1
- package/dist/zonos-elements/p-c8927b27.system.entry.js +0 -1
- package/dist/zonos-elements/p-caddd067.entry.js +0 -1
- package/dist/zonos-elements/p-e9862f66.entry.js +0 -1
- package/dist/zonos-elements/p-fa790aaf.system.js +0 -1
package/dist/esm-es5/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,e,o,r){function t(n){return n instanceof o?n:new o((function(e){e(n)}))}return new(o||(o=Promise))((function(o,i){function a(n){try{u(r.next(n))}catch(n){i(n)}}function s(n){try{u(r["throw"](n))}catch(n){i(n)}}function u(n){n.done?o(n.value):t(n.value).then(a,s)}u((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,t,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(n){return function(e){return u([n,e])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,t&&(i=s[0]&2?t["return"]:s[0]?t["throw"]||((i=t["return"])&&i.call(t),0):t.next)&&!(i=i.call(t,s[1])).done)return i;if(t=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;t=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=e.call(n,o)}catch(n){s=[6,n];t=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{l as log,h as handleFetch,a as logError}from"./handleFetch-22cb914b.js";import{s as setupCartData,c as checkoutHiddenBtnSelector}from"./CheckoutConfig-930107d4.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./CheckoutConfig-930107d4.js";var checkIfLoadVersionDomain=function(n){var e=n.loadScriptSrc;if(!e){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var r=["qa.js.zonos.com"];var t=new URL(e).origin;var i=o.some((function(n){return t.includes(n)}));var a=r.some((function(n){return t.includes(n)}));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:a,isWhiteListed:i}};var fallbackList=["jsdelivr","cdnjs","unpkg","vercel"];var MAIN_LOAD_CDN_TYPE="jsdelivr";var getNextFallbackUrl=function(n){var e=fallbackList.indexOf(n);var o=fallbackList[e+1];return o||null};var getWithTestPublicCredential=function(){return __awaiter(void 0,void 0,void 0,(function(){var n,e,o,r,t;return __generator(this,(function(i){switch(i.label){case 0:n=window.location.search.includes("zonosTestMode=1");if(!n||!window.Zonos.zonosApiKey){return[2,null]}log("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){log("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,handleFetch("/api/get-test-public-credential")];case 1:e=i.sent(),o=e.errors,r=e.json;if(o.length||!r){logError("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o);return[2,null]}t=r.publicCredential;if(!t){logError("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}log("[ZONOS - loadZonos] Retrieve new test public token ".concat(t),"info");return[2,t]}}))}))};var extractZonosQaUrl=function(n){if(!n){return null}var e=new URL(n).searchParams;var o=e.get("zonosQaUrl");if(!o){return null}var r=/[^a-zA-Z0-9-_]+/.test(o);if(!!r){return null}return o};var getZonosQaUrl=function(){var n=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||n){return null}var e=extractZonosQaUrl(window.location.href);var o="https://v1.3.136.js.zonos.com";if(!e&&(o.includes("test.")||o.includes("test-"))){return o}if(!e&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!e){return null}if(e==="dev-elements"){return"https://dev.elements.zonos.com"}var r="preview.js.zonos.com";var t="https://".concat(e,".").concat(r);log("[ZONOS-WARNING] using '".concat(t,"' for loading elements script"),"warn");void fetch(t).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(t,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var n=new URLSearchParams(window.location.search);n.delete("zonosQaUrl");var e=window.location.pathname;var o="".concat(e,"?").concat(n.toString());window.history.replaceState(window.history.state,"",o);window.location.reload();return null}));return t};var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var n=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var e=0;e<n.length;e++){var o=n[e];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(n){var e=n&&!n.advancedFraudSignals?"?advancedFraudSignals=false":"";var o=document.createElement("script");o.src="".concat(V3_URL).concat(e);var r=document.head||document.body;if(!r){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(o);return o};var zonosStripeLoadScript=function(n){if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(e,o){if(typeof window==="undefined"||typeof document==="undefined"){e(null);return}if(window.Stripe&&n){console.warn(EXISTING_SCRIPT_MESSAGE)}if(window.Stripe){e(window.Stripe);return}try{var r=zonosStripeFindScript();if(r&&n){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!r){r=injectScript(n)}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){e(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(n){o(n);return}}));return stripePromise$1};var registerWrapper=function(n,e){if(!n||!n._registerWrapper){return}n._registerWrapper({name:"stripe-js",startTime:e})};var initStripe=function(n,e,o){if(n===null){return null}var r=n.apply(undefined,e);registerWrapper(r,o);return r};var stripePromise=Promise.resolve().then((function(){return zonosStripeLoadScript(null)}));var loadCalled=false;stripePromise.catch((function(n){if(!loadCalled){console.warn(n)}}));var zonosLoadStripe=function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(o){loadCalled=true;e=Date.now();return[2,stripePromise.then((function(o){return initStripe(o,n,e)}))]}))}))};var TEMP_CART_ID_QUERY_PARAM="tempCartUUID";var getCartIdFromQueryParam=function(){var n=new URLSearchParams(window.location.search);var e=n.get(TEMP_CART_ID_QUERY_PARAM);return e};var _a;var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var n=document.querySelector('script[src*="/zonos.js"]');var e=checkIfLoadVersionDomain({loadScriptSrc:n===null||n===void 0?void 0:n.src}),o=e.currentLoadScriptUrl,r=e.isWhiteListed;if(r){return o}return null}();var ZONOS_URL="https://v1.3.136.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.136";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.136";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.136";var INTER_FONT_URL="https://rsms.me";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var INTER_FONT_REGEX=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;var Zonos=function(){function n(){}return n}();_a=Zonos;Zonos.doneInit=false;Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.isBigCommerce=false;Zonos.releaseDate="1733241504089";Zonos.isLegacyCheckout=false;Zonos.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.version="v".concat("1.3.136");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.init=function(n){return __awaiter(void 0,void 0,void 0,(function(){var e,o,r,t,i,a,s,u,c,l,d,f,v;return __generator(this,(function(m){switch(m.label){case 0:e=n.appearance,o=n.checkoutSettings,r=n.currencyConverter,t=n.helloSettings,i=n.onCountryChange,a=n.overrideCurrencyFormat,s=n.storeId,u=n.zonosApiKey;_a.cartId=getCartIdFromQueryParam();if(_a.doneInit){return[2]}log("====== ZONOS DEBUG MODE: on (".concat(_a.version,") ======"));_a.zonosApiKey=u;_a.storeId=s;if(!_a.isNpm)return[3,4];log("====== ZONOS LOADING FROM NPM ======");c=getZonosQaUrl();if(c&&!window.isZonosPreview){log('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(c," ======"),"info");l=document.createElement("script");l.src="".concat(c,"/dist/scripts/zonos.js");document.head.appendChild(l);l.addEventListener("load",(function(){window.Zonos.isNpm=_a.isNpm;window.Zonos.isBigCommerce=_a.isBigCommerce;window.Zonos.isLegacyCheckout=_a.isLegacyCheckout;void window.Zonos.init(n)}));l.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(c))}));window.isZonosPreview=true;return[2]}if(!u&&!_a.cartId){logError("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!_a.cartData&&_a.cartId))return[3,2];log("Initialize cart data");return[4,setupCartData(_a.cartId)];case 1:d=m.sent();if(!d){logError("Failed to get cart data");return[2]}_a.cartData=d.cartData;_a.zonosApiKey=d.zonosApiKey;m.label=2;case 2:return[4,getWithTestPublicCredential()];case 3:f=m.sent();if(f){_a.zonosApiKey=f}m.label=4;case 4:if(_a.cartId&&_a.cartData){log("Cart data is available, inject hidden button and trigger checkout");v=document.createElement("button");v.style.display="none";v.id="".concat(checkoutHiddenBtnSelector);document.body.appendChild(v)}log("init zonos");_a.injectZonosCdn();_a.injectZonosCss();_a.injectFonts();_a.injectController({config:{appearance:e,checkoutSettings:o,currencyConverter:r,helloSettings:t,onCountryChange:i,overrideCurrencyFormat:a}});_a.doneInit=true;return[2]}}))}))};Zonos.displayCurrency=function(){var n=document.querySelector("zonos-hello");if(n){void n.displayCurrency()}};Zonos.openHelloDialog=function(n){var e=document.querySelector("zonos-hello");if(e){void e.openHelloDialog(n!==null&&n!==void 0?n:true)}};Zonos.showNotification=function(n){var e;void((e=_a.zonosController)===null||e===void 0?void 0:e.showNotification(n))};Zonos.updateOrganizationName=function(n){var e;void((e=_a.zonosController)===null||e===void 0?void 0:e.updateOrganizationName(n))};Zonos.disablePlaceOrderButtons=function(n){var e=n.autoEnable,o=e===void 0?true:e,r=n.config,t=n.disable,i=n.placeOrderButtonSelector;var a;if((a=r.checkoutSettings)===null||a===void 0?void 0:a.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var u=function(n){var e=n.target;if(e.getAttribute("disabled")){n.preventDefault();n.stopPropagation()}};s.forEach((function(n){var e=n.getAttribute("data-zonos-checkout-attached");if(e){return}if(t){n.setAttribute("disabled","true");n.addEventListener("click",u)}else{n.removeAttribute("disabled");n.removeEventListener("click",u)}}));if(o&&t){setTimeout((function(){s.forEach((function(n){n.removeAttribute("disabled");n.removeEventListener("click",u)}))}),5e3)}}};Zonos.injectController=function(n){var e=n.config;var o;if(document.querySelector("zonos-controller")){return}if((o=e.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var r=e.checkoutSettings.placeOrderButtonSelector;_a.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:r});var t=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:r})}));t.observe(document.body,{childList:true,subtree:true})}var i=document.createElement("zonos-controller");i.config=e;i.zonosApiKey=_a.zonosApiKey||"";i.addEventListener("stripeInitEvent",(function(n){return __awaiter(void 0,void 0,void 0,(function(){var e,o;return __generator(this,(function(r){switch(r.label){case 0:e=n.detail;log("loading Stripe");return[4,zonosLoadStripe(e.publishableKey)];case 1:o=r.sent();if(!o){logError("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;void i.initCheckoutElement(o);return[2]}}))}))}));document.body.appendChild(i);_a.zonosController=i;log("Zonos controller injected!")};Zonos.injectScript=function(n){var e=n.cdnType,o=n.isModule,r=n.theRestUrl;var t=_a.getZonosUrl(e);var i="".concat(t,"/").concat(r);var a=function(){var n=document.querySelector('script[src="'.concat(i,'"]'));return!!n};if(a()){log('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var s=document.head||document.body;var u=document.createElement("script");if(!!o){u.type="module"}else{u.noModule=true}u.src=i;u.crossOrigin="anonymous";u.onerror=function(){logError("Failed to load ".concat(u.src));var n=getNextFallbackUrl(e);if(!n){return}_a.injectScript({cdnType:n,isModule:o,theRestUrl:r})};s.appendChild(u)};Zonos.getZonosUrl=function(n){var e=function(){switch(n){case"jsdelivr":return JS_DELIVR_ZONOS_URL;case"unpkg":return UNPKG_ZONOS_URL;case"cdnjs":return CDNJS_ZONOS_URL;case"vercel":return ZONOS_URL}};if(_a.isNpm){var o=getZonosQaUrl();return o||e()}return e()};Zonos.injectZonosCdn=function(){_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});log("Zonos cdn script injected!")};Zonos.injectStylesheet=function(n){var e=n.cdnType,o=n.theRestUrl;var r=_a.getZonosUrl(e);var t=document.head||document.body;var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ZONOS_URL,"/");t.appendChild(i);var a=document.createElement("link");a.rel="stylesheet";a.href="".concat(r,"/").concat(o);a.onerror=function(){logError("Failed to load ".concat(a.href));var n=getNextFallbackUrl(e);if(!n){return}_a.injectStylesheet({cdnType:n,theRestUrl:o})};t.appendChild(a)};Zonos.injectZonosCss=function(){var n=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(n()){log("Zonos style links already injected","warn");return}_a.injectStylesheet({cdnType:MAIN_LOAD_CDN_TYPE,theRestUrl:"dist/zonos-elements/zonos-elements.css"});log("Zonos style css injected!")};Zonos.injectFonts=function(){var n=function(){var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(INTER_FONT_URL,'"]'));for(var e=0;e<n.length;e++){var o=n[e];if(!o){continue}if(INTER_FONT_REGEX.test(o.href)){continue}return o}return null};if(n()){log("Inter font already injected","warn");return}var e=document.head||document.body;var o=document.createElement("link");o.rel="preconnect";o.href=INTER_FONT_URL;e.appendChild(o);var r=document.createElement("link");r.rel="stylesheet";r.href="".concat(INTER_FONT_URL,"/inter/inter.css");e.appendChild(r);log("Zonos font injected!")};Zonos.setupGoogleFont=function(n){var e;void((e=_a.zonosController)===null||e===void 0?void 0:e.setupGoogleFont(n))};Zonos.injectSupportGoogleFont=function(n){var e;log("[FONT] injecting ".concat(n));var o=(e=n.match(/family=(.*?):/))===null||e===void 0?void 0:e[1];var r=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(GOOGLE_FONT_URL,'"]'))){var t=document.createElement("link");t.rel="preconnect";t.href=GOOGLE_FONT_URL;r.appendChild(t)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(n,'"]'))){log("[FONT] ".concat(o," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=n;r.appendChild(i);log("[FONT] ".concat(o," font injected!"))};export{Zonos};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,o,t){function r(e){return e instanceof o?e:new o((function(n){n(e)}))}return new(o||(o=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t["throw"](e))}catch(e){i(e)}}function u(e){e.done?o(e.value):r(e.value).then(a,s)}u((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,r,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 u([e,n])}}function u(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(t=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e];r=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{l as log,h as handleFetch,a as logError}from"./handleFetch-22cb914b.js";import{s as setupCartData,c as checkoutHiddenBtnSelector}from"./CheckoutConfig-930107d4.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./CheckoutConfig-930107d4.js";var checkIfLoadVersionDomain=function(e){var n=e.loadScriptSrc;if(!n){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var t=["qa.js.zonos.com"];var r=new URL(n).origin;var i=o.some((function(e){return r.includes(e)}));var a=t.some((function(e){return r.includes(e)}));return{currentLoadScriptUrl:r,isForceLoadVersionDomain:a,isWhiteListed:i}};var fallbackList=["jsdelivr","cdnjs","unpkg","vercel"];var MAIN_LOAD_CDN_TYPE="jsdelivr";var getNextFallbackUrl=function(e){var n=fallbackList.indexOf(e);var o=fallbackList[n+1];return o||null};var getWithTestPublicCredential=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:e=window.location.search.includes("zonosTestMode=1");if(!e||!window.Zonos.zonosApiKey){return[2,null]}log("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){log("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,handleFetch("/api/get-test-public-credential")];case 1:n=i.sent(),o=n.errors,t=n.json;if(o.length||!t){logError("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o);return[2,null]}r=t.publicCredential;if(!r){logError("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}log("[ZONOS - loadZonos] Retrieve new test public token ".concat(r),"info");return[2,r]}}))}))};var extractZonosQaUrl=function(e){if(!e){return null}var n=new URL(e).searchParams;var o=n.get("zonosQaUrl");if(!o){return null}var t=/[^a-zA-Z0-9-_]+/.test(o);if(!!t){return null}return o};var getZonosQaUrl=function(){var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="https://v1.3.138.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-"))){return o}if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!n){return null}if(n==="dev-elements"){return"https://dev.elements.zonos.com"}var t="preview.js.zonos.com";var r="https://".concat(n,".").concat(t);log("[ZONOS-WARNING] using '".concat(r,"' for loading elements script"),"warn");void fetch(r).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(r,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=window.location.pathname;var o="".concat(n,"?").concat(e.toString());window.history.replaceState(window.history.state,"",o);window.location.reload();return null}));return r};var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"";var o=document.createElement("script");o.src="".concat(V3_URL).concat(n);var t=document.head||document.body;if(!t){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}t.appendChild(o);return o};var zonosStripeLoadScript=function(e){if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(n,o){if(typeof window==="undefined"||typeof document==="undefined"){n(null);return}if(window.Stripe&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript(e)}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.apply(undefined,n);registerWrapper(t,o);return t};var stripePromise=Promise.resolve().then((function(){return zonosStripeLoadScript(null)}));var loadCalled=false;stripePromise.catch((function(e){if(!loadCalled){console.warn(e)}}));var zonosLoadStripe=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(void 0,void 0,void 0,(function(){var n;return __generator(this,(function(o){loadCalled=true;n=Date.now();return[2,stripePromise.then((function(o){return initStripe(o,e,n)}))]}))}))};var TEMP_CART_ID_QUERY_PARAM="tempCartUUID";var getCartIdFromQueryParam=function(){var e=new URLSearchParams(window.location.search);var n=e.get(TEMP_CART_ID_QUERY_PARAM);return n};var _a;var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var ZONOS_URL="https://v1.3.138.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.138";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.138";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.138";var INTER_FONT_URL="https://rsms.me";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var INTER_FONT_REGEX=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;var Zonos=function(){function e(){}return e}();_a=Zonos;Zonos.doneInit=false;Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.isBigCommerce=false;Zonos.releaseDate="1733759888389";Zonos.isLegacyCheckout=false;Zonos.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.version="v".concat("1.3.138");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.init=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r,i,a,s,u,c,l,d,f,v,_,m;return __generator(this,(function(p){switch(p.label){case 0:n=e.appearance,o=e.checkoutSettings,t=e.currencyConverter,r=e.helloSettings,i=e.onCountryChange,a=e.overrideCurrencyFormat,s=e.storeId,u=e.zonosApiKey;_a.cartId=getCartIdFromQueryParam();if(_a.doneInit){return[2]}log("====== ZONOS DEBUG MODE: on (".concat(_a.version,") ======"));_a.zonosApiKey=u;_a.storeId=s;if(!_a.isNpm)return[3,4];log("====== ZONOS LOADING FROM NPM ======");c=getZonosQaUrl();if(c&&!window.isZonosPreview){log('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(c," ======"),"info");l=document.createElement("script");l.src="".concat(c,"/dist/scripts/zonos.js");document.head.appendChild(l);l.addEventListener("load",(function(){window.Zonos.isNpm=_a.isNpm;window.Zonos.isBigCommerce=_a.isBigCommerce;window.Zonos.isLegacyCheckout=_a.isLegacyCheckout;void window.Zonos.init(e)}));l.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(c))}));window.isZonosPreview=true;return[2]}if(!u&&!_a.cartId){logError("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!_a.cartData&&_a.cartId))return[3,2];log("Initialize cart data");return[4,setupCartData(_a.cartId)];case 1:d=p.sent();if(!d){logError("Failed to get cart data");return[2]}_a.cartData=d.cartData;_a.zonosApiKey=d.zonosApiKey;p.label=2;case 2:return[4,getWithTestPublicCredential()];case 3:f=p.sent();if(f){_a.zonosApiKey=f}p.label=4;case 4:v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");_=_a.cartId&&_a.cartData||!!v;if(_){log("Cart data or stripe client secret is available, inject hidden button and trigger checkout");m=document.createElement("button");m.style.display="none";m.id="".concat(checkoutHiddenBtnSelector);document.body.appendChild(m)}log("init zonos");_a.injectZonosCdn();_a.injectZonosCss();_a.injectFonts();_a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:r,onCountryChange:i,overrideCurrencyFormat:a}});_a.doneInit=true;return[2]}}))}))};Zonos.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};Zonos.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};Zonos.showNotification=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.showNotification(e))};Zonos.updateOrganizationName=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};Zonos.disablePlaceOrderButtons=function(e){var n=e.autoEnable,o=n===void 0?true:n,t=e.config,r=e.disable,i=e.placeOrderButtonSelector;var a;if((a=t.checkoutSettings)===null||a===void 0?void 0:a.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var u=function(e){var n=e.target;if(n.getAttribute("disabled")){e.preventDefault();e.stopPropagation()}};s.forEach((function(e){var n=e.getAttribute("data-zonos-checkout-attached");if(n){return}if(r){e.setAttribute("disabled","true");e.addEventListener("click",u)}else{e.removeAttribute("disabled");e.removeEventListener("click",u)}}));if(o&&r){setTimeout((function(){s.forEach((function(e){e.removeAttribute("disabled");e.removeEventListener("click",u)}))}),5e3)}}};Zonos.injectController=function(e){var n=e.config;var o;if(document.querySelector("zonos-controller")){return}if((o=n.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var t=n.checkoutSettings.placeOrderButtonSelector;_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:t});var r=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:t})}));r.observe(document.body,{childList:true,subtree:true})}var i=document.createElement("zonos-controller");i.config=n;i.zonosApiKey=_a.zonosApiKey||"";i.addEventListener("stripeInitEvent",(function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o;return __generator(this,(function(t){switch(t.label){case 0:n=e.detail;log("loading Stripe");return[4,zonosLoadStripe(n.publishableKey)];case 1:o=t.sent();if(!o){logError("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;void i.initCheckoutElement(o);return[2]}}))}))}));document.body.appendChild(i);_a.zonosController=i;log("Zonos controller injected!")};Zonos.injectScript=function(e){var n=e.cdnType,o=e.isModule,t=e.theRestUrl;var r=_a.getZonosUrl(n);var i="".concat(r,"/").concat(t);var a=function(){var e=document.querySelector('script[src="'.concat(i,'"]'));return!!e};if(a()){log('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var s=document.head||document.body;var u=document.createElement("script");if(!!o){u.type="module"}else{u.noModule=true}u.src=i;u.crossOrigin="anonymous";u.onerror=function(){logError("Failed to load ".concat(u.src));var e=getNextFallbackUrl(n);if(!e){return}_a.injectScript({cdnType:e,isModule:o,theRestUrl:t})};s.appendChild(u)};Zonos.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return JS_DELIVR_ZONOS_URL;case"unpkg":return UNPKG_ZONOS_URL;case"cdnjs":return CDNJS_ZONOS_URL;case"vercel":return ZONOS_URL}};if(_a.isNpm){var o=getZonosQaUrl();return o||n()}return n()};Zonos.injectZonosCdn=function(){_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});log("Zonos cdn script injected!")};Zonos.injectStylesheet=function(e){var n=e.cdnType,o=e.theRestUrl;var t=_a.getZonosUrl(n);var r=document.head||document.body;var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ZONOS_URL,"/");r.appendChild(i);var a=document.createElement("link");a.rel="stylesheet";a.href="".concat(t,"/").concat(o);a.onerror=function(){logError("Failed to load ".concat(a.href));var e=getNextFallbackUrl(n);if(!e){return}_a.injectStylesheet({cdnType:e,theRestUrl:o})};r.appendChild(a)};Zonos.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){log("Zonos style links already injected","warn");return}_a.injectStylesheet({cdnType:MAIN_LOAD_CDN_TYPE,theRestUrl:"dist/zonos-elements/zonos-elements.css"});log("Zonos style css injected!")};Zonos.injectFonts=function(){var e=function(){var e=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(INTER_FONT_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(INTER_FONT_REGEX.test(o.href)){continue}return o}return null};if(e()){log("Inter font already injected","warn");return}var n=document.head||document.body;var o=document.createElement("link");o.rel="preconnect";o.href=INTER_FONT_URL;n.appendChild(o);var t=document.createElement("link");t.rel="stylesheet";t.href="".concat(INTER_FONT_URL,"/inter/inter.css");n.appendChild(t);log("Zonos font injected!")};Zonos.setupGoogleFont=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};Zonos.injectSupportGoogleFont=function(e){var n;log("[FONT] injecting ".concat(e));var o=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var t=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(GOOGLE_FONT_URL,'"]'))){var r=document.createElement("link");r.rel="preconnect";r.href=GOOGLE_FONT_URL;t.appendChild(r)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){log("[FONT] ".concat(o," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=e;t.appendChild(i);log("[FONT] ".concat(o," font injected!"))};export{Zonos};
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,i){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):n(e.value).then(r,a)}l((i=i.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(o){return l([e,o])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(t=0)),t)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1];s=a;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(a);break}if(s[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{b as bootstrapLazy}from"./index-86b8247e.js";export{s as setNonce}from"./index-86b8247e.js";import{g as globalScripts}from"./app-globals-0f993ce5.js";var defineCustomElements=function(e,o){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(typeof window==="undefined")return[2,undefined];return[4,globalScripts()];case 1:e.sent();return[2,bootstrapLazy(JSON.parse('[["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"open":["handleOpenChange"]}]]],["zonos-hello",[[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"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["zonos-tooltip",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-link",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["zonos-logo",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["zonos-hello-dialog",[[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"]}]]],["zonos-badge",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["zonos-toggle",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["zonos-collapse",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["zonos-card",[[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]}]]],["zonos-input",[[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"]}]]],["zonos-notification_3",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["zonos-country-flag",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-v-stack",[[1,"zonos-v-stack",{"spacing":[2]}]]],["zonos-text",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["zonos-button_3",[[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"],"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]}]]],["zonos-language-select_2",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["zonos-country-select_4",[[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],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["zonos-address_7",[[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-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[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"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[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"]]],[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"]}]]],["zonos-cart-items_13",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[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]}],[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-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-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]}]]]]'),o)]}}))}))};export{defineCustomElements};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,i){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):n(e.value).then(r,a)}l((i=i.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(o){return l([e,o])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(t=0)),t)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1];s=a;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(a);break}if(s[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{b as bootstrapLazy}from"./index-86b8247e.js";export{s as setNonce}from"./index-86b8247e.js";import{g as globalScripts}from"./app-globals-0f993ce5.js";var defineCustomElements=function(e,o){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(typeof window==="undefined")return[2,undefined];return[4,globalScripts()];case 1:e.sent();return[2,bootstrapLazy(JSON.parse('[["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"defaultAddressParams":[32],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"open":["handleOpenChange"]}]]],["zonos-hello",[[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"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["zonos-tooltip",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-link",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["zonos-logo",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["zonos-hello-dialog",[[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"]}]]],["zonos-badge",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["zonos-toggle",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["zonos-collapse",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["zonos-card",[[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]}]]],["zonos-input",[[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"]}]]],["zonos-notification_3",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["zonos-country-flag",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-v-stack",[[1,"zonos-v-stack",{"spacing":[2]}]]],["zonos-text",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["zonos-button_3",[[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"],"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]}]]],["zonos-language-select_2",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["zonos-country-select_4",[[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],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["zonos-address_7",[[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-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[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"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[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"]]],[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"]}]]],["zonos-cart-items_13",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[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]}],[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-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-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]}]]]]'),o)]}}))}))};export{defineCustomElements};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(r,e,t,n){function o(r){return r instanceof t?r:new t((function(e){e(r)}))}return new(t||(t=Promise))((function(t,a){function i(r){try{c(n.next(r))}catch(r){a(r)}}function u(r){try{c(n["throw"](r))}catch(r){a(r)}}function c(r){r.done?t(r.value):o(r.value).then(i,u)}c((n=n.apply(r,e||[])).next())}))};var __generator=this&&this.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(r){return function(e){return c([r,e])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(t=0)),t)try{if(n=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;o=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1];a=u;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(u);break}if(a[2])t.ops.pop();t.trys.pop();continue}u=e.call(r,t)}catch(r){u=[6,r];o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{z as zonosStore,c as createStore}from"./zonosStore-c493c4fe.js";import{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,e,t,n){function o(r){return r instanceof t?r:new t((function(e){e(r)}))}return new(t||(t=Promise))((function(t,a){function i(r){try{c(n.next(r))}catch(r){a(r)}}function u(r){try{c(n["throw"](r))}catch(r){a(r)}}function c(r){r.done?t(r.value):o(r.value).then(i,u)}c((n=n.apply(r,e||[])).next())}))};var __generator=this&&this.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(r){return function(e){return c([r,e])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(t=0)),t)try{if(n=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;o=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1];a=u;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(u);break}if(a[2])t.ops.pop();t.trys.pop();continue}u=e.call(r,t)}catch(r){u=[6,r];o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{z as zonosStore,c as createStore}from"./zonosStore-c493c4fe.js";import{e as cartStore,x as stripeStoreHandleInventoryCheck,q as translate,w as cartStoreNextStep,k as cartStoreClearCheckoutInterval}from"./cart-f0bf7202.js";import{h as handleFetch,l as log,a as logError,j as jsonParse}from"./handleFetch-22cb914b.js";import{t as tinycolor}from"./isDarkColor-c6924924.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,s,e,t){function n(o){return o instanceof e?o:new e((function(s){s(o)}))}return new(e||(e=Promise))((function(e,i){function a(o){try{d(t.next(o))}catch(o){i(o)}}function r(o){try{d(t["throw"](o))}catch(o){i(o)}}function d(o){o.done?e(o.value):n(o.value).then(a,r)}d((t=t.apply(o,s||[])).next())}))};var __generator=this&&this.__generator||function(o,s){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(s){return d([o,s])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(e=0)),e)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;n=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){e.label=r[1];break}if(r[0]===6&&e.label<i[1]){e.label=i[1];i=r;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(r);break}if(i[2])e.ops.pop();e.trys.pop();continue}r=s.call(o,e)}catch(o){r=[6,o];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,d as getElement}from"./index-86b8247e.js";import{j as stripeStore,S as getFallbackDefaultCountryCode,l as localizationStore,p as translate}from"./cart-3e0e4d5c.js";import{i as isCheckoutMobile}from"./isCheckoutMobile-8846dccb.js";import{a as logError,l as log}from"./handleFetch-22cb914b.js";import{i as isTextContainsNonLatinChars,c as containsNonLatinChars}from"./containsNonLatinChars-2d8810c3.js";import{z as zonosStore,d as zonosStoreFontFamily}from"./zonosStore-c493c4fe.js";import{c as classes}from"./classes-0d95c529.js";import{R as RemoveIcon$1}from"./RemoveIcon-9dc5dd1a.js";import{g as getBorderRadius}from"./getBorderRadius-bdd709e7.js";import{i as isDarkColor}from"./isDarkColor-c6924924.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function o(o){registerInstance(this,o);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}o.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};o.prototype.updateAddressEventData=function(o){var s=o.event,e=o.type;switch(e){case"billing":stripeStore.stripeBillingAddressEventData=s;break;default:stripeStore.stripeAddressEventData=s;break}};o.prototype.updateAddressElement=function(o){var s=o.stripeAddressElement,e=o.type;if(e==="shipping"){stripeStore.stripeAddressElement=s;return}stripeStore.stripeBillingAddressElement=s};o.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var o,s,e,t,n,i,a,r,d,l,c;var h=this;return __generator(this,(function(f){this.stripe=window.Zonos.stripe;e=this.getStripeAddressInstance(),t=e.stripeAddressEventData,n=e.stripeElements;if(!this.stripe||!n){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(o=this.defaultAddress)===null||o===void 0?void 0:o.phone;if(!i){(s=this.defaultAddress)===null||s===void 0?true:delete s.phone}a=localizationStore.shippingZoneCountries;r=a?Object.values(a).map((function(o){return o.code})):[];d=this.type==="shipping"?r:[];l=(t===null||t===void 0?void 0:t.value.address.country)||getFallbackDefaultCountryCode(d);log("Stripe country code: ".concat(l),"info");c=n.create("address",{allowedCountries:d,contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:l}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));c.on("change",(function(o){var s=o.value;if(!h.isDirtyAddress&&s.address.line1.length>=3){h.isDirtyAddress=true;setTimeout((function(){if(isCheckoutMobile()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var o=h.type==="shipping"?100:600;var s=h.el.closest(".zonos--group");var e=h.el.getBoundingClientRect().top+o;s===null||s===void 0?void 0:s.scrollTo({behavior:"smooth",top:e})}}),600)}h.updateAddressEventData({event:Object.assign(Object.assign({},o),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},s),{firstName:s.firstName||s.name.split(" ")[0],lastName:s.lastName||s.name.split(" ")[1]})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2]}))}))};o.prototype.disconnectedCallback=function(){var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.destroy()};o.prototype.componentDidLoad=function(){var o=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!o&&o.value.address.line1.length>0;void this.watchInitStripe()};o.prototype.render=function(){return h(Host,{key:"15074e6cf5021e2d583838eb866f92cb8dad0c1e",class:"zonos--address zonos--elements"},h("zonos-text",{key:"4203a4dffc101ba0667e975ff2ebe6125e023509",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"66add8724cb61193252e44b7a8179fbabc34d3d2",class:"zonos--address-component"}))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}();ZonosAddress.style=ZonosAddressStyle0;var zonosAddressDisplayCss=':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 .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var ZonosAddressDisplayStyle0=zonosAddressDisplayCss;var ZonosAddressDisplay=function(){function o(o){registerInstance(this,o);this.currentAddress=undefined;this.addressType=undefined}o.prototype.render=function(){var o;var s=this.currentAddress,e=s.city,t=s.country,n=s.email,i=s.line1,a=s.line2,r=s.name,d=s.phone,l=s.postal_code,c=s.state;var f=(o=localizationStore.shippingZoneCountries)===null||o===void 0?void 0:o[t];var u=function(o){var s=o.bold,e=o.content;var t=isTextContainsNonLatinChars(e)?"red-600":"gray-1000";return h("zonos-text",{textColor:t,type:s?"boldLabel":"body"},e)};return h(Host,{class:"zonos--address-form zonos--elements"},h("div",{class:"zonos--title"},h("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?translate("Shipping"):translate("Billing"))),h("div",{class:"zonos--address-group"},r&&h("div",{class:"zonos--address-line"},u({bold:true,content:r})),n&&h("div",{class:"zonos--address-line"},u({content:n})),d&&h("div",{class:"zonos--address-line"},u({content:d})),i&&h("div",{class:"zonos--address-line"},u({content:i})),a&&h("div",{class:"zonos--address-line"},u({content:a})),h("div",{class:"zonos--address-line"},e&&u({content:e}),c&&u({content:c}),l&&u({content:l})),f&&h("div",{class:"zonos--address-line"},h("zonos-country-flag",{class:"zonos--country-flag",countryCode:f.code})," ",u({content:f.displayName}))))};return o}();ZonosAddressDisplay.style=ZonosAddressDisplayStyle0;var zonosAddressFormCss=":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 .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var ZonosAddressFormStyle0=zonosAddressFormCss;var ZonosAddressForm=function(){function o(o){var s=this;registerInstance(this,o);this.addressChange=createEvent(this,"addressChange",7);this.onInputChange=function(o){var e;var t=o.key,n=o.value;s.addressChange.emit(Object.assign(Object.assign({},s.localAddress),(e={},e[t]=n,e)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}o.prototype.watchCurrentAddress=function(){var o,s,e,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((o=this.translatedAddress.city)===null||o===void 0?void 0:o[r])||r,line1:((s=this.translatedAddress.line1)===null||s===void 0?void 0:s[d])||d,line2:((e=this.translatedAddress.line2)===null||e===void 0?void 0:e[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};o.prototype.componentWillLoad=function(){this.watchCurrentAddress()};o.prototype.render=function(){var o=this;var s=this.localAddress,e=s.city,t=s.country,n=s.line1,i=s.line2,a=s.name,r=s.phone,d=s.postal_code,l=s.state;var c=a.split(" ")[0]||"";var f=a.split(" ").slice(1).join(" ")||"";return h(Host,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},h("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},h("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?translate("Shipping"):translate("Billing"))),h("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},h("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},h("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},translate("Contact")),h("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:translate("Email"),inputValue:this.currentAddress.email,isDisabled:true}),h("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},h("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:translate("First name"),inputValue:c,isError:isTextContainsNonLatinChars(c),onInputChange:function(s){return o.onInputChange({key:"name",value:"".concat(s.detail," ").concat(f)})}}),h("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:translate("Last name"),inputValue:f,isError:isTextContainsNonLatinChars(f),onInputChange:function(s){return o.onInputChange({key:"name",value:"".concat(c," ").concat(s.detail)})}}))),h("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},h("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},translate("Address")),h("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:translate("Country"),inputValue:t,isDisabled:true}),h("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:translate("Address line 1"),inputValue:n,isError:isTextContainsNonLatinChars(n),onInputChange:function(s){return o.onInputChange({key:"line1",value:s.detail})}}),h("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:translate("Address line 2"),inputValue:i,isError:isTextContainsNonLatinChars(i),onInputChange:function(s){return o.onInputChange({key:"line2",value:s.detail})}}),h("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},h("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:translate("City"),inputValue:e,isError:isTextContainsNonLatinChars(e),onInputChange:function(s){return o.onInputChange({key:"city",value:s.detail})}}),h("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:translate("State/Province"),inputValue:l,isError:isTextContainsNonLatinChars(l),onInputChange:function(s){return o.onInputChange({key:"state",value:s.detail})}})),h("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:translate("Postal code"),inputValue:d,isError:isTextContainsNonLatinChars(d),onInputChange:function(s){return o.onInputChange({key:"postal_code",value:s.detail})}}),h("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:translate("Phone number"),inputValue:r,onInputChange:function(s){return o.onInputChange({key:"phone",value:s.detail})}}))))};Object.defineProperty(o,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return o}();ZonosAddressForm.style=ZonosAddressFormStyle0;var zonosAddressUpdateDialogCss=":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 .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var ZonosAddressUpdateDialogStyle0=zonosAddressUpdateDialogCss;var ZonosAddressUpdateDialog=function(){function o(o){var s=this;registerInstance(this,o);this.closeUpdateDialog=createEvent(this,"closeUpdateDialog",7);this.continueClicked=createEvent(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){s.closeUpdateDialog.emit()};this.getTranslatedAddress=function(o){var s=o.currentAddress,e=o.translatedAddress;var t,n,i,a,r,d;var l=s.city,c=s.line1,h=s.line2,f=s.name,u=s.postal_code,b=s.state;return{city:((t=e.city)===null||t===void 0?void 0:t[l])||l,line1:((n=e.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=e.line2)===null||i===void 0?void 0:i[h])||h,name:((a=e.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=e.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=e.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(s,void 0,void 0,(function(){var o,s,e,t,n,i,a,r,d,l,c,h,f;return __generator(this,(function(u){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=containsNonLatinChars(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&containsNonLatinChars(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];f=((s=c===null||c===void 0?void 0:c.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"))||((e=h===null||h===void 0?void 0:h.shadowRoot)===null||e===void 0?void 0:e.querySelector(".has-error"));if(f){f.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(o){var s,e,t,n,i,a;var r=o.currentAddress,d=o.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(s={},s[l]=d.city,s),line1:(e={},e[c]=d.line1,e),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}o.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};o.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};o.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};o.prototype.render=function(){var o=this;var s=this.submitBtnColor||zonosStore.appearance.colorSecondary;var e=s==="#ffffff"?"outline":this.submitBtnType||"standard";var t=this.billingAddress;var n=this.shippingAddress;return h(Host,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:classes(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},h("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},h("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},h("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},h("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},h("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},translate("Update your address")),h("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon$1}),noBackground:true,onClick:function(){return o.closeUpdateDialogHandler()}})),h("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},translate("To ensure delivery all address details must be in Latin characters."))),h("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},h("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},translate("What you entered")),h("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},h("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),t&&h("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:t})),h("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},h("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},translate("Translated address")),h("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:function(s){var e=s.detail;o.translatedShippingAddressState=o.buildTranslateAddressState({currentAddress:n,translatedAddress:e})},translatedAddress:this.translatedShippingAddressState}),t&&h("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:t,onAddressChange:function(s){var e=s.detail;o.translatedBillingAddressState=o.buildTranslateAddressState({currentAddress:t,translatedAddress:e})},translatedAddress:this.translatedBillingAddressState}))),h("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},h("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},h("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return o.closeUpdateDialogHandler()},variant:"subtle"},translate("Cancel")),h("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"sm",variant:e},translate("Update address")))))))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return o}();ZonosAddressUpdateDialog.style=ZonosAddressUpdateDialogStyle0;var colorPrefixes=["blue","cyan","green","orange","purple","red","gray","glass"];var zonosCheckboxCss=":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;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var ZonosCheckboxStyle0=zonosCheckboxCss;var ZonosCheckbox=function(){function o(o){registerInstance(this,o);this.checkboxSelected=createEvent(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}o.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};o.prototype.render=function(){var o=this;var s=colorPrefixes.includes(this.backgroundColor);var e=s?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var t=s?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!isDarkColor(e)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var n=getBorderRadius({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return h(Host,{key:"a5ac0531735ec33f61886845af2ca061dc08ddd3",class:classes(["zonos--elements zonos--checkbox"]),style:{"--zonos--background-color":e,"--zonos--border-radius":n,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--size":"".concat(this.size,"px")}},h("label",{key:"a43282ec66f0bf45aadea3be194f37dfb71bcae3",class:classes([this.isDisabled&&"disabled"])},h("input",{key:"1249ee568cd5b503bf40ccfbabd698ad8079f1cb",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(s){o.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),h("span",{key:"65b6fb17e7ebb7160ce891d3f86a8ca0453a2f87",class:"checkmark-container"},h("svg",{key:"9e58246871517832dfae28a92d9c4177e09eb095",class:"checkmark",color:t,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"c11830908d0dbfc929b77025b42a930f243cc587","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&h("zonos-text",{key:"af6464b76512b252b0adf24d04b17884f7af60f4",size:this.fontSize},this.label)))};return o}();ZonosCheckbox.style=ZonosCheckboxStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosDialogCss=":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 .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{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;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var ZonosDialogStyle0=zonosDialogCss;var ZonosDialog=function(){function o(o){var s=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",3);this.isMobileMode=function(){return s.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!s.open){return}s.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!s.noClickOutside){s.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeButtonHandler()}};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){var o=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"506cffe43252a55397dc49ff230311ab38b7f049",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},h("div",{key:"42944e3338f04feca7cbc928bb12ebeba555c6a5",class:"zonos--backdrop"}),h("div",{key:"b4e17568fbee4cbe15f745bf49efaab8d1be8b6e",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},h("div",{key:"255c11f4c3dc5d2f28703b35a774f1d63078f0b0",class:"zonos--dialog"},this.isLoading&&h("div",{key:"48f1d08a3d2bbeb765be73f2c65dd566dbceebe4",class:"zonos--loading"},h("zonos-spinner",{key:"e0250720aefea8b5ac13000cd61a980e0e09e42f",size:30})),(this.headerText||!this.noCloseButton)&&h("div",{key:"bccb4783b92d4b90ab67faacbc6f888af3f52aa5",class:"zonos--header"},this.headerText&&h("h3",{key:"79c0da7d43317142d177a03629cb3916d9f7923f",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{key:"c835b4a928867c66aed65e0204503553cfe410eb",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close dialog",content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),h("div",{key:"2c9612b655676ac82fb6a7cec268dd12ad0bd8f0",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"035123e25049b21951bcfd0a765dd1eca0c50c99"})),h("slot",{key:"3b40b61cb3a234348689f33ce2376d58fbc2f0e7",name:"dialog-footer"}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=ZonosDialogStyle0;var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var ZonosLinkAuthentication=function(){function o(o){registerInstance(this,o);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.titleText=undefined;this.defaultEmail=null;this.isEmailError=false;this.stripe=stripeStore.stripe}o.prototype.watchInitStripe=function(){var o=this;if(!this.stripe||!stripeStore.stripeElements){return}var s=this.defaultEmail?{email:this.defaultEmail}:undefined;var e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:s||undefined});var t=this.el.querySelector(".zonos--link-authentication-component");if(!t){logError("Cannot find container element for linkAuthenticationElement");return}e.mount(t);e.on("change",(function(s){var e;stripeStore.stripeLinkEventData=s;(e=o.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e};o.prototype.componentDidLoad=function(){this.watchInitStripe()};o.prototype.render=function(){return h(Host,{key:"8f2a168814430480824ef48220dd9a06da6ab3df",class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},h("zonos-text",{key:"0325aa30e9dd91ceca034859d64e7454ef489ad0",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"282a18cec412a0cfe5bc473b42cdf1ff38beaf9b",class:"zonos--link-authentication-component ".concat(this.isEmailError&&"zonos--input-invalid")}),this.isEmailError&&h("zonos-text",{key:"8d1f66444d6bb925d9b581dd15fe2a7e2acf88a5",textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;export{ZonosAddress as zonos_address,ZonosAddressDisplay as zonos_address_display,ZonosAddressForm as zonos_address_form,ZonosAddressUpdateDialog as zonos_address_update_dialog,ZonosCheckbox as zonos_checkbox,ZonosDialog as zonos_dialog,ZonosLinkAuthentication as zonos_link_authentication};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,s,e,t){function n(o){return o instanceof e?o:new e((function(s){s(o)}))}return new(e||(e=Promise))((function(e,i){function a(o){try{d(t.next(o))}catch(o){i(o)}}function r(o){try{d(t["throw"](o))}catch(o){i(o)}}function d(o){o.done?e(o.value):n(o.value).then(a,r)}d((t=t.apply(o,s||[])).next())}))};var __generator=this&&this.__generator||function(o,s){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(s){return d([o,s])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(e=0)),e)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;n=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){e.label=r[1];break}if(r[0]===6&&e.label<i[1]){e.label=i[1];i=r;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(r);break}if(i[2])e.ops.pop();e.trys.pop();continue}r=s.call(o,e)}catch(o){r=[6,o];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,d as getElement}from"./index-86b8247e.js";import{f as stripeStore,S as getFallbackDefaultCountryCode,l as localizationStore,q as translate}from"./cart-f0bf7202.js";import{i as isCheckoutMobile}from"./isCheckoutMobile-8846dccb.js";import{a as logError,l as log}from"./handleFetch-22cb914b.js";import{i as isTextContainsNonLatinChars,c as containsNonLatinChars}from"./containsNonLatinChars-2d8810c3.js";import{z as zonosStore,d as zonosStoreFontFamily}from"./zonosStore-c493c4fe.js";import{c as classes}from"./classes-0d95c529.js";import{R as RemoveIcon$1}from"./RemoveIcon-9dc5dd1a.js";import{g as getBorderRadius}from"./getBorderRadius-bdd709e7.js";import{i as isDarkColor}from"./isDarkColor-c6924924.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function o(o){registerInstance(this,o);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}o.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};o.prototype.updateAddressEventData=function(o){var s=o.event,e=o.type;switch(e){case"billing":stripeStore.stripeBillingAddressEventData=s;break;default:stripeStore.stripeAddressEventData=s;break}};o.prototype.updateAddressElement=function(o){var s=o.stripeAddressElement,e=o.type;if(e==="shipping"){stripeStore.stripeAddressElement=s;return}stripeStore.stripeBillingAddressElement=s};o.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var o,s,e,t,n,i,a,r,d,l,c;var h=this;return __generator(this,(function(f){this.stripe=window.Zonos.stripe;e=this.getStripeAddressInstance(),t=e.stripeAddressEventData,n=e.stripeElements;if(!this.stripe||!n){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(o=this.defaultAddress)===null||o===void 0?void 0:o.phone;if(!i){(s=this.defaultAddress)===null||s===void 0?true:delete s.phone}a=localizationStore.shippingZoneCountries;r=a?Object.values(a).map((function(o){return o.code})):[];d=this.type==="shipping"?r:[];l=(t===null||t===void 0?void 0:t.value.address.country)||getFallbackDefaultCountryCode(d);log("Stripe country code: ".concat(l),"info");c=n.create("address",{allowedCountries:d,contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:l}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));c.on("change",(function(o){var s=o.value;if(!h.isDirtyAddress&&s.address.line1.length>=3){h.isDirtyAddress=true;setTimeout((function(){if(isCheckoutMobile()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var o=h.type==="shipping"?100:600;var s=h.el.closest(".zonos--group");var e=h.el.getBoundingClientRect().top+o;s===null||s===void 0?void 0:s.scrollTo({behavior:"smooth",top:e})}}),600)}h.updateAddressEventData({event:Object.assign(Object.assign({},o),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},s),{firstName:s.firstName||s.name.split(" ")[0],lastName:s.lastName||s.name.split(" ")[1]})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2]}))}))};o.prototype.disconnectedCallback=function(){var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.destroy()};o.prototype.componentDidLoad=function(){var o=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!o&&o.value.address.line1.length>0;void this.watchInitStripe()};o.prototype.render=function(){return h(Host,{key:"15074e6cf5021e2d583838eb866f92cb8dad0c1e",class:"zonos--address zonos--elements"},h("zonos-text",{key:"4203a4dffc101ba0667e975ff2ebe6125e023509",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"66add8724cb61193252e44b7a8179fbabc34d3d2",class:"zonos--address-component"}))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}();ZonosAddress.style=ZonosAddressStyle0;var zonosAddressDisplayCss=':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 .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var ZonosAddressDisplayStyle0=zonosAddressDisplayCss;var ZonosAddressDisplay=function(){function o(o){registerInstance(this,o);this.currentAddress=undefined;this.addressType=undefined}o.prototype.render=function(){var o;var s=this.currentAddress,e=s.city,t=s.country,n=s.email,i=s.line1,a=s.line2,r=s.name,d=s.phone,l=s.postal_code,c=s.state;var f=(o=localizationStore.shippingZoneCountries)===null||o===void 0?void 0:o[t];var u=function(o){var s=o.bold,e=o.content;var t=isTextContainsNonLatinChars(e)?"red-600":"gray-1000";return h("zonos-text",{textColor:t,type:s?"boldLabel":"body"},e)};return h(Host,{class:"zonos--address-form zonos--elements"},h("div",{class:"zonos--title"},h("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?translate("Shipping"):translate("Billing"))),h("div",{class:"zonos--address-group"},r&&h("div",{class:"zonos--address-line"},u({bold:true,content:r})),n&&h("div",{class:"zonos--address-line"},u({content:n})),d&&h("div",{class:"zonos--address-line"},u({content:d})),i&&h("div",{class:"zonos--address-line"},u({content:i})),a&&h("div",{class:"zonos--address-line"},u({content:a})),h("div",{class:"zonos--address-line"},e&&u({content:e}),c&&u({content:c}),l&&u({content:l})),f&&h("div",{class:"zonos--address-line"},h("zonos-country-flag",{class:"zonos--country-flag",countryCode:f.code})," ",u({content:f.displayName}))))};return o}();ZonosAddressDisplay.style=ZonosAddressDisplayStyle0;var zonosAddressFormCss=":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 .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var ZonosAddressFormStyle0=zonosAddressFormCss;var ZonosAddressForm=function(){function o(o){var s=this;registerInstance(this,o);this.addressChange=createEvent(this,"addressChange",7);this.onInputChange=function(o){var e;var t=o.key,n=o.value;s.addressChange.emit(Object.assign(Object.assign({},s.localAddress),(e={},e[t]=n,e)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}o.prototype.watchCurrentAddress=function(){var o,s,e,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((o=this.translatedAddress.city)===null||o===void 0?void 0:o[r])||r,line1:((s=this.translatedAddress.line1)===null||s===void 0?void 0:s[d])||d,line2:((e=this.translatedAddress.line2)===null||e===void 0?void 0:e[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};o.prototype.componentWillLoad=function(){this.watchCurrentAddress()};o.prototype.render=function(){var o=this;var s=this.localAddress,e=s.city,t=s.country,n=s.line1,i=s.line2,a=s.name,r=s.phone,d=s.postal_code,l=s.state;var c=a.split(" ")[0]||"";var f=a.split(" ").slice(1).join(" ")||"";return h(Host,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},h("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},h("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?translate("Shipping"):translate("Billing"))),h("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},h("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},h("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},translate("Contact")),h("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:translate("Email"),inputValue:this.currentAddress.email,isDisabled:true}),h("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},h("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:translate("First name"),inputValue:c,isError:isTextContainsNonLatinChars(c),onInputChange:function(s){return o.onInputChange({key:"name",value:"".concat(s.detail," ").concat(f)})}}),h("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:translate("Last name"),inputValue:f,isError:isTextContainsNonLatinChars(f),onInputChange:function(s){return o.onInputChange({key:"name",value:"".concat(c," ").concat(s.detail)})}}))),h("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},h("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},translate("Address")),h("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:translate("Country"),inputValue:t,isDisabled:true}),h("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:translate("Address line 1"),inputValue:n,isError:isTextContainsNonLatinChars(n),onInputChange:function(s){return o.onInputChange({key:"line1",value:s.detail})}}),h("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:translate("Address line 2"),inputValue:i,isError:isTextContainsNonLatinChars(i),onInputChange:function(s){return o.onInputChange({key:"line2",value:s.detail})}}),h("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},h("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:translate("City"),inputValue:e,isError:isTextContainsNonLatinChars(e),onInputChange:function(s){return o.onInputChange({key:"city",value:s.detail})}}),h("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:translate("State/Province"),inputValue:l,isError:isTextContainsNonLatinChars(l),onInputChange:function(s){return o.onInputChange({key:"state",value:s.detail})}})),h("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:translate("Postal code"),inputValue:d,isError:isTextContainsNonLatinChars(d),onInputChange:function(s){return o.onInputChange({key:"postal_code",value:s.detail})}}),h("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:translate("Phone number"),inputValue:r,onInputChange:function(s){return o.onInputChange({key:"phone",value:s.detail})}}))))};Object.defineProperty(o,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return o}();ZonosAddressForm.style=ZonosAddressFormStyle0;var zonosAddressUpdateDialogCss=":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 .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var ZonosAddressUpdateDialogStyle0=zonosAddressUpdateDialogCss;var ZonosAddressUpdateDialog=function(){function o(o){var s=this;registerInstance(this,o);this.closeUpdateDialog=createEvent(this,"closeUpdateDialog",7);this.continueClicked=createEvent(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){s.closeUpdateDialog.emit()};this.getTranslatedAddress=function(o){var s=o.currentAddress,e=o.translatedAddress;var t,n,i,a,r,d;var l=s.city,c=s.line1,h=s.line2,f=s.name,u=s.postal_code,b=s.state;return{city:((t=e.city)===null||t===void 0?void 0:t[l])||l,line1:((n=e.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=e.line2)===null||i===void 0?void 0:i[h])||h,name:((a=e.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=e.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=e.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(s,void 0,void 0,(function(){var o,s,e,t,n,i,a,r,d,l,c,h,f;return __generator(this,(function(u){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=containsNonLatinChars(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&containsNonLatinChars(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];f=((s=c===null||c===void 0?void 0:c.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"))||((e=h===null||h===void 0?void 0:h.shadowRoot)===null||e===void 0?void 0:e.querySelector(".has-error"));if(f){f.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(o){var s,e,t,n,i,a;var r=o.currentAddress,d=o.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(s={},s[l]=d.city,s),line1:(e={},e[c]=d.line1,e),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}o.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};o.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};o.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};o.prototype.render=function(){var o=this;var s=this.submitBtnColor||zonosStore.appearance.colorSecondary;var e=s==="#ffffff"?"outline":this.submitBtnType||"standard";var t=this.billingAddress;var n=this.shippingAddress;return h(Host,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:classes(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},h("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},h("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},h("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},h("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},h("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},translate("Update your address")),h("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon$1}),noBackground:true,onClick:function(){return o.closeUpdateDialogHandler()}})),h("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},translate("To ensure delivery all address details must be in Latin characters."))),h("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},h("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},translate("What you entered")),h("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},h("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),t&&h("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:t})),h("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},h("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},translate("Translated address")),h("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:function(s){var e=s.detail;o.translatedShippingAddressState=o.buildTranslateAddressState({currentAddress:n,translatedAddress:e})},translatedAddress:this.translatedShippingAddressState}),t&&h("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:t,onAddressChange:function(s){var e=s.detail;o.translatedBillingAddressState=o.buildTranslateAddressState({currentAddress:t,translatedAddress:e})},translatedAddress:this.translatedBillingAddressState}))),h("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},h("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},h("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return o.closeUpdateDialogHandler()},variant:"subtle"},translate("Cancel")),h("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"sm",variant:e},translate("Update address")))))))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return o}();ZonosAddressUpdateDialog.style=ZonosAddressUpdateDialogStyle0;var colorPrefixes=["blue","cyan","green","orange","purple","red","gray","glass"];var zonosCheckboxCss=":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;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var ZonosCheckboxStyle0=zonosCheckboxCss;var ZonosCheckbox=function(){function o(o){registerInstance(this,o);this.checkboxSelected=createEvent(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}o.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};o.prototype.render=function(){var o=this;var s=colorPrefixes.includes(this.backgroundColor);var e=s?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var t=s?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!isDarkColor(e)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var n=getBorderRadius({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return h(Host,{key:"a5ac0531735ec33f61886845af2ca061dc08ddd3",class:classes(["zonos--elements zonos--checkbox"]),style:{"--zonos--background-color":e,"--zonos--border-radius":n,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--size":"".concat(this.size,"px")}},h("label",{key:"a43282ec66f0bf45aadea3be194f37dfb71bcae3",class:classes([this.isDisabled&&"disabled"])},h("input",{key:"1249ee568cd5b503bf40ccfbabd698ad8079f1cb",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(s){o.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),h("span",{key:"65b6fb17e7ebb7160ce891d3f86a8ca0453a2f87",class:"checkmark-container"},h("svg",{key:"9e58246871517832dfae28a92d9c4177e09eb095",class:"checkmark",color:t,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"c11830908d0dbfc929b77025b42a930f243cc587","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&h("zonos-text",{key:"af6464b76512b252b0adf24d04b17884f7af60f4",size:this.fontSize},this.label)))};return o}();ZonosCheckbox.style=ZonosCheckboxStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosDialogCss=":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 .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{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;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var ZonosDialogStyle0=zonosDialogCss;var ZonosDialog=function(){function o(o){var s=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",3);this.isMobileMode=function(){return s.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!s.open){return}s.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!s.noClickOutside){s.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeButtonHandler()}};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){var o=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"506cffe43252a55397dc49ff230311ab38b7f049",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},h("div",{key:"42944e3338f04feca7cbc928bb12ebeba555c6a5",class:"zonos--backdrop"}),h("div",{key:"b4e17568fbee4cbe15f745bf49efaab8d1be8b6e",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},h("div",{key:"255c11f4c3dc5d2f28703b35a774f1d63078f0b0",class:"zonos--dialog"},this.isLoading&&h("div",{key:"48f1d08a3d2bbeb765be73f2c65dd566dbceebe4",class:"zonos--loading"},h("zonos-spinner",{key:"e0250720aefea8b5ac13000cd61a980e0e09e42f",size:30})),(this.headerText||!this.noCloseButton)&&h("div",{key:"bccb4783b92d4b90ab67faacbc6f888af3f52aa5",class:"zonos--header"},this.headerText&&h("h3",{key:"79c0da7d43317142d177a03629cb3916d9f7923f",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{key:"c835b4a928867c66aed65e0204503553cfe410eb",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close dialog",content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),h("div",{key:"2c9612b655676ac82fb6a7cec268dd12ad0bd8f0",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"035123e25049b21951bcfd0a765dd1eca0c50c99"})),h("slot",{key:"3b40b61cb3a234348689f33ce2376d58fbc2f0e7",name:"dialog-footer"}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=ZonosDialogStyle0;var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var ZonosLinkAuthentication=function(){function o(o){registerInstance(this,o);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.titleText=undefined;this.defaultEmail=null;this.isEmailError=false;this.stripe=stripeStore.stripe}o.prototype.watchInitStripe=function(){var o=this;if(!this.stripe||!stripeStore.stripeElements){return}var s=this.defaultEmail?{email:this.defaultEmail}:undefined;var e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:s||undefined});var t=this.el.querySelector(".zonos--link-authentication-component");if(!t){logError("Cannot find container element for linkAuthenticationElement");return}e.mount(t);e.on("change",(function(s){var e;stripeStore.stripeLinkEventData=s;(e=o.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e};o.prototype.componentDidLoad=function(){this.watchInitStripe()};o.prototype.render=function(){return h(Host,{key:"8f2a168814430480824ef48220dd9a06da6ab3df",class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},h("zonos-text",{key:"0325aa30e9dd91ceca034859d64e7454ef489ad0",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"282a18cec412a0cfe5bc473b42cdf1ff38beaf9b",class:"zonos--link-authentication-component ".concat(this.isEmailError&&"zonos--input-invalid")}),this.isEmailError&&h("zonos-text",{key:"8d1f66444d6bb925d9b581dd15fe2a7e2acf88a5",textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;export{ZonosAddress as zonos_address,ZonosAddressDisplay as zonos_address_display,ZonosAddressForm as zonos_address_form,ZonosAddressUpdateDialog as zonos_address_update_dialog,ZonosCheckbox as zonos_checkbox,ZonosDialog as zonos_dialog,ZonosLinkAuthentication as zonos_link_authentication};
|