@zonos/elements 1.3.277 → 1.3.279
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-65e8da66.js → cart-e8bc11a3.js} +7 -2
- package/dist/cjs/{collect-37c177ab.js → collect-e6485168.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-96f5c802.js → invoice-dff7ec81.js} +1 -1
- package/dist/cjs/{paypal-1952f6ec.js → paypal-77bd640c.js} +1 -1
- package/dist/cjs/{placeTestOrder-30191a8f.js → placeTestOrder-7767d119.js} +1 -1
- package/dist/cjs/{renderCheckoutCurrency-fd35b4ef.js → renderCheckoutCurrency-66377cf5.js} +1 -1
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +4 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +5 -5
- package/dist/cjs/zonos-collect.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice.cjs.entry.js +3 -3
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +7 -2
- package/dist/esm/{cart-402dcde5.js → cart-8b8dc79f.js} +7 -2
- package/dist/esm/{collect-b88fe4ca.js → collect-f4965586.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-5eb27944.js → invoice-b7a1fb14.js} +1 -1
- package/dist/esm/{paypal-2d4c9d01.js → paypal-da551105.js} +1 -1
- package/dist/esm/{placeTestOrder-2ba7c3f2.js → placeTestOrder-4309b170.js} +1 -1
- package/dist/esm/{renderCheckoutCurrency-ef71083e.js → renderCheckoutCurrency-0ed221ac.js} +1 -1
- package/dist/esm/zonos-address-display_8.entry.js +1 -1
- package/dist/esm/zonos-address_4.entry.js +1 -1
- package/dist/esm/zonos-airwallex-payment.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +2 -2
- package/dist/esm/zonos-cart-items_12.entry.js +4 -4
- package/dist/esm/zonos-checkout.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm/zonos-collect-finish_6.entry.js +5 -5
- package/dist/esm/zonos-collect.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
- package/dist/esm/zonos-invoice-finish_5.entry.js +5 -5
- package/dist/esm/zonos-invoice.entry.js +3 -3
- package/dist/esm/zonos-policy-consent_2.entry.js +2 -2
- package/dist/esm-es5/cart-8b8dc79f.js +1 -0
- package/dist/esm-es5/{collect-b88fe4ca.js → collect-f4965586.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-5eb27944.js → invoice-b7a1fb14.js} +1 -1
- package/dist/esm-es5/{paypal-2d4c9d01.js → paypal-da551105.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-2ba7c3f2.js → placeTestOrder-4309b170.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-ef71083e.js → renderCheckoutCurrency-0ed221ac.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +2 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +2 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-f2d50796.system.js → p-02065a08.system.js} +1 -1
- package/dist/zonos-elements/{p-3feff726.entry.js → p-0402af0d.entry.js} +1 -1
- package/dist/zonos-elements/{p-864525b4.system.entry.js → p-12a08423.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d90e79e4.system.js → p-1b963905.system.js} +1 -1
- package/dist/zonos-elements/{p-18135660.entry.js → p-21d925d7.entry.js} +1 -1
- package/dist/zonos-elements/p-2654556b.js +1 -0
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-4a1c9fa1.entry.js → p-2aecc055.entry.js} +1 -1
- package/dist/zonos-elements/{p-2ea73ca2.system.js → p-32278945.system.js} +1 -1
- package/dist/zonos-elements/{p-45535a81.js → p-32704baa.js} +1 -1
- package/dist/zonos-elements/{p-6ad0f720.system.js → p-3f380c8f.system.js} +2 -2
- package/dist/zonos-elements/{p-c750a2e0.system.entry.js → p-43815edd.system.entry.js} +1 -1
- package/dist/zonos-elements/p-45e1c33b.entry.js +1 -0
- package/dist/zonos-elements/{p-ac9b9f7d.entry.js → p-5827c868.entry.js} +1 -1
- package/dist/zonos-elements/{p-48627415.system.entry.js → p-5afea02c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4596bdca.system.entry.js → p-5bc43687.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3bc7e97.js → p-5c76ef2a.js} +1 -1
- package/dist/zonos-elements/{p-2e0d813f.system.js → p-5e09c22d.system.js} +1 -1
- package/dist/zonos-elements/{p-58b56c69.entry.js → p-6b4ef7e0.entry.js} +1 -1
- package/dist/zonos-elements/{p-10715fee.system.entry.js → p-6fae9835.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f2768c92.system.js → p-7365e22c.system.js} +1 -1
- package/dist/zonos-elements/{p-b79989a6.entry.js → p-73d3fa61.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1c86a5b.js → p-74ebd766.js} +1 -1
- package/dist/zonos-elements/{p-3cfa4880.js → p-7522ec43.js} +1 -1
- package/dist/zonos-elements/{p-89befc63.system.entry.js → p-7614ea6f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4d29dcc8.entry.js → p-77fa437c.entry.js} +1 -1
- package/dist/zonos-elements/{p-a7050d1e.system.entry.js → p-7e8aba66.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1e4dcd29.entry.js → p-8b42245d.entry.js} +1 -1
- package/dist/zonos-elements/{p-b7e4f1f5.entry.js → p-8bd37d3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-77ac8bfe.entry.js → p-8d87e748.entry.js} +1 -1
- package/dist/zonos-elements/{p-144a380d.entry.js → p-9beb2624.entry.js} +1 -1
- package/dist/zonos-elements/{p-a02ff788.js → p-a8c79850.js} +1 -1
- package/dist/zonos-elements/{p-ac1b60c8.system.entry.js → p-abf61f6f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a6f9c5e.system.entry.js → p-ac59f5c1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-55195dab.entry.js → p-b36205f4.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b321037.system.entry.js → p-cd41b16b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-628fe742.system.entry.js → p-d7cb9ef6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-534057ad.system.entry.js → p-d93991c3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-684e27da.system.js → p-e6165cc2.system.js} +1 -1
- package/dist/zonos-elements/{p-42ba4da5.system.entry.js → p-eb9369b9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ce88ef3.system.entry.js → p-ed676ad1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-521cbeea.entry.js → p-f44a3338.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-402dcde5.js +0 -1
- package/dist/zonos-elements/p-4b06044f.js +0 -1
- package/dist/zonos-elements/p-5e3b0ef4.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,n,t){function s(o){return o instanceof n?o:new n((function(e){e(o)}))}return new(n||(n=Promise))((function(n,r){function i(o){try{l(t.next(o))}catch(o){r(o)}}function a(o){try{l(t["throw"](o))}catch(o){r(o)}}function l(o){o.done?n(o.value):s(o.value).then(i,a)}l((t=t.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,s,r,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(o){return function(e){return l([o,e])}}function l(a){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(n=0)),n)try{if(t=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;s=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=e.call(o,n)}catch(o){a=[6,o];s=0}finally{t=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-2e0d813f.system.js","./p-9fab45aa.system.js","./p-47a1d469.system.js","./p-684e27da.system.js","./p-30e9a6d7.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-dab78981.system.js","./p-2b8345d8.system.js"],(function(o){"use strict";var e,n,t,s,r,i,a,l,c,d,u,f,m,p,h,v,z,y,g,x;return{setters:[function(o){e=o.r;n=o.h;t=o.F;s=o.a;r=o.g},function(o){i=o._;a=o.E;l=o.$;c=o.a0;d=o.a1;u=o.S;f=o.a2;m=o.a3;p=o.I},function(o){h=o.l;v=o.t},function(o){z=o.z;y=o.f},function(o){g=o.r},function(o){x=o.g},function(){},function(){},function(){},function(){}],execute:function(){var b=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var w=b;var k="POLICIES";var j=o("zonos_policy_consent",function(){function o(o){e(this,o)}o.prototype.render=function(){var o=i();if(!o.length){return null}var e=Intl.ListFormat;var r=e?new e(h.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((function(o){return o.name}))):o.flatMap((function(o,e){return e===0?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]}));var l=r.map((function(e){if(e.type==="literal"){return e.value}var t=o.find((function(o){return o.name===e.value}));if(!t){return e.value}return n("a",{href:t.url,onClick:function(o){o.preventDefault();o.stopPropagation();window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},e.value)}));var c=z.organizationName;var d=c?v("I agree to [merchantName]'s [policies]",{merchantName:c,policies:k}):v("I agree to the [policies]",{policies:k});var u=d.split(k),f=u[0],m=f===void 0?"":f,p=u[1],y=p===void 0?"":p;var g=a.showError;var x="zonos--policy-consent-error";return n(s,{class:"zonos--policy-consent-host"},n("div",{class:"zonos--policy-consent".concat(g?" zonos--policy-consent--error":"")},n("label",{class:"zonos--policy-consent-label"},n("input",{"aria-describedby":g?x:undefined,"aria-invalid":g?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:function(o){var e=o.target.checked;a.accepted=e;if(e){if(!a.acceptedAt){a.acceptedAt=(new Date).toISOString()}a.showError=false}else{a.acceptedAt=null}},type:"checkbox"}),n("span",{class:"zonos--policy-consent-text"},m,n(t,null,l),y))),g&&n("div",{class:"zonos--policy-consent-error",id:x,role:"alert"},v("You must accept the policies to place this order")))};return o}());j.style=w;var C='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';var I=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';var _=I;var S="full";var E="custom";var N=o("zonos_store_credit",function(){function o(o){var n=this;e(this,o);this.enabled=true;this.customAmountInput="";this.handleUseStoreCreditChange=function(o){l(o);if(o){c(true)}void d()};this.handleAmountModeChange=function(o){var e=o===S;c(e);if(!e){n.customAmountInput=""}void d()};this.handleCustomAmountChange=function(o){n.customAmountInput=o;u.error=null};this.handleApplyCustomAmount=function(){var o=parseFloat(n.customAmountInput);if(!isNaN(o)&&o>0){f(o)}else{f(null)}if(!u.error){void d()}}}o.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,m()];case 1:o.sent();return[2]}}))}))};o.prototype.render=function(){var o=this;if(!this.enabled){return null}var e=z.appearance.colorPrimary;var r=x({});var i=u.availableBalance;var a=i!==null&&i>0;var l=u.isEnabled;var c=u.useFullBalance;var d=u.error;var f=p();var m=g({amount:i!==null&&i!==void 0?i:0,isForeign:true});return n(s,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":r,"--zonos--font-family":y(),"--zonos--primary-color":e}},n("div",{class:"zonos--store-credit-container"},n("div",{class:"zonos--store-credit-header"},n("div",{class:"zonos--store-credit-title-row"},n("div",{class:"zonos--store-credit-title-left"},n("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},n("zonos-icon",{content:C,iconColor:"gray-500",size:22})),n("zonos-text",{type:"semiBoldLabel"},v("Store credit"))),a&&n("div",{class:"zonos--store-credit-balance-badge"},n("zonos-text",{textColor:"gray-600",type:"caption"},m)))),n(t,null,a?n("div",{class:"zonos--store-credit-content"},n("div",{class:"zonos--store-credit-checkbox"},n("zonos-checkbox",{isChecked:l,label:v("Use store credit"),onCheckboxSelected:function(e){return o.handleUseStoreCreditChange(e.detail)},size:16})),l&&n("div",{class:"zonos--store-credit-options"},n("div",{class:"zonos--store-credit-toggle-row"},n("zonos-toggle",{onToggleChanged:function(e){return o.handleAmountModeChange(e.detail)},options:[{label:v("Apply full balance"),value:S},{label:v("Enter amount"),value:E}],value:c?S:E})),!c&&n("div",{class:"zonos--store-credit-custom-amount"},n("div",{class:"zonos--store-credit-custom-amount-row"},n("zonos-input",{inputLabel:v("Enter amount"),inputValue:this.customAmountInput,isError:!!d,onInputChange:function(e){return o.handleCustomAmountChange(e.detail)}}),n("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},v("Apply")))),d&&n("div",{class:"zonos--store-credit-error"},n("zonos-text",{textColor:"red-600",type:"caption"},d)),n("div",{class:"zonos--store-credit-summary"},n("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},v("Amount to apply: [amount]",{amount:g({amount:f,isForeign:true})}))))):n("div",{class:"zonos--store-credit-empty"},n("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},n("zonos-icon",{content:C,iconColor:"gray-500",size:28})),n("zonos-text",{textColor:"gray-600",type:"caption"},v("No store credit available"))))))};Object.defineProperty(o.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return o}());N.style=_}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,n,t){function s(o){return o instanceof n?o:new n((function(e){e(o)}))}return new(n||(n=Promise))((function(n,r){function i(o){try{l(t.next(o))}catch(o){r(o)}}function a(o){try{l(t["throw"](o))}catch(o){r(o)}}function l(o){o.done?n(o.value):s(o.value).then(i,a)}l((t=t.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,s,r,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(o){return function(e){return l([o,e])}}function l(a){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(n=0)),n)try{if(t=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;s=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=e.call(o,n)}catch(o){a=[6,o];s=0}finally{t=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-5e09c22d.system.js","./p-9fab45aa.system.js","./p-47a1d469.system.js","./p-e6165cc2.system.js","./p-30e9a6d7.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-dab78981.system.js","./p-2b8345d8.system.js"],(function(o){"use strict";var e,n,t,s,r,i,a,l,c,d,u,f,m,p,h,v,z,y,g,x;return{setters:[function(o){e=o.r;n=o.h;t=o.F;s=o.a;r=o.g},function(o){i=o._;a=o.E;l=o.$;c=o.a0;d=o.a1;u=o.S;f=o.a2;m=o.a3;p=o.I},function(o){h=o.l;v=o.t},function(o){z=o.z;y=o.f},function(o){g=o.r},function(o){x=o.g},function(){},function(){},function(){},function(){}],execute:function(){var b=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var w=b;var k="POLICIES";var j=o("zonos_policy_consent",function(){function o(o){e(this,o)}o.prototype.render=function(){var o=i();if(!o.length){return null}var e=Intl.ListFormat;var r=e?new e(h.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((function(o){return o.name}))):o.flatMap((function(o,e){return e===0?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]}));var l=r.map((function(e){if(e.type==="literal"){return e.value}var t=o.find((function(o){return o.name===e.value}));if(!t){return e.value}return n("a",{href:t.url,onClick:function(o){o.preventDefault();o.stopPropagation();window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},e.value)}));var c=z.organizationName;var d=c?v("I agree to [merchantName]'s [policies]",{merchantName:c,policies:k}):v("I agree to the [policies]",{policies:k});var u=d.split(k),f=u[0],m=f===void 0?"":f,p=u[1],y=p===void 0?"":p;var g=a.showError;var x="zonos--policy-consent-error";return n(s,{class:"zonos--policy-consent-host"},n("div",{class:"zonos--policy-consent".concat(g?" zonos--policy-consent--error":"")},n("label",{class:"zonos--policy-consent-label"},n("input",{"aria-describedby":g?x:undefined,"aria-invalid":g?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:function(o){var e=o.target.checked;a.accepted=e;if(e){if(!a.acceptedAt){a.acceptedAt=(new Date).toISOString()}a.showError=false}else{a.acceptedAt=null}},type:"checkbox"}),n("span",{class:"zonos--policy-consent-text"},m,n(t,null,l),y))),g&&n("div",{class:"zonos--policy-consent-error",id:x,role:"alert"},v("You must accept the policies to place this order")))};return o}());j.style=w;var C='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';var I=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';var _=I;var S="full";var E="custom";var N=o("zonos_store_credit",function(){function o(o){var n=this;e(this,o);this.enabled=true;this.customAmountInput="";this.handleUseStoreCreditChange=function(o){l(o);if(o){c(true)}void d()};this.handleAmountModeChange=function(o){var e=o===S;c(e);if(!e){n.customAmountInput=""}void d()};this.handleCustomAmountChange=function(o){n.customAmountInput=o;u.error=null};this.handleApplyCustomAmount=function(){var o=parseFloat(n.customAmountInput);if(!isNaN(o)&&o>0){f(o)}else{f(null)}if(!u.error){void d()}}}o.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,m()];case 1:o.sent();return[2]}}))}))};o.prototype.render=function(){var o=this;if(!this.enabled){return null}var e=z.appearance.colorPrimary;var r=x({});var i=u.availableBalance;var a=i!==null&&i>0;var l=u.isEnabled;var c=u.useFullBalance;var d=u.error;var f=p();var m=g({amount:i!==null&&i!==void 0?i:0,isForeign:true});return n(s,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":r,"--zonos--font-family":y(),"--zonos--primary-color":e}},n("div",{class:"zonos--store-credit-container"},n("div",{class:"zonos--store-credit-header"},n("div",{class:"zonos--store-credit-title-row"},n("div",{class:"zonos--store-credit-title-left"},n("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},n("zonos-icon",{content:C,iconColor:"gray-500",size:22})),n("zonos-text",{type:"semiBoldLabel"},v("Store credit"))),a&&n("div",{class:"zonos--store-credit-balance-badge"},n("zonos-text",{textColor:"gray-600",type:"caption"},m)))),n(t,null,a?n("div",{class:"zonos--store-credit-content"},n("div",{class:"zonos--store-credit-checkbox"},n("zonos-checkbox",{isChecked:l,label:v("Use store credit"),onCheckboxSelected:function(e){return o.handleUseStoreCreditChange(e.detail)},size:16})),l&&n("div",{class:"zonos--store-credit-options"},n("div",{class:"zonos--store-credit-toggle-row"},n("zonos-toggle",{onToggleChanged:function(e){return o.handleAmountModeChange(e.detail)},options:[{label:v("Apply full balance"),value:S},{label:v("Enter amount"),value:E}],value:c?S:E})),!c&&n("div",{class:"zonos--store-credit-custom-amount"},n("div",{class:"zonos--store-credit-custom-amount-row"},n("zonos-input",{inputLabel:v("Enter amount"),inputValue:this.customAmountInput,isError:!!d,onInputChange:function(e){return o.handleCustomAmountChange(e.detail)}}),n("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},v("Apply")))),d&&n("div",{class:"zonos--store-credit-error"},n("zonos-text",{textColor:"red-600",type:"caption"},d)),n("div",{class:"zonos--store-credit-summary"},n("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},v("Amount to apply: [amount]",{amount:g({amount:f,isForeign:true})}))))):n("div",{class:"zonos--store-credit-empty"},n("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},n("zonos-icon",{content:C,iconColor:"gray-500",size:28})),n("zonos-text",{textColor:"gray-600",type:"caption"},v("No store credit available"))))))};Object.defineProperty(o.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return o}());N.style=_}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,c){function l(o){try{r(n.next(o))}catch(o){c(o)}}function i(o){try{r(n["throw"](o))}catch(o){c(o)}}function r(o){o.done?t(o.value):s(o.value).then(l,i)}r((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(o){return function(e){return r([o,e])}}function r(i){if(n)throw new TypeError("Generator is already executing.");while(l&&(l=0,i[0]&&(t=0)),t)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:t.label++;return{value:i[1],done:false};case 5:t.label++;s=i[1];i=[0];continue;case 7:i=t.ops.pop();t.trys.pop();continue;default:if(!(c=t.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){t=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){t.label=i[1];break}if(i[0]===6&&t.label<c[1]){t.label=c[1];c=i;break}if(c&&t.label<c[2]){t.label=c[2];t.ops.push(i);break}if(c[2])t.ops.pop();t.trys.pop();continue}i=e.call(o,t)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-f2d50796.system.js","./p-2e0d813f.system.js","./p-6ad0f720.system.js","./p-9fab45aa.system.js","./p-47a1d469.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-2adbbce7.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-45bd8072.system.js","./p-c9e433c0.system.js","./p-dab78981.system.js","./p-30e9a6d7.system.js","./p-2b8345d8.system.js","./p-d706852e.system.js","./p-e977562b.system.js"],(function(o){"use strict";var e,t,n,s,c,l,i,r,a,d,z,u,h,f,m,p,g,b,v,w,x,y,k,_,C,I,S,j,L,A,E,O,T,P,U,N,D,R,B,W,F,H,X,K,V;return{setters:[function(o){e=o.r;t=o.h;n=o.a;s=o.F},function(o){c=o.c;l=o.a;i=o.b;r=o.d;a=o.e;d=o.f;z=o.g;u=o.h;h=o.i},function(o){f=o.b;m=o.i;p=o.d;g=o.c;b=o.n;v=o.e;w=o.j;x=o.k;y=o.w;k=o.C;_=o.H;C=o.F;I=o.f},function(o){S=o.p;j=o.a},function(o){L=o.s;A=o.t;E=o.e;O=o.h;T=o.l},function(o){P=o.z},function(o){U=o.b},function(o){N=o.h;D=o.s;R=o.l;B=o.g},function(o){W=o.i;F=o.a},function(o){H=o.c},function(o){X=o.l},function(o){K=o.r},function(o){V=o.l},function(){},function(){},function(){},function(){},function(){}],execute:function(){var q='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var G=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var M=G;var Q=o("zonos_collect",function(){function o(o){var t=this;e(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=f.clientSecret;this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=p.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=P.appearance.theme;return[4,m({overrideTheme:this.isMobile?o:undefined,paypalEnabled:S()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,z;return __generator(this,(function(u){switch(u.label){case 0:e=L.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=u.sent();c.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!l(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}n=t.checkoutSession;i.currency=p.currency;this.confirmationId=((o=n.landedCost)===null||o===void 0?void 0:o.shortId)||null;s=!!n.completedAt||!!n.order;if(!(!s&&n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:z=u.sent().status;s=a(z);u.label=3;case 3:if(s){void this.setToFinishStep();return[2]}void d();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,c,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;n=t.get("payment_intent_client_secret");s=t.get("zonosCheckoutSessionId");X("Payment intent exist, checking stripe payment intent status");if(!n){X("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,g({clientSecret:n})];case 1:c=d.sent(),l=c.error,i=c.status;r=new URLSearchParams(window.location.search).get("redirect_status");if(!(r&&s))return[3,3];if(!l){X("Payment intent is succeeded or in a good state to move forward, show success screen")}else{X("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;L.checkoutSessionId=s;f.clientSecret=n;void this.setToFinishStep(i);return[2,{shouldAllowOrder:false}];case 3:if(!e){X("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}X("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t,n,s,d,d;return __generator(this,(function(z){switch(z.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=z.sent();if(!t){return[2,false]}n=t.checkoutSession;this.confirmationId=((e=n.landedCost)===null||e===void 0?void 0:e.shortId)||null;c.paymentProcessor=n.paymentProcessor||null;s=n.paymentProcessor==="AIRWALLEX";if(s&&n.clientSecret){l(n);i.currency=p.currency}if(n.completedAt||n.order){void this.setToFinishStep("succeeded");return[2,true]}if(!s)return[3,4];if(!(n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:d=z.sent().status;if(a(d)){void this.setToFinishStep();return[2,true]}z.label=3;case 3:return[3,6];case 4:if(!n.clientSecret)return[3,6];return[4,g({clientSecret:n.clientSecret})];case 5:d=z.sent().status;if(d==="processing"||d==="succeeded"){f.clientSecret=n.clientSecret;void this.setToFinishStep(d);return[2,true]}z.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=W(this.mobile);this.isTablet=F(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){f.stripe=window.Zonos.stripe;p.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,r,a,d,h,f,m,g,y,k,_,C,I,S,j,E,O;return __generator(this,(function(T){switch(T.label){case 0:if(!window.Zonos.cartData){return[2]}m=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(m){p.currency=m}g=(n=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||n===void 0?void 0:n.checkoutSessionId;y=(l=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||l===void 0?void 0:l.landedCostId;if(!y){b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[2]}if(g){X("Setting checkout session id from cart reference","info",g);L.checkoutSessionId=g}else{X("Clear checkout session id from storage so we start from a fresh session for the collect cart");L.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:k=T.sent().shouldAllowOrder;if(!k){return[2]}T.label=2;case 2:T.trys.push([2,13,,14]);_=U(window.Zonos.cartData),C=_.adjustments,I=_.cartItems;return[4,v({adjustments:C,cartItems:I,landedCostId:y,shouldInitSessionOnFailure:false})];case 3:T.sent();if(!(!L.checkoutSessionId&&!g))return[3,5];return[4,w()];case 4:S=T.sent();X("stripeStoreInitCheckoutSession: ".concat(S));if(!S){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}T.label=5;case 5:if(!((!p.checkoutSession||((r=p.checkoutSession)===null||r===void 0?void 0:r.completedAt))&&g))return[3,7];return[4,this.recoverCompletedCollectSession(g)];case 6:j=T.sent();if(j){return[2]}void D({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:g,cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:y}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!p.checkoutSession){void D({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:g||"N/A",cartId:(d=window.Zonos.cartData)===null||d===void 0?void 0:d.id,cartLandedCostId:y||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}c.paymentProcessor=p.checkoutSession.paymentProcessor;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,x()];case 8:T.sent();if((h=p.checkoutSession)===null||h===void 0?void 0:h.clientSecret){i.clientSecret=p.checkoutSession.clientSecret;i.currency=p.currency}return[3,10];case 9:void x();T.label=10;case 10:E=(f=p.checkoutSession)===null||f===void 0?void 0:f.landedCost;if(!E){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,z(Object.assign(Object.assign({},p.checkoutSession),{id:L.checkoutSessionId||""}))];case 11:T.sent();void u({landedCostId:E.id});return[4,this.initPaymentProcessor()];case 12:T.sent();return[3,14];case 13:O=T.sent();R(O);b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[3,14];case 14:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:void((o=f.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=f.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=f.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){l=document.querySelector(".zonos--billing-address");l===null||l===void 0?void 0:l.scrollIntoView({behavior:"smooth"});return[2]}i=f.checkoutSettlementCurrency==="USD";if(i&&f.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;j.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;p.inventoryCheckErrorMessage=null;return[4,y()];case 1:r=d.sent();if(!r){f.hasPaymentError=true;f.customErrorMessage=A("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:f.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,h()];case 2:d.sent();d.label=3;case 3:d.trys.push([3,5,,6]);return[4,k({noLandedCostCheck:true})];case 4:d.sent();p.step="finish";this.confirmationId=c.landedCostShortId||((n=p.selectedLandedCost)===null||n===void 0?void 0:n.landedCostId)||null;return[2];case 5:a=d.sent();R(a);f.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;f.stripe=window.Zonos.stripe;p.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[_("clientSecret",(function(){void o.applyStripeTheme()})),E("selectedLocale",(function(){void o.applyStripeTheme()}))];X("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){C();I();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=f.clientSecret;if(f.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var l=P.appearance,i=l.logoUrl,r=l.theme;var a=c.originCompanyName;var d=function(){var o;var e=c.collectLogoUrl?c.collectLogoUrl:((o=P.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&i?"".concat(i,"?timestamp=").concat(Date.now()):"";if(!e){return null}return t("div",{class:"zonos--logo"},t("img",{alt:"".concat(a||P.organizationName," logo"),src:e}))};var z=B();var u=function(){var e;var n=new URLSearchParams(window.location.search);var l=n.get("zonosQaUrl");var i=n.get("zonosDebug");var r=(e=V.find((function(o){return o.code===T.selectedLocale})))===null||e===void 0?void 0:e.label;return t(s,null,t("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},t("div",{class:"zonos--logo-wrapper"},d(),z&&t("zonos-badge",{badgeColor:"orange",size:"small"},A("Test mode")),i==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&t("zonos-badge",{badgeColor:"purple",size:"small"},l)),t("div",{class:"zonos--header-right"},t("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,t("zonos-icon",{"aria-label":"Language select",content:q,iconColor:"gray-1200"})),t("div",{class:H(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),K({content:t("zonos-text",{class:"zonos--header-title",type:"header"},a?A("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:a}):A("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var h=function(){if(o.isOverlayLoading||f.isFetchingSession){return null}return t("div",{class:"zonos--content"},p.step!=="finish"&&p.step!=="error"&&t(s,null,(o.isMobile||o.isTablet)&&u(),t("div",{class:"zonos--left","data-theme":r},!o.isMobile&&!o.isTablet&&u(),c.paymentProcessor!=="AIRWALLEX"&&t(s,null,t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},A("Billing info")),t("zonos-v-stack",{spacing:16},t("zonos-link-authentication",{titleText:""}),t("zonos-address",{titleText:"",type:"billing"}))),t("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;p.step="finish";o.confirmationId=c.landedCostShortId||((e=p.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),t("div",{class:"zonos--right","data-theme":r},t("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),t("div",{class:"zonos--order-details-container"},t("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),t("div",{class:"flex--wrapper"},t("zonos-v-stack",{spacing:16},t("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet})))),(p.step==="finish"||p.step==="error")&&t("div",{class:"zonos--done","data-theme":r},t("div",{class:"zonos--header"},d()),t("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:p.step==="error"&&!!p.error?Object.assign(Object.assign({},p.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||p.step==="finish"||p.step==="error")&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet}))};return t(n,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":r},h(),e&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:A("Cancel"),dialogConfirmBtnText:A("Pay [orderTotal]",{orderTotal:O({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:A("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:A("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Q.style=M}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,c){function l(o){try{r(n.next(o))}catch(o){c(o)}}function i(o){try{r(n["throw"](o))}catch(o){c(o)}}function r(o){o.done?t(o.value):s(o.value).then(l,i)}r((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(o){return function(e){return r([o,e])}}function r(i){if(n)throw new TypeError("Generator is already executing.");while(l&&(l=0,i[0]&&(t=0)),t)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:t.label++;return{value:i[1],done:false};case 5:t.label++;s=i[1];i=[0];continue;case 7:i=t.ops.pop();t.trys.pop();continue;default:if(!(c=t.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){t=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){t.label=i[1];break}if(i[0]===6&&t.label<c[1]){t.label=c[1];c=i;break}if(c&&t.label<c[2]){t.label=c[2];t.ops.push(i);break}if(c[2])t.ops.pop();t.trys.pop();continue}i=e.call(o,t)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-02065a08.system.js","./p-5e09c22d.system.js","./p-3f380c8f.system.js","./p-9fab45aa.system.js","./p-47a1d469.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-2adbbce7.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-45bd8072.system.js","./p-c9e433c0.system.js","./p-dab78981.system.js","./p-30e9a6d7.system.js","./p-2b8345d8.system.js","./p-d706852e.system.js","./p-e977562b.system.js"],(function(o){"use strict";var e,t,n,s,c,l,i,r,a,d,z,u,h,f,m,p,g,b,v,w,x,y,k,_,C,I,S,j,L,A,E,O,T,P,U,N,D,R,B,W,F,H,X,K,V;return{setters:[function(o){e=o.r;t=o.h;n=o.a;s=o.F},function(o){c=o.c;l=o.a;i=o.b;r=o.d;a=o.e;d=o.f;z=o.g;u=o.h;h=o.i},function(o){f=o.b;m=o.i;p=o.d;g=o.c;b=o.n;v=o.e;w=o.j;x=o.k;y=o.w;k=o.C;_=o.H;C=o.F;I=o.f},function(o){S=o.p;j=o.a},function(o){L=o.s;A=o.t;E=o.e;O=o.h;T=o.l},function(o){P=o.z},function(o){U=o.b},function(o){N=o.h;D=o.s;R=o.l;B=o.g},function(o){W=o.i;F=o.a},function(o){H=o.c},function(o){X=o.l},function(o){K=o.r},function(o){V=o.l},function(){},function(){},function(){},function(){},function(){}],execute:function(){var q='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var G=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var M=G;var Q=o("zonos_collect",function(){function o(o){var t=this;e(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=f.clientSecret;this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=p.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=P.appearance.theme;return[4,m({overrideTheme:this.isMobile?o:undefined,paypalEnabled:S()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,z;return __generator(this,(function(u){switch(u.label){case 0:e=L.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=u.sent();c.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!l(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}n=t.checkoutSession;i.currency=p.currency;this.confirmationId=((o=n.landedCost)===null||o===void 0?void 0:o.shortId)||null;s=!!n.completedAt||!!n.order;if(!(!s&&n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:z=u.sent().status;s=a(z);u.label=3;case 3:if(s){void this.setToFinishStep();return[2]}void d();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,c,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;n=t.get("payment_intent_client_secret");s=t.get("zonosCheckoutSessionId");X("Payment intent exist, checking stripe payment intent status");if(!n){X("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,g({clientSecret:n})];case 1:c=d.sent(),l=c.error,i=c.status;r=new URLSearchParams(window.location.search).get("redirect_status");if(!(r&&s))return[3,3];if(!l){X("Payment intent is succeeded or in a good state to move forward, show success screen")}else{X("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;L.checkoutSessionId=s;f.clientSecret=n;void this.setToFinishStep(i);return[2,{shouldAllowOrder:false}];case 3:if(!e){X("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}X("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t,n,s,d,d;return __generator(this,(function(z){switch(z.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=z.sent();if(!t){return[2,false]}n=t.checkoutSession;this.confirmationId=((e=n.landedCost)===null||e===void 0?void 0:e.shortId)||null;c.paymentProcessor=n.paymentProcessor||null;s=n.paymentProcessor==="AIRWALLEX";if(s&&n.clientSecret){l(n);i.currency=p.currency}if(n.completedAt||n.order){void this.setToFinishStep("succeeded");return[2,true]}if(!s)return[3,4];if(!(n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:d=z.sent().status;if(a(d)){void this.setToFinishStep();return[2,true]}z.label=3;case 3:return[3,6];case 4:if(!n.clientSecret)return[3,6];return[4,g({clientSecret:n.clientSecret})];case 5:d=z.sent().status;if(d==="processing"||d==="succeeded"){f.clientSecret=n.clientSecret;void this.setToFinishStep(d);return[2,true]}z.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=W(this.mobile);this.isTablet=F(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){f.stripe=window.Zonos.stripe;p.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,r,a,d,h,f,m,g,y,k,_,C,I,S,j,E,O;return __generator(this,(function(T){switch(T.label){case 0:if(!window.Zonos.cartData){return[2]}m=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(m){p.currency=m}g=(n=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||n===void 0?void 0:n.checkoutSessionId;y=(l=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||l===void 0?void 0:l.landedCostId;if(!y){b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[2]}if(g){X("Setting checkout session id from cart reference","info",g);L.checkoutSessionId=g}else{X("Clear checkout session id from storage so we start from a fresh session for the collect cart");L.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:k=T.sent().shouldAllowOrder;if(!k){return[2]}T.label=2;case 2:T.trys.push([2,13,,14]);_=U(window.Zonos.cartData),C=_.adjustments,I=_.cartItems;return[4,v({adjustments:C,cartItems:I,landedCostId:y,shouldInitSessionOnFailure:false})];case 3:T.sent();if(!(!L.checkoutSessionId&&!g))return[3,5];return[4,w()];case 4:S=T.sent();X("stripeStoreInitCheckoutSession: ".concat(S));if(!S){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}T.label=5;case 5:if(!((!p.checkoutSession||((r=p.checkoutSession)===null||r===void 0?void 0:r.completedAt))&&g))return[3,7];return[4,this.recoverCompletedCollectSession(g)];case 6:j=T.sent();if(j){return[2]}void D({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:g,cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:y}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!p.checkoutSession){void D({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:g||"N/A",cartId:(d=window.Zonos.cartData)===null||d===void 0?void 0:d.id,cartLandedCostId:y||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}c.paymentProcessor=p.checkoutSession.paymentProcessor;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,x()];case 8:T.sent();if((h=p.checkoutSession)===null||h===void 0?void 0:h.clientSecret){i.clientSecret=p.checkoutSession.clientSecret;i.currency=p.currency}return[3,10];case 9:void x();T.label=10;case 10:E=(f=p.checkoutSession)===null||f===void 0?void 0:f.landedCost;if(!E){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,z(Object.assign(Object.assign({},p.checkoutSession),{id:L.checkoutSessionId||""}))];case 11:T.sent();void u({landedCostId:E.id});return[4,this.initPaymentProcessor()];case 12:T.sent();return[3,14];case 13:O=T.sent();R(O);b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[3,14];case 14:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:void((o=f.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=f.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=f.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){l=document.querySelector(".zonos--billing-address");l===null||l===void 0?void 0:l.scrollIntoView({behavior:"smooth"});return[2]}i=f.checkoutSettlementCurrency==="USD";if(i&&f.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;j.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;p.inventoryCheckErrorMessage=null;return[4,y()];case 1:r=d.sent();if(!r){f.hasPaymentError=true;f.customErrorMessage=A("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:f.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,h()];case 2:d.sent();d.label=3;case 3:d.trys.push([3,5,,6]);return[4,k({noLandedCostCheck:true})];case 4:d.sent();p.step="finish";this.confirmationId=c.landedCostShortId||((n=p.selectedLandedCost)===null||n===void 0?void 0:n.landedCostId)||null;return[2];case 5:a=d.sent();R(a);f.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;f.stripe=window.Zonos.stripe;p.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[_("clientSecret",(function(){void o.applyStripeTheme()})),E("selectedLocale",(function(){void o.applyStripeTheme()}))];X("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){C();I();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=f.clientSecret;if(f.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var l=P.appearance,i=l.logoUrl,r=l.theme;var a=c.originCompanyName;var d=function(){var o;var e=c.collectLogoUrl?c.collectLogoUrl:((o=P.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&i?"".concat(i,"?timestamp=").concat(Date.now()):"";if(!e){return null}return t("div",{class:"zonos--logo"},t("img",{alt:"".concat(a||P.organizationName," logo"),src:e}))};var z=B();var u=function(){var e;var n=new URLSearchParams(window.location.search);var l=n.get("zonosQaUrl");var i=n.get("zonosDebug");var r=(e=V.find((function(o){return o.code===T.selectedLocale})))===null||e===void 0?void 0:e.label;return t(s,null,t("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},t("div",{class:"zonos--logo-wrapper"},d(),z&&t("zonos-badge",{badgeColor:"orange",size:"small"},A("Test mode")),i==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&t("zonos-badge",{badgeColor:"purple",size:"small"},l)),t("div",{class:"zonos--header-right"},t("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,t("zonos-icon",{"aria-label":"Language select",content:q,iconColor:"gray-1200"})),t("div",{class:H(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),K({content:t("zonos-text",{class:"zonos--header-title",type:"header"},a?A("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:a}):A("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var h=function(){if(o.isOverlayLoading||f.isFetchingSession){return null}return t("div",{class:"zonos--content"},p.step!=="finish"&&p.step!=="error"&&t(s,null,(o.isMobile||o.isTablet)&&u(),t("div",{class:"zonos--left","data-theme":r},!o.isMobile&&!o.isTablet&&u(),c.paymentProcessor!=="AIRWALLEX"&&t(s,null,t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},A("Billing info")),t("zonos-v-stack",{spacing:16},t("zonos-link-authentication",{titleText:""}),t("zonos-address",{titleText:"",type:"billing"}))),t("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;p.step="finish";o.confirmationId=c.landedCostShortId||((e=p.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),t("div",{class:"zonos--right","data-theme":r},t("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),t("div",{class:"zonos--order-details-container"},t("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),t("div",{class:"flex--wrapper"},t("zonos-v-stack",{spacing:16},t("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet})))),(p.step==="finish"||p.step==="error")&&t("div",{class:"zonos--done","data-theme":r},t("div",{class:"zonos--header"},d()),t("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:p.step==="error"&&!!p.error?Object.assign(Object.assign({},p.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||p.step==="finish"||p.step==="error")&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet}))};return t(n,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":r},h(),e&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:A("Cancel"),dialogConfirmBtnText:A("Pay [orderTotal]",{orderTotal:O({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:A("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:A("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Q.style=M}}}));
|