@zonos/elements 1.3.139 → 1.3.141
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-0070bff2.js → cart-e1b59d03.js} +180 -1
- package/dist/cjs/index.cjs.js +41 -13
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-7c8a99b0.js → paypal-86cc51e4.js} +13 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +49 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +24 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -2
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +11 -4
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +1 -1
- package/dist/collection/components/store/checkout/paypal.js +14 -1
- package/dist/collection/components/store/checkout/stripe.js +9 -0
- package/dist/collection/components/store/hello/localization.js +3 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +6 -0
- package/dist/collection/components/store/translationStore/strings.base.js +6 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +6 -0
- package/dist/collection/components/store/translationStore/strings.french.js +6 -0
- package/dist/collection/components/store/translationStore/strings.german.js +6 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +6 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +6 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +6 -0
- package/dist/collection/components/utils/api/getCheckoutSession.js +14 -0
- package/dist/collection/components/utils/resetToSelectedTab.js +17 -0
- package/dist/collection/components/utils/validateCheckoutSession.js +39 -0
- package/dist/collection/scripts/_zonosBase.js +34 -6
- package/dist/esm/{cart-e5fb3abe.js → cart-709f053f.js} +181 -3
- package/dist/esm/index.js +41 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-9636651e.js → paypal-77a60c44.js} +13 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_13.entry.js +49 -7
- package/dist/esm/zonos-checkout.entry.js +5 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/cart-709f053f.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/paypal-77a60c44.js +17 -0
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +1 -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-payment/zonos-checkout-payment.d.ts +6 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +6 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/getCheckoutSession.d.ts +9 -0
- package/dist/types/components/utils/resetToSelectedTab.d.ts +12 -0
- package/dist/types/components/utils/validateCheckoutSession.d.ts +9 -0
- package/dist/types/scripts/_zonosBase.d.ts +1 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +5 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +112 -0
- package/dist/types/types/generated/graphql.internal.types.ts +102 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-85545d0b.system.entry.js → p-01ad5be8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0c027d2e.entry.js +1 -0
- package/dist/zonos-elements/{p-d66cbed3.system.entry.js → p-1c4ff7b2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-30f75fc0.system.entry.js → p-22d69480.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3316bcb0.system.entry.js → p-25c7e4fa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-456d8ac3.system.entry.js → p-289ded20.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8d7bad6.entry.js → p-35b8dcde.entry.js} +1 -1
- package/dist/zonos-elements/{p-daf800c5.system.entry.js → p-49e4ca08.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d374ef35.system.entry.js → p-64a04391.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6b0aa1bb.system.js +17 -0
- package/dist/zonos-elements/{p-59f7cc80.entry.js → p-8368a79e.entry.js} +1 -1
- package/dist/zonos-elements/{p-e176da08.system.entry.js → p-896d62a4.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8f9affb3.system.entry.js +1 -0
- package/dist/zonos-elements/p-a58731ec.system.js +1 -0
- package/dist/zonos-elements/{p-9138a10d.entry.js → p-ad1d6ea2.entry.js} +1 -1
- package/dist/zonos-elements/p-afffdfc2.js +1 -0
- package/dist/zonos-elements/{p-3f71bac6.entry.js → p-b832ec52.entry.js} +1 -1
- package/dist/zonos-elements/{p-0931f518.entry.js → p-b9efc660.entry.js} +1 -1
- package/dist/zonos-elements/p-be2feba6.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-244fe3a1.system.entry.js → p-cf72603f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d35376d3.js +17 -0
- package/dist/zonos-elements/{p-035571bf.entry.js → p-e6c31531.entry.js} +1 -1
- package/dist/zonos-elements/{p-99190477.entry.js → p-f2867195.entry.js} +1 -1
- package/dist/zonos-elements/{p-d58b6247.entry.js → p-f8ca3e71.entry.js} +1 -1
- package/dist/zonos-elements/p-f8e8b50e.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +2 -1
- package/dist/esm-es5/cart-e5fb3abe.js +0 -1
- package/dist/esm-es5/paypal-9636651e.js +0 -17
- package/dist/zonos-elements/p-1037c75b.system.js +0 -1
- package/dist/zonos-elements/p-4e4a45cb.js +0 -17
- package/dist/zonos-elements/p-75048606.system.js +0 -1
- package/dist/zonos-elements/p-79a8c9ef.system.js +0 -17
- package/dist/zonos-elements/p-b7652a21.system.entry.js +0 -1
- package/dist/zonos-elements/p-e3112267.entry.js +0 -1
- package/dist/zonos-elements/p-f64e4276.js +0 -1
- package/dist/zonos-elements/p-f66fbfe8.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,o,e){function a(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(e.next(n))}catch(n){s(n)}}function r(n){try{c(e["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):a(n.value).then(i,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;a=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];a=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var e=0,a=t.length,s;e<a;e++){if(s||!(e in t)){if(!s)s=Array.prototype.slice.call(t,0,e);s[e]=t[e]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-10efff62.system.js","./p-23e7c655.system.js","./p-6b6cd6c3.system.js","./p-75048606.system.js","./p-febc72e7.system.js","./p-79a8c9ef.system.js","./p-46a5ec52.system.js"],(function(n){"use strict";var t,o,e,a,s,i,r,c,p,f,y,l;return{setters:[function(n){t=n.r;o=n.h;e=n.H;a=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.g},function(n){p=n.f},function(n){f=n.a;y=n.l},function(n){l=n.d},function(){}],execute:function(){var m=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var h=m;var u=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(a){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(e,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());u.style=h;var z=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var d=z;var b=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=p.stripe;this.stripeElements=p.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=p.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var t=this.el.querySelector(".zonos--payment-component");if(!t){f("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){p.stripePaymentEventData=n}));p.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(e,{key:"ee5ea97f737cce6dd2ad3d90797545e38a979820",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"5473d3bce1d842cba3a3e2c156fc31a70ee6b7f6",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"087268368f53116ce125b337eb2f99bf4cc7fa94",class:"zonos--payment-component"}),o("div",{key:"5987aa638084ac3635c522d3067b451b8a96a6e7",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());b.style=d;var v=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var g=v;var x=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){y("Paypal is not available");return[2]}n=l({onPaypalFail:function(){y("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;y("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){y("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){y("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(e,{key:"00f9e39b2a69f5da6799301b76571fe31ad2b3db",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"4977e93ec49ab8deca29c69072ea5fa0fc1c145b",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return n}());x.style=g}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,o,a){function e(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(a.next(n))}catch(n){s(n)}}function r(n){try{c(a["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):e(n.value).then(i,r)}c((a=a.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,e,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(a)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(a=1,e&&(s=r[0]&2?e["return"]:r[0]?e["throw"]||((s=e["return"])&&s.call(e),0):e.next)&&!(s=s.call(e,r[1])).done)return s;if(e=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;e=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];e=0}finally{a=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var a=0,e=t.length,s;a<e;a++){if(s||!(a in t)){if(!s)s=Array.prototype.slice.call(t,0,a);s[a]=t[a]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-10efff62.system.js","./p-23e7c655.system.js","./p-6b6cd6c3.system.js","./p-a58731ec.system.js","./p-febc72e7.system.js","./p-6b0aa1bb.system.js","./p-46a5ec52.system.js"],(function(n){"use strict";var t,o,a,e,s,i,r,c,p,f,y,l;return{setters:[function(n){t=n.r;o=n.h;a=n.H;e=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.g},function(n){p=n.f},function(n){f=n.a;y=n.l},function(n){l=n.d},function(){}],execute:function(){var m=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var h=m;var u=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var a=this;return __generator(this,(function(e){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){a.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){a.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(a,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());u.style=h;var z=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var d=z;var b=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=p.stripe;this.stripeElements=p.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=p.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var t=this.el.querySelector(".zonos--payment-component");if(!t){f("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){p.stripePaymentEventData=n}));p.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(a,{key:"ee5ea97f737cce6dd2ad3d90797545e38a979820",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"5473d3bce1d842cba3a3e2c156fc31a70ee6b7f6",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"087268368f53116ce125b337eb2f99bf4cc7fa94",class:"zonos--payment-component"}),o("div",{key:"5987aa638084ac3635c522d3067b451b8a96a6e7",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());b.style=d;var v=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var g=v;var x=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(a){if(!window.Zonos.paypal){y("Paypal is not available");return[2]}n=l({onPaypalFail:function(){y("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;y("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){y("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){y("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(a,{key:"00f9e39b2a69f5da6799301b76571fe31ad2b3db",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"4977e93ec49ab8deca29c69072ea5fa0fc1c145b",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});return n}());x.style=g}}}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{c(t.next(r))}catch(r){i(r)}}function u(r){try{c(t["throw"](r))}catch(r){i(r)}}function c(r){r.done?e(r.value):o(r.value).then(a,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-10efff62.system.js","./p-a58731ec.system.js","./p-febc72e7.system.js","./p-46a5ec52.system.js"],(function(r){"use strict";var n,e,t,o,i,a,u,c,s,l,d,f,v,p;return{setters:[function(r){n=r.z;e=r.c},function(r){t=r.C;o=r.f;i=r.e;a=r.x;u=r.q;c=r.w;s=r.k},function(r){l=r.h;d=r.l;f=r.a;v=r.j},function(r){p=r.t}],execute:function(){var w=this;
|
|
2
|
+
/*!
|
|
3
|
+
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
|
+
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/function h(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=m(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){i=false}}));return i?e:null}function y(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var i=m(n,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function b(r){var n=r.environment;var e=n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete r.environment;if(r.sdkBaseUrl){e=r.sdkBaseUrl;delete r.sdkBaseUrl}var t=r;var o=Object.keys(t).filter((function(r){return typeof t[r]!=="undefined"&&t[r]!==null&&t[r]!==""})).reduce((function(r,n){var e=t[n].toString();n=_(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),i=o.queryParams,a=o.attributes;if(i["merchant-id"]&&i["merchant-id"].indexOf(",")!==-1){a["data-merchant-id"]=i["merchant-id"];i["merchant-id"]="*"}return{url:"".concat(e,"?").concat(g(i)),attributes:a}}function _(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function g(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function m(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function P(r,n){if(n===void 0){n=Promise}j(r,n);if(typeof document==="undefined")return n.resolve(null);var e=b(r),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=k(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(h(t,o)&&a){return n.resolve(a)}return E({url:t,attributes:o},n).then((function(){var r=k(i);if(r){return r}throw new Error("The window.".concat(i," global variable is not available."))}))}function E(r,n){if(n===void 0){n=Promise}j(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();y({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function k(r){return window[r]}function j(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var A=function(r){return __awaiter(w,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,i=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,l("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var S=function(r){return __awaiter(w,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,l("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var I=r("i",(function(r){var n=r.backgroundColor1,e=r.backgroundColor2;var t=p.readability(n,e);return t>2.5}));var x=r("s",(function(r){var e=n.checkoutSettings.analyticsProviders.find((function(r){return r.type==="GOOGLE_ANALYTICS"}));if(!e||(e===null||e===void 0?void 0:e.status)==="DISABLED"){return}if(typeof window.gtag==="function"){d("Zonos submits gtag event","log",r);window.gtag("event",r,{})}}));var O=e((function(){return{orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),L=O.reset,T=O.state;r({c:L,b:T});var B=function(r){return __awaiter(w,[r],void 0,(function(r){var n,e,t,o,i,a;var u=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,S({checkoutSessionId:u})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,a]}}))}))};var C=function(r){return __awaiter(w,[r],void 0,(function(r){var n,e,t,o,i,a;var c=r.checkoutSessionId,s=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,A({checkoutSessionId:c,paypalMockResponse:s})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||u("An unexpected error occurred when processing PayPal order."))}return[2,a]}}))}))};var D=function(r){var n=r.error;var e;var t=v(n.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var i=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!i){T.paypalErrorMessage=u("An unexpected error occurred when processing PayPal order.")}var a=i[2]||u("An unexpected error occurred when processing PayPal order.");T.paypalErrorMessage=a};var F=function(r){var e=r.checkoutSessionId,l=r.onPaypalFail,d=r.onPaypalSessionDone,v=r.overrideBorderRaidus,p=r.overridePrimaryColor;var h=p||n.appearance.colorPrimary;var y="#ffc33a";var b=I({backgroundColor1:y,backgroundColor2:h||""});return{createOrder:function(){return __awaiter(w,void 0,void 0,(function(){var r,n,c,s,d;return __generator(this,(function(v){switch(v.label){case 0:return[4,t()];case 1:r=v.sent();if(!r.valid){T.paypalErrorMessage=r.errorMessage;o.hasPaymentError=false;o.customErrorMessage=null;l===null||l===void 0?void 0:l();return[2,""]}v.label=2;case 2:v.trys.push([2,8,,9]);T.paypalErrorMessage=null;i.inventoryCheckErrorMessage=null;v.label=3;case 3:v.trys.push([3,5,,6]);n=i;return[4,a()];case 4:n.inventoryCheckErrorMessage=v.sent();return[3,6];case 5:c=v.sent();i.inventoryCheckErrorMessage=u("Unable to check inventory. Please try again.");return[3,6];case 6:if(i.inventoryCheckErrorMessage){return[2,""]}return[4,B({checkoutSessionId:e})];case 7:s=v.sent();return[2,s];case 8:d=v.sent();f("Failed to create paypal order",d);T.paypalErrorMessage=u("Failed to create PayPal order. Please try again, or consider using an alternative method.");o.hasPaymentError=false;o.customErrorMessage=null;l===null||l===void 0?void 0:l();return[2,""];case 9:return[2]}}))}))},onApprove:function(r,n){return __awaiter(w,void 0,void 0,(function(){var r,n;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);T.paypalErrorMessage=null;x("zonos-checkout-payment-info");return[4,C({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:r=t.sent();T.orderIdCreated=r;d===null||d===void 0?void 0:d({orderId:r});c();s();return[3,3];case 2:n=t.sent();f("==== Failed to capture paypal order",n);if(n instanceof Error){return[2,D({error:n})]}l===null||l===void 0?void 0:l();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:v==="SHARP"?0:10,color:b?"gold":"blue",shape:"rect"}}};var R=function(){if(!T.paypalButtons.length){return}T.paypalButtons.forEach((function(r){return __awaiter(w,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,r.close()];case 1:n.sent();return[2]}}))}))}));T.paypalButtons=[]};var z=r("a",(function(r){return __awaiter(w,[r],void 0,(function(r){var e,t,o,i,a;var u=r.currency;return __generator(this,(function(r){switch(r.label){case 0:t=!!((e=n.checkoutSettings.externalPaymentMethods)===null||e===void 0?void 0:e.find((function(r){return r.type==="PAYPAL"&&r.status==="ENABLED"})));if(!t){d("=== Paypal is disabled for this store","warn");return[2]}o=n.checkoutSettings.externalServiceTokens.find((function(r){return r.type==="PAYPAL_CLIENT_ID"}));if(!o){d("Failed to load paypal -- missing paypal publishable key","warn");return[2]}i=n.zonosMode==="production"&&n.checkoutSettings.mode==="LIVE"?"production":"sandbox";a=window.Zonos;return[4,P({clientId:o.token,currency:u,environment:i})];case 1:a.paypal=r.sent();d("==== Paypal script loaded");return[2]}}))}))}));var M=r("d",(function(r){var n;var e=window.Zonos.paypal;if(!e){d("Paypal is not available");return null}var t=i.checkoutSessionId;if(!t){d("Paypal is not available due to checkoutSessionId is not available");return null}d("==== Loading Paypal buttons");R();var o=[(n=e.FUNDING)===null||n===void 0?void 0:n.PAYPAL].filter(Boolean);T.paypalButtons=o.map((function(n){var o;var i=null;try{i=((o=e.Buttons)===null||o===void 0?void 0:o.call(e,Object.assign(Object.assign({},F(Object.assign({checkoutSessionId:t,fundingSource:n},r))),{fundingSource:n})))||null}catch(r){d("===== Failed to load paypal's \"".concat(n,'" button'),"warn",r)}if(i===null||i===void 0?void 0:i.isEligible()){d("==== Paypal button ".concat(n," loaded"));return i}return null})).filter(Boolean);return T.paypalButtons}));var N=r("p",(function(){var r,e;var t=((e=(r=n.checkoutSettings.externalPaymentMethods)===null||r===void 0?void 0:r.find((function(r){return r.type==="PAYPAL"})))===null||e===void 0?void 0:e.status)==="ENABLED";return t||!!T.paypalButtons.length}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{
|
|
1
|
+
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{D as i,f as s,E as r,e as a,a as c}from"./p-afffdfc2.js";import{z as l,b as d,d as h}from"./p-edc16f69.js";import{h as u,a as f,l as m}from"./p-860e46ab.js";import"./p-10d6fe23.js";import"./p-d10ffd69.js";const p=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},w=o=>{switch(o){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},b=({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t},v=async o=>{if(window.Zonos.isLegacyCheckout)return void m("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:t}=o;let n=t;if(!o.anchorElementSelector&&o.desktopLocation){const o=b({position:"bottom-right"});n=o}if(n&&i(n)){if(m("Hello init complete"),!p(n)){const t=new MutationObserver((()=>{p(n)&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{p(n)}),1e3),setTimeout((()=>{if(o.notFoundElementFallback){m(`Hello anchor selector ${o.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${o.notFoundElementFallback}`,"info");const t=b({position:w(o.notFoundElementFallback)});p(t)}}),3e3)}}else f(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)},y=class{constructor(n){o(this,n),this.paypalInitEvent=t(this,"paypalInitEvent",7),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,((t=l.checkoutSettings).placeOrderButtonSelector||window.Zonos.cartData)&&(!t.placeOrderButtonSelector||i(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():f(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),m("init checkout element")):m("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||h();if("Inter"===e){if(!o)return;m("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o})}const i=new URLSearchParams;i.set("family",e);const{errors:s,json:r}=await u(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0)return m(`Failed to load font ${e}`,"warn"),void(l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"}));const a=null==r?void 0:r.fontUrl;a&&(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,a)),o&&(m(`[FONT] ${o} font override applied`),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o}))}handleLocationChange(){v(l.helloSettings)}initHistoryListener(){const o=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),o.apply(this,arguments)};const t=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)}}async componentWillLoad(){this.initHistoryListener(),l.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e,zonosMode:i}=await(async()=>{const{errors:o,json:t,zonosMode:n}=await u("/api/zonos-elements/zonos-settings");return o.length?(f("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:t,zonosMode:n}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void m("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification();const s=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var o,t,n;return window.Zonos.isLegacyCheckout?(null===(o=null==e?void 0:e.appearanceSettings)||void 0===o?void 0:o.logoUrl)||(null===(t=this.config.appearance)||void 0===t?void 0:t.logoUrl):null===(n=this.config.appearance)||void 0===n?void 0:n.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:void 0}):void 0});d({overrideSettings:s,zonosSettings:e}),l.zonosMode=i,this.setupGoogleFont(),"DISABLED"===l.helloSettings.visibilityStatus&&m("=== Hello is disabled by store owner ===","warn"),l.helloSettings&&"ENABLED"===l.helloSettings.visibilityStatus&&(m("Initializing hello"),v(l.helloSettings)),await r();const a=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(a&&this.stripeInitEvent)return"INACTIVE"===l.checkoutSettings.subscriptionStatus?(m('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void m("zonos controller loaded")):"DISABLED"===l.checkoutSettings.visibilityStatus?(m("=== Checkout is disabled by store owner ===","warn"),void m("zonos controller loaded")):void this.stripeInitEvent.emit({publishableKey:a.token});m("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):m("Failed to show notification - zonos-notification not found","warn")}async reset(){a.checkoutSessionId=null,s.clientSecret=null}async overrideConfig(o){d({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){m(`Override country code to ${o}`),c(o)}async getAppearanceSetting(){return l.appearance}async updateOrganizationName(o){l.organizationName=o}render(){return n(e,{key:"7cdde4733b47d96c6539a6bd9c78f150de8a6eb4",class:"zonos--elements"})}};y.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{y as zonos_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,s){function a(o){try{l(n.next(o))}catch(o){s(o)}}function r(o){try{l(n["throw"](o))}catch(o){s(o)}}function l(o){o.done?t(o.value):i(o.value).then(a,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-75048606.system.js","./p-10efff62.system.js","./p-23e7c655.system.js","./p-2d6557ee.system.js","./p-bc7bf53e.system.js","./p-febc72e7.system.js","./p-46a5ec52.system.js","./p-6b6cd6c3.system.js"],(function(o){"use strict";var e,t,n,i,s,a,r,l,d,h,c,u;return{setters:[function(o){e=o.r;t=o.c;n=o.h;i=o.F;s=o.H},function(o){a=o.q;r=o.l;l=o.I},function(o){d=o.z},function(o){h=o.c},function(o){c=o.f},function(o){u=o.g},function(){},function(){},function(){}],execute:function(){var f=function(o){var e=o.getBoundingClientRect();var t=e.top;var n=window.innerHeight-e.bottom;return t>=n};var m=function(o){var e=o.href,t=o.text;return'<zonos-link href="'.concat(e,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var g='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var b='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var v='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>';var p='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var x='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var z=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var C=z;var y="".concat(a("The low-value GST law passed July 1st, 2018 applies to this retailer.")," ").concat(m({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:a("Learn more.")}));var k=o("zonos_hello_dialog",function(){function o(o){var n=this;e(this,o);this.closeDialog=t(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(n.dialogRef)&&n.isOpen){n.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(d.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.setShowLanguageSelect=function(o){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){this.showLanguageSelect=o;return[2]}))}))};this.hasTaxId=function(){var o;return(o=r.countryLandedCost)===null||o===void 0?void 0:o.hasTaxId};this.hasInclusivePrices=function(){var o;return((o=r.inclusivePricing)===null||o===void 0?void 0:o.status)==="ENABLED"};this.isNoThresholdCountry=function(o){if(!o||!n.hasTaxId()){return false}return["AU"].includes(o)};this.getDutyMessage=function(){var o=r.countryLandedCost;var e=(o===null||o===void 0?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e&&!n.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?a("Spend [threshold] duty free.",{threshold:e}):a("Duties will apply to all orders.")};this.getTaxMessage=function(){var o=r.countryLandedCost;var e=(o===null||o===void 0?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!n.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?a("Spend [threshold] tax free.",{threshold:e}):a("Taxes will apply to all orders.")};this.getUkDutyTaxMessage=function(o){if(o.allowLowValueOrders){return null}var e=o.dutyDeminimus;return[a("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:e})})]};this.getAustraliaDutyTaxMessage=function(o){if(n.hasInclusivePrices()){return[y]}return[a("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:"".concat(o.vatTaxRate*100,"%")}),y]};this.getNewZealandDutyTaxMessge=function(o){if(n.hasInclusivePrices()){return null}return[a("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:"".concat(o.vatTaxRate*100,"%"),threshold:l({amount:o.vatTaxDeminimus})})]};this.getInclusivePriceMessage=function(){var o=r.inclusivePricing;if((o===null||o===void 0?void 0:o.status)!=="ENABLED"){return null}if(o.duty.status==="INCLUDED"&&o.tax.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"&&o.tax.status==="INCLUDED"){return a("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions.")}if(o.tax.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"){return a("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions.")}if(o.tax.status==="INCLUDED"){return a("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions.")}if(o.fee.status==="INCLUDED"){return a("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions.")}return null};this.getAdditionalDutyTaxMessage=function(){if(!r.countryLandedCost){return null}if(!n.hasTaxId()){return null}switch(r.countryLandedCost.countryCode){case"GB":return n.getUkDutyTaxMessage(r.countryLandedCost);case"AU":return n.getAustraliaDutyTaxMessage(r.countryLandedCost);case"NZ":return n.getNewZealandDutyTaxMessge(r.countryLandedCost);default:return null}};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};o.prototype.render=function(){var o=this;var e;var t=r.selectedCountryCode;var l=this.hasInclusivePrices();var m=this.getInclusivePriceMessage();var z=this.getDutyMessage();var C=this.getTaxMessage();var y=this.getAdditionalDutyTaxMessage();var k=this.animateFromLeftOverride||this.dialogRef&&u(this.dialogRef);var L=this.dialogRef&&f(this.dialogRef);var D=r.customMessages;var H=a("Welcome to [storeName]",{storeName:d.organizationName});var N=((e=D.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||a("Know about duties and taxes before you buy. Shop with confidence!");var V=c(N);var M=this.getCurrentPageEnum();var _=D.filter((function(o){return o.pageName===M}));return n(s,{key:"25f0055cadd0b38a8374cdb0c981124d569ae9df",class:"zonos--elements"},n("div",{key:"7c04c71c7926d0bc64499f9c124464087d19570d",class:h(["zonos--hello-dialog",k&&"zonos--hello-dialog-animate-from-left",L&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:function(e){return e&&(o.dialogRef=e)}},!this.showCountrySelect&&!this.showLanguageSelect&&n("div",{key:"b4ad9c5eb5893ecd553b1bed056810bd8d69c3ca"},n("div",{key:"bd442c14e751180b3dded8d415662eb456b5b5fd",class:"zonos--hello-dialog-content"},n("zonos-button",{key:"2d0f6d48e91c1897ca6ab442e8bff7efefd76920",class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:x}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),n("zonos-v-stack",{key:"eb19103741ccbced87f11d800a8c9439f692fcfd",spacing:24},n("zonos-country-flag",{key:"50f7375b30576d69bb751de6b6ba6565f34e83aa",class:"zonos--hello-country-flag",countryCode:t}),n("zonos-v-stack",{key:"4e5eb35029bbafa1343d4b7b911dadfa77074be0",class:"zonos--hello-dialog-header",spacing:4},n("zonos-text",{key:"fc62525f1442ddb2ad98b8b4f5a4e874586ffa55",type:"boldSubheader"},H),n("zonos-text",{key:"b85a16aacba64bdc477102d87e76071312395128",innerHTML:V,textColor:"gray-800"})),n("zonos-v-stack",{key:"9cff07928aeadaccdb5d9c906125f603281d3bb1",spacing:8},this.restrictedItems.map((function(o){var e;return o&&n("zonos-banner",{bannerTitle:o.name,intent:"error"},(e=o.itemRestrictions)===null||e===void 0?void 0:e.map((function(o){return n("zonos-text",{textColor:"red-800"},o===null||o===void 0?void 0:o.note)})))})),n("zonos-card",{key:"e3a98411ec2be35dfbe3e9a2a5945851697da7ad",spacing:"12px"},n("zonos-v-stack",{key:"09cd2bbbb94e819a272f3ef415bb9ace37111f04",spacing:12},l?n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:v}),n("zonos-text",null,m)):n(i,null,n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:b}),n("zonos-text",null,z)),n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis",content:w}),n("zonos-text",null,C))),y===null||y===void 0?void 0:y.map((function(o){return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:g}),n("zonos-text",{innerHTML:o}))})))),_.map((function(o){return n("zonos-custom-message",{icon:p,message:o.message})}))))),n("zonos-hello-dialog-footer",{key:"443975bc6a4355f49cde5513aa494f700e1eee98",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)},setShowLanguageSelect:function(e){return o.setShowLanguageSelect(e)}})),this.showCountrySelect&&n("div",{key:"a55ed373839ed80b449b9f6271ea19cf15124843"},n("zonos-country-select",{key:"e8fa0c5c6f36ebe67b84f692ad10a9a84305eba5",handleOnClose:function(){return o.setShowCountrySelect(false)}})),this.showLanguageSelect&&n("div",{key:"7bd9d8836c876049d190aaa1bbf3ddea04139090"},n("zonos-language-select",{key:"15002ebf92828cd52881f30ddb639f704d074462",handleOnClose:function(){return o.setShowLanguageSelect(false)}}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}());k.style=C}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,s){function a(o){try{l(n.next(o))}catch(o){s(o)}}function r(o){try{l(n["throw"](o))}catch(o){s(o)}}function l(o){o.done?t(o.value):i(o.value).then(a,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-a58731ec.system.js","./p-10efff62.system.js","./p-23e7c655.system.js","./p-2d6557ee.system.js","./p-bc7bf53e.system.js","./p-febc72e7.system.js","./p-46a5ec52.system.js","./p-6b6cd6c3.system.js"],(function(o){"use strict";var e,t,n,i,s,a,r,l,d,h,c,u;return{setters:[function(o){e=o.r;t=o.c;n=o.h;i=o.F;s=o.H},function(o){a=o.q;r=o.l;l=o.J},function(o){d=o.z},function(o){h=o.c},function(o){c=o.f},function(o){u=o.g},function(){},function(){},function(){}],execute:function(){var f=function(o){var e=o.getBoundingClientRect();var t=e.top;var n=window.innerHeight-e.bottom;return t>=n};var m=function(o){var e=o.href,t=o.text;return'<zonos-link href="'.concat(e,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var g='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var b='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var v='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>';var p='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var x='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var z=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var C=z;var y="".concat(a("The low-value GST law passed July 1st, 2018 applies to this retailer.")," ").concat(m({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:a("Learn more.")}));var k=o("zonos_hello_dialog",function(){function o(o){var n=this;e(this,o);this.closeDialog=t(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(n.dialogRef)&&n.isOpen){n.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(d.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.setShowLanguageSelect=function(o){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){this.showLanguageSelect=o;return[2]}))}))};this.hasTaxId=function(){var o;return(o=r.countryLandedCost)===null||o===void 0?void 0:o.hasTaxId};this.hasInclusivePrices=function(){var o;return((o=r.inclusivePricing)===null||o===void 0?void 0:o.status)==="ENABLED"};this.isNoThresholdCountry=function(o){if(!o||!n.hasTaxId()){return false}return["AU"].includes(o)};this.getDutyMessage=function(){var o=r.countryLandedCost;var e=(o===null||o===void 0?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e&&!n.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?a("Spend [threshold] duty free.",{threshold:e}):a("Duties will apply to all orders.")};this.getTaxMessage=function(){var o=r.countryLandedCost;var e=(o===null||o===void 0?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!n.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?a("Spend [threshold] tax free.",{threshold:e}):a("Taxes will apply to all orders.")};this.getUkDutyTaxMessage=function(o){if(o.allowLowValueOrders){return null}var e=o.dutyDeminimus;return[a("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:e})})]};this.getAustraliaDutyTaxMessage=function(o){if(n.hasInclusivePrices()){return[y]}return[a("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:"".concat(o.vatTaxRate*100,"%")}),y]};this.getNewZealandDutyTaxMessge=function(o){if(n.hasInclusivePrices()){return null}return[a("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:"".concat(o.vatTaxRate*100,"%"),threshold:l({amount:o.vatTaxDeminimus})})]};this.getInclusivePriceMessage=function(){var o=r.inclusivePricing;if((o===null||o===void 0?void 0:o.status)!=="ENABLED"){return null}if(o.duty.status==="INCLUDED"&&o.tax.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"&&o.tax.status==="INCLUDED"){return a("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions.")}if(o.tax.status==="INCLUDED"&&o.fee.status==="INCLUDED"){return a("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions.")}if(o.duty.status==="INCLUDED"){return a("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions.")}if(o.tax.status==="INCLUDED"){return a("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions.")}if(o.fee.status==="INCLUDED"){return a("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions.")}return null};this.getAdditionalDutyTaxMessage=function(){if(!r.countryLandedCost){return null}if(!n.hasTaxId()){return null}switch(r.countryLandedCost.countryCode){case"GB":return n.getUkDutyTaxMessage(r.countryLandedCost);case"AU":return n.getAustraliaDutyTaxMessage(r.countryLandedCost);case"NZ":return n.getNewZealandDutyTaxMessge(r.countryLandedCost);default:return null}};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};o.prototype.render=function(){var o=this;var e;var t=r.selectedCountryCode;var l=this.hasInclusivePrices();var m=this.getInclusivePriceMessage();var z=this.getDutyMessage();var C=this.getTaxMessage();var y=this.getAdditionalDutyTaxMessage();var k=this.animateFromLeftOverride||this.dialogRef&&u(this.dialogRef);var L=this.dialogRef&&f(this.dialogRef);var D=r.customMessages;var H=a("Welcome to [storeName]",{storeName:d.organizationName});var N=((e=D.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||a("Know about duties and taxes before you buy. Shop with confidence!");var V=c(N);var M=this.getCurrentPageEnum();var _=D.filter((function(o){return o.pageName===M}));return n(s,{key:"25f0055cadd0b38a8374cdb0c981124d569ae9df",class:"zonos--elements"},n("div",{key:"7c04c71c7926d0bc64499f9c124464087d19570d",class:h(["zonos--hello-dialog",k&&"zonos--hello-dialog-animate-from-left",L&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:function(e){return e&&(o.dialogRef=e)}},!this.showCountrySelect&&!this.showLanguageSelect&&n("div",{key:"b4ad9c5eb5893ecd553b1bed056810bd8d69c3ca"},n("div",{key:"bd442c14e751180b3dded8d415662eb456b5b5fd",class:"zonos--hello-dialog-content"},n("zonos-button",{key:"2d0f6d48e91c1897ca6ab442e8bff7efefd76920",class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:x}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),n("zonos-v-stack",{key:"eb19103741ccbced87f11d800a8c9439f692fcfd",spacing:24},n("zonos-country-flag",{key:"50f7375b30576d69bb751de6b6ba6565f34e83aa",class:"zonos--hello-country-flag",countryCode:t}),n("zonos-v-stack",{key:"4e5eb35029bbafa1343d4b7b911dadfa77074be0",class:"zonos--hello-dialog-header",spacing:4},n("zonos-text",{key:"fc62525f1442ddb2ad98b8b4f5a4e874586ffa55",type:"boldSubheader"},H),n("zonos-text",{key:"b85a16aacba64bdc477102d87e76071312395128",innerHTML:V,textColor:"gray-800"})),n("zonos-v-stack",{key:"9cff07928aeadaccdb5d9c906125f603281d3bb1",spacing:8},this.restrictedItems.map((function(o){var e;return o&&n("zonos-banner",{bannerTitle:o.name,intent:"error"},(e=o.itemRestrictions)===null||e===void 0?void 0:e.map((function(o){return n("zonos-text",{textColor:"red-800"},o===null||o===void 0?void 0:o.note)})))})),n("zonos-card",{key:"e3a98411ec2be35dfbe3e9a2a5945851697da7ad",spacing:"12px"},n("zonos-v-stack",{key:"09cd2bbbb94e819a272f3ef415bb9ace37111f04",spacing:12},l?n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:v}),n("zonos-text",null,m)):n(i,null,n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:b}),n("zonos-text",null,z)),n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis",content:w}),n("zonos-text",null,C))),y===null||y===void 0?void 0:y.map((function(o){return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:g}),n("zonos-text",{innerHTML:o}))})))),_.map((function(o){return n("zonos-custom-message",{icon:p,message:o.message})}))))),n("zonos-hello-dialog-footer",{key:"443975bc6a4355f49cde5513aa494f700e1eee98",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)},setShowLanguageSelect:function(e){return o.setShowLanguageSelect(e)}})),this.showCountrySelect&&n("div",{key:"a55ed373839ed80b449b9f6271ea19cf15124843"},n("zonos-country-select",{key:"e8fa0c5c6f36ebe67b84f692ad10a9a84305eba5",handleOnClose:function(){return o.setShowCountrySelect(false)}})),this.showLanguageSelect&&n("div",{key:"7bd9d8836c876049d190aaa1bbf3ddea04139090"},n("zonos-language-select",{key:"15002ebf92828cd52881f30ddb639f704d074462",handleOnClose:function(){return o.setShowLanguageSelect(false)}}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}());k.style=C}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,n,t){function s(o){return o instanceof n?o:new n((function(e){e(o)}))}return new(n||(n=Promise))((function(n,i){function r(o){try{a(t.next(o))}catch(o){i(o)}}function c(o){try{a(t["throw"](o))}catch(o){i(o)}}function a(o){o.done?n(o.value):s(o.value).then(r,c)}a((t=t.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,s,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(o){return function(e){return a([o,e])}}function a(c){if(t)throw new TypeError("Generator is already executing.");while(r&&(r=0,c[0]&&(n=0)),n)try{if(t=1,s&&(i=c[0]&2?s["return"]:c[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;if(s=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;s=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1];i=c;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(c);break}if(i[2])n.ops.pop();n.trys.pop();continue}c=e.call(o,n)}catch(o){c=[6,o];s=0}finally{t=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-a58731ec.system.js","./p-6b0aa1bb.system.js","./p-10efff62.system.js","./p-febc72e7.system.js","./p-64372f93.system.js","./p-aed0098c.system.js","./p-23e7c655.system.js","./p-6b6cd6c3.system.js","./p-46a5ec52.system.js","./p-1aa93d1e.system.js","./p-bb418544.system.js","./p-2770ba48.system.js"],(function(o){"use strict";var e,n,t,s,i,r,c,a,u,d,l,h,f,m,z,v,p,g,k,w,b,y,x,C,_,S,O,A,T,I,j,B,E,D,L,P,R,N,U,H,M,F,G,Z,V,q,K,W,Y,J,Q,X,$,oo,eo,no,to;return{setters:[function(o){e=o.r;n=o.h;t=o.H;s=o.F},function(o){i=o.l;r=o.s;c=o.a;a=o.b;u=o.c;d=o.i;l=o.d;h=o.e;f=o.f;m=o.g;z=o.h;v=o.j;p=o.k;g=o.m;k=o.n;w=o.t;b=o.o;y=o.p;x=o.q;C=o.r;_=o.u;S=o.v;O=o.w;A=o.x;T=o.y;I=o.z;j=o.A;B=o.B},function(o){E=o.p;D=o.s;L=o.a;P=o.b},function(o){R=o.z;N=o.g;U=o.m},function(o){H=o.h;M=o.l;F=o.a;G=o.s;Z=o.g;V=o.b;q=o.j},function(o){K=o.g;W=o.c},function(o){Y=o.i},function(o){J=o.c},function(o){Q=o.g},function(o){X=o.i},function(o){$=o.s},function(o){oo=o.c;eo=o.s;no=o.d},function(o){to=o.R}],execute:function(){var so=this;var io=function(o){var e=o.items.map((function(o){return{amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||undefined,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}}))||[];return{adjustments:o.adjustments,cartItems:e}};var ro=function(){return __awaiter(so,void 0,void 0,(function(){var o,e,n;return __generator(this,(function(t){switch(t.label){case 0:return[4,H("/api/zonos-elements/get-store-discount-enabled-status")];case 1:o=t.sent(),e=o.errors,n=o.json;if(e.length||!(n===null||n===void 0?void 0:n.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var co=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return true}if(i.isDisabledCountry){if(o){M("Checkout: disabled country")}return true}return false};var ao=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return false}if(!i.isShippableCountry){if(o){M("Checkout: not shippable country")}return false}return true};var uo=function(o){var e=o.domesticRedirectedBtnSelector,n=o.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var t=new MutationObserver((function(){return __awaiter(so,void 0,void 0,(function(){var o,s,i,d,l;var h=this;return __generator(this,(function(f){o=document.querySelector(e);s=r();if(!o&&s){i=document.createElement("button");i.style.display="none";i.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(i);n===null||n===void 0?void 0:n(s);t.disconnect();return[2]}d=document.querySelector('select[name="shippingAddress.countryCode"]');l=document.querySelector("#checkout-shipping-continue");if(!d||!l){return[2]}t.disconnect();l.addEventListener("click",(function(o){return __awaiter(h,void 0,void 0,(function(){var e,n,t,s,i,r,l;return __generator(this,(function(h){t=d.value;if(!t){return[2]}c(t);if(!ao(false)){a();return[2]}s=document.querySelector("form");if(!s){return[2]}i=new FormData(s);r=document.querySelector("input#addressLine1Input");l={address1:(e=i.get("shippingAddress.address1"))!==null&&e!==void 0?e:r&&r.value,address2:i.get("shippingAddress.address2"),city:i.get("shippingAddress.city"),countryCode:i.get("shippingAddress.countryCode"),firstName:i.get("shippingAddress.firstName"),lastName:i.get("shippingAddress.lastName"),phone:i.get("shippingAddress.phone"),postalCode:i.get("shippingAddress.postalCode"),stateOrProvince:(n=i.get("shippingAddress.stateOrProvince"))!==null&&n!==void 0?n:i.get("shippingAddress.stateOrProvinceCode")};if(Object.values(l).some((function(o){return o===undefined||o===null}))){F("One or more shipping address field is missing",Object.entries(l));void G({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(l))],metadata:{storeId:R.storeId}});return[2]}u({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince});o.preventDefault();o.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));t.observe(document.body,{childList:true,subtree:true})};var lo=function(){var o="connection"in window.navigator?window.navigator.connection:null;var e="mozConnection"in window.navigator?window.navigator.mozConnection:null;var n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;var t=o||e||n;return t};var ho=function(){var o="userAgentData"in window.navigator?window.navigator.userAgentData:null;var e=lo();return{connectionDownlink:e===null||e===void 0?void 0:e.downlink,connectionEffectiveType:e===null||e===void 0?void 0:e.effectiveType,connectionRtt:e===null||e===void 0?void 0:e.rtt,connectionSaveData:e===null||e===void 0?void 0:e.saveData,userAgent:o&&o.brands.length>0?o:window.navigator.userAgent}};var fo=function(){return __awaiter(so,void 0,void 0,(function(){var o,e;return __generator(this,(function(n){o=Z().elapsedTime;e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:V},ho()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId};void H("/api/zonos-elements/log-script-load",{body:e,method:"POST"});return[2]}))}))};var mo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var zo=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var vo=zo;var po=90*60*1e3;var go=6*60*60*1e3;var ko=o("zonos_checkout",function(){function o(o){var n=this;e(this,o);this.onChangeLocaleListener=function(){};this.isRedirectAfterOrder=false;this.applyStripeTheme=function(){return __awaiter(n,void 0,void 0,(function(){var o,e,n,t,s;return __generator(this,(function(i){switch(i.label){case 0:s=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||R.appearance.theme;return[4,d({overrideBorderRadius:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.style,overridePrimaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorPrimary,overrideSecondaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorSecondary,overrideTheme:this.isMobile?s:undefined,paypalEnabled:E()})];case 1:i.sent();return[2]}}))}))};this.handleCartExpiredCheck=function(){var o;if(K()){M("Not checking for cart expiration in test mode");return false}if(!R.checkoutSettings.cartExpiration||!((o=window.Zonos.cartData)===null||o===void 0?void 0:o.createdAt)){return false}var e=new Date(window.Zonos.cartData.createdAt).getTime();var t=(new Date).getTime();var s=t-e;var i=Math.floor(s/6e4);M("Cart has been created for ".concat(i," minutes"));if(R.checkoutSettings.cartExpiration){if(i>R.checkoutSettings.cartExpiration){n.isCartExpired=true;return true}}return false};this.checkStripePaymentIntentStatus=function(o){return __awaiter(n,[o],void 0,(function(o){var e,n,t,s,i,r,c,a,u;var d=o.triggeredButton;return __generator(this,(function(o){switch(o.label){case 0:e=d===null||d===void 0?void 0:d.matches("#".concat(oo));n=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");i=t.get("zonosCheckoutSessionId");if(!e){M("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}M("Payment intent exist, checking stripe payment intent status");if(!s){M("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:n}]}return[4,l({clientSecret:s})];case 1:r=o.sent(),c=r.error,a=r.status;u=new URLSearchParams(window.location.search).get("redirect_status");if(u){if(!c){M("Payment intent is succeeded or in a good state to move forward, show success screen")}else{M("Payment intent failed, show status from error")}this.open=true;h.checkoutSessionId=i;f.clientSecret=s;void this.setToFinishStep(a);return[2,{shouldAllowOrder:false}]}if(!n){M("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}M("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.formatDate=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleDateString()};this.formatTime=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(h.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.appearanceSettingsOverride=undefined;this.preview=false;this.mobile=false;this.defaultAddress=null;this.forceDialogOpen=false;this.defaultAddressParams=null;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){e=o.detail;void m({adjustments:h.adjustments,cartItems:e});return[2]}))}))};o.prototype.handleKeyPress=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(o.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};o.prototype.closeDialogHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e,n;return __generator(this,(function(t){if(!this.open){return[2]}if(!(o===null||o===void 0?void 0:o.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;D("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&h.step==="finish"){z()}h.step="customer-info";v();p();(n=(e=R.checkoutSettings).onClose)===null||n===void 0?void 0:n.call(e);return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,n,t,s,r,c,o,a,n,t,t,u,d,n,l;return __generator(this,(function(z){switch(z.label){case 0:if(!window.Zonos.cartData)return[3,2];M("tempCartUUID is provided, start building cart");o=this.handleCartExpiredCheck();if(o){return[2]}e=io(window.Zonos.cartData),n=e.adjustments,t=e.cartItems;return[4,m({adjustments:n,cartItems:t})];case 1:z.sent();return[3,9];case 2:if(!(typeof R.checkoutSettings.createCartId==="function"))return[3,6];M('"createCartId" is provided, start building cart');return[4,R.checkoutSettings.createCartId()];case 3:s=z.sent();window.Zonos.cartId=s;return[4,eo(s)];case 4:r=z.sent();c=r===null||r===void 0?void 0:r.cartData;if(!c){F("Failed to build cart, please try again.");return[2]}window.Zonos.cartData=c;o=this.handleCartExpiredCheck();if(o){return[2]}a=io(c),n=a.adjustments,t=a.cartItems;return[4,m({adjustments:n,cartItems:t})];case 5:z.sent();return[3,9];case 6:if(!(R.checkoutSettings.buildCartDetail&&i.selectedCountryCode))return[3,9];M("build cart detail");return[4,R.checkoutSettings.buildCartDetail({countryCode:i.selectedCountryCode,currencyCode:i.targetCurrency})];case 7:t=z.sent();u=t.filter((function(o){return o.amount>=0}));d=t.filter((function(o){return o.amount<0}));n=d.map((function(o){return{amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"}}));return[4,m({adjustments:n,cartItems:u})];case 8:z.sent();z.label=9;case 9:if(!!f.clientSecret)return[3,11];return[4,g()];case 10:l=z.sent();M("stripeStoreInitCheckoutSession: ".concat(l));if(!l){return[2,false]}z.label=11;case 11:return[4,this.applyStripeTheme()];case 12:z.sent();this.isRedirectAfterOrder=R.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!h.externalConfirmationPageURL;return[2,true]}}))}))};o.prototype.reloadCheckoutSession=function(){window.location.reload()};o.prototype.handleOrderDuplication=function(){var o=q(localStorage.getItem("zonos--placed-order-info"));if(!o){localStorage.removeItem("zonos--placed-order-info");return}var e=Date.now()-o.time;M("=== Existing placed order info: ".concat(o.orderId," - ").concat(this.formatDate(o.time)," - elapsed in hh:ss format: ").concat(new Date(e).toISOString().substring(11,8)),"warn");var n=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||go;if(e>n){M("=== Existing placed order info is older than ".concat(n,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=o;M("=== Showing order duplication confirmation","warn")};o.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!h.checkoutSessionId){return}void H("/api/zonos-elements/update-checkout-session-metadata",{body:{id:h.checkoutSessionId,metadata:[{key:"orderDuplicationConsent",value:"1"}]},method:"POST"})};o.prototype.handleCancelOrderDuplication=function(){var o;this.placedOrderInfo=null;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}void this.closeDialogHandler({confirmed:true})};o.prototype.attachCheckout=function(){var o=this;var e=R.checkoutSettings.placeOrderButtonSelector;M("attach checkout ".concat(e));if(!e&&!window.Zonos.cartData){return}var n=[e,"#".concat(no),"#".concat(oo)].filter(Boolean);var t=document.querySelectorAll(n.join(","));t.forEach((function(n){var t=n.getAttribute("data-zonos-checkout-attached");if(t){return}M("attached event to button ".concat(e),"info",{button:n});n.addEventListener("click",(function(e){return __awaiter(o,void 0,void 0,(function(){var o,n,t,s,i;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isLegacyCheckout&&(!ao()||co())){return[2]}e.preventDefault();e.stopPropagation();M("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:e.target})];case 1:n=r.sent().shouldAllowOrder;if(!n){return[2]}f.isFetchingSession=true;this.open=true;r.label=2;case 2:r.trys.push([2,5,,6]);return[4,this.buildCartAndInit()];case 3:t=r.sent();if(this.isCartExpired){throw new Error("This shopping cart is expired")}if(!t){throw new Error("Error building cart")}k({isPreview:this.preview,sessionTimeout:po});return[4,ro()];case 4:s=r.sent().enabled;h.shouldHideDiscountInput=!s;D("zonos-checkout-start");void w("checkout_open");this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void fo()}return[3,6];case 5:i=r.sent();f.isFetchingSession=false;F(i);if(this.isCartExpired){return[2]}void G({endpoint:"Error creating Checkout",errors:[i instanceof Error?i.toString():"Unknown error"],metadata:{allLogs:V,cartId:window.Zonos.cartId,checkoutSessionBody:b(),href:window.location.href,storeBaseUrl:(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl}});y({messages:[x("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:x("Error creating Checkout")});return[3,6];case 6:return[2]}}))}))}),{capture:true,passive:false});if(!R.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");if(n.matches(no)){n.dispatchEvent(W("click"));a();n.remove()}if(n.matches("#".concat(oo))){n.dispatchEvent(W("click"));n.remove()}}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.useLegacyQueryParams=function(){var o=new URLSearchParams(window.location.search);M("legacy urlParams","info",Object.fromEntries(o.entries()));var e=function(e){var n=o.get(e);if(!n||n==="undefined"){return null}return n};var n=C(o)||i.selectedCountryCode;var t=e("customerCity");var s=e("customerEmail")||"";var r=e("customerAddress1");var c=e("customerAddress2")||"";var a=e("customerName");var u=e("customerPhone");var d=e("customerZip")||"";var l=e("customerState")||"";if(!r||!a||!u||!n){M("Missing required query params so it can not be prefilled","info",[!r&&"line1",!a&&"name",!u&&"phone",!n&&"country"].filter(Boolean).join(", "));return}this.defaultAddressParams={address:{city:t||"",country:n,line1:r,line2:c,postal_code:d,state:l},email:s,name:a,phone:u}};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(n){f.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;uo({domesticRedirectedBtnSelector:no,onShippingAddressSessionFound:function(o){e.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:"".concat(o.firstName," ").concat(o.lastName),phone:o.phone}}});if(window.Zonos){this.useLegacyQueryParams()}o=setInterval((function(){f.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){M("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(o);return}M("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){e.attachCheckout()}else if(window){e.attachCheckout();var n=new MutationObserver((function(){e.attachCheckout()}));n.observe(document.body,{childList:true,subtree:true})}clearInterval(o)}),50);setTimeout((function(){clearInterval(o)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){h.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.mockCheckoutSession=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){_(o);return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(n){switch(n.label){case 0:this.submitLoading=true;return[4,S()];case 1:n.sent();o=setInterval((function(){if(h.landedCostData||!f.isFetchingLandedCost){if(h.landedCostData){void L({currency:h.currency});O()}e.submitLoading=false;clearInterval(o)}}),500);return[2]}}))}))};o.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.submitLoading=true;setTimeout((function(){O();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleInventoryCheckDialogConfirm=function(){h.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};o.prototype.handleCartExpiredDialogConfirm=function(){var o;this.isCartExpired=false;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,n;return __generator(this,(function(t){switch(t.label){case 0:P.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;h.inventoryCheckErrorMessage=null;t.label=1;case 1:t.trys.push([1,3,,4]);o=h;return[4,A()];case 2:o.inventoryCheckErrorMessage=t.sent();return[3,4];case 3:e=t.sent();h.inventoryCheckErrorMessage=x("Unable to check inventory. Please try again.");return[3,4];case 4:if(h.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}t.label=5;case 5:t.trys.push([5,7,,8]);return[4,T()];case 6:t.sent();O();p();return[3,8];case 7:n=t.sent();F(n);D("zonos-checkout-payment-fail");f.hasPaymentError=true;if(f.shouldInventoryRefund){void I();f.shouldInventoryRefund=false}return[3,8];case 8:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,n,t;return __generator(this,(function(s){switch(s.label){case 0:j();if(!this.preview)return[3,2];h.step="customer-info";return[4,this.init()];case 1:s.sent();return[2];case 2:z();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){o=window.Zonos.cartData.storeBaseUrl;if(window.parent){window.parent.location.href=o}window.location.href=o;return[2]}e=window.location.href;n=e.split("?")[0];this.open=false;t=window.location.hostname.includes("dashboard.zonos.com");if(!t){window.history.replaceState(window.history.state,document.title,n);window.location.reload()}return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=Y(this.mobile);void this.applyStripeTheme();M("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=Y(this.mobile);void this.applyStripeTheme();M("mobile: ".concat(this.isMobile))};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=N(this.appearanceSettingsOverride.theme)}};o.prototype.handleAddressChange=function(){j()};o.prototype.handleOpenChange=function(){var o="data-zonos-overflow-origin";var e=document.body;var n=document.documentElement;if(this.open){if(e.style.overflow){e.setAttribute(o,e.style.overflow)}e.style.overflow="hidden";if(n.style.overflow){n.setAttribute(o,n.style.overflow)}n.style.overflow="hidden"}else{var t=e.getAttribute(o);var s=n.getAttribute(o);if(t){e.removeAttribute(o);e.style.overflow=t}else{e.style.removeProperty("overflow")}if(s){n.removeAttribute(o);n.style.overflow=s}else{n.style.removeProperty("overflow")}}};o.prototype.componentWillLoad=function(){var o=this;void this.init();this.isMobile=Y(this.mobile);this.isIframed=window.self!==window.top;M("iframed: ".concat(this.isIframed));this.handleAppearanceSettingsOverrideChange();this.onChangeLocaleListener=B("selectedLocale",(function(){void o.applyStripeTheme()}));M("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){j();z();this.onChangeLocaleListener()};o.prototype.render=function(){var o=this;var e,r,c,a;var u=h.step!=="finish"&&h.step!=="error"&&!f.stripeElements||f.isFetchingSession;var d=U(R.appearance,this.appearanceSettingsOverride||null),l=d.colorPrimary,m=d.colorSecondary,z=d.logoUrl,v=d.style;var p=R.appearance.zonosAttribution==="ENABLED";var g=R.appearance.theme;var k=l&&X(l)?"DARK":"LIGHT";var w=this.isMobile?g:k;var b=!this.isMobile?m:undefined;var y=i.customMessages;var C=(e=y.find((function(o){return o.pageName==="checkout_default"})))===null||e===void 0?void 0:e.message;var _=this.getCurrentLocalePageEnum();var S=y.filter((function(o){return o.pageName===_}));var O=function(){var e=o.preview?"".concat(z,"?timestamp=").concat(Date.now()):z;return n("div",{class:"zonos--logo"},e&&n("img",{alt:"".concat(R.organizationName," logo"),src:e}))};var A=K();var T=function(){var e=new URLSearchParams(window.location.search);var t=e.get("zonosQaUrl");var s=e.get("zonosDebug");var i=e.get("zonosE2ETest");return n("zonos-v-stack",null,n("div",{class:"zonos--logo-wrapper"},O(),A&&n("zonos-badge",{badgeColor:"orange",size:"small"},x("Test mode")),s==="1"&&n("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&n("zonos-badge",{badgeColor:"purple",size:"small"},t),i&&n("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),n("zonos-checkout-progress-tabs",{backgroundColor:o.isMobile?"--zonos-elements-gray-0":null}),S.map((function(o){return n("zonos-custom-message",{icon:mo,message:o.message})})))};var I=function(){if(h.checkoutSessionTimeoutShow){return n("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:x("Your checkout session has expired. Please reload the page to continue."),restStateTitle:x("Session timed out"),restStateType:"Warning"},n("zonos-button",{onClick:function(){return o.reloadCheckoutSession()},variant:"primary"},x("Reload")))}return n("div",{class:"zonos--content",style:{"--zonos--border-radius":Q({overrideBorderStyle:v})}},h.step!=="finish"&&h.step!=="error"&&n(s,null,n("div",{class:"zonos--left","data-theme":w,style:$({"--zonos--primary-color":!o.isMobile?l:undefined})},!o.isMobile&&T(),h.step==="customer-info"&&n("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress||o.defaultAddressParams,isMobile:o.isMobile,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:b}),h.step==="shipping"&&n("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:b}),h.step==="payment"&&n("zonos-checkout-payment",{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]}}))}))},submitBtnColor:b})),n("div",{class:"zonos--right","data-theme":g},o.isMobile&&T(),n("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&n("zonos-currency-toggle",null),!o.isLegacyCheckout&&n("zonos-button",{class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close checkout dialog",content:to}),noBackground:true,onClick:function(){return o.closeDialogHandler()}})),n("div",{class:"flex--wrapper"},n("div",{class:"zonos--wrapper"},n("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile}}),n("zonos-collapse",{collapsed:o.collapseReviewMobile&&o.isMobile},n("zonos-cart-items",null),o.isMobile&&n("zonos-v-stack",{spacing:16},n("zonos-cart-subtotal",{submitBtnColor:b}),n("zonos-custom-message",{class:"zonos--checkout-default-message",icon:mo,message:C})))),n("zonos-cart-restricted-items",null),!o.isMobile&&n("zonos-v-stack",{spacing:16},n("zonos-cart-subtotal",null),n("zonos-custom-message",{class:"zonos--checkout-default-message",icon:mo,message:C}))))),(h.step==="finish"||h.step==="error")&&n("div",{class:"zonos--done","data-theme":g},n("div",{class:"zonos--header"},O(),!o.isRedirectAfterOrder&&n("zonos-button",{class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close checkout dialog",content:to}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:g})),n("zonos-checkout-finish",{borderRadius:v,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:h.step==="error"&&!!h.error?Object.assign(Object.assign({},h.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),n("zonos-checkout-footer",{"data-theme":g,mobile:o.isMobile,slot:!o.isMobile?"dialog-footer":undefined}))};return n(t,{class:J(["zonos--checkout zonos--elements",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed"])},this.preview?I():n("zonos-dialog",{borderStyle:v,"data-theme":g,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},I()),n("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:x("Don't close"),dialogConfirmBtnText:x("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:x("Would you like to close checkout and return to the site?"),dialogTitle:x("Are you sure?"),onCancelClicked:function(){o.confirmDialogOpen=false},onConfirmClicked:function(){return o.closeDialogHandler({confirmed:true})}}),n("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:x("Return to merchant site"),dialogConfirmBtnText:x("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((r=this.placedOrderInfo)===null||r===void 0?void 0:r.zonosOrderNumber)?x("It looks like you placed an order just a few minutes ago ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):x("It looks like you placed an order just a few minutes ago ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((c=this.placedOrderInfo)===null||c===void 0?void 0:c.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:x("Are you sure?"),dialogWidth:530,onCancelClicked:function(){o.handleCancelOrderDuplication()},onConfirmClicked:function(){o.confirmProceedWithOrderDuplication()}}),n("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:x("Return to cart"),dialogIntent:"danger",dialogOpen:!!h.inventoryCheckErrorMessage,dialogSubtitle:h.inventoryCheckErrorMessage,dialogTitle:x("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return o.handleInventoryCheckDialogConfirm()}}),n("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:x("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:x("You are being sent back to the shop to re-add items to your cart."),dialogTitle:x("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return o.handleCartExpiredDialogConfirm()}}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return o}());ko.style=vo}}}));
|