@zonos/elements 1.2.4-alpha.10 → 1.2.4-alpha.12
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-90f7c8c0.js → cart-963ffc24.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-9caf3397.js → localization-994933ce.js} +1 -1
- package/dist/cjs/{submitGtag-b141b45d.js → submitGtag-e047f309.js} +1 -1
- package/dist/cjs/zonos-address_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +8 -2
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +2 -2
- package/dist/collection/components/main/zonos-controller.js +27 -0
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/scripts/zonos.js +4 -0
- package/dist/components/localization.js +1 -1
- package/dist/components/zonos-controller.js +8 -1
- package/dist/esm/{cart-b439be00.js → cart-c5236eec.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-a51ccbc2.js → localization-3cb32a71.js} +1 -1
- package/dist/esm/{submitGtag-521826a2.js → submitGtag-9de4957f.js} +1 -1
- package/dist/esm/zonos-address_2.entry.js +2 -2
- package/dist/esm/zonos-cart-items_10.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +8 -2
- package/dist/esm/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +2 -2
- package/dist/esm-es5/{cart-b439be00.js → cart-c5236eec.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{submitGtag-521826a2.js → submitGtag-9de4957f.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.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_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-payment.entry.js +1 -1
- package/dist/scripts/loadZonos.js +7 -3
- package/dist/scripts/zonos.js +7 -3
- package/dist/types/components/main/zonos-controller.d.ts +4 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/scripts/zonos.d.ts +2 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-b6148206.entry.js → p-07ebdfd9.entry.js} +1 -1
- package/dist/zonos-elements/{p-a0e36ed3.entry.js → p-0d536271.entry.js} +1 -1
- package/dist/zonos-elements/p-24fbe845.system.js +1 -1
- package/dist/zonos-elements/{p-494c77a7.entry.js → p-39013804.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9b832c5.entry.js → p-3e70063e.entry.js} +1 -1
- package/dist/zonos-elements/{p-4846796a.js → p-425996c1.js} +1 -1
- package/dist/zonos-elements/{p-a504f64f.system.js → p-509eb1de.system.js} +1 -1
- package/dist/zonos-elements/{p-f141519c.system.entry.js → p-510d3aa3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a15c5c7.system.entry.js → p-5554ff33.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4bee0bff.system.entry.js → p-65749745.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3cea383b.system.entry.js → p-6aa44c88.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c48b75e.system.js → p-6d4232a6.system.js} +1 -1
- package/dist/zonos-elements/{p-67aec665.entry.js → p-6f8da71e.entry.js} +1 -1
- package/dist/zonos-elements/{p-b4601210.system.entry.js → p-7fdc8b27.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-639396bb.entry.js → p-83c7c3f4.entry.js} +1 -1
- package/dist/zonos-elements/{p-afe26069.entry.js → p-8cefaae6.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a307c55.system.entry.js → p-8e4794fe.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4ed71bd7.entry.js → p-bb24e583.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c5595d9.system.entry.js → p-e06711b8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-06fb9d1f.system.entry.js → p-e100f180.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1685c8df.js → p-e2c2584c.js} +1 -1
- package/dist/zonos-elements/{p-d2217f09.system.js → p-f33e1ffb.system.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -2
- /package/dist/esm-es5/{localization-a51ccbc2.js → localization-3cb32a71.js} +0 -0
- /package/dist/zonos-elements/{p-b51de536.system.js → p-8a8b08e9.system.js} +0 -0
- /package/dist/zonos-elements/{p-3c6988d7.js → p-bbb154a9.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,s,t,n){function e(o){return o instanceof t?o:new t((function(s){s(o)}))}return new(t||(t=Promise))((function(t,i){function a(o){try{c(n.next(o))}catch(o){i(o)}}function r(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?t(o.value):e(o.value).then(a,r)}c((n=n.apply(o,s||[])).next())}))};var __generator=this&&this.__generator||function(o,s){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,e,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(s){return c([o,s])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,e&&(i=r[0]&2?e["return"]:r[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,r[1])).done)return i;if(e=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;e=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){t.label=r[1];break}if(r[0]===6&&t.label<i[1]){t.label=i[1];i=r;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(r);break}if(i[2])t.ops.pop();t.trys.pop();continue}r=s.call(o,t)}catch(o){r=[6,o];e=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,s,t){if(t||arguments.length===2)for(var n=0,e=s.length,i;n<e;n++){if(i||!(n in s)){if(!i)i=Array.prototype.slice.call(s,0,n);i[n]=s[n]}}return o.concat(i||Array.prototype.slice.call(s))};System.register(["./p-18904b7c.system.js","./p-d2217f09.system.js","./p-b51de536.system.js","./p-24eed2a8.system.js","./p-a504f64f.system.js","./p-b85be1ab.system.js","./p-23e7c655.system.js","./p-da060b1c.system.js"],(function(o){"use strict";var s,t,n,e,i,a,r,c,l,h,u,d,p,m,f,z,g,v,b,y,x,w;return{setters:[function(o){s=o.r;t=o.a;n=o.h;e=o.H;i=o.F;a=o.c;r=o.d},function(o){c=o.c;l=o.s;h=o.p;u=o.o;d=o.i;p=o.b},function(o){m=o.t;f=o.h;z=o.b},function(o){g=o.g},function(o){v=o.s;b=o.i},function(o){y=o.e;x=o.z},function(o){w=o.c},function(){}],execute:function(){var k=function(o){var s=o.amount,t=o.currency,n=o.showCurrencyText;return n?"".concat(new Intl.NumberFormat("en-US",{currency:t,style:"currency"}).format(s)," ").concat(t):new Intl.NumberFormat("en-US",{currency:t,style:"currency"}).format(s)};var C=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-8);font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}";var I=o("zonos_cart_items",function(){function o(o){s(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var s;var i=t("./assets/empty-item.jpeg");var a=((s=c.exchangeRate)===null||s===void 0?void 0:s.rate)||1;return n(e,{class:"zonos--cart-items zonos--elements"},n("table",{class:"zonos--cart-table"},n("tbody",null,c.items.map((function(s){var t=s.imageUrl;return n("tr",{class:"zonos--cart-item"},n("td",{class:"zonos--column zonos--cart-item-image"},t&&!o.errorImages.includes(t)?n("img",{alt:s.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[t],false)},src:s.imageUrl,style:{"min-width":"40px"},width:40}):n("img",{alt:s.name,src:i,width:40})),n("td",{class:"zonos--column zonos--cart-item-name"},n("zonos-text",{type:"label"},s.name)),n("td",{class:"zonos--column zonos--cart-item-price"},n("zonos-text",{type:"semiBoldLabel"},k({amount:s.amount*s.quantity*a,currency:c.currency}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());I.style=C;var _='<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.96704 8.00065C1.96704 4.31875 4.93024 1.33398 8.58554 1.33398C12.2408 1.33398 15.204 4.31875 15.204 8.00065C15.204 11.6826 12.2408 14.6673 8.58554 14.6673C4.93024 14.6673 1.96704 11.6825 1.96704 8.00065Z" fill="#C5C6CA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.58543 4.66016C8.95096 4.66016 9.24728 4.95863 9.24728 5.32682V5.33349C9.24728 5.70168 8.95096 6.00016 8.58543 6.00016C8.2199 6.00016 7.92358 5.70168 7.92358 5.33349V5.32682C7.92358 4.95863 8.2199 4.66016 8.58543 4.66016ZM8.58543 7.33349C8.95096 7.33349 9.24728 7.63197 9.24728 8.00016V10.6668C9.24728 11.035 8.95096 11.3335 8.58543 11.3335C8.2199 11.3335 7.92358 11.035 7.92358 10.6668V8.00016C7.92358 7.63197 8.2199 7.33349 8.58543 7.33349Z" fill="#4D505A"/>\n</svg>\n';var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}";var L=o("zonos_cart_subtotal",function(){function o(o){s(this,o)}o.prototype.render=function(){var o=c.total-c.dutiesTaxFees;var s=c.step==="payment"||c.step==="shipping";var t=function(){if(!c.selectedShippingOption){return n(i,null,n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Shipping")),n("zonos-text",{class:"zonos--caption",type:"caption"},m("No shipping method selected")))}return n(i,null,n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},c.selectedShippingOption.displayName),c.selectedShippingOptionTransitTime&&n("zonos-text",{class:"zonos--caption",type:"caption"},c.selectedShippingOptionTransitTime," ",m("business days")))};return n(e,{class:"zonos--cart-subtotal zonos--elements"},n("table",{class:"zonos--cart-table"},n("tr",{class:"zonos--row zonos--cart-subtotal"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},n("zonos-text",{type:"semiBoldLabel"},m("Cart subtotal"))),n("td",{class:"zonos--column zonos--cart-subtotal-price"},n("zonos-text",{type:"semiBoldLabel"},k({amount:c.subtotal,currency:c.currency})))),n("tr",{class:"zonos--row zonos--cart-shipping"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},t()),n("td",{class:"zonos--column zonos--cart-subtotal-price"},c.shipping?k({amount:c.shipping,currency:c.currency}):"-")),s&&n("tr",{class:"zonos--row zonos--cart-duties"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},n("div",{class:"zonos--title-with-icon"},n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Duties, taxes, and fees")),n("zonos-icon",{content:_,size:16})),!!c.isSelectedShippingAboveDeminimis&&n("zonos-text",{color:"gray-800",type:"body"},m("Order is over the de minimis threshold for both duty and tax"))),n("td",{class:"zonos--column zonos--cart-subtotal-price"},n("div",{class:"zonos--cart-duty-tax-price"},c.dutiesTaxFees?k({amount:c.dutiesTaxFees,currency:c.currency}):"-",c.isSelectedShippingGuarantee&&n("zonos-badge",null,m("Guaranteed"))))),n("tr",{class:"zonos--row zonos--cart-pay-total"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column"},n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Order total"))),n("td",{class:"zonos--column"},n("zonos-text",{type:"semiBoldLabel"},k({amount:c.step==="shipping"?o:c.total,currency:c.currency}))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());L.style=j;var B='<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var S='<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var D=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--amino-space-24);border-radius:var(--border-radius, 10px);gap:var(--amino-space-24);max-width:360px;width:auto;margin:auto;margin-top:var(--amino-space-24);background-color:var(--amino-gray-50);padding:var(--amino-space-20)}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}";var Z=o("zonos_checkout_finish",function(){function o(o){var t=this;s(this,o);this.closeClick=a(this,"closeClick",7);this.pullOrder=function(){return __awaiter(t,void 0,void 0,(function(){var o,s,t,n,e,i,a,r,l;return __generator(this,(function(h){switch(h.label){case 0:t="https://v1.route.js.zonos.com";n=c.checkoutSessionId;return[4,f("".concat(t,"/api/zonos-elements/get-order?checkoutSessionId=").concat(n))];case 1:e=h.sent(),i=e.errors,a=e.json;if(i.length||!(a===null||a===void 0?void 0:a.id)){return[2,null]}if(window.Zonos.isBigCommerce){r=a===null||a===void 0?void 0:a.id;l=(s=(o=a===null||a===void 0?void 0:a.metadata)===null||o===void 0?void 0:o.find((function(o){return(o===null||o===void 0?void 0:o.key)==="storeHash"})))===null||s===void 0?void 0:s.value;if(!r||!l){return[2,z("Unable to trigger BigCommerce /success: Missing orderId or storeHash")]}void f("".concat(t,"/api/bigcommerce/success?orderId=").concat(r,"&storeHash=").concat(l))}return[2,a]}}))}))};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var s;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.pullOrder()];case 1:s=t.sent();if(!s)return[3,2];this.order=s;return[3,5];case 2:if(!(!s&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:t.sent();return[4,this.getPullOrder(o+1)];case 4:t.sent();t.label=5;case 5:return[2]}}))}))};this.checkPaymentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,s,t,n,e;return __generator(this,(function(i){switch(i.label){case 0:this.isLoading=true;o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||l.clientSecret;if(!(o||this.storybookForceStatus))return[3,2];return[4,h({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:s=i.sent(),t=s.error,n=s.messages;this.notificationType=t?"error":"success";this.notificationMessages=n||[];this.notificationTitle=t?m("Payment failed"):m("You're all set!");if(t){v("zonos-checkout-payment-fail")}else{v("zonos-checkout-success");e=new CustomEvent("zonos-checkout-success",{detail:{message:"Zonos Checkout successfully processed order"}});document.dispatchEvent(e)}if(this.notificationType==="success"){void this.getPullOrder()}i.label=2;case 2:u();this.isLoading=false;return[2]}}))}))};this.closeClickHandler=function(){t.closeClick.emit()};this.borderRadius="ROUNDED";this.storybookForceStatus=undefined;this.overrideNotification=undefined;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.order=null}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}void this.checkPaymentStatus()};o.prototype.render=function(){var o=this;return n(e,{class:"zonos--checkout-finish zonos--elements",style:{"--border-radius":g(this.borderRadius)}},this.isLoading&&n("div",{class:"loading-wrapper"},n("zonos-spinner",null)),!this.isLoading&&n(i,null,n("div",{class:"zonos--group"},this.notificationType==="success"?n("zonos-icon",{color:"blue-800",content:S,size:50}):n("zonos-icon",{color:"red-800",content:B,size:50}),n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),n("zonos-text",null,this.notificationMessages.map((function(o){return n(i,null,o,n("br",null))}))),n("zonos-button",{onClick:function(){return o.closeClickHandler()},size:"md",variant:"primary"},m("Keep shopping")))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Z.style=D;var O=".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:calc(100% - 10px)}";var A=o("zonos_checkout_payment",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.paymentError=false;this.submitBtnType=undefined;this.continueLoading=false;this.submitBtnColor=undefined;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-payment-info")}};o.prototype.render=function(){var o=this;var s;if(!l.stripeElements){return null}this.disabled=!((s=l.stripePaymentEventData)===null||s===void 0?void 0:s.complete);return n(e,{class:"zonos--checkout-payment zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Payment method")),this.paymentError&&n("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},m("We couldn't complete your payment. Please verify the payment details and try again.")),n("zonos-payment",null)),n("div",{class:"zonos--group-btn"},n("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},"Pay"," ",k({amount:c.total,currency:c.currency}))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());A.style=O;var M=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var P=o("zonos_collapse",function(){function o(o){s(this,o);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight}o.prototype.getElementHeight=function(){var o="".concat(this.height,"px");var s="".concat(this.collapseSize,"px");return this.collapsed?s:o};o.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};o.prototype.componentDidRender=function(){var o=this;var s,t,n;(n=(t=(s=this.el.shadowRoot)===null||s===void 0?void 0:s.querySelector("iframe"))===null||t===void 0?void 0:t.contentWindow)===null||n===void 0?void 0:n.addEventListener("resize",(function(){o.height=o.el.scrollHeight}))};o.prototype.render=function(){this.height=this.el.scrollHeight;return n(e,{class:"zonos--elements zonos--collapse",style:{"--font-family":y(),height:this.getElementHeight()}},n("div",null,n("iframe",{class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),n("slot",null)))};Object.defineProperty(o.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return o}());P.style=M;var T=".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:calc(100% - 10px)}";var E=o("zonos_customer_info",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.defaultAddress=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-customer-info")}};o.prototype.render=function(){var o=this;var s,t;if(!l.stripeElements){return null}this.disabled=!((s=l.stripeAddressEventData)===null||s===void 0?void 0:s.complete)||!((t=l.stripeLinkEventData)===null||t===void 0?void 0:t.complete);return n(e,{class:"zonos--customer-info zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Customer information")),n("zonos-link-authentication",{titleText:m("Contact")}),n("zonos-address",{defaultAddress:this.defaultAddress,titleText:m("Address"),type:"shipping"})),n("div",{class:"zonos--group-btn"},n("zonos-button",{backgroundColor:this.submitBtnColor,isDisabled:this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},m("Continue to shipping"))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());E.style=T;var H='<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 U=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:1002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:1001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var F=o("zonos_dialog",function(){function o(o){var t=this;s(this,o);this.closeDialog=a(this,"closeDialog",7);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){t.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.footerRightAction=null;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var o=g(this.borderStyle);return n(e,{class:w(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":o,"--font-family":y(),"--height":this.height||"initial","--width":this.width}},n("div",{class:"zonos--backdrop"}),n("div",{"aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},n("div",{class:"zonos--dialog"},this.isLoading&&n("div",{class:"zonos--loading"},n("zonos-spinner",{size:30})),(this.headerText||!this.noCloseButton)&&n("div",{class:"zonos--header"},this.headerText&&n("h3",{class:"zonos--header-text"},this.headerText),!this.noCloseButton&&n("zonos-button",{class:"zonos--close-button",icon:n("zonos-icon",{content:H}),noBackground:true,onClick:this.closeButtonHandler})),n("div",{class:w(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},n("slot",null)),this.footerRightAction&&n("div",{class:"zonos--footer"},n("div",{class:"zonos--footer-right-action"},this.footerRightAction)))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());F.style=U;var G=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var R=o("zonos_logo",function(){function o(o){s(this,o);this.theme="LIGHT";this.width="auto";this.class=""}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return n(e,{class:w(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":y(),"--width":this.width}},n("img",{alt:"Zonos Logo",src:t("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());R.style=G;var V='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var N='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var K=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--total-pay{margin:var(--amino-space-16) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8)}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";var W=o("zonos_review",function(){function o(o){s(this,o);this.mobile=false;this.collapsed=false;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=b(this.mobile)};o.prototype.componentWillLoad=function(){this.isMobile=b(this.mobile)};o.prototype.render=function(){var o=this;var s=this.isMobile?"boldSubheader":"semiBoldLabel";var t=this.isMobile?"boldSubheader":"secondaryPageHeader";var i=this.isMobile?"gray-1200":"gray-800";var a=c.total-c.dutiesTaxFees;var r=function(){if(!o.isMobile){return null}if(!o.collapsed){return n("zonos-icon",{color:"gray-1200",content:V})}return n("zonos-icon",{color:"gray-1200",content:N})};return n(e,{class:w(["zonos--review zonos--elements",this.isMobile&&"mobile"])},n("div",{class:"zonos--title"},n("zonos-text",{color:i,type:s},m("Pay")," ",x.organizationName),r()),n("div",{class:"zonos--total-pay"},n("zonos-text",{type:t},k({amount:c.step==="shipping"?a:c.total,currency:c.currency}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());W.style=K;var Y=".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:calc(100% - 10px)}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";var q=o("zonos_shipping",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.handleRadioSelected=function(o){return __awaiter(t,void 0,void 0,(function(){var s,t,n;var e=this;return __generator(this,(function(i){switch(i.label){case 0:this.selectedShippingMethod=o.detail;if(!this.selectedShippingMethod){return[2]}t=((s=c.shippingData)===null||s===void 0?void 0:s.find((function(o){var s;return o.id===((s=e.selectedShippingMethod)===null||s===void 0?void 0:s.value)})))||null;if(!t){return[2]}return[4,d(t)];case 1:n=i.sent();if(!n){return[2]}this.disabled=false;return[2]}}))}))};this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnColor=undefined;this.submitBtnType=undefined;this.selectedShippingMethod=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-shipping-info")}};o.prototype.render=function(){var o=this;var s;var t=(s=c.shippingData)===null||s===void 0?void 0:s.flatMap((function(o){var s,t;var n=p(o),e=n.expectedDate,i=n.maxTransit,a=n.minTransit;var r=e?"".concat(m("Expected delivery")," ").concat(e):"";var l=a&&i?"(".concat(a,"-").concat(i," ").concat(m("business days"),")"):"";var h=((t=(s=c.landedCostData)===null||s===void 0?void 0:s.find((function(s){var t;return((t=s.landedCost)===null||t===void 0?void 0:t.shipmentRating.id)===o.id})))===null||t===void 0?void 0:t.subtotals.shipping)||0;return{caption:l,label:o.displayName,price:k({amount:h,currency:c.currency}),sublabel:r,value:o.id}}));return n(e,{class:"zonos--shipping zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Shipping information")),n("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},m("Shipping method")),!(t===null||t===void 0?void 0:t.length)?n("zonos-banner",{bannerTitle:"No shipping methods found - try editing your address or contacting support if the error persists",intent:"error"}):n("zonos-shipping-rich-radio",{items:t||[],onRadioSelected:function(s){return o.handleRadioSelected(s)}})),n("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},m("Go to payment")))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());q.style=Y}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,s,t,n){function e(o){return o instanceof t?o:new t((function(s){s(o)}))}return new(t||(t=Promise))((function(t,i){function a(o){try{c(n.next(o))}catch(o){i(o)}}function r(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?t(o.value):e(o.value).then(a,r)}c((n=n.apply(o,s||[])).next())}))};var __generator=this&&this.__generator||function(o,s){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,e,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(s){return c([o,s])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,e&&(i=r[0]&2?e["return"]:r[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,r[1])).done)return i;if(e=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;e=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){t.label=r[1];break}if(r[0]===6&&t.label<i[1]){t.label=i[1];i=r;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(r);break}if(i[2])t.ops.pop();t.trys.pop();continue}r=s.call(o,t)}catch(o){r=[6,o];e=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,s,t){if(t||arguments.length===2)for(var n=0,e=s.length,i;n<e;n++){if(i||!(n in s)){if(!i)i=Array.prototype.slice.call(s,0,n);i[n]=s[n]}}return o.concat(i||Array.prototype.slice.call(s))};System.register(["./p-18904b7c.system.js","./p-f33e1ffb.system.js","./p-8a8b08e9.system.js","./p-24eed2a8.system.js","./p-509eb1de.system.js","./p-b85be1ab.system.js","./p-23e7c655.system.js","./p-da060b1c.system.js"],(function(o){"use strict";var s,t,n,e,i,a,r,c,l,h,u,d,p,m,f,z,g,v,b,y,x,w;return{setters:[function(o){s=o.r;t=o.a;n=o.h;e=o.H;i=o.F;a=o.c;r=o.d},function(o){c=o.c;l=o.s;h=o.p;u=o.o;d=o.i;p=o.b},function(o){m=o.t;f=o.h;z=o.b},function(o){g=o.g},function(o){v=o.s;b=o.i},function(o){y=o.e;x=o.z},function(o){w=o.c},function(){}],execute:function(){var k=function(o){var s=o.amount,t=o.currency,n=o.showCurrencyText;return n?"".concat(new Intl.NumberFormat("en-US",{currency:t,style:"currency"}).format(s)," ").concat(t):new Intl.NumberFormat("en-US",{currency:t,style:"currency"}).format(s)};var C=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-8);font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}";var I=o("zonos_cart_items",function(){function o(o){s(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var s;var i=t("./assets/empty-item.jpeg");var a=((s=c.exchangeRate)===null||s===void 0?void 0:s.rate)||1;return n(e,{class:"zonos--cart-items zonos--elements"},n("table",{class:"zonos--cart-table"},n("tbody",null,c.items.map((function(s){var t=s.imageUrl;return n("tr",{class:"zonos--cart-item"},n("td",{class:"zonos--column zonos--cart-item-image"},t&&!o.errorImages.includes(t)?n("img",{alt:s.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[t],false)},src:s.imageUrl,style:{"min-width":"40px"},width:40}):n("img",{alt:s.name,src:i,width:40})),n("td",{class:"zonos--column zonos--cart-item-name"},n("zonos-text",{type:"label"},s.name)),n("td",{class:"zonos--column zonos--cart-item-price"},n("zonos-text",{type:"semiBoldLabel"},k({amount:s.amount*s.quantity*a,currency:c.currency}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());I.style=C;var _='<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.96704 8.00065C1.96704 4.31875 4.93024 1.33398 8.58554 1.33398C12.2408 1.33398 15.204 4.31875 15.204 8.00065C15.204 11.6826 12.2408 14.6673 8.58554 14.6673C4.93024 14.6673 1.96704 11.6825 1.96704 8.00065Z" fill="#C5C6CA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.58543 4.66016C8.95096 4.66016 9.24728 4.95863 9.24728 5.32682V5.33349C9.24728 5.70168 8.95096 6.00016 8.58543 6.00016C8.2199 6.00016 7.92358 5.70168 7.92358 5.33349V5.32682C7.92358 4.95863 8.2199 4.66016 8.58543 4.66016ZM8.58543 7.33349C8.95096 7.33349 9.24728 7.63197 9.24728 8.00016V10.6668C9.24728 11.035 8.95096 11.3335 8.58543 11.3335C8.2199 11.3335 7.92358 11.035 7.92358 10.6668V8.00016C7.92358 7.63197 8.2199 7.33349 8.58543 7.33349Z" fill="#4D505A"/>\n</svg>\n';var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}";var L=o("zonos_cart_subtotal",function(){function o(o){s(this,o)}o.prototype.render=function(){var o=c.total-c.dutiesTaxFees;var s=c.step==="payment"||c.step==="shipping";var t=function(){if(!c.selectedShippingOption){return n(i,null,n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Shipping")),n("zonos-text",{class:"zonos--caption",type:"caption"},m("No shipping method selected")))}return n(i,null,n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},c.selectedShippingOption.displayName),c.selectedShippingOptionTransitTime&&n("zonos-text",{class:"zonos--caption",type:"caption"},c.selectedShippingOptionTransitTime," ",m("business days")))};return n(e,{class:"zonos--cart-subtotal zonos--elements"},n("table",{class:"zonos--cart-table"},n("tr",{class:"zonos--row zonos--cart-subtotal"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},n("zonos-text",{type:"semiBoldLabel"},m("Cart subtotal"))),n("td",{class:"zonos--column zonos--cart-subtotal-price"},n("zonos-text",{type:"semiBoldLabel"},k({amount:c.subtotal,currency:c.currency})))),n("tr",{class:"zonos--row zonos--cart-shipping"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},t()),n("td",{class:"zonos--column zonos--cart-subtotal-price"},c.shipping?k({amount:c.shipping,currency:c.currency}):"-")),s&&n("tr",{class:"zonos--row zonos--cart-duties"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column zonos--cart-subtotal-title"},n("div",{class:"zonos--title-with-icon"},n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Duties, taxes, and fees")),n("zonos-icon",{content:_,size:16})),!!c.isSelectedShippingAboveDeminimis&&n("zonos-text",{color:"gray-800",type:"body"},m("Order is over the de minimis threshold for both duty and tax"))),n("td",{class:"zonos--column zonos--cart-subtotal-price"},n("div",{class:"zonos--cart-duty-tax-price"},c.dutiesTaxFees?k({amount:c.dutiesTaxFees,currency:c.currency}):"-",c.isSelectedShippingGuarantee&&n("zonos-badge",null,m("Guaranteed"))))),n("tr",{class:"zonos--row zonos--cart-pay-total"},n("td",{class:"zonos--column"}),n("td",{class:"zonos--column"},n("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Order total"))),n("td",{class:"zonos--column"},n("zonos-text",{type:"semiBoldLabel"},k({amount:c.step==="shipping"?o:c.total,currency:c.currency}))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());L.style=j;var B='<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var S='<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var D=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--amino-space-24);border-radius:var(--border-radius, 10px);gap:var(--amino-space-24);max-width:360px;width:auto;margin:auto;margin-top:var(--amino-space-24);background-color:var(--amino-gray-50);padding:var(--amino-space-20)}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}";var Z=o("zonos_checkout_finish",function(){function o(o){var t=this;s(this,o);this.closeClick=a(this,"closeClick",7);this.pullOrder=function(){return __awaiter(t,void 0,void 0,(function(){var o,s,t,n,e,i,a,r,l;return __generator(this,(function(h){switch(h.label){case 0:t="https://v1.route.js.zonos.com";n=c.checkoutSessionId;return[4,f("".concat(t,"/api/zonos-elements/get-order?checkoutSessionId=").concat(n))];case 1:e=h.sent(),i=e.errors,a=e.json;if(i.length||!(a===null||a===void 0?void 0:a.id)){return[2,null]}if(window.Zonos.isBigCommerce){r=a===null||a===void 0?void 0:a.id;l=(s=(o=a===null||a===void 0?void 0:a.metadata)===null||o===void 0?void 0:o.find((function(o){return(o===null||o===void 0?void 0:o.key)==="storeHash"})))===null||s===void 0?void 0:s.value;if(!r||!l){return[2,z("Unable to trigger BigCommerce /success: Missing orderId or storeHash")]}void f("".concat(t,"/api/bigcommerce/success?orderId=").concat(r,"&storeHash=").concat(l))}return[2,a]}}))}))};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var s;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.pullOrder()];case 1:s=t.sent();if(!s)return[3,2];this.order=s;return[3,5];case 2:if(!(!s&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:t.sent();return[4,this.getPullOrder(o+1)];case 4:t.sent();t.label=5;case 5:return[2]}}))}))};this.checkPaymentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,s,t,n,e;return __generator(this,(function(i){switch(i.label){case 0:this.isLoading=true;o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||l.clientSecret;if(!(o||this.storybookForceStatus))return[3,2];return[4,h({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:s=i.sent(),t=s.error,n=s.messages;this.notificationType=t?"error":"success";this.notificationMessages=n||[];this.notificationTitle=t?m("Payment failed"):m("You're all set!");if(t){v("zonos-checkout-payment-fail")}else{v("zonos-checkout-success");e=new CustomEvent("zonos-checkout-success",{detail:{message:"Zonos Checkout successfully processed order"}});document.dispatchEvent(e)}if(this.notificationType==="success"){void this.getPullOrder()}i.label=2;case 2:u();this.isLoading=false;return[2]}}))}))};this.closeClickHandler=function(){t.closeClick.emit()};this.borderRadius="ROUNDED";this.storybookForceStatus=undefined;this.overrideNotification=undefined;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.order=null}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}void this.checkPaymentStatus()};o.prototype.render=function(){var o=this;return n(e,{class:"zonos--checkout-finish zonos--elements",style:{"--border-radius":g(this.borderRadius)}},this.isLoading&&n("div",{class:"loading-wrapper"},n("zonos-spinner",null)),!this.isLoading&&n(i,null,n("div",{class:"zonos--group"},this.notificationType==="success"?n("zonos-icon",{color:"blue-800",content:S,size:50}):n("zonos-icon",{color:"red-800",content:B,size:50}),n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),n("zonos-text",null,this.notificationMessages.map((function(o){return n(i,null,o,n("br",null))}))),n("zonos-button",{onClick:function(){return o.closeClickHandler()},size:"md",variant:"primary"},m("Keep shopping")))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Z.style=D;var O=".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:calc(100% - 10px)}";var A=o("zonos_checkout_payment",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.paymentError=false;this.submitBtnType=undefined;this.continueLoading=false;this.submitBtnColor=undefined;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-payment-info")}};o.prototype.render=function(){var o=this;var s;if(!l.stripeElements){return null}this.disabled=!((s=l.stripePaymentEventData)===null||s===void 0?void 0:s.complete);return n(e,{class:"zonos--checkout-payment zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Payment method")),this.paymentError&&n("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},m("We couldn't complete your payment. Please verify the payment details and try again.")),n("zonos-payment",null)),n("div",{class:"zonos--group-btn"},n("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},"Pay"," ",k({amount:c.total,currency:c.currency}))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());A.style=O;var M=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var P=o("zonos_collapse",function(){function o(o){s(this,o);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight}o.prototype.getElementHeight=function(){var o="".concat(this.height,"px");var s="".concat(this.collapseSize,"px");return this.collapsed?s:o};o.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};o.prototype.componentDidRender=function(){var o=this;var s,t,n;(n=(t=(s=this.el.shadowRoot)===null||s===void 0?void 0:s.querySelector("iframe"))===null||t===void 0?void 0:t.contentWindow)===null||n===void 0?void 0:n.addEventListener("resize",(function(){o.height=o.el.scrollHeight}))};o.prototype.render=function(){this.height=this.el.scrollHeight;return n(e,{class:"zonos--elements zonos--collapse",style:{"--font-family":y(),height:this.getElementHeight()}},n("div",null,n("iframe",{class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),n("slot",null)))};Object.defineProperty(o.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return o}());P.style=M;var T=".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:calc(100% - 10px)}";var E=o("zonos_customer_info",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.defaultAddress=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-customer-info")}};o.prototype.render=function(){var o=this;var s,t;if(!l.stripeElements){return null}this.disabled=!((s=l.stripeAddressEventData)===null||s===void 0?void 0:s.complete)||!((t=l.stripeLinkEventData)===null||t===void 0?void 0:t.complete);return n(e,{class:"zonos--customer-info zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Customer information")),n("zonos-link-authentication",{titleText:m("Contact")}),n("zonos-address",{defaultAddress:this.defaultAddress,titleText:m("Address"),type:"shipping"})),n("div",{class:"zonos--group-btn"},n("zonos-button",{backgroundColor:this.submitBtnColor,isDisabled:this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},m("Continue to shipping"))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());E.style=T;var H='<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 U=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:1002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:1001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var F=o("zonos_dialog",function(){function o(o){var t=this;s(this,o);this.closeDialog=a(this,"closeDialog",7);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){t.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.footerRightAction=null;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var o=g(this.borderStyle);return n(e,{class:w(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":o,"--font-family":y(),"--height":this.height||"initial","--width":this.width}},n("div",{class:"zonos--backdrop"}),n("div",{"aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},n("div",{class:"zonos--dialog"},this.isLoading&&n("div",{class:"zonos--loading"},n("zonos-spinner",{size:30})),(this.headerText||!this.noCloseButton)&&n("div",{class:"zonos--header"},this.headerText&&n("h3",{class:"zonos--header-text"},this.headerText),!this.noCloseButton&&n("zonos-button",{class:"zonos--close-button",icon:n("zonos-icon",{content:H}),noBackground:true,onClick:this.closeButtonHandler})),n("div",{class:w(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},n("slot",null)),this.footerRightAction&&n("div",{class:"zonos--footer"},n("div",{class:"zonos--footer-right-action"},this.footerRightAction)))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());F.style=U;var G=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var R=o("zonos_logo",function(){function o(o){s(this,o);this.theme="LIGHT";this.width="auto";this.class=""}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return n(e,{class:w(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":y(),"--width":this.width}},n("img",{alt:"Zonos Logo",src:t("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());R.style=G;var V='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var N='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var K=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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--total-pay{margin:var(--amino-space-16) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8)}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";var W=o("zonos_review",function(){function o(o){s(this,o);this.mobile=false;this.collapsed=false;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=b(this.mobile)};o.prototype.componentWillLoad=function(){this.isMobile=b(this.mobile)};o.prototype.render=function(){var o=this;var s=this.isMobile?"boldSubheader":"semiBoldLabel";var t=this.isMobile?"boldSubheader":"secondaryPageHeader";var i=this.isMobile?"gray-1200":"gray-800";var a=c.total-c.dutiesTaxFees;var r=function(){if(!o.isMobile){return null}if(!o.collapsed){return n("zonos-icon",{color:"gray-1200",content:V})}return n("zonos-icon",{color:"gray-1200",content:N})};return n(e,{class:w(["zonos--review zonos--elements",this.isMobile&&"mobile"])},n("div",{class:"zonos--title"},n("zonos-text",{color:i,type:s},m("Pay")," ",x.organizationName),r()),n("div",{class:"zonos--total-pay"},n("zonos-text",{type:t},k({amount:c.step==="shipping"?a:c.total,currency:c.currency}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());W.style=K;var Y=".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:calc(100% - 10px)}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";var q=o("zonos_shipping",function(){function o(o){var t=this;s(this,o);this.continueClicked=a(this,"continueClicked",7);this.handleRadioSelected=function(o){return __awaiter(t,void 0,void 0,(function(){var s,t,n;var e=this;return __generator(this,(function(i){switch(i.label){case 0:this.selectedShippingMethod=o.detail;if(!this.selectedShippingMethod){return[2]}t=((s=c.shippingData)===null||s===void 0?void 0:s.find((function(o){var s;return o.id===((s=e.selectedShippingMethod)===null||s===void 0?void 0:s.value)})))||null;if(!t){return[2]}return[4,d(t)];case 1:n=i.sent();if(!n){return[2]}this.disabled=false;return[2]}}))}))};this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnColor=undefined;this.submitBtnType=undefined;this.selectedShippingMethod=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){v("zonos-checkout-shipping-info")}};o.prototype.render=function(){var o=this;var s;var t=(s=c.shippingData)===null||s===void 0?void 0:s.flatMap((function(o){var s,t;var n=p(o),e=n.expectedDate,i=n.maxTransit,a=n.minTransit;var r=e?"".concat(m("Expected delivery")," ").concat(e):"";var l=a&&i?"(".concat(a,"-").concat(i," ").concat(m("business days"),")"):"";var h=((t=(s=c.landedCostData)===null||s===void 0?void 0:s.find((function(s){var t;return((t=s.landedCost)===null||t===void 0?void 0:t.shipmentRating.id)===o.id})))===null||t===void 0?void 0:t.subtotals.shipping)||0;return{caption:l,label:o.displayName,price:k({amount:h,currency:c.currency}),sublabel:r,value:o.id}}));return n(e,{class:"zonos--shipping zonos--elements"},n("div",{class:"zonos--group"},n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Shipping information")),n("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},m("Shipping method")),!(t===null||t===void 0?void 0:t.length)?n("zonos-banner",{bannerTitle:"No shipping methods found - try editing your address or contacting support if the error persists",intent:"error"}):n("zonos-shipping-rich-radio",{items:t||[],onRadioSelected:function(s){return o.handleRadioSelected(s)}})),n("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},m("Go to payment")))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}());q.style=Y}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"./p-089ba905.js";import{l as s}from"./p-
|
|
1
|
+
import{z as o}from"./p-089ba905.js";import{l as s}from"./p-bbb154a9.js";const n=o=>o||window.innerWidth<890,t=n=>{const t=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));t&&"DISABLED"!==(null==t?void 0:t.status)&&"function"==typeof window.gtag&&(s("Zonos submits gtag event","log",n),window.gtag("event",n,{}))};export{n as i,t as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r["throw"](e))}catch(e){o(e)}}function u(e){e.done?t(e.value):i(e.value).then(a,s)}u((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return u([e,n])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(t=0)),t)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){t.label=s[1];break}if(s[0]===6&&t.label<o[1]){t.label=o[1];o=s;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(s);break}if(o[2])t.ops.pop();t.trys.pop();continue}s=n.call(e,t)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-b85be1ab.system.js","./p-b51de536.system.js","./p-da060b1c.system.js","./p-24eed2a8.system.js"],(function(e){"use strict";var n,t,r,i,o,a,s,u,c;return{setters:[function(e){n=e.z;t=e.c},function(e){r=e.h;i=e.l;o=e.a;a=e.b;s=e.t},function(e){u=e.i},function(e){c=e.g}],execute:function(){var l=this;var d=function(){var e=y.stripeLinkEventData;var n=y.stripeAddressEventData;if(!n||!n.complete){throw new Error("Missing stripe address data")}return{checkoutSessionId:B.checkoutSessionId||"",contact:{email:(e===null||e===void 0?void 0:e.value.email)||"",firstName:n.value.firstName||"",lastName:n.value.lastName||"",phone:n.value.phone||""},items:B.items.map((function(e){return e})),shippingAddress:{addressLine1:n.value.address.line1,addressLine2:n.value.address.line2||"",city:n.value.address.city,country:n.value.address.country,postalCode:n.value.address.postal_code,state:n.value.address.state}}};var v=function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:t=d();return[4,e(t.checkoutSessionId,t.contact,t.shippingAddress)];case 1:i=u.sent();if(!i){throw new Error("Failed to build landed cost")}return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/validate-landed-cost"),{body:i,headers:{"Content-Type":"application/json"},method:"POST"})];case 2:o=u.sent(),a=o.errors,s=o.json;if(!s||a.length){throw new Error("Invalid landed cost object: ".concat(((n=a.find(Boolean))===null||n===void 0?void 0:n.message)||"Unknown error"))}return[2,i]}}))}))};var f=function(e){return __awaiter(l,void 0,void 0,(function(){var t,i,o,a,s,u;return __generator(this,(function(c){switch(c.label){case 0:t=n.checkoutSettings.buildLandedCost;if(!t)return[3,2];return[4,v(t)];case 1:i=c.sent();return[2,i];case 2:o="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/calculate-landed-cost");return[4,r(o,{body:d(),method:"POST",signal:e===null||e===void 0?void 0:e.signal})];case 3:a=c.sent(),s=a.errors,u=a.json;if(s.length||!u){throw new Error("Failed to calculate landed cost")}return[2,u]}}))}))};var h=function(e){var n=e.theme;switch(n){default:return{".Input":{padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"}}}};var p=function(e){var n=e.borderStyle,t=e.theme;switch(t){case"DARK":return{borderRadius:c(n),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"};default:return{borderRadius:c(n)}}};var m=t((function(){return{clientSecret:sessionStorage.getItem("zonos--client-secret")||null,fetchingLandedCostAbordController:null,isFetchingLandedCost:false,isFetchingSession:false,stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenFetchingLC:null,stripeBillingAddressElement:null,stripeElements:null,stripeElementsOptions:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null}})),g=m.onChange,w=m.reset,y=m.state;e("s",y);var _=function(e){var t=e.clientSecret,r=e.overrideBorderRaidus,i=e.overridePrimaryColor,a=e.overrideTheme;var s=i||n.appearance.colorPrimary;var c=s&&u(s)?"night":"flat";var l=a==="DARK"?"night":"flat";return{appearance:{labels:"floating",rules:Object.assign({},h({theme:"LIGHT"})),theme:a?l:c,variables:Object.assign({},p({borderStyle:r,theme:"LIGHT"}))},clientSecret:t,locale:o.selectedLocale}};var S=e("k",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(a){t=y.clientSecret;if(!y.stripe){i("Skip. Stripe is not initialized");return[2]}if(t){r=_({clientSecret:t,overrideBorderRaidus:e===null||e===void 0?void 0:e.overrideBorderRaidus,overridePrimaryColor:e===null||e===void 0?void 0:e.overridePrimaryColor,overrideTheme:e===null||e===void 0?void 0:e.overrideTheme});o=JSON.stringify(r)===JSON.stringify(y.stripeElementsOptions);if(!y.stripeElements){y.stripeElements=(n=y.stripe)===null||n===void 0?void 0:n.elements(r);y.stripeElementsOptions=r;i("Stripe elements initialized");return[2]}if(!o){y.stripeElements.update(r);y.stripeElementsOptions=r}i("Stripe elements initialized")}return[2]}))}))}));var b=e("o",(function(){sessionStorage.removeItem("zonos--client-secret");w();y.stripe=window.Zonos.stripe}));var k=function(){var e,n,t,r;var i=y.fetchingLandedCostAbordController;if(!i){return false}var o=JSON.stringify((e=y.stripeLinkUsedWhenFetchingLC)===null||e===void 0?void 0:e.value)!==JSON.stringify((n=y.stripeLinkEventData)===null||n===void 0?void 0:n.value);var a=JSON.stringify((t=y.stripeAddressUsedWhenFetchingLC)===null||t===void 0?void 0:t.value)!==JSON.stringify((r=y.stripeAddressEventData)===null||r===void 0?void 0:r.value);return o||a};var C=e("m",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,r,i,o,s,u,c,l,d,v,h,p;return __generator(this,(function(m){switch(m.label){case 0:i=!!((e=y.stripeAddressEventData)===null||e===void 0?void 0:e.complete);o=!!((n=y.stripeLinkEventData)===null||n===void 0?void 0:n.complete);s=k();if(s){(t=y.fetchingLandedCostAbordController)===null||t===void 0?void 0:t.abort();y.fetchingLandedCostAbordController=null}if(!(i&&o&&(s||!y.isFetchingLandedCost)))return[3,5];y.isFetchingLandedCost=true;if(y.stripeAddressEventData){y.stripeAddressUsedWhenFetchingLC=Object.assign({},y.stripeAddressEventData)}if(y.stripeLinkEventData){y.stripeLinkUsedWhenFetchingLC=Object.assign({},y.stripeLinkEventData)}m.label=1;case 1:m.trys.push([1,3,,4]);u=new AbortController;y.fetchingLandedCostAbordController=u;return[4,f(u)];case 2:c=m.sent(),l=c.checkoutSessionWorkflow,d=c.shipmentRatingCalculateWorkflow;y.fetchingLandedCostAbordController=null;B.landedCostData=(l===null||l===void 0?void 0:l.filter(Boolean))||null;B.shippingData=(d===null||d===void 0?void 0:d.filter(Boolean))||null;v=(r=B.landedCostData)===null||r===void 0?void 0:r.find(Boolean);h=!!v?v.subtotals:null;if(h){J({exchangeRate:h.exchangeRate,items:h.items,landedCostTotal:0,presentmentCurrencyCode:h.presentmentCurrencyCode,shipping:0,total:h.items})}return[3,4];case 3:p=m.sent();a(p);return[3,4];case 4:y.isFetchingLandedCost=false;m.label=5;case 5:return[2]}}))}))}));var E=function(e){var n=[];var t=true;switch(e){case"succeeded":{n=[s("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"","",s("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")];t=false;break}case"requires_capture":case"processing":{n=[s("Payment processing. We'll update you when payment is received.")];t=false;break}case"requires_payment_method":{n=[s("Payment failed. Please try another payment method.")];break}default:{n=[s("Something went wrong.")];break}}return{isError:t,messages:n}};var O=e("p",(function(e){var n=e.clientSecret,t=e.storybookForceStatus;return __awaiter(l,void 0,void 0,(function(){var e,r,i,o,u,c,l,d,v;return __generator(this,(function(f){switch(f.label){case 0:if(t){e=E(t),r=e.isError,i=e.messages;return[2,{error:r,messages:i}]}o=n||y.clientSecret;if(!y.stripe||!o){a("Failed to retrieve payment intent. Stripe is not initialized");return[2,{error:true,message:[s("Something went wrong.")]}]}return[4,y.stripe.retrievePaymentIntent(o)];case 1:u=f.sent().paymentIntent;c=u===null||u===void 0?void 0:u.status;l=E(c),d=l.isError,v=l.messages;return[2,{error:d,messages:v}]}}))}))}));var T=e("n",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,r,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:r=!!((e=y.stripePaymentEventData)===null||e===void 0?void 0:e.complete);i=y.stripeElements;o=y.stripe;a=y.clientSecret;if(!(o&&i&&r&&a))return[3,2];return[4,o.confirmPayment({confirmParams:{receipt_email:(t=(n=y.stripeLinkEventData)===null||n===void 0?void 0:n.value)===null||t===void 0?void 0:t.email,return_url:window.location.href},elements:i,redirect:"if_required"})];case 1:s=u.sent().error;if(s){if(s.type==="card_error"||s.type==="validation_error"){throw new Error(s.message)}if(s.type==="invalid_request_error"){if(s.code==="payment_intent_unexpected_state"){return[2]}}throw new Error("An unexpected error occurred.")}u.label=2;case 2:return[2]}}))}))}));var x=e("l",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,s,u,c;return __generator(this,(function(l){switch(l.label){case 0:n=B.items.reduce((function(e,n){return e+n.amount*n.quantity}),0);if(!n||!o.targetCurrency){a("Fail to create checkout session - invalid total or currency");return[2,false]}y.isFetchingSession=true;return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/create-checkout-session"),{body:{currency:((e=B.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"",itemsAmount:n,presentmentCountryCode:o.selectedCountryCode||null},method:"POST"})];case 1:t=l.sent(),s=t.errors,u=t.json;y.isFetchingSession=false;if(s.length||!u){a("Error occurs when creating checkout session",JSON.stringify(s,null,2));return[2,false]}c=u.checkoutSessionCreate;y.clientSecret=c.clientSecret;B.checkoutSessionId=c.id;J(Object.assign(Object.assign({},c.subtotals),{landedCostTotal:0,shipping:0,total:c.subtotals.items}));i("Exchange rate updated for cart items (checkout session create)","info",B.exchangeRate);i("done-init-checkout-session");return[2,true]}}))}))}));var A=function(e){var n=e.currency,t=e.id,i=e.itemsAmount,o=e.landedCostId,s=e.presentmentCountryCode;return __awaiter(l,void 0,void 0,(function(){var e,u,c;return __generator(this,(function(l){switch(l.label){case 0:return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/update-checkout-session"),{body:{currency:n,id:t,itemsAmount:i,landedCostId:o,presentmentCountryCode:s},method:"POST"})];case 1:e=l.sent(),u=e.errors,c=e.json;if(u.length||!c){a("Error occurs when updating checkout session",JSON.stringify(u,null,2));return[2,{errors:u,json:c}]}return[2,{errors:[],json:c}]}}))}))};g("clientSecret",(function(e){if(e&&y.stripe){sessionStorage.setItem("zonos--client-secret",e)}if(!e){sessionStorage.removeItem("zonos--client-secret")}}));var j=function(e){var n=e.date,t=e.formatOptions,r=t===void 0?{day:"numeric",weekday:"long",year:"numeric"}:t;return new Intl.DateTimeFormat("en-US",r).format(n)};var z=function(e){var n=new Date;var t=e.getTime()-n.getTime();var r=Math.floor(t/(1e3*60*60*24));return r};var D=t((function(){return{checkoutSessionId:sessionStorage.getItem("zonos--checkout-session-id")||null,currency:"USD",dutiesTaxFees:0,error:null,exchangeRate:null,isSelectedShippingAboveDeminimis:false,isSelectedShippingGuarantee:false,items:[],landedCostData:null,selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,step:"customer-info",subtotal:0,total:0}})),P=D.onChange,L=D.reset,B=D.state;e("c",B);var I=e("b",(function(e){var n=e.minTransitAt?z(new Date(e.minTransitAt)):"";var t=e.maxTransitAt?z(new Date(e.maxTransitAt)):"";var r=e.minTransitAt?j({date:new Date(e.minTransitAt)}):"";return{expectedDate:r,maxTransit:t,minTransit:n}}));var N=e("g",(function(){sessionStorage.removeItem("zonos--checkout-session-id");L()}));var F=e("j",(function(e){var n=e.messages,t=e.title;B.step="error";B.error={messages:n,title:t}}));var J=e("a",(function(e){B.exchangeRate=e.exchangeRate;B.dutiesTaxFees=e.landedCostTotal;B.subtotal=e.items;B.total=e.total;B.currency=e.presentmentCurrencyCode}));var R=e("f",(function(e){var n=e.currency,t=e.itemsAmount,r=e.landedCostId;return __awaiter(l,void 0,void 0,(function(){var e,u;return __generator(this,(function(c){switch(c.label){case 0:if(r&&B.selectedLandedCost){e=B.selectedLandedCost.subtotals;J(e);i("Exchange rate updated for cart items (landed cost subtotal)","info",B.exchangeRate)}if(!B.checkoutSessionId){a("Could not update cart total without checkout session id");return[2,false]}return[4,A({currency:n,id:B.checkoutSessionId,itemsAmount:t,landedCostId:r,presentmentCountryCode:o.selectedCountryCode})];case 1:u=c.sent().json;if(!u){a("Error occurs when updating checkout session");F({messages:[s("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists")],title:s("Error updating Checkout")});return[2,false]}if(!r){J(u.checkoutSessionUpdate.subtotals);i("Exchange rate updated for cart items (checkout session update)","info",B.exchangeRate)}return[2,true]}}))}))}));var U=e("i",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r,i,o,a,s,u,c,l,d,v,f;return __generator(this,(function(h){switch(h.label){case 0:B.selectedShippingOption=e;a=I(B.selectedShippingOption),s=a.expectedDate,u=a.maxTransit,c=a.minTransit;B.selectedShippingOptionExpectedDate=s;B.selectedShippingOptionTransitTime=c&&u?"".concat(c,"-").concat(u):"".concat(c||u);l=(n=B.landedCostData)===null||n===void 0?void 0:n.find((function(e){var n,t,r;return((t=(n=e.landedCost)===null||n===void 0?void 0:n.shipmentRating)===null||t===void 0?void 0:t.id)===((r=B.selectedShippingOption)===null||r===void 0?void 0:r.id)}));B.selectedLandedCost=l||null;if(!l){return[2,false]}B.shipping=l.subtotals.shipping;d=((t=l===null||l===void 0?void 0:l.landedCost)===null||t===void 0?void 0:t.landedCostGuaranteeCode)==="ZONOS";v=!!((i=(r=l===null||l===void 0?void 0:l.landedCost)===null||r===void 0?void 0:r.deMinimis)===null||i===void 0?void 0:i.find((function(e){return["DUTY","TAX"].includes(e.type)&&e.threshold==="ABOVE"})));B.isSelectedShippingAboveDeminimis=v;B.isSelectedShippingGuarantee=d;return[4,R({landedCostId:(o=l.landedCost)===null||o===void 0?void 0:o.id})];case 1:f=h.sent();return[2,f]}}))}))}));P("checkoutSessionId",(function(){if(!B.checkoutSessionId){sessionStorage.removeItem("zonos--checkout-session-id");return}sessionStorage.setItem("zonos--checkout-session-id",B.checkoutSessionId)}));var W=e("h",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r;return __generator(this,(function(i){switch(i.label){case 0:B.items=e;t=(n=e.find(Boolean))===null||n===void 0?void 0:n.currencyCode;r=e.reduce((function(e,n){return e+n.amount*n.quantity}),0);if(!t||!r){return[2]}B.currency=t;y.isFetchingSession=true;return[4,R({currency:t,itemsAmount:r})];case 1:i.sent();y.isFetchingSession=false;return[2]}}))}))}));var q=function(){B.selectedShippingOption=null;B.isSelectedShippingAboveDeminimis=false;B.isSelectedShippingGuarantee=false;B.selectedShippingOptionExpectedDate="";B.selectedShippingOptionTransitTime="";B.shipping=0};var G=e("d",(function(){if(B.step==="customer-info"){B.step="shipping"}else if(B.step==="shipping"){B.step="payment"}else if(B.step==="payment"){B.step="finish"}}));var H=e("e",(function(){if(B.step==="payment"){B.step="shipping"}else if(B.step==="shipping"){B.step="customer-info";q()}}))}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r["throw"](e))}catch(e){o(e)}}function u(e){e.done?t(e.value):i(e.value).then(a,s)}u((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return u([e,n])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(t=0)),t)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){t.label=s[1];break}if(s[0]===6&&t.label<o[1]){t.label=o[1];o=s;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(s);break}if(o[2])t.ops.pop();t.trys.pop();continue}s=n.call(e,t)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-b85be1ab.system.js","./p-8a8b08e9.system.js","./p-da060b1c.system.js","./p-24eed2a8.system.js"],(function(e){"use strict";var n,t,r,i,o,a,s,u,c;return{setters:[function(e){n=e.z;t=e.c},function(e){r=e.h;i=e.l;o=e.a;a=e.b;s=e.t},function(e){u=e.i},function(e){c=e.g}],execute:function(){var l=this;var d=function(){var e=y.stripeLinkEventData;var n=y.stripeAddressEventData;if(!n||!n.complete){throw new Error("Missing stripe address data")}return{checkoutSessionId:B.checkoutSessionId||"",contact:{email:(e===null||e===void 0?void 0:e.value.email)||"",firstName:n.value.firstName||"",lastName:n.value.lastName||"",phone:n.value.phone||""},items:B.items.map((function(e){return e})),shippingAddress:{addressLine1:n.value.address.line1,addressLine2:n.value.address.line2||"",city:n.value.address.city,country:n.value.address.country,postalCode:n.value.address.postal_code,state:n.value.address.state}}};var v=function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:t=d();return[4,e(t.checkoutSessionId,t.contact,t.shippingAddress)];case 1:i=u.sent();if(!i){throw new Error("Failed to build landed cost")}return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/validate-landed-cost"),{body:i,headers:{"Content-Type":"application/json"},method:"POST"})];case 2:o=u.sent(),a=o.errors,s=o.json;if(!s||a.length){throw new Error("Invalid landed cost object: ".concat(((n=a.find(Boolean))===null||n===void 0?void 0:n.message)||"Unknown error"))}return[2,i]}}))}))};var f=function(e){return __awaiter(l,void 0,void 0,(function(){var t,i,o,a,s,u;return __generator(this,(function(c){switch(c.label){case 0:t=n.checkoutSettings.buildLandedCost;if(!t)return[3,2];return[4,v(t)];case 1:i=c.sent();return[2,i];case 2:o="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/calculate-landed-cost");return[4,r(o,{body:d(),method:"POST",signal:e===null||e===void 0?void 0:e.signal})];case 3:a=c.sent(),s=a.errors,u=a.json;if(s.length||!u){throw new Error("Failed to calculate landed cost")}return[2,u]}}))}))};var h=function(e){var n=e.theme;switch(n){default:return{".Input":{padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"}}}};var p=function(e){var n=e.borderStyle,t=e.theme;switch(t){case"DARK":return{borderRadius:c(n),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"};default:return{borderRadius:c(n)}}};var m=t((function(){return{clientSecret:sessionStorage.getItem("zonos--client-secret")||null,fetchingLandedCostAbordController:null,isFetchingLandedCost:false,isFetchingSession:false,stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenFetchingLC:null,stripeBillingAddressElement:null,stripeElements:null,stripeElementsOptions:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null}})),g=m.onChange,w=m.reset,y=m.state;e("s",y);var _=function(e){var t=e.clientSecret,r=e.overrideBorderRaidus,i=e.overridePrimaryColor,a=e.overrideTheme;var s=i||n.appearance.colorPrimary;var c=s&&u(s)?"night":"flat";var l=a==="DARK"?"night":"flat";return{appearance:{labels:"floating",rules:Object.assign({},h({theme:"LIGHT"})),theme:a?l:c,variables:Object.assign({},p({borderStyle:r,theme:"LIGHT"}))},clientSecret:t,locale:o.selectedLocale}};var S=e("k",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(a){t=y.clientSecret;if(!y.stripe){i("Skip. Stripe is not initialized");return[2]}if(t){r=_({clientSecret:t,overrideBorderRaidus:e===null||e===void 0?void 0:e.overrideBorderRaidus,overridePrimaryColor:e===null||e===void 0?void 0:e.overridePrimaryColor,overrideTheme:e===null||e===void 0?void 0:e.overrideTheme});o=JSON.stringify(r)===JSON.stringify(y.stripeElementsOptions);if(!y.stripeElements){y.stripeElements=(n=y.stripe)===null||n===void 0?void 0:n.elements(r);y.stripeElementsOptions=r;i("Stripe elements initialized");return[2]}if(!o){y.stripeElements.update(r);y.stripeElementsOptions=r}i("Stripe elements initialized")}return[2]}))}))}));var b=e("o",(function(){sessionStorage.removeItem("zonos--client-secret");w();y.stripe=window.Zonos.stripe}));var k=function(){var e,n,t,r;var i=y.fetchingLandedCostAbordController;if(!i){return false}var o=JSON.stringify((e=y.stripeLinkUsedWhenFetchingLC)===null||e===void 0?void 0:e.value)!==JSON.stringify((n=y.stripeLinkEventData)===null||n===void 0?void 0:n.value);var a=JSON.stringify((t=y.stripeAddressUsedWhenFetchingLC)===null||t===void 0?void 0:t.value)!==JSON.stringify((r=y.stripeAddressEventData)===null||r===void 0?void 0:r.value);return o||a};var C=e("m",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,r,i,o,s,u,c,l,d,v,h,p;return __generator(this,(function(m){switch(m.label){case 0:i=!!((e=y.stripeAddressEventData)===null||e===void 0?void 0:e.complete);o=!!((n=y.stripeLinkEventData)===null||n===void 0?void 0:n.complete);s=k();if(s){(t=y.fetchingLandedCostAbordController)===null||t===void 0?void 0:t.abort();y.fetchingLandedCostAbordController=null}if(!(i&&o&&(s||!y.isFetchingLandedCost)))return[3,5];y.isFetchingLandedCost=true;if(y.stripeAddressEventData){y.stripeAddressUsedWhenFetchingLC=Object.assign({},y.stripeAddressEventData)}if(y.stripeLinkEventData){y.stripeLinkUsedWhenFetchingLC=Object.assign({},y.stripeLinkEventData)}m.label=1;case 1:m.trys.push([1,3,,4]);u=new AbortController;y.fetchingLandedCostAbordController=u;return[4,f(u)];case 2:c=m.sent(),l=c.checkoutSessionWorkflow,d=c.shipmentRatingCalculateWorkflow;y.fetchingLandedCostAbordController=null;B.landedCostData=(l===null||l===void 0?void 0:l.filter(Boolean))||null;B.shippingData=(d===null||d===void 0?void 0:d.filter(Boolean))||null;v=(r=B.landedCostData)===null||r===void 0?void 0:r.find(Boolean);h=!!v?v.subtotals:null;if(h){J({exchangeRate:h.exchangeRate,items:h.items,landedCostTotal:0,presentmentCurrencyCode:h.presentmentCurrencyCode,shipping:0,total:h.items})}return[3,4];case 3:p=m.sent();a(p);return[3,4];case 4:y.isFetchingLandedCost=false;m.label=5;case 5:return[2]}}))}))}));var E=function(e){var n=[];var t=true;switch(e){case"succeeded":{n=[s("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"","",s("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")];t=false;break}case"requires_capture":case"processing":{n=[s("Payment processing. We'll update you when payment is received.")];t=false;break}case"requires_payment_method":{n=[s("Payment failed. Please try another payment method.")];break}default:{n=[s("Something went wrong.")];break}}return{isError:t,messages:n}};var O=e("p",(function(e){var n=e.clientSecret,t=e.storybookForceStatus;return __awaiter(l,void 0,void 0,(function(){var e,r,i,o,u,c,l,d,v;return __generator(this,(function(f){switch(f.label){case 0:if(t){e=E(t),r=e.isError,i=e.messages;return[2,{error:r,messages:i}]}o=n||y.clientSecret;if(!y.stripe||!o){a("Failed to retrieve payment intent. Stripe is not initialized");return[2,{error:true,message:[s("Something went wrong.")]}]}return[4,y.stripe.retrievePaymentIntent(o)];case 1:u=f.sent().paymentIntent;c=u===null||u===void 0?void 0:u.status;l=E(c),d=l.isError,v=l.messages;return[2,{error:d,messages:v}]}}))}))}));var T=e("n",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,r,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:r=!!((e=y.stripePaymentEventData)===null||e===void 0?void 0:e.complete);i=y.stripeElements;o=y.stripe;a=y.clientSecret;if(!(o&&i&&r&&a))return[3,2];return[4,o.confirmPayment({confirmParams:{receipt_email:(t=(n=y.stripeLinkEventData)===null||n===void 0?void 0:n.value)===null||t===void 0?void 0:t.email,return_url:window.location.href},elements:i,redirect:"if_required"})];case 1:s=u.sent().error;if(s){if(s.type==="card_error"||s.type==="validation_error"){throw new Error(s.message)}if(s.type==="invalid_request_error"){if(s.code==="payment_intent_unexpected_state"){return[2]}}throw new Error("An unexpected error occurred.")}u.label=2;case 2:return[2]}}))}))}));var x=e("l",(function(){return __awaiter(l,void 0,void 0,(function(){var e,n,t,s,u,c;return __generator(this,(function(l){switch(l.label){case 0:n=B.items.reduce((function(e,n){return e+n.amount*n.quantity}),0);if(!n||!o.targetCurrency){a("Fail to create checkout session - invalid total or currency");return[2,false]}y.isFetchingSession=true;return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/create-checkout-session"),{body:{currency:((e=B.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"",itemsAmount:n,presentmentCountryCode:o.selectedCountryCode||null},method:"POST"})];case 1:t=l.sent(),s=t.errors,u=t.json;y.isFetchingSession=false;if(s.length||!u){a("Error occurs when creating checkout session",JSON.stringify(s,null,2));return[2,false]}c=u.checkoutSessionCreate;y.clientSecret=c.clientSecret;B.checkoutSessionId=c.id;J(Object.assign(Object.assign({},c.subtotals),{landedCostTotal:0,shipping:0,total:c.subtotals.items}));i("Exchange rate updated for cart items (checkout session create)","info",B.exchangeRate);i("done-init-checkout-session");return[2,true]}}))}))}));var A=function(e){var n=e.currency,t=e.id,i=e.itemsAmount,o=e.landedCostId,s=e.presentmentCountryCode;return __awaiter(l,void 0,void 0,(function(){var e,u,c;return __generator(this,(function(l){switch(l.label){case 0:return[4,r("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/update-checkout-session"),{body:{currency:n,id:t,itemsAmount:i,landedCostId:o,presentmentCountryCode:s},method:"POST"})];case 1:e=l.sent(),u=e.errors,c=e.json;if(u.length||!c){a("Error occurs when updating checkout session",JSON.stringify(u,null,2));return[2,{errors:u,json:c}]}return[2,{errors:[],json:c}]}}))}))};g("clientSecret",(function(e){if(e&&y.stripe){sessionStorage.setItem("zonos--client-secret",e)}if(!e){sessionStorage.removeItem("zonos--client-secret")}}));var j=function(e){var n=e.date,t=e.formatOptions,r=t===void 0?{day:"numeric",weekday:"long",year:"numeric"}:t;return new Intl.DateTimeFormat("en-US",r).format(n)};var z=function(e){var n=new Date;var t=e.getTime()-n.getTime();var r=Math.floor(t/(1e3*60*60*24));return r};var D=t((function(){return{checkoutSessionId:sessionStorage.getItem("zonos--checkout-session-id")||null,currency:"USD",dutiesTaxFees:0,error:null,exchangeRate:null,isSelectedShippingAboveDeminimis:false,isSelectedShippingGuarantee:false,items:[],landedCostData:null,selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,step:"customer-info",subtotal:0,total:0}})),P=D.onChange,L=D.reset,B=D.state;e("c",B);var I=e("b",(function(e){var n=e.minTransitAt?z(new Date(e.minTransitAt)):"";var t=e.maxTransitAt?z(new Date(e.maxTransitAt)):"";var r=e.minTransitAt?j({date:new Date(e.minTransitAt)}):"";return{expectedDate:r,maxTransit:t,minTransit:n}}));var N=e("g",(function(){sessionStorage.removeItem("zonos--checkout-session-id");L()}));var F=e("j",(function(e){var n=e.messages,t=e.title;B.step="error";B.error={messages:n,title:t}}));var J=e("a",(function(e){B.exchangeRate=e.exchangeRate;B.dutiesTaxFees=e.landedCostTotal;B.subtotal=e.items;B.total=e.total;B.currency=e.presentmentCurrencyCode}));var R=e("f",(function(e){var n=e.currency,t=e.itemsAmount,r=e.landedCostId;return __awaiter(l,void 0,void 0,(function(){var e,u;return __generator(this,(function(c){switch(c.label){case 0:if(r&&B.selectedLandedCost){e=B.selectedLandedCost.subtotals;J(e);i("Exchange rate updated for cart items (landed cost subtotal)","info",B.exchangeRate)}if(!B.checkoutSessionId){a("Could not update cart total without checkout session id");return[2,false]}return[4,A({currency:n,id:B.checkoutSessionId,itemsAmount:t,landedCostId:r,presentmentCountryCode:o.selectedCountryCode})];case 1:u=c.sent().json;if(!u){a("Error occurs when updating checkout session");F({messages:[s("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists")],title:s("Error updating Checkout")});return[2,false]}if(!r){J(u.checkoutSessionUpdate.subtotals);i("Exchange rate updated for cart items (checkout session update)","info",B.exchangeRate)}return[2,true]}}))}))}));var U=e("i",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r,i,o,a,s,u,c,l,d,v,f;return __generator(this,(function(h){switch(h.label){case 0:B.selectedShippingOption=e;a=I(B.selectedShippingOption),s=a.expectedDate,u=a.maxTransit,c=a.minTransit;B.selectedShippingOptionExpectedDate=s;B.selectedShippingOptionTransitTime=c&&u?"".concat(c,"-").concat(u):"".concat(c||u);l=(n=B.landedCostData)===null||n===void 0?void 0:n.find((function(e){var n,t,r;return((t=(n=e.landedCost)===null||n===void 0?void 0:n.shipmentRating)===null||t===void 0?void 0:t.id)===((r=B.selectedShippingOption)===null||r===void 0?void 0:r.id)}));B.selectedLandedCost=l||null;if(!l){return[2,false]}B.shipping=l.subtotals.shipping;d=((t=l===null||l===void 0?void 0:l.landedCost)===null||t===void 0?void 0:t.landedCostGuaranteeCode)==="ZONOS";v=!!((i=(r=l===null||l===void 0?void 0:l.landedCost)===null||r===void 0?void 0:r.deMinimis)===null||i===void 0?void 0:i.find((function(e){return["DUTY","TAX"].includes(e.type)&&e.threshold==="ABOVE"})));B.isSelectedShippingAboveDeminimis=v;B.isSelectedShippingGuarantee=d;return[4,R({landedCostId:(o=l.landedCost)===null||o===void 0?void 0:o.id})];case 1:f=h.sent();return[2,f]}}))}))}));P("checkoutSessionId",(function(){if(!B.checkoutSessionId){sessionStorage.removeItem("zonos--checkout-session-id");return}sessionStorage.setItem("zonos--checkout-session-id",B.checkoutSessionId)}));var W=e("h",(function(e){return __awaiter(l,void 0,void 0,(function(){var n,t,r;return __generator(this,(function(i){switch(i.label){case 0:B.items=e;t=(n=e.find(Boolean))===null||n===void 0?void 0:n.currencyCode;r=e.reduce((function(e,n){return e+n.amount*n.quantity}),0);if(!t||!r){return[2]}B.currency=t;y.isFetchingSession=true;return[4,R({currency:t,itemsAmount:r})];case 1:i.sent();y.isFetchingSession=false;return[2]}}))}))}));var q=function(){B.selectedShippingOption=null;B.isSelectedShippingAboveDeminimis=false;B.isSelectedShippingGuarantee=false;B.selectedShippingOptionExpectedDate="";B.selectedShippingOptionTransitTime="";B.shipping=0};var G=e("d",(function(){if(B.step==="customer-info"){B.step="shipping"}else if(B.step==="shipping"){B.step="payment"}else if(B.step==="payment"){B.step="finish"}}));var H=e("e",(function(){if(B.step==="payment"){B.step="shipping"}else if(B.step==="shipping"){B.step="customer-info";q()}}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-956efa27.js";export{s as setNonce}from"./p-956efa27.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-938803f4",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-956efa27.js";export{s as setNonce}from"./p-956efa27.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-938803f4",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-8cefaae6",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],paymentError:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}]]],["p-3e70063e",[[1,"zonos-hello",{mobileLocationOverride:[1,"mobile-location-override"],animateFromLeftOverride:[4,"animate-from-left-override"],appearanceSettingsOverride:[16],showPeekMessage:[32],zonosStoreHelloSettings:[32],showDialog:[32],peekMessage:[32],initialUrl:[32],allRestrictedItems:[32],allFoundProducts:[32],productsOnPage:[32],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64]},[[9,"resize","handleResize"]]]]],["p-6f8da71e",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64],updateOrganizationName:[64]}]]],["p-684ed483",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-bb24e583",[[1,"zonos-country-select",{closeCountrySelect:[16],inputValue:[32]}],[1,"zonos-hello-dialog-footer",{appearanceSettings:[16],setShowCountrySelect:[16]}],[1,"zonos-custom-message",{icon:[1],message:[1]}],[1,"zonos-country-flag",{class:[1],countryCode:[1,"country-code"],size:[2]}]]],["p-0d536271",[[1,"zonos-hello-dialog",{isOpen:[4,"is-open"],setIsOpen:[16],mobileLocationOverride:[1,"mobile-location-override"],animateFromLeftOverride:[4,"animate-from-left-override"],appearanceSettings:[16],restrictedItems:[16],welcomeMessage:[32],showCountrySelect:[32]},[[4,"click","globalClickHandler"]],{isOpen:["isOpenHandler"]}]]],["p-a376a37f",[[1,"zonos-notification",{class:[1],notificationArray:[32],showNotification:[64]}]]],["p-4d93275c",[[1,"zonos-badge",{bold:[4],color:[1],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4],class:[1]}]]],["p-83c7c3f4",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}]]],["p-89c210d6",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],selectedItem:[32]}]]],["p-07ebdfd9",[[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32]},null,{stripe:["watchInitStripe"]}],[2,"zonos-link-authentication",{titleText:[1,"title-text"],stripe:[32]},null,{stripe:["watchInitStripe"]}]]],["p-e1f6ab97",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],class:[1],hasContent:[32]}]]],["p-1d4a970b",[[1,"zonos-card",{actions:[16],class:[1],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}],[1,"zonos-v-stack",{spacing:[2],class:[1]}]]],["p-2801d868",[[1,"zonos-icon",{autoHeight:[4,"auto-height"],color:[1],content:[1],size:[2]}]]],["p-49f09b91",[[1,"zonos-button",{class:[1],color:[1],backgroundColor:[1,"background-color"],borderStyle:[1,"border-style"],isDisabled:[4,"is-disabled"],icon:[16],iconRight:[4,"icon-right"],size:[1],variant:[1],noBackground:[4,"no-background"],noPaddingLeft:[4,"no-padding-left"],noPaddingRight:[4,"no-padding-right"],loading:[4],theme:[1],hasIcon:[32],hasContent:[32]},[[2,"click","clickHandler"]],{icon:["iconChangeHandler"]}],[1,"zonos-spinner",{size:[2],color:[1]}]]],["p-39013804",[[2,"zonos-checkout-payment",{paymentError:[4,"payment-error"],submitBtnType:[1,"submit-btn-type"],continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],defaultAddress:[16],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],disabled:[32]},null,{disabled:["watchFormComplete"]}],[1,"zonos-checkout-finish",{borderRadius:[1,"border-radius"],storybookForceStatus:[1,"storybook-force-status"],overrideNotification:[16],isLoading:[32],notificationType:[32],notificationTitle:[32],notificationMessages:[32],order:[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{open:[4],headerText:[1,"header-text"],width:[1],height:[1],noHeader:[4,"no-header"],noBodyPadding:[4,"no-body-padding"],noBorder:[4,"no-border"],footerRightAction:[16],borderStyle:[1,"border-style"],noCloseButton:[4,"no-close-button"],noClickOutside:[4,"no-click-outside"],mobile:[4],isLoading:[4,"is-loading"],isMobile:[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{mobile:[4],collapsed:[4],isMobile:[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{errorImages:[32]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32]}],[1,"zonos-logo",{theme:[1],width:[1],class:[1]}]]]],e)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zonos/elements",
|
|
3
|
-
"version": "1.2.4-alpha.
|
|
3
|
+
"version": "1.2.4-alpha.12",
|
|
4
4
|
"description": "Zonos component UI for Stripe elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"loader/"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "pnpm build:css && mkdir -p dist && pnpm build:components && pnpm build:scripts",
|
|
24
|
+
"build": "pnpm build:css && mkdir -p dist && pnpm build:components && pnpm build:scripts && pnpm css:copy",
|
|
25
25
|
"build:components": "stencil build --docs",
|
|
26
26
|
"build:scripts": "pnpm rollup --config ./rollup.config.ts --configPlugin typescript",
|
|
27
27
|
"build:css": "pnpm css:sass && pnpm css:minify",
|
|
28
28
|
"css:minify": "cleancss -O2 -o ./src/css/zonos-elements.css ./src/css/zonos-elements.css",
|
|
29
29
|
"css:sass": "sass --embed-sources src/styles/css:./src/css",
|
|
30
|
+
"css:copy": "echo ./dist/zonos-elements ./www/dist/zonos-elements | xargs -n 1 cp ./src/css/zonos-elements.css",
|
|
30
31
|
"dev": "concurrently 'pnpm build:css && mkdir -p dist && stencil build --watch --es5 --serve --no-open --port 7001' 'pnpm proxy' 'pnpm dev:scripts'",
|
|
31
32
|
"dev:scripts": "pnpm build:scripts --watch",
|
|
32
33
|
"dev:open": "open https://dev.elements.zonos.com:7002",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|