@zonos/elements 1.3.227 → 1.3.228
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-af017ac3.js → cart-ad82a680.js} +2 -2
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-21030292.js → localization-31e3dfe3.js} +1 -1
- package/dist/cjs/{paypal-2b22f0f5.js → paypal-88b5e878.js} +3 -3
- package/dist/cjs/{placeTestOrder-9cde1ca4.js → placeTestOrder-6aefbf9c.js} +2 -2
- package/dist/cjs/{renderFallback-9300dbaf.js → renderFallback-87c908ad.js} +2 -2
- package/dist/cjs/{translationStore-ce2c700d.js → translationStore-b8b25e9d.js} +240 -0
- package/dist/cjs/zonos-address_11.cjs.entry.js +3 -3
- package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-cart-items_13.cjs.entry.js} +23 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +26 -15
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +5 -5
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +25 -13
- package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
- package/dist/collection/components/store/translationStore/strings.base.js +12 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
- package/dist/collection/components/store/translationStore/strings.french.js +12 -0
- package/dist/collection/components/store/translationStore/strings.german.js +12 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
- package/dist/esm/{cart-11b87221.js → cart-c74f9aaa.js} +3 -3
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-9320a65d.js → localization-106476cb.js} +1 -1
- package/dist/esm/{paypal-338a4350.js → paypal-bf3a2bdd.js} +3 -3
- package/dist/esm/{placeTestOrder-d28f33c2.js → placeTestOrder-891295e8.js} +2 -2
- package/dist/esm/{renderFallback-28ef3364.js → renderFallback-ce0e238a.js} +2 -2
- package/dist/esm/{translationStore-7eebaa41.js → translationStore-766b7521.js} +240 -0
- package/dist/esm/zonos-address_11.entry.js +3 -3
- package/dist/esm/{zonos-cart-items_12.entry.js → zonos-cart-items_13.entry.js} +23 -6
- package/dist/esm/zonos-checkout.entry.js +27 -16
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +5 -5
- package/dist/esm/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +3 -3
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/{cart-11b87221.js → cart-c74f9aaa.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-9320a65d.js → localization-106476cb.js} +1 -1
- package/dist/esm-es5/{paypal-338a4350.js → paypal-bf3a2bdd.js} +1 -1
- package/dist/esm-es5/placeTestOrder-891295e8.js +1 -0
- package/dist/esm-es5/{renderFallback-28ef3364.js → renderFallback-ce0e238a.js} +1 -1
- package/dist/esm-es5/translationStore-766b7521.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/{zonos-cart-items_12.entry.js → zonos-cart-items_13.entry.js} +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +10 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +5 -4
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +21 -0
- package/dist/types/types/generated/graphql.internal.types.ts +7 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +4 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-19305aa8.entry.js → p-053a042e.entry.js} +1 -1
- package/dist/zonos-elements/{p-4ce3489a.entry.js → p-10894d36.entry.js} +1 -1
- package/dist/zonos-elements/p-1865e33b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1c5ba523.js → p-1d15662c.js} +1 -1
- package/dist/zonos-elements/{p-0260fd13.js → p-203c7fda.js} +1 -1
- package/dist/zonos-elements/{p-e00e5d64.system.entry.js → p-21b251f0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2657f099.system.entry.js → p-225a61c4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4004c838.system.entry.js → p-236e0144.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e03a145.system.entry.js → p-23f6a2fb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bfc0fc85.system.entry.js → p-288f5a5b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1ef793d0.entry.js → p-2b84039a.entry.js} +1 -1
- package/dist/zonos-elements/{p-04c1dc63.system.entry.js → p-2db90c99.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-290715a7.system.js → p-33bd80d2.system.js} +1 -1
- package/dist/zonos-elements/p-35c247d9.entry.js +1 -0
- package/dist/zonos-elements/{p-ba334962.system.entry.js → p-3d2925c5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ae3e4f2b.entry.js → p-462f8857.entry.js} +1 -1
- package/dist/zonos-elements/{p-1868a283.entry.js → p-5608ac9d.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b6a3a09.system.entry.js → p-57ee34aa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d531b524.system.js → p-595668d7.system.js} +1 -1
- package/dist/zonos-elements/{p-67787bd4.entry.js → p-62803534.entry.js} +1 -1
- package/dist/zonos-elements/p-6497ce22.entry.js +1 -0
- package/dist/zonos-elements/{p-6092af05.entry.js → p-65db3219.entry.js} +1 -1
- package/dist/zonos-elements/{p-7cee0e68.system.entry.js → p-6c8e4f01.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b9cc0e2.system.entry.js → p-6f1024de.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0a92e3fd.entry.js → p-76f924b3.entry.js} +1 -1
- package/dist/zonos-elements/{p-375994d1.system.entry.js → p-7a97e1cf.system.entry.js} +1 -1
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/{p-4dfe97ad.js → p-964a4d85.js} +2 -2
- package/dist/zonos-elements/{p-2616ba72.entry.js → p-9972941a.entry.js} +1 -1
- package/dist/zonos-elements/{p-bcf11c99.system.entry.js → p-ad7be556.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cb0e6468.entry.js → p-b0a75761.entry.js} +1 -1
- package/dist/zonos-elements/p-b4fe3604.system.js +1 -0
- package/dist/zonos-elements/p-b8293509.js +1 -0
- package/dist/zonos-elements/{p-873b6185.system.entry.js → p-bd373de0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7eb8e2d4.js → p-c3c3cd98.js} +1 -1
- package/dist/zonos-elements/{p-0ec82d78.system.js → p-c89e9d56.system.js} +1 -1
- package/dist/zonos-elements/{p-725605f6.system.js → p-cdaf52f4.system.js} +1 -1
- package/dist/zonos-elements/{p-b5b3f908.system.js → p-cef1e888.system.js} +1 -1
- package/dist/zonos-elements/{p-e60b988c.entry.js → p-cf56b990.entry.js} +1 -1
- package/dist/zonos-elements/{p-112c6453.system.js → p-de984173.system.js} +1 -1
- package/dist/zonos-elements/p-eea0d8af.js +1 -0
- package/dist/zonos-elements/{p-252fa1da.entry.js → p-f4085c23.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/zonos-link.cjs.entry.js +0 -24
- package/dist/esm/zonos-link.entry.js +0 -20
- package/dist/esm-es5/placeTestOrder-d28f33c2.js +0 -1
- package/dist/esm-es5/translationStore-7eebaa41.js +0 -1
- package/dist/esm-es5/zonos-link.entry.js +0 -1
- package/dist/zonos-elements/p-02667a58.entry.js +0 -1
- package/dist/zonos-elements/p-0d82e1fd.entry.js +0 -1
- package/dist/zonos-elements/p-182da73f.system.js +0 -1
- package/dist/zonos-elements/p-5c43ecdf.system.entry.js +0 -1
- package/dist/zonos-elements/p-820ad058.js +0 -1
- package/dist/zonos-elements/p-a800965d.system.entry.js +0 -1
- package/dist/zonos-elements/p-cc599cd9.entry.js +0 -1
- package/dist/zonos-elements/p-d42b5113.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,s){function n(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,a){function r(o){try{i(s.next(o))}catch(o){a(o)}}function l(o){try{i(s["throw"](o))}catch(o){a(o)}}function i(o){o.done?t(o.value):n(o.value).then(r,l)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(o){return function(e){return i([o,e])}}function i(l){if(s)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(t=0)),t)try{if(s=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;n=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1];a=l;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(l);break}if(a[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];n=0}finally{s=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,e,t){if(t||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++){if(a||!(s in e)){if(!a)a=Array.prototype.slice.call(e,0,s);a[s]=e[s]}}return o.concat(a||Array.prototype.slice.call(e))};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,a as getElement}from"./index-55a03023.js";import{c as stripeStore,d as stripeStoreRetrievePayment,t as trackConversionEvent,G as stripeStoreResetPromoCode,y as stripeStoreReset,H as stripeStoreMessageBasedOnStatus,e as cartStore,r as cartStoreNextStep,K as cartStoreOnChange}from"./cart-11b87221.js";import{s as submitGtag,c as paypalStoreReset,a as paypalStore,b as paypalInitScript}from"./paypal-338a4350.js";import{s as storageStore,l as localizationStore}from"./localization-9320a65d.js";import{t as translate,b as translationStoreOnChange}from"./translationStore-7eebaa41.js";import{z as zonosStore}from"./zonosStore-e3d0493a.js";import{h as handleFetch,s as sendErrorLog,g as getIsTestMode,i as isCheckoutMobile,a as getIsStagingMode}from"./handleFetch-a844cac1.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-6281d902.js";import{l as log,b as allLogs}from"./VarianceTest-572cecf5.js";import{i as isCollectMobile,a as isCollectTablet,e as collectStore,r as renderFallback}from"./renderFallback-28ef3364.js";import{c as classes}from"./classes-0d95c529.js";import{l as languages}from"./ILanguage-cd6acb72.js";import{r as renderCheckoutCurrency,p as placeTestOrder}from"./placeTestOrder-d28f33c2.js";import"./isDarkColor-83e0c27e.js";var RemoveIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-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" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-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" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectFinishCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";var ZonosCollectFinishStyle0=zonosCollectFinishCss;var MAX_RETRIES=30;var ZonosCollectFinish=function(){function o(o){var e=this;registerInstance(this,o);this.closeClick=createEvent(this,"closeClick",7);this.borderRadius="ROUNDED";this.confirmationId=null;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.notificationActionText=translate("Keep shopping");this.order=null;this.isWaitingToRedirect=true;this.pullOrder=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,n,a,r,l;return __generator(this,(function(i){switch(i.label){case 0:t=storageStore.checkoutSessionId;s=new URLSearchParams;s.set("checkoutSessionId",t||"");return[4,handleFetch("/api/zonos-elements/get-order?".concat(s.toString()))];case 1:n=i.sent(),a=n.baseUrl,r=n.errors,l=n.json;if(r.length||!(l===null||l===void 0?void 0:l.id)){return[2,{baseUrl:a,order:null}]}return[4,(e=(o=zonosStore.checkoutSettings).onOrderSuccess)===null||e===void 0?void 0:e.call(o,{zonosApiRoute:a,zonosOrder:l})];case 2:i.sent();return[2,{baseUrl:a,order:l}]}}))}))};this.handleSuccessBehavior=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.isLoading=false;return[4,this.getPullOrder()];case 1:o.sent();return[2]}}))}))};this.getPullOrder=function(){var o=[];for(var t=0;t<arguments.length;t++){o[t]=arguments[t]}return __awaiter(e,__spreadArray([],o,true),void 0,(function(o){var e,t,s,n,a,r,l,i;if(o===void 0){o=0}return __generator(this,(function(c){switch(c.label){case 0:if(o===0){log("=== Start to poll for order info","info")}return[4,this.pullOrder()];case 1:s=c.sent(),n=s.baseUrl,a=s.order;r=!!((t=(e=a===null||a===void 0?void 0:a.references)===null||e===void 0?void 0:e.find((function(o){return(o===null||o===void 0?void 0:o.key)==="zonosOrderNumber"})))===null||t===void 0?void 0:t.value);l=storageStore.checkoutSessionId;i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||MAX_RETRIES;log("=== Polling order (".concat(o," attemps)"),"info");if(!a)return[3,2];log("=== CollectOrder info found","info");if(o>10){void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l,"&orderId=").concat(a.id),errors:["Collect order found after ".concat(o," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",orderId:a.id,storeId:zonosStore.storeId}})}this.order=a;return[3,6];case 2:if(!((!a||!r)&&o<i))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:c.sent();return[4,this.getPullOrder(o+1)];case 4:c.sent();return[3,6];case 5:void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l),errors:["Collect order not found after ".concat(i," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",storeId:zonosStore.storeId}});c.label=6;case 6:return[2]}}))}))};this.checkStripePaymentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,n,a,r,l,i;return __generator(this,(function(c){switch(c.label){case 0:o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(o||this.storybookForceStatus))return[3,4];return[4,stripeStoreRetrievePayment({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:e=c.sent(),t=e.error,s=e.messages,n=e.status;a=n==="requires_action"||t;this.notificationType=a?"error":"success";this.notificationMessages=s||[];this.notificationTitle=a?translate("Payment failed"):translate("You're all set!");log("=== Payment intent retrieve status","info",{clientSecret:o,error:t,messages:s,status:n});r=new URL(window.location.href);r.searchParams.delete("payment_intent_client_secret");r.searchParams.delete("payment_intent");r.searchParams.delete("redirect_status");r.searchParams.delete("zonosCheckoutSessionId");window.history.replaceState({},"",r.toString());if(!(t&&(s===null||s===void 0?void 0:s.length)))return[3,2];submitGtag("zonos-checkout-payment-fail");void sendErrorLog({endpoint:"Stripe payment failed",errors:['Payment intent "'.concat(o.split("_secret_")[0]||o,'" status: ').concat(n," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});return[3,4];case 2:submitGtag("zonos-checkout-success");l=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:l,eventName:"checkout_orderCompleted"});i=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(i);return[4,this.handleSuccessBehavior()];case 3:c.sent();c.label=4;case 4:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkStagingOrderStatus=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:o.sent();stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkPaypalPaymentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:if(paypalStore.paypalErrorMessage){this.notificationType="error";this.notificationTitle=translate("Payment failed");this.notificationMessages=[paypalStore.paypalErrorMessage];this.isLoading=false;return[2]}this.isLoading=false;if(!paypalStore.orderIdCreated)return[3,2];submitGtag("zonos-checkout-success");o=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:o,eventName:"checkout_orderCompleted"});this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:e.sent();e.label=2;case 2:stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getReceiptUrl=function(o){var e=o.cartId;var t=new URL("".concat(window.location.origin,"/receipt"));t.searchParams.set("referenceId",e);var s=getIsTestMode();if(s){t.searchParams.set("zonosTestMode","1")}var n=new URLSearchParams(window.location.search).get("zonosQaUrl");if(n){t.searchParams.set("zonosQaUrl",n)}return t.toString()}}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}if(cartStore.isStagingMode){void this.checkStagingOrderStatus()}else if(paypalStore.orderIdCreated){void this.checkPaypalPaymentStatus()}else{void this.checkStripePaymentStatus()}};o.prototype.render=function(){var o=this;var e=window.Zonos.cartId;return h(Host,{key:"e145b7396302157ccb515c54f99e50faa8ba45e6",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&h("div",{key:"b9df4788f27c935ba7fc47e7c930cd162c8fbebe",class:"zonos--finish-details"},h("div",{key:"a510c995880c8698dc98390d0504b70333551c86",class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{"aria-label":"Order success",content:SuccessIcon,iconColor:"blue-800",size:50}):h("zonos-icon",{"aria-label":"Order failed",content:RemoveIcon,iconColor:"red-800",size:50}),h("zonos-text",{key:"8f84f87bf2365b85acffefe16e8b10cd9227a6e6",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&h("zonos-badge",{key:"0e3f3f71cae6262d6394ad2c5a6d656509b484d5",badgeColor:"gray"},this.confirmationId),h("zonos-text",{key:"c769f2ada1e6b421e373aeb4393560a21d6fcffc",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((function(o){return h(Fragment,null,o,h("br",null))}))),this.order&&e&&h("div",{key:"9972858fadd4d2d9c4f00e54921002ea04a5cc51",class:"zonos--button-container"},h("zonos-button",{key:"fe931a552fc1c43b29a1966736379c3c1d0536f6",onClick:function(){window.open(o.getReceiptUrl({cartId:e}),"_blank")},size:"lg",variant:"primary"},translate("View receipt"))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectFinish.style=ZonosCollectFinishStyle0;var Globe='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n';var ZonosWordmark='<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n';var zonosCollectFooterCss=":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{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";var ZonosCollectFooterStyle0=zonosCollectFooterCss;var ZonosCollectFooter=function(){function o(o){registerInstance(this,o);this.mobile=false;this.tablet=false;this.showLanguageDialog=false;this.isMobile=false;this.isTablet=false}o.prototype.handleGlobalClick=function(o){if(!this.el.contains(o.target)&&this.showLanguageDialog){this.showLanguageDialog=false}};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialog=!this.showLanguageDialog};o.prototype.handleMobileChange=function(){this.isMobile=isCollectMobile(this.mobile)};o.prototype.handleTabletChange=function(){this.isTablet=isCollectTablet(this.tablet)};o.prototype.componentWillLoad=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.render=function(){var o=this;var e;var t=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;var s="gray-1000";return h(Host,{key:"9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e",class:classes(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"250716798bf30901678b16e1ac159810f1d7a6ad",class:"zonos--collect-footer"},h("div",{key:"ab61803d4b5348b8978e7dfcb16a5733cca5dd29",class:"zonos--collect-locale-wrapper"},h("zonos-button",{key:"6c5dcd25d5ef73b2098269d840e291343d30cb81",buttonColor:s,class:"zonos--collect-footer-language-button",icon:h("zonos-icon",{"aria-label":"Language select",content:Globe,iconColor:s}),onClick:function(){return o.toggleLanguageDialog()},variant:"subtle"},t),h("div",{key:"d1a367cd19b36f1a0f49ccfe78e750218b50a03e",class:classes(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{key:"02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c",handleOnClose:function(){return o.toggleLanguageDialog()}}))),h("div",{key:"b713a78cbd3d3f131c6c473bb1d979899d40b13b",class:"zonos--collect-footer-icon-wrapper"},h("div",{key:"97eab5909d556f13fa2acc0628d583d49f13d3a2",class:"zonos--collect-footer-logo"},h("zonos-text",{key:"a6488e084f153305eed8d6f65341d7ab00297adb",textColor:s},"Powered by"),h("a",{key:"c63a6e1064dbd733add1cc3b1df1456484e2f103",href:"https://zonos.com",target:"_blank",title:"Zonos website"},h("zonos-icon",{key:"081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7",autoHeight:true,content:ZonosWordmark,size:42}))),h("div",{key:"0862a11838e62f425d38066230b01f445999d751",class:"dot"}),h("a",{key:"b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},h("zonos-text",{key:"a675218a36da83427c2ce517a15b1ed5ea5910d6",textColor:s},"Privacy policy")))))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}},enumerable:false,configurable:true});return o}();ZonosCollectFooter.style=ZonosCollectFooterStyle0;var ChevronDownIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var ChevronUpIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectOrderDetailsCss=":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";var ZonosCollectOrderDetailsStyle0=zonosCollectOrderDetailsCss;var ZonosCollectOrderDetails=function(){function o(o){registerInstance(this,o);this.collapseClicked=createEvent(this,"collapseClicked",7);this.mobile=true;this.landedCostId="";this.isMobile=false;this.collapseState=this.collapsed}o.prototype.handleCollapseChangeFromProp=function(o){this.collapseState=o};o.prototype.handleCollapseChange=function(o){this.collapseClicked.emit(o)};o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.componentWillLoad=function(){this.handleWindowResize()};o.prototype.renderShippingAddress=function(){if(collectStore.isFetchingShippingInfo){return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},h("zonos-skeleton",{skeletonWidth:"99px"})),h("div",{class:"zonos--collect-order-shipping-info"},h("zonos-skeleton",{skeletonWidth:"152px"}),h("zonos-h-stack",{spacing:8},h("zonos-skeleton",{skeletonWidth:"75px"}),h("zonos-skeleton",{skeletonWidth:"75px"})),h("zonos-skeleton",{skeletonWidth:"50px"})))}var o=collectStore.shippingAddress;if(!o){return null}return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Shipping address")),h("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((function(o){return h("zonos-text",null,o)}))))};o.prototype.render=function(){var o=this;var e=function(){if(o.collapseState){return h("zonos-icon",{"aria-label":"Collapse expanded section",content:ChevronDownIcon,iconColor:"gray-1200"})}return h("zonos-icon",{"aria-label":"Expand collapsed section",content:ChevronUpIcon,iconColor:"gray-1200"})};return h(Host,{class:classes(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--wrapper"},h("button",{class:"zonos--order-details-header",onClick:function(){o.collapseState=!o.collapseState},type:"button"},h("zonos-text",{type:"semiBoldLabel"},translate("Order details")),e()),h("div",{class:"zonos--order-details-wrapper"},h("zonos-collapse",{collapsed:this.collapseState},h("div",{class:"zonos--collect-order-details-content"},h("zonos-collect-cart-items",null),h("div",{class:"zonos--collect-order-info"},h("div",{class:"zonos--collect-order-details-row"},collectStore.amountTotalPaid!==null&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Total paid")),h("zonos-text",null,renderCheckoutCurrency({amount:collectStore.amountTotalPaid||0,isForeign:true}))),collectStore.originCompanyName&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Ordered from")),h("zonos-text",null,collectStore.originCompanyName||""))),this.renderShippingAddress()))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}},enumerable:false,configurable:true});return o}();ZonosCollectOrderDetails.style=ZonosCollectOrderDetailsStyle0;var CheckmarkLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var RemoveLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var zonosCollectPaymentCss=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-5px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";var ZonosCollectPaymentStyle0=zonosCollectPaymentCss;var ZonosCollectPayment=function(){function o(o){var e=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.paypalSessionFailed=createEvent(this,"paypalSessionFailed",7);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.storeUnsubscribeList=[];this.continueLoading=false;this.showErrorBanner=false;this.hasStripePaymentError=false;this.stagingOrderCreateErrorMessage="";this.internalContinueLoading=this.continueLoading;this.handleValidate=function(){var o;return!!((o=stripeStore.stripePaymentEventData)===null||o===void 0?void 0:o.complete)};this.continueClickHandler=function(o){return __awaiter(e,[o],void 0,(function(o){var e,t;var s=this;var n=o.currencyCode;return __generator(this,(function(o){if(!this.handleValidate()){void((e=stripeStore.stripeBillingAddressElement)===null||e===void 0?void 0:e.getValue());this.showErrorBanner=true;void((t=stripeStore.stripeElements)===null||t===void 0?void 0:t.submit());setTimeout((function(){var o;(o=s.ele.querySelector("zonos-banner"))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth"})}),10);return[2]}stripeStore.checkoutSettlementCurrency=n;submitGtag("zonos-checkout-payment-info");this.continueClicked.emit();return[2]}))}))};this.copyCardToClipboard=function(o){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,navigator.clipboard.writeText(o)];case 1:s.sent();return[3,3];case 2:e=s.sent();t=document.createElement("textarea");t.style.position="fixed";t.style.left="-1000px";t.style.top="-1000px";t.style.width="1px";t.style.height="1px";t.value=o;t.id="zonos-copy-card-number";document.body.appendChild(t);t.select();document.execCommand("copy");document.body.removeChild(t);return[3,3];case 3:window.Zonos.showNotification({message:translate("Card number copied to clipboard"),timeout:4e3,type:"success"});return[2]}}))}))};this.placeTestOrder=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:this.internalContinueLoading=true;return[4,placeTestOrder()];case 1:o=e.sent().errors;if(o.length){this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.";this.internalContinueLoading=false;return[2]}this.internalContinueLoading=false;cartStoreNextStep();return[2]}}))}))}}o.prototype.continueLoadingWatcher=function(){this.internalContinueLoading=this.continueLoading};o.prototype.stripePaymentErrorWatcher=function(){var o=this;if(this.hasStripePaymentError){setTimeout((function(){var e;(e=o.ele.querySelector("zonos-banner"))===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth"})}),50)}};o.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("currency",(function(){void paypalInitScript({currency:cartStore.currency})}))];void paypalInitScript({currency:cartStore.currency})};o.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;var e;this.hasStripePaymentError=stripeStore.hasPaymentError;if(!stripeStore.stripeElements){return null}if(!stripeStore.clientSecret){return null}if(this.showErrorBanner){this.showErrorBanner=!this.handleValidate()}var t=getIsTestMode();var s=cartStore.isStagingMode||getIsStagingMode();var n=((e=stripeStore.stripePaymentEventData)===null||e===void 0?void 0:e.value.type)==="external_paypal";var a=function(){if(s){var e=zonosStore.appearance.theme;return h(Fragment,null,o.stagingOrderCreateErrorMessage&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},o.stagingOrderCreateErrorMessage),h("zonos-empty-state-payment",{emptyStateText:translate("No payment method needed for staging"),theme:e}),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:o.submitBtnColor,loading:o.internalContinueLoading,onClick:function(){void o.placeTestOrder()},size:"lg",variant:o.submitBtnType},translate("Place test order"))))}if(stripeStore.isFetchingSession||collectStore.isFetchingShippingInfo){return null}return h(Fragment,null,o.showErrorBanner&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},translate("Missing required fields. Make sure all fields are completed.")),o.hasStripePaymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},stripeStore.customErrorMessage||translate("We couldn't complete your payment. Please verify the payment details and try again.")),paypalStore.paypalErrorMessage&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},paypalStore.paypalErrorMessage),h("zonos-payment",null),h("div",{class:"zonos--group-btn"},!n&&h(Fragment,null,h("zonos-button",{backgroundColor:o.submitBtnColor,bold:true,isDisabled:o.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",loading:o.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",onClick:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!cartStore.checkoutSession){log("Checkout session is not found");return[2]}return[4,this.continueClickHandler({currencyCode:cartStore.checkoutSession.subtotals.presentmentCurrencyCode})];case 1:o.sent();return[2]}}))}))},size:"lg",variant:o.submitBtnType},translate("Pay [orderTotal]",{orderTotal:renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})})),stripeStore.shouldRenderPayInUsdButton&&h("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:o.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",loading:o.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",onClick:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.continueClickHandler({currencyCode:"USD"})];case 1:o.sent();return[2]}}))}))},size:"lg",variant:"subtle"},translate("Click to pay in USD"))),h("zonos-paypal-payment",{onPaypalSessionDone:function(e){var t=e.detail.orderId;o.paypalSessionDone.emit(t)},onPaypalSessionFail:function(){return o.paypalSessionFailed.emit()},style:{display:n?"block":"none"}})),t&&h("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},h("zonos-v-stack",{spacing:16},h("div",null,h("zonos-text",{type:"semiBoldLabel"},translate("Test cards")),h("zonos-text",{textColor:"gray-700"},translate("Click to copy the card number. Use any future expiration date and three number CVC."))),h("zonos-button",{icon:h("zonos-icon",{content:CheckmarkLineIcon}),justifyContent:"flex-start",onClick:function(){return o.copyCardToClipboard("4242424242424242")}},translate("Success")," (****4242)"),h("zonos-button",{icon:h("zonos-icon",{content:RemoveLineIcon}),justifyContent:"flex-start",onClick:function(){return o.copyCardToClipboard("4000000000000002")}},translate("Failure")," (****0002)")),h("zonos-notification",null)))};return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),a()))};Object.defineProperty(o.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}},enumerable:false,configurable:true});return o}();ZonosCollectPayment.style=ZonosCollectPaymentStyle0;var zonosCollectReviewCss=':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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';var ZonosCollectReviewStyle0=zonosCollectReviewCss;var ZonosCollectReview=function(){function o(o){registerInstance(this,o);this.mobile=false;this.tablet=false;this.collapsed=false;this.isMobile=false;this.isTablet=false;this.isLoading=true}o.prototype.handleWindowResize=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.componentWillLoad=function(){var o=this;this.handleWindowResize();setTimeout((function(){o.isLoading=false}),1e3)};o.prototype.render=function(){var o=this.isMobile?"gray-1000":"gray-800";return h(Host,{key:"6432c5dd5afd628e33ba26385ecfecb470f1757e",class:classes(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"e4d113ff1268c36119e1f80164b6cfd702c67f75",class:"zonos--title"},h("zonos-text",{key:"aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1",textColor:o,type:"semiBoldLabel"},translate("Pay [organizationName]",{organizationName:zonosStore.organizationName}))),h("div",{key:"fcdaebc734a270742fbe21ff932550994e522ea6",class:"zonos--total-pay"},renderFallback({content:h("zonos-text",{type:"secondaryPageHeader"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectReview.style=ZonosCollectReviewStyle0;var zonosCollectSubtotalCss=":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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";var ZonosCollectSubtotalStyle0=zonosCollectSubtotalCss;var ZonosCollectSubtotal=function(){function o(o){var e=this;registerInstance(this,o);this.storeUnsubscribeList=[];this.subtotals={};this.initSubtotalData=function(){var o;var t;var s=(t=cartStore.checkoutSession)===null||t===void 0?void 0:t.subtotals;if(!s){return}var n=translate("Duties");var a=translate("Taxes");var r=translate("Fees");var l=(o={},o[n]=0,o[r]=0,o[a]=0,o);var i=s.duties;var c=s.taxes;var d=s.fees;if(i!==undefined){l[n]||(l[n]=0);l[n]+=i}if(c!==undefined){l[a]||(l[a]=0);l[a]+=c}if(d!==undefined){l[r]||(l[r]=0);l[r]+=d}e.subtotals=l}}o.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("checkoutSession",this.initSubtotalData),translationStoreOnChange("translatedChunks",this.initSubtotalData)]};o.prototype.render=function(){this.initSubtotalData();return h(Host,{key:"ab687a6e1ec67f6609081036a75e9905ff34c6b1",class:"zonos--collect-subtotal zonos--elements"},h("table",{key:"303b8c49983e9f7aea4d31400fed53d858eb078d",class:"zonos--collect-table"},!!this.subtotals[translate("Duties")]&&h("tr",{key:"a60fa4f1f1afacef0144b86c054f44572576f7af",class:"zonos--row zonos--collect-duty"},h("td",{key:"aeaf798e26bbd482196d7208eb05657a1d15dad8",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"835d817709ae3b7e2d888d618e0856fb2e637e4d",type:"semiBoldLabel"},translate("Duties"))),h("td",{key:"5bb47a115ea61fa897a3f48bbd10c5f78af3703e",class:"zonos--column"}),h("td",{key:"32632c4beb855ca687c615f5e6c63c82e2e05c80",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Duties")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Taxes")]&&h("tr",{key:"055bb237dafaea8de18b127641c8fd7e1ece563b",class:"zonos--row zonos--collect-tax"},h("td",{key:"1e73b140c2c9090ccfb91ce4efca483e8fb56e9e",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"a3375ecd77460c78c7c5f59bf7b9b8612cd53e41",type:"semiBoldLabel"},translate("Taxes"))),h("td",{key:"20685646be29873967c2f335c775046068248ad3",class:"zonos--column"}),h("td",{key:"2e2c6af2c1a7840df03351178ddf3107fcc36494",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Taxes")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Fees")]&&h("tr",{key:"8157aba5c6a23680b0bc681adc127747f01a2973",class:"zonos--row zonos--collect-fee"},h("td",{key:"8266654f9e65003f297222bb935013a8b9b3b430",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"8399000a5f61e4737764b68b89799b409dce6034",type:"semiBoldLabel"},translate("Fees"))),h("td",{key:"2a9763f2401967ea1bdfa2c17514d18e2a4e0db6",class:"zonos--column"}),h("td",{key:"ac2f275312c2ba69888e6e57dde8b4b451839b86",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Fees")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"a293d1b9342251f7326c1ac68e2bab83eae2ed80",class:"zonos--row zonos--collect-spacing"},h("td",{key:"c136b1b807f32dc21c131326d70500d2e2c64efe",class:"zonos--column",colSpan:3})),h("tr",{key:"59747101f1a9ef7c8fad60e90ea5b8c31015438c",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},h("td",{key:"96d201ba6f3e571adac265127229c94cdc96be2a",class:"zonos--column"}),h("td",{key:"f2f4cb751e35fc0ebaa803659f26a2314d8bf639",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441",type:"label"},translate("Subtotal"))),h("td",{key:"28b6aea6363b2bef1d072ad77f409ae77976305c",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"f0072cdd200e8483421265af39a90fb655fb2ef0",class:"zonos--row zonos--collect-total"},h("td",{key:"88a007048d33c919a6c5f87cf7cd071f83e7448b",class:"zonos--column"}),h("td",{key:"24bba9e9b81ff443dd5ca4832c3169e3605a93b8",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"594d4e96bec3a2153f6622c6842970ebee5bb463",type:"semiBoldLabel"},translate("Customs fees total"))),h("td",{key:"b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"semiBoldLabel"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectSubtotal.style=ZonosCollectSubtotalStyle0;export{ZonosCollectFinish as zonos_collect_finish,ZonosCollectFooter as zonos_collect_footer,ZonosCollectOrderDetails as zonos_collect_order_details,ZonosCollectPayment as zonos_collect_payment,ZonosCollectReview as zonos_collect_review,ZonosCollectSubtotal as zonos_collect_subtotal};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,s){function n(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,a){function r(o){try{i(s.next(o))}catch(o){a(o)}}function l(o){try{i(s["throw"](o))}catch(o){a(o)}}function i(o){o.done?t(o.value):n(o.value).then(r,l)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(o){return function(e){return i([o,e])}}function i(l){if(s)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(t=0)),t)try{if(s=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;n=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1];a=l;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(l);break}if(a[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];n=0}finally{s=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,e,t){if(t||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++){if(a||!(s in e)){if(!a)a=Array.prototype.slice.call(e,0,s);a[s]=e[s]}}return o.concat(a||Array.prototype.slice.call(e))};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,a as getElement}from"./index-55a03023.js";import{c as stripeStore,d as stripeStoreRetrievePayment,t as trackConversionEvent,H as stripeStoreResetPromoCode,y as stripeStoreReset,I as stripeStoreMessageBasedOnStatus,e as cartStore,r as cartStoreNextStep,z as cartStoreOnChange}from"./cart-c74f9aaa.js";import{s as submitGtag,c as paypalStoreReset,a as paypalStore,b as paypalInitScript}from"./paypal-bf3a2bdd.js";import{s as storageStore,l as localizationStore}from"./localization-106476cb.js";import{t as translate,b as translationStoreOnChange}from"./translationStore-766b7521.js";import{z as zonosStore}from"./zonosStore-e3d0493a.js";import{h as handleFetch,s as sendErrorLog,g as getIsTestMode,i as isCheckoutMobile,a as getIsStagingMode}from"./handleFetch-a844cac1.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-6281d902.js";import{l as log,b as allLogs}from"./VarianceTest-572cecf5.js";import{i as isCollectMobile,a as isCollectTablet,e as collectStore,r as renderFallback}from"./renderFallback-ce0e238a.js";import{c as classes}from"./classes-0d95c529.js";import{l as languages}from"./ILanguage-cd6acb72.js";import{r as renderCheckoutCurrency,p as placeTestOrder}from"./placeTestOrder-891295e8.js";import"./isDarkColor-83e0c27e.js";var RemoveIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-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" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-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" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectFinishCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";var ZonosCollectFinishStyle0=zonosCollectFinishCss;var MAX_RETRIES=30;var ZonosCollectFinish=function(){function o(o){var e=this;registerInstance(this,o);this.closeClick=createEvent(this,"closeClick",7);this.borderRadius="ROUNDED";this.confirmationId=null;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.notificationActionText=translate("Keep shopping");this.order=null;this.isWaitingToRedirect=true;this.pullOrder=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,n,a,r,l;return __generator(this,(function(i){switch(i.label){case 0:t=storageStore.checkoutSessionId;s=new URLSearchParams;s.set("checkoutSessionId",t||"");return[4,handleFetch("/api/zonos-elements/get-order?".concat(s.toString()))];case 1:n=i.sent(),a=n.baseUrl,r=n.errors,l=n.json;if(r.length||!(l===null||l===void 0?void 0:l.id)){return[2,{baseUrl:a,order:null}]}return[4,(e=(o=zonosStore.checkoutSettings).onOrderSuccess)===null||e===void 0?void 0:e.call(o,{zonosApiRoute:a,zonosOrder:l})];case 2:i.sent();return[2,{baseUrl:a,order:l}]}}))}))};this.handleSuccessBehavior=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.isLoading=false;return[4,this.getPullOrder()];case 1:o.sent();return[2]}}))}))};this.getPullOrder=function(){var o=[];for(var t=0;t<arguments.length;t++){o[t]=arguments[t]}return __awaiter(e,__spreadArray([],o,true),void 0,(function(o){var e,t,s,n,a,r,l,i;if(o===void 0){o=0}return __generator(this,(function(c){switch(c.label){case 0:if(o===0){log("=== Start to poll for order info","info")}return[4,this.pullOrder()];case 1:s=c.sent(),n=s.baseUrl,a=s.order;r=!!((t=(e=a===null||a===void 0?void 0:a.references)===null||e===void 0?void 0:e.find((function(o){return(o===null||o===void 0?void 0:o.key)==="zonosOrderNumber"})))===null||t===void 0?void 0:t.value);l=storageStore.checkoutSessionId;i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||MAX_RETRIES;log("=== Polling order (".concat(o," attemps)"),"info");if(!a)return[3,2];log("=== CollectOrder info found","info");if(o>10){void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l,"&orderId=").concat(a.id),errors:["Collect order found after ".concat(o," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",orderId:a.id,storeId:zonosStore.storeId}})}this.order=a;return[3,6];case 2:if(!((!a||!r)&&o<i))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:c.sent();return[4,this.getPullOrder(o+1)];case 4:c.sent();return[3,6];case 5:void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l),errors:["Collect order not found after ".concat(i," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",storeId:zonosStore.storeId}});c.label=6;case 6:return[2]}}))}))};this.checkStripePaymentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,n,a,r,l,i;return __generator(this,(function(c){switch(c.label){case 0:o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(o||this.storybookForceStatus))return[3,4];return[4,stripeStoreRetrievePayment({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:e=c.sent(),t=e.error,s=e.messages,n=e.status;a=n==="requires_action"||t;this.notificationType=a?"error":"success";this.notificationMessages=s||[];this.notificationTitle=a?translate("Payment failed"):translate("You're all set!");log("=== Payment intent retrieve status","info",{clientSecret:o,error:t,messages:s,status:n});r=new URL(window.location.href);r.searchParams.delete("payment_intent_client_secret");r.searchParams.delete("payment_intent");r.searchParams.delete("redirect_status");r.searchParams.delete("zonosCheckoutSessionId");window.history.replaceState({},"",r.toString());if(!(t&&(s===null||s===void 0?void 0:s.length)))return[3,2];submitGtag("zonos-checkout-payment-fail");void sendErrorLog({endpoint:"Stripe payment failed",errors:['Payment intent "'.concat(o.split("_secret_")[0]||o,'" status: ').concat(n," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});return[3,4];case 2:submitGtag("zonos-checkout-success");l=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:l,eventName:"checkout_orderCompleted"});i=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(i);return[4,this.handleSuccessBehavior()];case 3:c.sent();c.label=4;case 4:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkStagingOrderStatus=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:o.sent();stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkPaypalPaymentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:if(paypalStore.paypalErrorMessage){this.notificationType="error";this.notificationTitle=translate("Payment failed");this.notificationMessages=[paypalStore.paypalErrorMessage];this.isLoading=false;return[2]}this.isLoading=false;if(!paypalStore.orderIdCreated)return[3,2];submitGtag("zonos-checkout-success");o=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:o,eventName:"checkout_orderCompleted"});this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:e.sent();e.label=2;case 2:stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getReceiptUrl=function(o){var e=o.cartId;var t=new URL("".concat(window.location.origin,"/receipt"));t.searchParams.set("referenceId",e);var s=getIsTestMode();if(s){t.searchParams.set("zonosTestMode","1")}var n=new URLSearchParams(window.location.search).get("zonosQaUrl");if(n){t.searchParams.set("zonosQaUrl",n)}return t.toString()}}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}if(cartStore.isStagingMode){void this.checkStagingOrderStatus()}else if(paypalStore.orderIdCreated){void this.checkPaypalPaymentStatus()}else{void this.checkStripePaymentStatus()}};o.prototype.render=function(){var o=this;var e=window.Zonos.cartId;return h(Host,{key:"e145b7396302157ccb515c54f99e50faa8ba45e6",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&h("div",{key:"b9df4788f27c935ba7fc47e7c930cd162c8fbebe",class:"zonos--finish-details"},h("div",{key:"a510c995880c8698dc98390d0504b70333551c86",class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{"aria-label":"Order success",content:SuccessIcon,iconColor:"blue-800",size:50}):h("zonos-icon",{"aria-label":"Order failed",content:RemoveIcon,iconColor:"red-800",size:50}),h("zonos-text",{key:"8f84f87bf2365b85acffefe16e8b10cd9227a6e6",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&h("zonos-badge",{key:"0e3f3f71cae6262d6394ad2c5a6d656509b484d5",badgeColor:"gray"},this.confirmationId),h("zonos-text",{key:"c769f2ada1e6b421e373aeb4393560a21d6fcffc",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((function(o){return h(Fragment,null,o,h("br",null))}))),this.order&&e&&h("div",{key:"9972858fadd4d2d9c4f00e54921002ea04a5cc51",class:"zonos--button-container"},h("zonos-button",{key:"fe931a552fc1c43b29a1966736379c3c1d0536f6",onClick:function(){window.open(o.getReceiptUrl({cartId:e}),"_blank")},size:"lg",variant:"primary"},translate("View receipt"))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectFinish.style=ZonosCollectFinishStyle0;var Globe='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n';var ZonosWordmark='<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n';var zonosCollectFooterCss=":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{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";var ZonosCollectFooterStyle0=zonosCollectFooterCss;var ZonosCollectFooter=function(){function o(o){registerInstance(this,o);this.mobile=false;this.tablet=false;this.showLanguageDialog=false;this.isMobile=false;this.isTablet=false}o.prototype.handleGlobalClick=function(o){if(!this.el.contains(o.target)&&this.showLanguageDialog){this.showLanguageDialog=false}};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialog=!this.showLanguageDialog};o.prototype.handleMobileChange=function(){this.isMobile=isCollectMobile(this.mobile)};o.prototype.handleTabletChange=function(){this.isTablet=isCollectTablet(this.tablet)};o.prototype.componentWillLoad=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.render=function(){var o=this;var e;var t=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;var s="gray-1000";return h(Host,{key:"9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e",class:classes(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"250716798bf30901678b16e1ac159810f1d7a6ad",class:"zonos--collect-footer"},h("div",{key:"ab61803d4b5348b8978e7dfcb16a5733cca5dd29",class:"zonos--collect-locale-wrapper"},h("zonos-button",{key:"6c5dcd25d5ef73b2098269d840e291343d30cb81",buttonColor:s,class:"zonos--collect-footer-language-button",icon:h("zonos-icon",{"aria-label":"Language select",content:Globe,iconColor:s}),onClick:function(){return o.toggleLanguageDialog()},variant:"subtle"},t),h("div",{key:"d1a367cd19b36f1a0f49ccfe78e750218b50a03e",class:classes(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{key:"02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c",handleOnClose:function(){return o.toggleLanguageDialog()}}))),h("div",{key:"b713a78cbd3d3f131c6c473bb1d979899d40b13b",class:"zonos--collect-footer-icon-wrapper"},h("div",{key:"97eab5909d556f13fa2acc0628d583d49f13d3a2",class:"zonos--collect-footer-logo"},h("zonos-text",{key:"a6488e084f153305eed8d6f65341d7ab00297adb",textColor:s},"Powered by"),h("a",{key:"c63a6e1064dbd733add1cc3b1df1456484e2f103",href:"https://zonos.com",target:"_blank",title:"Zonos website"},h("zonos-icon",{key:"081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7",autoHeight:true,content:ZonosWordmark,size:42}))),h("div",{key:"0862a11838e62f425d38066230b01f445999d751",class:"dot"}),h("a",{key:"b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},h("zonos-text",{key:"a675218a36da83427c2ce517a15b1ed5ea5910d6",textColor:s},"Privacy policy")))))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}},enumerable:false,configurable:true});return o}();ZonosCollectFooter.style=ZonosCollectFooterStyle0;var ChevronDownIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var ChevronUpIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectOrderDetailsCss=":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";var ZonosCollectOrderDetailsStyle0=zonosCollectOrderDetailsCss;var ZonosCollectOrderDetails=function(){function o(o){registerInstance(this,o);this.collapseClicked=createEvent(this,"collapseClicked",7);this.mobile=true;this.landedCostId="";this.isMobile=false;this.collapseState=this.collapsed}o.prototype.handleCollapseChangeFromProp=function(o){this.collapseState=o};o.prototype.handleCollapseChange=function(o){this.collapseClicked.emit(o)};o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.componentWillLoad=function(){this.handleWindowResize()};o.prototype.renderShippingAddress=function(){if(collectStore.isFetchingShippingInfo){return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},h("zonos-skeleton",{skeletonWidth:"99px"})),h("div",{class:"zonos--collect-order-shipping-info"},h("zonos-skeleton",{skeletonWidth:"152px"}),h("zonos-h-stack",{spacing:8},h("zonos-skeleton",{skeletonWidth:"75px"}),h("zonos-skeleton",{skeletonWidth:"75px"})),h("zonos-skeleton",{skeletonWidth:"50px"})))}var o=collectStore.shippingAddress;if(!o){return null}return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Shipping address")),h("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((function(o){return h("zonos-text",null,o)}))))};o.prototype.render=function(){var o=this;var e=function(){if(o.collapseState){return h("zonos-icon",{"aria-label":"Collapse expanded section",content:ChevronDownIcon,iconColor:"gray-1200"})}return h("zonos-icon",{"aria-label":"Expand collapsed section",content:ChevronUpIcon,iconColor:"gray-1200"})};return h(Host,{class:classes(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--wrapper"},h("button",{class:"zonos--order-details-header",onClick:function(){o.collapseState=!o.collapseState},type:"button"},h("zonos-text",{type:"semiBoldLabel"},translate("Order details")),e()),h("div",{class:"zonos--order-details-wrapper"},h("zonos-collapse",{collapsed:this.collapseState},h("div",{class:"zonos--collect-order-details-content"},h("zonos-collect-cart-items",null),h("div",{class:"zonos--collect-order-info"},h("div",{class:"zonos--collect-order-details-row"},collectStore.amountTotalPaid!==null&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Total paid")),h("zonos-text",null,renderCheckoutCurrency({amount:collectStore.amountTotalPaid||0,isForeign:true}))),collectStore.originCompanyName&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Ordered from")),h("zonos-text",null,collectStore.originCompanyName||""))),this.renderShippingAddress()))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}},enumerable:false,configurable:true});return o}();ZonosCollectOrderDetails.style=ZonosCollectOrderDetailsStyle0;var CheckmarkLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var RemoveLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var zonosCollectPaymentCss=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-5px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";var ZonosCollectPaymentStyle0=zonosCollectPaymentCss;var ZonosCollectPayment=function(){function o(o){var e=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.paypalSessionFailed=createEvent(this,"paypalSessionFailed",7);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.storeUnsubscribeList=[];this.continueLoading=false;this.showErrorBanner=false;this.hasStripePaymentError=false;this.stagingOrderCreateErrorMessage="";this.internalContinueLoading=this.continueLoading;this.handleValidate=function(){var o;return!!((o=stripeStore.stripePaymentEventData)===null||o===void 0?void 0:o.complete)};this.continueClickHandler=function(o){return __awaiter(e,[o],void 0,(function(o){var e,t;var s=this;var n=o.currencyCode;return __generator(this,(function(o){if(!this.handleValidate()){void((e=stripeStore.stripeBillingAddressElement)===null||e===void 0?void 0:e.getValue());this.showErrorBanner=true;void((t=stripeStore.stripeElements)===null||t===void 0?void 0:t.submit());setTimeout((function(){var o;(o=s.ele.querySelector("zonos-banner"))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth"})}),10);return[2]}stripeStore.checkoutSettlementCurrency=n;submitGtag("zonos-checkout-payment-info");this.continueClicked.emit();return[2]}))}))};this.copyCardToClipboard=function(o){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,navigator.clipboard.writeText(o)];case 1:s.sent();return[3,3];case 2:e=s.sent();t=document.createElement("textarea");t.style.position="fixed";t.style.left="-1000px";t.style.top="-1000px";t.style.width="1px";t.style.height="1px";t.value=o;t.id="zonos-copy-card-number";document.body.appendChild(t);t.select();document.execCommand("copy");document.body.removeChild(t);return[3,3];case 3:window.Zonos.showNotification({message:translate("Card number copied to clipboard"),timeout:4e3,type:"success"});return[2]}}))}))};this.placeTestOrder=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:this.internalContinueLoading=true;return[4,placeTestOrder()];case 1:o=e.sent().errors;if(o.length){this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.";this.internalContinueLoading=false;return[2]}this.internalContinueLoading=false;cartStoreNextStep();return[2]}}))}))}}o.prototype.continueLoadingWatcher=function(){this.internalContinueLoading=this.continueLoading};o.prototype.stripePaymentErrorWatcher=function(){var o=this;if(this.hasStripePaymentError){setTimeout((function(){var e;(e=o.ele.querySelector("zonos-banner"))===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth"})}),50)}};o.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("currency",(function(){void paypalInitScript({currency:cartStore.currency})}))];void paypalInitScript({currency:cartStore.currency})};o.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;var e;this.hasStripePaymentError=stripeStore.hasPaymentError;if(!stripeStore.stripeElements){return null}if(!stripeStore.clientSecret){return null}if(this.showErrorBanner){this.showErrorBanner=!this.handleValidate()}var t=getIsTestMode();var s=cartStore.isStagingMode||getIsStagingMode();var n=((e=stripeStore.stripePaymentEventData)===null||e===void 0?void 0:e.value.type)==="external_paypal";var a=function(){if(s){var e=zonosStore.appearance.theme;return h(Fragment,null,o.stagingOrderCreateErrorMessage&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},o.stagingOrderCreateErrorMessage),h("zonos-empty-state-payment",{emptyStateText:translate("No payment method needed for staging"),theme:e}),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:o.submitBtnColor,loading:o.internalContinueLoading,onClick:function(){void o.placeTestOrder()},size:"lg",variant:o.submitBtnType},translate("Place test order"))))}if(stripeStore.isFetchingSession||collectStore.isFetchingShippingInfo){return null}return h(Fragment,null,o.showErrorBanner&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},translate("Missing required fields. Make sure all fields are completed.")),o.hasStripePaymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},stripeStore.customErrorMessage||translate("We couldn't complete your payment. Please verify the payment details and try again.")),paypalStore.paypalErrorMessage&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},paypalStore.paypalErrorMessage),h("zonos-payment",null),h("div",{class:"zonos--group-btn"},!n&&h(Fragment,null,h("zonos-button",{backgroundColor:o.submitBtnColor,bold:true,isDisabled:o.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",loading:o.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",onClick:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!cartStore.checkoutSession){log("Checkout session is not found");return[2]}return[4,this.continueClickHandler({currencyCode:cartStore.checkoutSession.subtotals.presentmentCurrencyCode})];case 1:o.sent();return[2]}}))}))},size:"lg",variant:o.submitBtnType},translate("Pay [orderTotal]",{orderTotal:renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})})),stripeStore.shouldRenderPayInUsdButton&&h("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:o.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",loading:o.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",onClick:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.continueClickHandler({currencyCode:"USD"})];case 1:o.sent();return[2]}}))}))},size:"lg",variant:"subtle"},translate("Click to pay in USD"))),h("zonos-paypal-payment",{onPaypalSessionDone:function(e){var t=e.detail.orderId;o.paypalSessionDone.emit(t)},onPaypalSessionFail:function(){return o.paypalSessionFailed.emit()},style:{display:n?"block":"none"}})),t&&h("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},h("zonos-v-stack",{spacing:16},h("div",null,h("zonos-text",{type:"semiBoldLabel"},translate("Test cards")),h("zonos-text",{textColor:"gray-700"},translate("Click to copy the card number. Use any future expiration date and three number CVC."))),h("zonos-button",{icon:h("zonos-icon",{content:CheckmarkLineIcon}),justifyContent:"flex-start",onClick:function(){return o.copyCardToClipboard("4242424242424242")}},translate("Success")," (****4242)"),h("zonos-button",{icon:h("zonos-icon",{content:RemoveLineIcon}),justifyContent:"flex-start",onClick:function(){return o.copyCardToClipboard("4000000000000002")}},translate("Failure")," (****0002)")),h("zonos-notification",null)))};return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),a()))};Object.defineProperty(o.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}},enumerable:false,configurable:true});return o}();ZonosCollectPayment.style=ZonosCollectPaymentStyle0;var zonosCollectReviewCss=':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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';var ZonosCollectReviewStyle0=zonosCollectReviewCss;var ZonosCollectReview=function(){function o(o){registerInstance(this,o);this.mobile=false;this.tablet=false;this.collapsed=false;this.isMobile=false;this.isTablet=false;this.isLoading=true}o.prototype.handleWindowResize=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.componentWillLoad=function(){var o=this;this.handleWindowResize();setTimeout((function(){o.isLoading=false}),1e3)};o.prototype.render=function(){var o=this.isMobile?"gray-1000":"gray-800";return h(Host,{key:"6432c5dd5afd628e33ba26385ecfecb470f1757e",class:classes(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"e4d113ff1268c36119e1f80164b6cfd702c67f75",class:"zonos--title"},h("zonos-text",{key:"aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1",textColor:o,type:"semiBoldLabel"},translate("Pay [organizationName]",{organizationName:zonosStore.organizationName}))),h("div",{key:"fcdaebc734a270742fbe21ff932550994e522ea6",class:"zonos--total-pay"},renderFallback({content:h("zonos-text",{type:"secondaryPageHeader"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectReview.style=ZonosCollectReviewStyle0;var zonosCollectSubtotalCss=":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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";var ZonosCollectSubtotalStyle0=zonosCollectSubtotalCss;var ZonosCollectSubtotal=function(){function o(o){var e=this;registerInstance(this,o);this.storeUnsubscribeList=[];this.subtotals={};this.initSubtotalData=function(){var o;var t;var s=(t=cartStore.checkoutSession)===null||t===void 0?void 0:t.subtotals;if(!s){return}var n=translate("Duties");var a=translate("Taxes");var r=translate("Fees");var l=(o={},o[n]=0,o[r]=0,o[a]=0,o);var i=s.duties;var c=s.taxes;var d=s.fees;if(i!==undefined){l[n]||(l[n]=0);l[n]+=i}if(c!==undefined){l[a]||(l[a]=0);l[a]+=c}if(d!==undefined){l[r]||(l[r]=0);l[r]+=d}e.subtotals=l}}o.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("checkoutSession",this.initSubtotalData),translationStoreOnChange("translatedChunks",this.initSubtotalData)]};o.prototype.render=function(){this.initSubtotalData();return h(Host,{key:"ab687a6e1ec67f6609081036a75e9905ff34c6b1",class:"zonos--collect-subtotal zonos--elements"},h("table",{key:"303b8c49983e9f7aea4d31400fed53d858eb078d",class:"zonos--collect-table"},!!this.subtotals[translate("Duties")]&&h("tr",{key:"a60fa4f1f1afacef0144b86c054f44572576f7af",class:"zonos--row zonos--collect-duty"},h("td",{key:"aeaf798e26bbd482196d7208eb05657a1d15dad8",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"835d817709ae3b7e2d888d618e0856fb2e637e4d",type:"semiBoldLabel"},translate("Duties"))),h("td",{key:"5bb47a115ea61fa897a3f48bbd10c5f78af3703e",class:"zonos--column"}),h("td",{key:"32632c4beb855ca687c615f5e6c63c82e2e05c80",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Duties")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Taxes")]&&h("tr",{key:"055bb237dafaea8de18b127641c8fd7e1ece563b",class:"zonos--row zonos--collect-tax"},h("td",{key:"1e73b140c2c9090ccfb91ce4efca483e8fb56e9e",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"a3375ecd77460c78c7c5f59bf7b9b8612cd53e41",type:"semiBoldLabel"},translate("Taxes"))),h("td",{key:"20685646be29873967c2f335c775046068248ad3",class:"zonos--column"}),h("td",{key:"2e2c6af2c1a7840df03351178ddf3107fcc36494",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Taxes")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Fees")]&&h("tr",{key:"8157aba5c6a23680b0bc681adc127747f01a2973",class:"zonos--row zonos--collect-fee"},h("td",{key:"8266654f9e65003f297222bb935013a8b9b3b430",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"8399000a5f61e4737764b68b89799b409dce6034",type:"semiBoldLabel"},translate("Fees"))),h("td",{key:"2a9763f2401967ea1bdfa2c17514d18e2a4e0db6",class:"zonos--column"}),h("td",{key:"ac2f275312c2ba69888e6e57dde8b4b451839b86",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Fees")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"a293d1b9342251f7326c1ac68e2bab83eae2ed80",class:"zonos--row zonos--collect-spacing"},h("td",{key:"c136b1b807f32dc21c131326d70500d2e2c64efe",class:"zonos--column",colSpan:3})),h("tr",{key:"59747101f1a9ef7c8fad60e90ea5b8c31015438c",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},h("td",{key:"96d201ba6f3e571adac265127229c94cdc96be2a",class:"zonos--column"}),h("td",{key:"f2f4cb751e35fc0ebaa803659f26a2314d8bf639",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441",type:"label"},translate("Subtotal"))),h("td",{key:"28b6aea6363b2bef1d072ad77f409ae77976305c",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"f0072cdd200e8483421265af39a90fb655fb2ef0",class:"zonos--row zonos--collect-total"},h("td",{key:"88a007048d33c919a6c5f87cf7cd071f83e7448b",class:"zonos--column"}),h("td",{key:"24bba9e9b81ff443dd5ca4832c3169e3605a93b8",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"594d4e96bec3a2153f6622c6842970ebee5bb463",type:"semiBoldLabel"},translate("Customs fees total"))),h("td",{key:"b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"semiBoldLabel"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectSubtotal.style=ZonosCollectSubtotalStyle0;export{ZonosCollectFinish as zonos_collect_finish,ZonosCollectFooter as zonos_collect_footer,ZonosCollectOrderDetails as zonos_collect_order_details,ZonosCollectPayment as zonos_collect_payment,ZonosCollectReview as zonos_collect_review,ZonosCollectSubtotal as zonos_collect_subtotal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,s){function c(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,n){function l(o){try{i(s.next(o))}catch(o){n(o)}}function r(o){try{i(s["throw"](o))}catch(o){n(o)}}function i(o){o.done?t(o.value):c(o.value).then(l,r)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,c,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(o){return function(e){return i([o,e])}}function i(r){if(s)throw new TypeError("Generator is already executing.");while(l&&(l=0,r[0]&&(t=0)),t)try{if(s=1,c&&(n=r[0]&2?c["return"]:r[0]?c["throw"]||((n=c["return"])&&n.call(c),0):c.next)&&!(n=n.call(c,r[1])).done)return n;if(c=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;c=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){t.label=r[1];break}if(r[0]===6&&t.label<n[1]){t.label=n[1];n=r;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(r);break}if(n[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];c=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,F as Fragment}from"./index-55a03023.js";import{c as stripeStore,i as initStripeElements,d as stripeStoreRetrievePayment,e as cartStore,o as cartStoreUpdateToErrorState,f as cartStoreUpdateItems,k as stripeStoreInitCheckoutSession,l as stripeStoreGetPaymentIntent,u as stripeStoreUpdateCheckoutSessionBaseCurrency,w as stripeStoreConfirmPayment,A as stripeStoreOnChange,y as stripeStoreReset,g as cartStoreReset}from"./cart-11b87221.js";import{i as isCollectMobile,a as isCollectTablet,c as collectStoreUpdateSelectedShippingOption,b as collectStoreInitShippingInfo,d as collectStoreAsyncAddressUpdate,e as collectStore,r as renderFallback}from"./renderFallback-28ef3364.js";import{p as paypalStoreHasPaypalEnabled,a as paypalStore}from"./paypal-338a4350.js";import{s as storageStore,c as localizationStoreOnChange,d as currencyFormat,l as localizationStore}from"./localization-9320a65d.js";import{t as translate}from"./translationStore-7eebaa41.js";import{z as zonosStore}from"./zonosStore-e3d0493a.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-c4488f73.js";import{h as handleFetch,s as sendErrorLog,l as logError,g as getIsTestMode}from"./handleFetch-a844cac1.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./isDarkColor-83e0c27e.js";import"./getBorderRadius-6281d902.js";var ChevronDownIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectCss=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var ZonosCollectStyle0=zonosCollectCss;var ZonosCollect=function(){function o(o){var e=this;registerInstance(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=cartStore.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=zonosStore.appearance.theme;return[4,initStripeElements({overrideTheme:this.isMobile?o:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");c=t.get("zonosCheckoutSessionId");log("Payment intent exist, checking stripe payment intent status");if(!s){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,stripeStoreRetrievePayment({clientSecret:s})];case 1:n=d.sent(),l=n.error,r=n.status;i=new URLSearchParams(window.location.search).get("redirect_status");if(!(i&&c))return[3,3];if(!l){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(c)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;storageStore.checkoutSessionId=c;stripeStore.clientSecret=s;void this.setToFinishStep(r);return[2,{shouldAllowOrder:false}];case 3:if(!e){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){stripeStore.stripe=window.Zonos.stripe;cartStore.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a,d,z,h,u,f,p,m,g,b,v,w,x,S;return __generator(this,(function(y){switch(y.label){case 0:if(!window.Zonos.cartData){return[2]}z=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(z){cartStore.currency=z}h=(s=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||s===void 0?void 0:s.checkoutSessionId;u=(n=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.references)===null||n===void 0?void 0:n.landedCostId;if(!u){cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[2]}if(h){log("Setting checkout session id from cart reference","info",h);storageStore.checkoutSessionId=h}else{log("Clear checkout session id from storage so we start from a fresh session for the collect cart");storageStore.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:f=y.sent().shouldAllowOrder;if(!f){return[2]}y.label=2;case 2:y.trys.push([2,11,,12]);p=buildCartItemsByTempCart(window.Zonos.cartData),m=p.adjustments,g=p.cartItems;return[4,cartStoreUpdateItems({adjustments:m,cartItems:g,landedCostId:u,shouldInitSessionOnFailure:false})];case 3:y.sent();if(!(!storageStore.checkoutSessionId&&!h))return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:b=y.sent();log("stripeStoreInitCheckoutSession: ".concat(b));if(!b){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}y.label=5;case 5:if(!((!cartStore.checkoutSession||((l=cartStore.checkoutSession)===null||l===void 0?void 0:l.completedAt))&&h))return[3,9];return[4,this.fetchCheckoutSession(h)];case 6:v=y.sent();this.confirmationId=((r=v===null||v===void 0?void 0:v.checkoutSession.landedCost)===null||r===void 0?void 0:r.shortId)||null;if(!!(v===null||v===void 0?void 0:v.checkoutSession.completedAt)){void this.setToFinishStep("succeeded");return[2]}if(!(v===null||v===void 0?void 0:v.checkoutSession.clientSecret))return[3,8];return[4,stripeStoreRetrievePayment({clientSecret:v.checkoutSession.clientSecret})];case 7:w=y.sent().status;if(w==="processing"||w==="succeeded"){void this.setToFinishStep(w);return[2]}y.label=8;case 8:void sendErrorLog({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:h,cartId:(i=window.Zonos.cartData)===null||i===void 0?void 0:i.id,cartLandedCostId:u}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 9:if(!cartStore.checkoutSession){void sendErrorLog({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:h||"N/A",cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:u||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}void stripeStoreGetPaymentIntent();x=(d=cartStore.checkoutSession)===null||d===void 0?void 0:d.landedCost;if(!x){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,collectStoreUpdateSelectedShippingOption(Object.assign(Object.assign({},cartStore.checkoutSession),{id:storageStore.checkoutSessionId||""}))];case 10:y.sent();void collectStoreInitShippingInfo({landedCostId:x.id});void this.applyStripeTheme();return[3,12];case 11:S=y.sent();logError(S);cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[3,12];case 12:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i;return __generator(this,(function(a){switch(a.label){case 0:void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector("zonos-link-authentication");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){n=document.querySelector(".zonos--billing-address");n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth"});return[2]}l=stripeStore.checkoutSettlementCurrency==="USD";if(l&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:r=a.sent();if(!r){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,collectStoreAsyncAddressUpdate()];case 2:a.sent();a.label=3;case 3:a.trys.push([3,5,,6]);return[4,stripeStoreConfirmPayment({noLandedCostCheck:true})];case 4:a.sent();cartStore.step="finish";this.confirmationId=collectStore.landedCostShortId||((s=cartStore.selectedLandedCost)===null||s===void 0?void 0:s.landedCostId)||null;return[2];case 5:i=a.sent();logError(i);stripeStore.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;stripeStore.stripe=window.Zonos.stripe;cartStore.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[stripeStoreOnChange("clientSecret",(function(){void o.applyStripeTheme()})),localizationStoreOnChange("selectedLocale",(function(){void o.applyStripeTheme()}))];log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var t=zonosStore.appearance,s=t.logoUrl,c=t.theme;var n=function(){var o="".concat(s,"?timestamp=").concat(Date.now());return h("div",{class:"zonos--logo"},o&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:o}))};var l=getIsTestMode();var r=function(){var e;var t=new URLSearchParams(window.location.search);var s=t.get("zonosQaUrl");var c=t.get("zonosDebug");var r=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;return h(Fragment,null,h("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},h("div",{class:"zonos--logo-wrapper"},n(),l&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),c==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),s&&h("zonos-badge",{badgeColor:"purple",size:"small"},s)),h("div",{class:"zonos--header-right"},h("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,h("zonos-icon",{"aria-label":"Language select",content:ChevronDownIcon,iconColor:"gray-1200"})),h("div",{class:classes(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),renderFallback({content:h("zonos-text",{class:"zonos--header-title",type:"header"},collectStore.originCompanyName?translate("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:collectStore.originCompanyName}):translate("Customs charges from your recent purchase are available for payment")),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var i=function(){if(o.isOverlayLoading||stripeStore.isFetchingSession){return null}return h("div",{class:"zonos--content"},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,(o.isMobile||o.isTablet)&&r(),h("div",{class:"zonos--left","data-theme":c},!o.isMobile&&!o.isTablet&&r(),h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Billing info")),h("zonos-v-stack",{spacing:16},h("zonos-link-authentication",{titleText:""}),h("zonos-address",{titleText:"",type:"billing"})),h("zonos-collect-payment",{class:classes(["zonos--collect-container"]),continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),h("div",{class:"zonos--right","data-theme":c},h("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),h("div",{class:"zonos--order-details-container"},h("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),h("div",{class:"flex--wrapper"},h("zonos-v-stack",{spacing:16},h("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet})))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":c},h("div",{class:"zonos--header"},n()),h("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||cartStore.step==="finish"||cartStore.step==="error")&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet}))};return h(Host,{class:classes(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},i(),e&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),h("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollect.style=ZonosCollectStyle0;export{ZonosCollect as zonos_collect};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,s){function c(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,n){function l(o){try{i(s.next(o))}catch(o){n(o)}}function r(o){try{i(s["throw"](o))}catch(o){n(o)}}function i(o){o.done?t(o.value):c(o.value).then(l,r)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,c,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(o){return function(e){return i([o,e])}}function i(r){if(s)throw new TypeError("Generator is already executing.");while(l&&(l=0,r[0]&&(t=0)),t)try{if(s=1,c&&(n=r[0]&2?c["return"]:r[0]?c["throw"]||((n=c["return"])&&n.call(c),0):c.next)&&!(n=n.call(c,r[1])).done)return n;if(c=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;c=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){t.label=r[1];break}if(r[0]===6&&t.label<n[1]){t.label=n[1];n=r;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(r);break}if(n[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];c=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,F as Fragment}from"./index-55a03023.js";import{c as stripeStore,i as initStripeElements,d as stripeStoreRetrievePayment,e as cartStore,o as cartStoreUpdateToErrorState,f as cartStoreUpdateItems,k as stripeStoreInitCheckoutSession,l as stripeStoreGetPaymentIntent,u as stripeStoreUpdateCheckoutSessionBaseCurrency,w as stripeStoreConfirmPayment,B as stripeStoreOnChange,y as stripeStoreReset,g as cartStoreReset}from"./cart-c74f9aaa.js";import{i as isCollectMobile,a as isCollectTablet,c as collectStoreUpdateSelectedShippingOption,b as collectStoreInitShippingInfo,d as collectStoreAsyncAddressUpdate,e as collectStore,r as renderFallback}from"./renderFallback-ce0e238a.js";import{p as paypalStoreHasPaypalEnabled,a as paypalStore}from"./paypal-bf3a2bdd.js";import{s as storageStore,c as localizationStoreOnChange,d as currencyFormat,l as localizationStore}from"./localization-106476cb.js";import{t as translate}from"./translationStore-766b7521.js";import{z as zonosStore}from"./zonosStore-e3d0493a.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-c4488f73.js";import{h as handleFetch,s as sendErrorLog,l as logError,g as getIsTestMode}from"./handleFetch-a844cac1.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./isDarkColor-83e0c27e.js";import"./getBorderRadius-6281d902.js";var ChevronDownIcon='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectCss=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var ZonosCollectStyle0=zonosCollectCss;var ZonosCollect=function(){function o(o){var e=this;registerInstance(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=cartStore.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=zonosStore.appearance.theme;return[4,initStripeElements({overrideTheme:this.isMobile?o:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");c=t.get("zonosCheckoutSessionId");log("Payment intent exist, checking stripe payment intent status");if(!s){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,stripeStoreRetrievePayment({clientSecret:s})];case 1:n=d.sent(),l=n.error,r=n.status;i=new URLSearchParams(window.location.search).get("redirect_status");if(!(i&&c))return[3,3];if(!l){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(c)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;storageStore.checkoutSessionId=c;stripeStore.clientSecret=s;void this.setToFinishStep(r);return[2,{shouldAllowOrder:false}];case 3:if(!e){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){stripeStore.stripe=window.Zonos.stripe;cartStore.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a,d,z,h,u,f,p,m,g,b,v,w,x,S;return __generator(this,(function(y){switch(y.label){case 0:if(!window.Zonos.cartData){return[2]}z=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(z){cartStore.currency=z}h=(s=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||s===void 0?void 0:s.checkoutSessionId;u=(n=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.references)===null||n===void 0?void 0:n.landedCostId;if(!u){cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[2]}if(h){log("Setting checkout session id from cart reference","info",h);storageStore.checkoutSessionId=h}else{log("Clear checkout session id from storage so we start from a fresh session for the collect cart");storageStore.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:f=y.sent().shouldAllowOrder;if(!f){return[2]}y.label=2;case 2:y.trys.push([2,11,,12]);p=buildCartItemsByTempCart(window.Zonos.cartData),m=p.adjustments,g=p.cartItems;return[4,cartStoreUpdateItems({adjustments:m,cartItems:g,landedCostId:u,shouldInitSessionOnFailure:false})];case 3:y.sent();if(!(!storageStore.checkoutSessionId&&!h))return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:b=y.sent();log("stripeStoreInitCheckoutSession: ".concat(b));if(!b){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}y.label=5;case 5:if(!((!cartStore.checkoutSession||((l=cartStore.checkoutSession)===null||l===void 0?void 0:l.completedAt))&&h))return[3,9];return[4,this.fetchCheckoutSession(h)];case 6:v=y.sent();this.confirmationId=((r=v===null||v===void 0?void 0:v.checkoutSession.landedCost)===null||r===void 0?void 0:r.shortId)||null;if(!!(v===null||v===void 0?void 0:v.checkoutSession.completedAt)){void this.setToFinishStep("succeeded");return[2]}if(!(v===null||v===void 0?void 0:v.checkoutSession.clientSecret))return[3,8];return[4,stripeStoreRetrievePayment({clientSecret:v.checkoutSession.clientSecret})];case 7:w=y.sent().status;if(w==="processing"||w==="succeeded"){void this.setToFinishStep(w);return[2]}y.label=8;case 8:void sendErrorLog({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:h,cartId:(i=window.Zonos.cartData)===null||i===void 0?void 0:i.id,cartLandedCostId:u}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 9:if(!cartStore.checkoutSession){void sendErrorLog({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:h||"N/A",cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:u||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}void stripeStoreGetPaymentIntent();x=(d=cartStore.checkoutSession)===null||d===void 0?void 0:d.landedCost;if(!x){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,collectStoreUpdateSelectedShippingOption(Object.assign(Object.assign({},cartStore.checkoutSession),{id:storageStore.checkoutSessionId||""}))];case 10:y.sent();void collectStoreInitShippingInfo({landedCostId:x.id});void this.applyStripeTheme();return[3,12];case 11:S=y.sent();logError(S);cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[3,12];case 12:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i;return __generator(this,(function(a){switch(a.label){case 0:void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector("zonos-link-authentication");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){n=document.querySelector(".zonos--billing-address");n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth"});return[2]}l=stripeStore.checkoutSettlementCurrency==="USD";if(l&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:r=a.sent();if(!r){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,collectStoreAsyncAddressUpdate()];case 2:a.sent();a.label=3;case 3:a.trys.push([3,5,,6]);return[4,stripeStoreConfirmPayment({noLandedCostCheck:true})];case 4:a.sent();cartStore.step="finish";this.confirmationId=collectStore.landedCostShortId||((s=cartStore.selectedLandedCost)===null||s===void 0?void 0:s.landedCostId)||null;return[2];case 5:i=a.sent();logError(i);stripeStore.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;stripeStore.stripe=window.Zonos.stripe;cartStore.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[stripeStoreOnChange("clientSecret",(function(){void o.applyStripeTheme()})),localizationStoreOnChange("selectedLocale",(function(){void o.applyStripeTheme()}))];log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var t=zonosStore.appearance,s=t.logoUrl,c=t.theme;var n=function(){var o="".concat(s,"?timestamp=").concat(Date.now());return h("div",{class:"zonos--logo"},o&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:o}))};var l=getIsTestMode();var r=function(){var e;var t=new URLSearchParams(window.location.search);var s=t.get("zonosQaUrl");var c=t.get("zonosDebug");var r=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;return h(Fragment,null,h("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},h("div",{class:"zonos--logo-wrapper"},n(),l&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),c==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),s&&h("zonos-badge",{badgeColor:"purple",size:"small"},s)),h("div",{class:"zonos--header-right"},h("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,h("zonos-icon",{"aria-label":"Language select",content:ChevronDownIcon,iconColor:"gray-1200"})),h("div",{class:classes(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),renderFallback({content:h("zonos-text",{class:"zonos--header-title",type:"header"},collectStore.originCompanyName?translate("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:collectStore.originCompanyName}):translate("Customs charges from your recent purchase are available for payment")),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var i=function(){if(o.isOverlayLoading||stripeStore.isFetchingSession){return null}return h("div",{class:"zonos--content"},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,(o.isMobile||o.isTablet)&&r(),h("div",{class:"zonos--left","data-theme":c},!o.isMobile&&!o.isTablet&&r(),h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Billing info")),h("zonos-v-stack",{spacing:16},h("zonos-link-authentication",{titleText:""}),h("zonos-address",{titleText:"",type:"billing"})),h("zonos-collect-payment",{class:classes(["zonos--collect-container"]),continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),h("div",{class:"zonos--right","data-theme":c},h("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),h("div",{class:"zonos--order-details-container"},h("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),h("div",{class:"flex--wrapper"},h("zonos-v-stack",{spacing:16},h("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet})))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":c},h("div",{class:"zonos--header"},n()),h("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||cartStore.step==="finish"||cartStore.step==="error")&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet}))};return h(Host,{class:classes(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},i(),e&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),h("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollect.style=ZonosCollectStyle0;export{ZonosCollect as zonos_collect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-55a03023.js";import{t as translate}from"./translationStore-7eebaa41.js";import{g as getZonosStoreTheme,f as zonosStoreFontFamily,z as zonosStore}from"./zonosStore-e3d0493a.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-6281d902.js";import"./VarianceTest-572cecf5.js";var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=":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--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-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)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);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 .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var ZonosConfirmDialogStyle0=zonosConfirmDialogCss;var ZonosConfirmDialog=function(){function o(o){var e=this;registerInstance(this,o);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);this.dialogTitle=translate("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeDialogHandler()}};o.prototype.focusDialog=function(){var o=this;if(this.dialogOpen){setTimeout((function(){var e,t;(t=(e=o.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||t===void 0?void 0:t.focus()}),100)}};o.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};o.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};o.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};o.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};o.prototype.render=function(){var o=this;this.focusDialog();var e=getBorderRadius();var t=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"c9eabf497f7e23ae201e6310e5ecb9f0d7068294",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":t,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"a9a525bfe764bf93e8725d9a00c069455de72ed6",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"072ab68e501618b640ffce6c6e8e96096966e09d",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return o.clickOutsideDialogHandler(e)}},h("div",{key:"3ab415f1cbc2bc36af01d67b279e732480de8685",class:"zonos--confirm-dialog",onBlur:function(){o.focusDialog()}},h("div",{key:"a1d99558318371c0e5ee95a9578a6de31a6fc27a",class:"wrapper"},h("div",{key:"3fd7fbc90c430a3e1496e5b0347947c1929aa6ed",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"5584080e0f0a5a756b0cc2ac761e0e18c864afcd",class:"content"},h("div",{key:"4a2070c137636193d05ded090fea26f05aada887",class:"title"},h("zonos-text",{key:"ab4c773f4af1271f5615a28f6a6193460330f16b",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"05a445dc37e754c99ea6727ae2bf861d42d5c2c4",class:"subtitle"},h("zonos-text",{key:"a7563f9fd3b405653487542e1b7a1f6aeab01893",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"812e9e43fdb6d10ed62da8138e344b0243ca5c34",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"07d7dc9d1a4bca9cb1ee420a4fed82e9fc513bd9",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return o.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"b607a5244dc39869b6d40cd361d9dee4686858a7",class:"confirm-button",onClick:function(){return o.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosConfirmDialog.style=ZonosConfirmDialogStyle0;var zonosLoadingOverlayCss=":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{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var ZonosLoadingOverlayStyle0=zonosLoadingOverlayCss;var ZonosLoadingOverlay=function(){function o(o){registerInstance(this,o);this.open=false;this.size=40}o.prototype.render=function(){return h(Host,{key:"1eb7313add29219032d8301abaf55ace726a3309",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"df9960e78817a9a98006fed7e87c5441f220f496",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"32795fe2c626add5d2f53032ea9b5b8d528bef38",size:this.size,spinnerColor:this.spinnerColor})))};return o}();ZonosLoadingOverlay.style=ZonosLoadingOverlayStyle0;export{ZonosConfirmDialog as zonos_confirm_dialog,ZonosLoadingOverlay as zonos_loading_overlay};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-55a03023.js";import{t as translate}from"./translationStore-766b7521.js";import{g as getZonosStoreTheme,f as zonosStoreFontFamily,z as zonosStore}from"./zonosStore-e3d0493a.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-6281d902.js";import"./VarianceTest-572cecf5.js";var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=":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--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-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)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);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 .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var ZonosConfirmDialogStyle0=zonosConfirmDialogCss;var ZonosConfirmDialog=function(){function o(o){var e=this;registerInstance(this,o);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);this.dialogTitle=translate("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeDialogHandler()}};o.prototype.focusDialog=function(){var o=this;if(this.dialogOpen){setTimeout((function(){var e,t;(t=(e=o.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||t===void 0?void 0:t.focus()}),100)}};o.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};o.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};o.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};o.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};o.prototype.render=function(){var o=this;this.focusDialog();var e=getBorderRadius();var t=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"c9eabf497f7e23ae201e6310e5ecb9f0d7068294",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":t,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"a9a525bfe764bf93e8725d9a00c069455de72ed6",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"072ab68e501618b640ffce6c6e8e96096966e09d",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return o.clickOutsideDialogHandler(e)}},h("div",{key:"3ab415f1cbc2bc36af01d67b279e732480de8685",class:"zonos--confirm-dialog",onBlur:function(){o.focusDialog()}},h("div",{key:"a1d99558318371c0e5ee95a9578a6de31a6fc27a",class:"wrapper"},h("div",{key:"3fd7fbc90c430a3e1496e5b0347947c1929aa6ed",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"5584080e0f0a5a756b0cc2ac761e0e18c864afcd",class:"content"},h("div",{key:"4a2070c137636193d05ded090fea26f05aada887",class:"title"},h("zonos-text",{key:"ab4c773f4af1271f5615a28f6a6193460330f16b",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"05a445dc37e754c99ea6727ae2bf861d42d5c2c4",class:"subtitle"},h("zonos-text",{key:"a7563f9fd3b405653487542e1b7a1f6aeab01893",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"812e9e43fdb6d10ed62da8138e344b0243ca5c34",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"07d7dc9d1a4bca9cb1ee420a4fed82e9fc513bd9",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return o.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"b607a5244dc39869b6d40cd361d9dee4686858a7",class:"confirm-button",onClick:function(){return o.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosConfirmDialog.style=ZonosConfirmDialogStyle0;var zonosLoadingOverlayCss=":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{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var ZonosLoadingOverlayStyle0=zonosLoadingOverlayCss;var ZonosLoadingOverlay=function(){function o(o){registerInstance(this,o);this.open=false;this.size=40}o.prototype.render=function(){return h(Host,{key:"1eb7313add29219032d8301abaf55ace726a3309",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"df9960e78817a9a98006fed7e87c5441f220f496",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"32795fe2c626add5d2f53032ea9b5b8d528bef38",size:this.size,spinnerColor:this.spinnerColor})))};return o}();ZonosLoadingOverlay.style=ZonosLoadingOverlayStyle0;export{ZonosConfirmDialog as zonos_confirm_dialog,ZonosLoadingOverlay as zonos_loading_overlay};
|