@zonos/elements 1.3.127 → 1.3.129
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/{CheckoutConfig-8e3cdcb3.js → CheckoutConfig-62479cef.js} +1 -1
- package/dist/cjs/{cart-3bdaf092.js → cart-ba8cca00.js} +22 -3
- package/dist/cjs/{handleFetch-fa0ce321.js → handleFetch-a8dfb07c.js} +1 -1
- package/dist/cjs/index.cjs.js +15 -9
- package/dist/cjs/{paypal-2f48ab8d.js → paypal-441c3f79.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +6 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +7 -8
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +21 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +3 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -4
- package/dist/collection/components/common/zonos-text/zonos-text.css +6 -6
- package/dist/collection/components/common/zonos-text/zonos-text.js +20 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +17 -2
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +4 -0
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +0 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +1 -1
- package/dist/collection/scripts/_zonosBase.js +6 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +5 -0
- package/dist/collection/types/generated/graphql.internal.types.js +39 -0
- package/dist/esm/{CheckoutConfig-101b97e6.js → CheckoutConfig-5da839fa.js} +1 -1
- package/dist/esm/{cart-519f08e3.js → cart-01b5bf4a.js} +22 -3
- package/dist/esm/{handleFetch-da1a9c5d.js → handleFetch-40fc3562.js} +1 -1
- package/dist/esm/index.js +16 -10
- package/dist/esm/{paypal-d0a05eda.js → paypal-4c094b25.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +2 -2
- package/dist/esm/zonos-cart-items_13.entry.js +6 -9
- package/dist/esm/zonos-checkout.entry.js +7 -8
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +21 -3
- package/dist/esm-es5/{CheckoutConfig-101b97e6.js → CheckoutConfig-5da839fa.js} +1 -1
- package/dist/esm-es5/{cart-519f08e3.js → cart-01b5bf4a.js} +1 -1
- package/dist/esm-es5/handleFetch-40fc3562.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-d0a05eda.js → paypal-4c094b25.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/scripts/index.d.ts +13 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +1 -0
- package/dist/types/components/store/zonosStore.d.ts +7 -1
- package/dist/types/scripts/_zonosBase.d.ts +2 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +23 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +33 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +44 -0
- package/dist/types/types/generated/graphql.internal.types.ts +57 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-eca920dc.system.entry.js → p-08948e65.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0cfb97ae.js +1 -0
- package/dist/zonos-elements/p-0e8613be.entry.js +1 -0
- package/dist/zonos-elements/{p-0cb426b8.entry.js → p-0f465aa6.entry.js} +1 -1
- package/dist/zonos-elements/{p-f962fc6a.system.entry.js → p-10aef679.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2db962f9.system.entry.js → p-17a5550a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-26172f0d.entry.js +1 -0
- package/dist/zonos-elements/{p-8df3d5d0.system.entry.js → p-2bb86f3d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2faa3104.system.entry.js +1 -0
- package/dist/zonos-elements/p-4d4ea5dc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ea8663b7.entry.js → p-55a3db7d.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7d56ce5.system.js → p-582cdd52.system.js} +1 -1
- package/dist/zonos-elements/{p-d9dceba1.system.js → p-5e22a288.system.js} +1 -1
- package/dist/zonos-elements/{p-9833f37d.system.entry.js → p-5ee9685e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-60b0025b.system.js +1 -0
- package/dist/zonos-elements/p-6305e92c.system.js +1 -0
- package/dist/zonos-elements/{p-3dbfe639.entry.js → p-700c5732.entry.js} +1 -1
- package/dist/zonos-elements/{p-e2cda105.system.entry.js → p-7312d038.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7c7feadb.system.entry.js +1 -0
- package/dist/zonos-elements/{p-167b7fa8.system.entry.js → p-8390f23d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d6f1b6fa.system.entry.js → p-8612f8d1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-723c9d4d.entry.js → p-91e111c4.entry.js} +1 -1
- package/dist/zonos-elements/{p-2402e12c.js → p-94146bc9.js} +1 -1
- package/dist/zonos-elements/p-9b0cbd91.entry.js +1 -0
- package/dist/zonos-elements/{p-f50f48da.entry.js → p-9d057d1d.entry.js} +1 -1
- package/dist/zonos-elements/{p-00ff4f4a.js → p-a9069f68.js} +1 -1
- package/dist/zonos-elements/{p-a3b195e9.js → p-b7cfbfc1.js} +1 -1
- package/dist/zonos-elements/p-c562de4a.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-abbfde44.system.js → p-c93c9524.system.js} +2 -2
- package/dist/zonos-elements/{p-76d03238.entry.js → p-ce391c90.entry.js} +1 -1
- package/dist/zonos-elements/{p-efffbaec.entry.js → p-d6f8309b.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-da1a9c5d.js +0 -1
- package/dist/zonos-elements/p-0fa85ff9.system.js +0 -1
- package/dist/zonos-elements/p-1ed1ce99.system.js +0 -1
- package/dist/zonos-elements/p-61380d53.system.entry.js +0 -1
- package/dist/zonos-elements/p-685e395e.entry.js +0 -1
- package/dist/zonos-elements/p-6a2bed3e.system.entry.js +0 -1
- package/dist/zonos-elements/p-7769b60c.js +0 -1
- package/dist/zonos-elements/p-a7eaa9ad.entry.js +0 -1
- package/dist/zonos-elements/p-bc9987f2.system.entry.js +0 -1
- package/dist/zonos-elements/p-bf2f9095.entry.js +0 -1
- package/dist/zonos-elements/p-cf7a5119.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as e,h as t,F as s,H as i}from"./p-5b7da777.js";import{p as n,l as a,H as l}from"./p-94146bc9.js";import{z as r}from"./p-91cfbf46.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{g as c}from"./p-5883217a.js";import"./p-0cfb97ae.js";import"./p-e1ce04b1.js";import"./p-67a32cc5.js";const f=`${n("The low-value GST law passed July 1st, 2018 applies to this retailer.")} ${(({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`)({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:n("Learn more.")})}`,m=class{constructor(t){o(this,t),this.closeDialog=e(this,"closeDialog",7),this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=a.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.hasInclusivePrices=()=>{var o;return"ENABLED"===(null===(o=a.inclusivePricing)||void 0===o?void 0:o.status)},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU"].includes(o),this.getDutyMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] duty free.",{threshold:e}):n("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] tax free.",{threshold:e}):n("Taxes will apply to all orders.")},this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?null:[n("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>this.hasInclusivePrices()?[f]:[n("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:100*o.vatTaxRate+"%"}),f],this.getNewZealandDutyTaxMessge=o=>this.hasInclusivePrices()?null:[n("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:100*o.vatTaxRate+"%",threshold:l({amount:o.vatTaxDeminimus})})],this.getInclusivePriceMessage=()=>{const o=a.inclusivePricing;return"ENABLED"!==(null==o?void 0:o.status)?null:"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status?n("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status?n("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status?n("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.fee.status?n("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions."):null},this.getAdditionalDutyTaxMessage=()=>{if(!a.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(a.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(a.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(a.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(a.countryLandedCost);default:return null}},this.isOpen=!1,this.setIsOpen=()=>{},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettings=void 0,this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=a,l=this.hasInclusivePrices(),f=this.getInclusivePriceMessage(),m=this.getDutyMessage(),g=this.getTaxMessage(),u=this.getAdditionalDutyTaxMessage(),p=this.animateFromLeftOverride||this.dialogRef&&c(this.dialogRef),b=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:w}=a,x=n("Welcome to [storeName]",{storeName:r.organizationName}),C=(null===(o=w.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||n("Know about duties and taxes before you buy. Shop with confidence!"),z=h(C),v=this.getCurrentPageEnum(),y=w.filter((o=>o.pageName===v));return t(i,{key:"df052224c778ebfceeef7c827fa3da0e8a2f3dc9",class:"zonos--elements"},t("div",{key:"0ecff6a07d24a72fb4f200cce82ab09e40b48baf",class:d(["zonos--hello-dialog",p&&"zonos--hello-dialog-animate-from-left",b&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"b2939d49930c8a34288a884582eb849a492080ff"},t("div",{key:"f1a22291d7865d57d37cbcd3c8f70c4aea57ed39",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"ee3794826efc9fed856f0a320cf6428a428b4ea4",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"3d2ff0b68268c97e385eb3cf7fcc34454d2ed3b5",spacing:24},t("zonos-country-flag",{key:"e09645ac583e59354d11b3c194d4d3f6d4780c55",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"42017a698c1678b90c8c7bbece5d623d0800e37b",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"ac30b7683dcc65773159832eadad8542d1d1bda8",type:"boldSubheader"},x),t("zonos-text",{key:"58cc0e8c51774c339b0fc735e4e98917ed614c8a",innerHTML:z,textColor:"gray-800"})),t("zonos-v-stack",{key:"0b3a3b2bf981ed72654506cc31f07edf6268b0a4",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"196a593b167fc979bf0a2bef7f266ad3778f6ca0",spacing:"12px"},t("zonos-v-stack",{key:"94925c753ddfdd1a659580f7f78f8d6626cdcdaa",spacing:12},l?t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>'}),t("zonos-text",null,f)):t(s,null,t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,m)),t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,g))),null==u?void 0:u.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{innerHTML:o})))))),y.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"540006185ce1d28d610052801dcf9281773c5504",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"886c371fdfa8c9c15188ef9d6cbb637162fb0d27"},t("zonos-country-select",{key:"1365bee67831b64637e5c481f239c557f2649694",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"44929f0c23627970b1706f6e8c76e51022201379"},t("zonos-language-select",{key:"86b9f68c84da77f9e1af51dcb7d512eb6b289a27",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};m.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{m as zonos_hello_dialog}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as o,h as e,H as t,d as n}from"./p-5b7da777.js";import{j as i,S as a,l as d,p as l}from"./p-2402e12c.js";import{i as r}from"./p-81a54668.js";import{a as c,l as h}from"./p-7769b60c.js";import{i as b,c as f}from"./p-0c64dbbb.js";import{z as p,d as u}from"./p-91cfbf46.js";import{c as m}from"./p-b4b7f705.js";import{R as z}from"./p-08e7107d.js";import{g as y}from"./p-67a32cc5.js";import{i as g}from"./p-e1ce04b1.js";const v=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:i.stripeBillingAddressElement,stripeAddressEventData:i.stripeBillingAddressEventData,stripeElements:i.stripeElementsForBillingAddress}:{stripeAddressElement:i.stripeAddressElement,stripeAddressEventData:i.stripeAddressEventData,stripeElements:i.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?i.stripeBillingAddressEventData=s:i.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?i.stripeBillingAddressElement=s:i.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void c("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const n=d.shippingZoneCountries,i=n?Object.values(n).map((s=>s.code)):[],l="shipping"===this.type?i:[],b=(null==e?void 0:e.value.address.country)||a(l);h(`Stripe country code: ${b}`,"info");const f=t.create("address",{allowedCountries:l,contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:b}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});f.mount(this.el.querySelector(".zonos--address-component")),f.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(r())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:f,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"50871d11c001d37882b61476acdc227fcf3e2abd",class:"zonos--address zonos--elements"},e("zonos-text",{key:"90ffd3b0cc76446c88f3afe864a9bc9ecabb3997",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"98c2bd4c328bc3df138ae61f767b70b18524e877",class:"zonos--address-component"}))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};v.style=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const x=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:n,email:i,line1:a,line2:r,name:c,phone:h,postal_code:f,state:p}=this.currentAddress,u=null===(s=d.shippingZoneCountries)||void 0===s?void 0:s[n],m=({bold:s,content:o})=>{const t=b(o)?"red-600":"gray-1000";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},c&&e("div",{class:"zonos--address-line"},m({bold:!0,content:c})),i&&e("div",{class:"zonos--address-line"},m({content:i})),h&&e("div",{class:"zonos--address-line"},m({content:h})),a&&e("div",{class:"zonos--address-line"},m({content:a})),r&&e("div",{class:"zonos--address-line"},m({content:r})),e("div",{class:"zonos--address-line"},o&&m({content:o}),p&&m({content:p}),f&&m({content:f})),u&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:u.code})," ",m({content:u.displayName}))))}};x.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const k=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,n,i;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(n=this.translatedAddress.postal_code)||void 0===n?void 0:n[c])||c,state:(null===(i=this.translatedAddress.state)||void 0===i?void 0:i[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:n,line2:i,name:a,phone:d,postal_code:r,state:c}=this.localAddress,h=a.split(" ")[0]||"",f=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},l("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:l("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:l("First name"),inputValue:h,isError:b(h),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${f}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:l("Last name"),inputValue:f,isError:b(f),onInputChange:s=>this.onInputChange({key:"name",value:`${h} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},l("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:l("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:l("Address line 1"),inputValue:n,isError:b(n),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:l("Address line 2"),inputValue:i,isError:b(i),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:l("City"),inputValue:s,isError:b(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:l("State/Province"),inputValue:c,isError:b(c),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:l("Postal code"),inputValue:r,isError:b(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:l("Phone number"),inputValue:d,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};k.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const w=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,n,i,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:b,state:f}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(n=o.line2)||void 0===n?void 0:n[c])||c,name:(null===(i=o.name)||void 0===i?void 0:i[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[b])||b,state:(null===(d=o.state)||void 0===d?void 0:d[f])||f}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(i).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),n=null==t?void 0:t[0],i=null==t?void 0:t[1],a=(null===(o=null==n?void 0:n.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:n})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:n,name:i,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[n]:o.line2},name:{[i]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||p.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,n=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:m(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},l("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:z}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},l("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},l("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},l("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:n,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},l("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},l("Update address")))))))}get el(){return n(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};w.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const A=["blue","cyan","green","orange","purple","red","gray","glass"],C=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=A.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,n=s?`var(--zonos-elements-${this.backgroundColor}-200)`:g(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",i=y({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"a863e05a6e647b9ea8ef8902a4c618f6998894cd",class:m(["zonos--elements zonos--checkbox"]),style:{"--zonos--background-color":o,"--zonos--border-radius":i,"--zonos--font-family":u(),"--zonos--size":`${this.size}px`}},e("label",{key:"2b84b59d106661937c10e76ccb1c05f887c657ec",class:m([this.isDisabled&&"disabled"])},e("input",{key:"1dc2037bf17c37c8f762f2ac28509e3d607c9e61",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"75175e238cbe841c11f43392797a2126d1cd65a8",class:"checkmark-container"},e("svg",{key:"5e853c2248dd1777f0b4029a1b7beeb0fb8a0e1c",class:"checkmark",color:n,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"367494224e826b903acb560cbb93f532502aa4d2","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"573cfdccbd768246996bff4eaed8064b67e90009",size:this.fontSize},this.label)))}};C.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const I=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=y({overrideBorderStyle:this.borderStyle});return e(t,{key:"ba7a8197ab543be448706f9e9691b57738d0caae",class:m(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":s,"--zonos--font-family":u(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},e("div",{key:"b930321b762118180765fa981ec36331fcf582e3",class:"zonos--backdrop"}),e("div",{key:"9e2c43b255342bf5ba2cce5a3ebd3690a855dea4",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"ba38ab19c3af855c46cd50cf1c9aac5279158432",class:"zonos--dialog"},this.isLoading&&e("div",{key:"a3ee6a94bb75c349b4f724295d514d3fd2c212dd",class:"zonos--loading"},e("zonos-spinner",{key:"91f094db949bbf1698bebc871f1ae5455f647ead",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"4804b7611ecf1eefb24126c408952941ab535ba4",class:"zonos--header"},this.headerText&&e("h3",{key:"9e8c592e93d3c144553321f59176a2ba7b29ef95",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"35d49072fdeadf26797f9ef82d63b8448100f833",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"f74d2afc8f0296a7ef81e8a3b530fd60d92f3274",class:m(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"78138acb4bc703c5248687468621e87262b7cc90"})),e("slot",{key:"a98f325d222c53ba779075871fcf6aad5542d743",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};I.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";const j=class{constructor(e){s(this,e),this.linkAuthenticationChange=o(this,"linkAuthenticationChange",7),this.titleText=void 0,this.defaultEmail=null,this.isEmailError=!1,this.stripe=i.stripe}watchInitStripe(){if(!this.stripe||!i.stripeElements)return;const s=i.stripeLinkElement||i.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{var o;i.stripeLinkEventData=s,null===(o=this.linkAuthenticationChange)||void 0===o||o.emit()})),i.stripeLinkElement=s):c("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"7950960b06faca8192a2132d8543013a99a0e5ba",class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":y()}},e("zonos-text",{key:"1f8f7f96e39f0d0c0b4012846b27fef994aa9db1",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"4b6b2471fe7254cea24b628284451bd46146f001",class:`zonos--link-authentication-component ${this.isEmailError&&"zonos--input-invalid"}`}),this.isEmailError&&e("zonos-text",{key:"3d55092ae5c569641c0ae915e63abe005f362207",textColor:"red-600"},l("Please enter a valid email address.")))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};j.style=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";export{v as zonos_address,x as zonos_address_display,k as zonos_address_form,w as zonos_address_update_dialog,C as zonos_checkbox,I as zonos_dialog,j as zonos_link_authentication}
|
|
1
|
+
import{r as s,c as o,h as e,H as t,d as n}from"./p-5b7da777.js";import{j as i,S as a,l as d,p as l}from"./p-94146bc9.js";import{i as r}from"./p-81a54668.js";import{a as c,l as h}from"./p-0cfb97ae.js";import{i as b,c as f}from"./p-0c64dbbb.js";import{z as p,d as u}from"./p-91cfbf46.js";import{c as m}from"./p-b4b7f705.js";import{R as z}from"./p-08e7107d.js";import{g as y}from"./p-67a32cc5.js";import{i as g}from"./p-e1ce04b1.js";const v=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:i.stripeBillingAddressElement,stripeAddressEventData:i.stripeBillingAddressEventData,stripeElements:i.stripeElementsForBillingAddress}:{stripeAddressElement:i.stripeAddressElement,stripeAddressEventData:i.stripeAddressEventData,stripeElements:i.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?i.stripeBillingAddressEventData=s:i.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?i.stripeBillingAddressElement=s:i.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void c("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const n=d.shippingZoneCountries,i=n?Object.values(n).map((s=>s.code)):[],l="shipping"===this.type?i:[],b=(null==e?void 0:e.value.address.country)||a(l);h(`Stripe country code: ${b}`,"info");const f=t.create("address",{allowedCountries:l,contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:b}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});f.mount(this.el.querySelector(".zonos--address-component")),f.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(r())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:f,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"50871d11c001d37882b61476acdc227fcf3e2abd",class:"zonos--address zonos--elements"},e("zonos-text",{key:"90ffd3b0cc76446c88f3afe864a9bc9ecabb3997",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"98c2bd4c328bc3df138ae61f767b70b18524e877",class:"zonos--address-component"}))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};v.style=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const x=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:n,email:i,line1:a,line2:r,name:c,phone:h,postal_code:f,state:p}=this.currentAddress,u=null===(s=d.shippingZoneCountries)||void 0===s?void 0:s[n],m=({bold:s,content:o})=>{const t=b(o)?"red-600":"gray-1000";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},c&&e("div",{class:"zonos--address-line"},m({bold:!0,content:c})),i&&e("div",{class:"zonos--address-line"},m({content:i})),h&&e("div",{class:"zonos--address-line"},m({content:h})),a&&e("div",{class:"zonos--address-line"},m({content:a})),r&&e("div",{class:"zonos--address-line"},m({content:r})),e("div",{class:"zonos--address-line"},o&&m({content:o}),p&&m({content:p}),f&&m({content:f})),u&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:u.code})," ",m({content:u.displayName}))))}};x.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const k=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,n,i;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(n=this.translatedAddress.postal_code)||void 0===n?void 0:n[c])||c,state:(null===(i=this.translatedAddress.state)||void 0===i?void 0:i[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:n,line2:i,name:a,phone:d,postal_code:r,state:c}=this.localAddress,h=a.split(" ")[0]||"",f=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},l("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:l("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:l("First name"),inputValue:h,isError:b(h),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${f}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:l("Last name"),inputValue:f,isError:b(f),onInputChange:s=>this.onInputChange({key:"name",value:`${h} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},l("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:l("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:l("Address line 1"),inputValue:n,isError:b(n),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:l("Address line 2"),inputValue:i,isError:b(i),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:l("City"),inputValue:s,isError:b(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:l("State/Province"),inputValue:c,isError:b(c),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:l("Postal code"),inputValue:r,isError:b(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:l("Phone number"),inputValue:d,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};k.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const w=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,n,i,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:b,state:f}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(n=o.line2)||void 0===n?void 0:n[c])||c,name:(null===(i=o.name)||void 0===i?void 0:i[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[b])||b,state:(null===(d=o.state)||void 0===d?void 0:d[f])||f}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(i).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),n=null==t?void 0:t[0],i=null==t?void 0:t[1],a=(null===(o=null==n?void 0:n.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:n})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:n,name:i,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[n]:o.line2},name:{[i]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||p.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,n=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:m(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},l("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:z}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},l("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},l("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},l("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:n,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},l("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},l("Update address")))))))}get el(){return n(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};w.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const A=["blue","cyan","green","orange","purple","red","gray","glass"],C=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=A.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,n=s?`var(--zonos-elements-${this.backgroundColor}-200)`:g(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",i=y({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"a863e05a6e647b9ea8ef8902a4c618f6998894cd",class:m(["zonos--elements zonos--checkbox"]),style:{"--zonos--background-color":o,"--zonos--border-radius":i,"--zonos--font-family":u(),"--zonos--size":`${this.size}px`}},e("label",{key:"2b84b59d106661937c10e76ccb1c05f887c657ec",class:m([this.isDisabled&&"disabled"])},e("input",{key:"1dc2037bf17c37c8f762f2ac28509e3d607c9e61",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"75175e238cbe841c11f43392797a2126d1cd65a8",class:"checkmark-container"},e("svg",{key:"5e853c2248dd1777f0b4029a1b7beeb0fb8a0e1c",class:"checkmark",color:n,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"367494224e826b903acb560cbb93f532502aa4d2","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"573cfdccbd768246996bff4eaed8064b67e90009",size:this.fontSize},this.label)))}};C.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const I=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=y({overrideBorderStyle:this.borderStyle});return e(t,{key:"ba7a8197ab543be448706f9e9691b57738d0caae",class:m(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":s,"--zonos--font-family":u(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},e("div",{key:"b930321b762118180765fa981ec36331fcf582e3",class:"zonos--backdrop"}),e("div",{key:"9e2c43b255342bf5ba2cce5a3ebd3690a855dea4",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"ba38ab19c3af855c46cd50cf1c9aac5279158432",class:"zonos--dialog"},this.isLoading&&e("div",{key:"a3ee6a94bb75c349b4f724295d514d3fd2c212dd",class:"zonos--loading"},e("zonos-spinner",{key:"91f094db949bbf1698bebc871f1ae5455f647ead",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"4804b7611ecf1eefb24126c408952941ab535ba4",class:"zonos--header"},this.headerText&&e("h3",{key:"9e8c592e93d3c144553321f59176a2ba7b29ef95",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"35d49072fdeadf26797f9ef82d63b8448100f833",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"f74d2afc8f0296a7ef81e8a3b530fd60d92f3274",class:m(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"78138acb4bc703c5248687468621e87262b7cc90"})),e("slot",{key:"a98f325d222c53ba779075871fcf6aad5542d743",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};I.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";const j=class{constructor(e){s(this,e),this.linkAuthenticationChange=o(this,"linkAuthenticationChange",7),this.titleText=void 0,this.defaultEmail=null,this.isEmailError=!1,this.stripe=i.stripe}watchInitStripe(){if(!this.stripe||!i.stripeElements)return;const s=i.stripeLinkElement||i.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{var o;i.stripeLinkEventData=s,null===(o=this.linkAuthenticationChange)||void 0===o||o.emit()})),i.stripeLinkElement=s):c("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"7950960b06faca8192a2132d8543013a99a0e5ba",class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":y()}},e("zonos-text",{key:"1f8f7f96e39f0d0c0b4012846b27fef994aa9db1",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"4b6b2471fe7254cea24b628284451bd46146f001",class:`zonos--link-authentication-component ${this.isEmailError&&"zonos--input-invalid"}`}),this.isEmailError&&e("zonos-text",{key:"3d55092ae5c569641c0ae915e63abe005f362207",textColor:"red-600"},l("Please enter a valid email address.")))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};j.style=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";export{v as zonos_address,x as zonos_address_display,k as zonos_address_form,w as zonos_address_update_dialog,C as zonos_checkbox,I as zonos_dialog,j as zonos_link_authentication}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as o,c as e}from"./p-91cfbf46.js";import{d as r,w as n,p as t,v as a,h as i}from"./p-
|
|
1
|
+
import{z as o,c as e}from"./p-91cfbf46.js";import{d as r,w as n,p as t,v as a,h as i}from"./p-94146bc9.js";import{h as s,l as c,a as l,j as u}from"./p-0cfb97ae.js";import{t as d}from"./p-e1ce04b1.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,l as a,a as e}from"./p-
|
|
1
|
+
import{h as t,l as a,a as e}from"./p-0cfb97ae.js";const s=async({cartId:e,retries:o})=>{const r="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:i}=await t("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),c=!i||n.length;return c&&o?(a("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((t=>setTimeout(t,500))),s({cartId:e,retries:o-1})):c?null:i},o=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,r=new RegExp(`^${o.source}$`),n=new RegExp(`^cart_${o.source}$`),i=async t=>{const{isDgsCartId:o,isLegacyCartId:i}=(t=>t?n.test(t)?{isDgsCartId:!0,isLegacyCartId:!1}:r.test(t)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(t);if(!i&&!o)return e("[ZONOS - loadZonos] invalid cart id"),null;const c=await s({cartId:t,retries:5});return a("[ZONOS - loadZonos] getting temp cart data","info",c),c?{cartData:c.cartData,storeFavicon:c.storeFaviconUrl,storeId:c.cartData.storeId,storeLogo:c.storeLogoUrl,zonosApiKey:c.cartData.credentialToken}:(e("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)},c="zonos--checkout-hidden-button",d="zonos--domestic-redirected-checkout-button";export{c,d,i as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as s,H as t}from"./p-5b7da777.js";import{d as o,z as i}from"./p-91cfbf46.js";import{c as n}from"./p-b4b7f705.js";import{i as a}from"./p-ae393255.js";import{s as l}from"./p-96d77739.js";const h={pageHeader:{label:"Page Header (3XL) · 34px (2.125rem)",size:"3xl",tag:"h2",weight:900},secondaryPageHeader:{label:'Secondary Page Header (3XL) • 34px, 500 "Medium"',size:"3xl",tag:"h2",weight:500},header:{label:"Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",weight:700},descriptionHeader:{label:"Description Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",weight:700},title:{label:"Title (XL) • 22px (1.375rem)",size:"xl",tag:"h4",weight:600},boldSubheader:{label:"Bold Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",weight:700},semiBoldSubheader:{label:"Semi Bold Subheader (L / H4) • 18px (1.125rem)",size:"l",tag:"h5",weight:600},subheader:{label:"Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",weight:500},boldLabel:{label:"Bold Label (Base) • 14px (.875rem)",size:"base",tag:"span",weight:700},semiBoldLabel:{label:"Semi Bold Label (Base) • 14px (.875rem)",size:"base",tag:"span",weight:600},label:{label:"Label (Base) • 14px (.875rem)",size:"base",tag:"span",weight:500},body:{label:"Body (Base) • 14px (.875rem)",size:"base",tag:"span",weight:400},smallHeader:{label:"Small header (S) • 12px (.75rem)",size:"s",tag:"span",weight:600},caption:{label:"Caption (S) • 12px (.75rem)",size:"s",tag:"span",weight:400},hintText:{label:"Hint text (XS) • 10px (.625rem)",size:"xs",tag:"span",weight:400}},z=class{constructor(s){e(this,s),this.textColor="gray-1000",this.size=void 0,this.type="body",this.weight=void 0,this.ready=!1}componentDidRender(){setTimeout((()=>{this.ready=!0}),100)}render(){const{size:e,tag:z,weight:r}=h.body,{size:x,tag:g,weight:f}=h[this.type],m=this.size||x||e,d=this.weight||f||r,p=g||z,b=a(this.textColor)?`var(--zonos-elements-${this.textColor})`:this.textColor;return s(t,{class:n(["zonos--elements",`zonos--text-size-${m}`,`zonos--text-weight-${d}`]),style:l({"--zonos--color":b,"--zonos--font-family":o(),"--zonos--font-size-2xl":i.appearance.fontSize2XL?`${i.appearance.fontSize2XL}px`:void 0,"--zonos--font-size-3xl":i.appearance.fontSize3XL?`${i.appearance.fontSize3XL}px`:void 0,"--zonos--font-size-base":i.appearance.fontSizeBase?`${i.appearance.fontSizeBase}px`:void 0,"--zonos--font-size-l":i.appearance.fontSizeL?`${i.appearance.fontSizeL}px`:void 0,"--zonos--font-size-s":i.appearance.fontSizeS?`${i.appearance.fontSizeS}px`:void 0,"--zonos--font-size-xl":i.appearance.fontSizeXL?`${i.appearance.fontSizeXL}px`:void 0,"--zonos--font-size-xs":i.appearance.fontSizeXS?`${i.appearance.fontSizeXS}px`:void 0})},(()=>{switch(p){case"h2":return s("h2",null,s("slot",null));case"h3":return s("h3",null,s("slot",null));case"h4":return s("h4",null,s("slot",null));case"h5":return s("h5",null,s("slot",null));default:return s("span",null,s("slot",null))}})())}};z.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{color:var(--zonos--color)}:host(.zonos--text-size-3xl)>*,:host(.zonos--text-size-3xl){font-size:var(--zonos--font-size-3xl, var(--zonos-elements-font-size-3xl))}:host(.zonos--text-size-2xl)>*,:host(.zonos--text-size-2xl){font-size:var(--zonos--font-size-2xl, var(--zonos-elements-font-size-2xl))}:host(.zonos--text-size-xl)>*,:host(.zonos--text-size-xl){font-size:var(--zonos--font-size-xl, var(--zonos-elements-font-size-xl))}:host(.zonos--text-size-l)>*,:host(.zonos--text-size-l){font-size:var(--zonos--font-size-l, var(--zonos-elements-font-size-l))}:host(.zonos--text-size-base)>*,:host(.zonos--text-size-base){font-size:var(--zonos--font-size-base, var(--zonos-elements-font-size-base))}:host(.zonos--text-size-s)>*,:host(.zonos--text-size-s){font-size:var(--zonos--font-size-s, var(--zonos-elements-font-size-s))}:host(.zonos--text-size-xs)>*,:host(.zonos--text-size-xs){font-size:var(--zonos--font-size-xs, var(--zonos-elements-font-size-xs))}:host(.zonos--text-weight-900)>*,:host(.zonos--text-weight-900){font-weight:900}:host(.zonos--text-weight-700)>*,:host(.zonos--text-weight-700){font-weight:700}:host(.zonos--text-weight-600)>*,:host(.zonos--text-weight-600){font-weight:600}:host(.zonos--text-weight-500)>*,:host(.zonos--text-weight-500){font-weight:500}:host(.zonos--text-weight-400)>*,:host(.zonos--text-weight-400){font-weight:400}";export{z as zonos_text}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):n(e.value).then(r,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-56ba5cbf.system.js"],(function(e,t){"use strict";var o,i,n;return{setters:[function(t){o=t.p;i=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var s=function(){var e=t.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return o(i)};s().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,i(JSON.parse('[["p-61380d53.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"]}]]],["p-8df3d5d0.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-9833f37d.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-0082eefd.system",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-eb6d1e26.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-e933cbf0.system",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-4fee6e7f.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-d6f1b6fa.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-ff0a79e6.system",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-e6fad32a.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-6b0a8709.system",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-3b5f49f6.system",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-6c047faf.system",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-4cd1e79c.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-eca920dc.system",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-5ac777a7.system",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-e2cda105.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-0bc813a9.system",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-6a2bed3e.system",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-8b3d9796.system",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-2db962f9.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-f962fc6a.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-167b7fa8.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}]]],["p-bc9987f2.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),t)]}}))}))}))}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):n(e.value).then(r,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-56ba5cbf.system.js"],(function(e,t){"use strict";var o,i,n;return{setters:[function(t){o=t.p;i=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var s=function(){var e=t.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return o(i)};s().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,i(JSON.parse('[["p-4d4ea5dc.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"]}]]],["p-2bb86f3d.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-5ee9685e.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-0082eefd.system",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-eb6d1e26.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-e933cbf0.system",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-4fee6e7f.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-8612f8d1.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-ff0a79e6.system",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-e6fad32a.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-6b0a8709.system",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-3b5f49f6.system",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-6c047faf.system",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-4cd1e79c.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-08948e65.system",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-5ac777a7.system",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-7312d038.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-0bc813a9.system",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-7c7feadb.system",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-8b3d9796.system",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-17a5550a.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-10aef679.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-8390f23d.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}]]],["p-2faa3104.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),t)]}}))}))}))}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{c(t.next(r))}catch(r){i(r)}}function u(r){try{c(t["throw"](r))}catch(r){i(r)}}function c(r){r.done?e(r.value):o(r.value).then(a,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-00dc1507.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{c(t.next(r))}catch(r){i(r)}}function u(r){try{c(t["throw"](r))}catch(r){i(r)}}function c(r){r.done?e(r.value):o(r.value).then(a,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-00dc1507.system.js","./p-582cdd52.system.js","./p-6305e92c.system.js","./p-c3e98be6.system.js"],(function(r){"use strict";var n,e,t,o,i,a,u,c,s,d,l,f;return{setters:[function(r){n=r.z;e=r.c},function(r){t=r.d;o=r.w;i=r.p;a=r.v;u=r.h},function(r){c=r.h;s=r.l;d=r.a;l=r.j},function(r){f=r.t}],execute:function(){var v=this;
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -14,4 +14,4 @@ var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r ins
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/function p(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=_(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){i=false}}));return i?e:null}function w(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var i=_(n,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function h(r){var n=r.environment;var e=n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete r.environment;if(r.sdkBaseUrl){e=r.sdkBaseUrl;delete r.sdkBaseUrl}var t=r;var o=Object.keys(t).filter((function(r){return typeof t[r]!=="undefined"&&t[r]!==null&&t[r]!==""})).reduce((function(r,n){var e=t[n].toString();n=y(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),i=o.queryParams,a=o.attributes;if(i["merchant-id"]&&i["merchant-id"].indexOf(",")!==-1){a["data-merchant-id"]=i["merchant-id"];i["merchant-id"]="*"}return{url:"".concat(e,"?").concat(b(i)),attributes:a}}function y(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function b(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function _(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function g(r,n){if(n===void 0){n=Promise}E(r,n);if(typeof document==="undefined")return n.resolve(null);var e=h(r),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=P(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(p(t,o)&&a){return n.resolve(a)}return m({url:t,attributes:o},n).then((function(){var r=P(i);if(r){return r}throw new Error("The window.".concat(i," global variable is not available."))}))}function m(r,n){if(n===void 0){n=Promise}E(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();w({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function P(r){return window[r]}function E(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var k=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,i=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var j=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var A=r("i",(function(r){var n=r.backgroundColor1,e=r.backgroundColor2;var t=f.readability(n,e);return t>2.5}));var S=r("s",(function(r){var e=n.checkoutSettings.analyticsProviders.find((function(r){return r.type==="GOOGLE_ANALYTICS"}));if(!e||(e===null||e===void 0?void 0:e.status)==="DISABLED"){return}if(typeof window.gtag==="function"){s("Zonos submits gtag event","log",r);window.gtag("event",r,{})}}));var I=e((function(){return{orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),x=I.reset,O=I.state;r({c:x,b:O});var L=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,i,a;var u=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,j({checkoutSessionId:u})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,a]}}))}))};var T=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,a,u;var c=r.checkoutSessionId,s=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:new URL(window.location.href);return[4,k({checkoutSessionId:c,paypalMockResponse:s})];case 1:t=r.sent(),o=t.errors,a=t.json;u=(n=a===null||a===void 0?void 0:a.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!u){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||i("An unexpected error occurred when processing PayPal order."))}return[2,u]}}))}))};var B=function(r){var n=r.error;var e;var t=
|
|
17
|
+
*/function p(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=_(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){i=false}}));return i?e:null}function w(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var i=_(n,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function h(r){var n=r.environment;var e=n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete r.environment;if(r.sdkBaseUrl){e=r.sdkBaseUrl;delete r.sdkBaseUrl}var t=r;var o=Object.keys(t).filter((function(r){return typeof t[r]!=="undefined"&&t[r]!==null&&t[r]!==""})).reduce((function(r,n){var e=t[n].toString();n=y(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),i=o.queryParams,a=o.attributes;if(i["merchant-id"]&&i["merchant-id"].indexOf(",")!==-1){a["data-merchant-id"]=i["merchant-id"];i["merchant-id"]="*"}return{url:"".concat(e,"?").concat(b(i)),attributes:a}}function y(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function b(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function _(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function g(r,n){if(n===void 0){n=Promise}E(r,n);if(typeof document==="undefined")return n.resolve(null);var e=h(r),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=P(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(p(t,o)&&a){return n.resolve(a)}return m({url:t,attributes:o},n).then((function(){var r=P(i);if(r){return r}throw new Error("The window.".concat(i," global variable is not available."))}))}function m(r,n){if(n===void 0){n=Promise}E(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();w({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function P(r){return window[r]}function E(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var k=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,i=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var j=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var A=r("i",(function(r){var n=r.backgroundColor1,e=r.backgroundColor2;var t=f.readability(n,e);return t>2.5}));var S=r("s",(function(r){var e=n.checkoutSettings.analyticsProviders.find((function(r){return r.type==="GOOGLE_ANALYTICS"}));if(!e||(e===null||e===void 0?void 0:e.status)==="DISABLED"){return}if(typeof window.gtag==="function"){s("Zonos submits gtag event","log",r);window.gtag("event",r,{})}}));var I=e((function(){return{orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),x=I.reset,O=I.state;r({c:x,b:O});var L=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,i,a;var u=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,j({checkoutSessionId:u})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,a]}}))}))};var T=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,a,u;var c=r.checkoutSessionId,s=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:new URL(window.location.href);return[4,k({checkoutSessionId:c,paypalMockResponse:s})];case 1:t=r.sent(),o=t.errors,a=t.json;u=(n=a===null||a===void 0?void 0:a.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!u){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||i("An unexpected error occurred when processing PayPal order."))}return[2,u]}}))}))};var B=function(r){var n=r.error;var e;var t=l(n.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var a=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!a){O.paypalErrorMessage=i("An unexpected error occurred when processing PayPal order.")}var u=a[2]||i("An unexpected error occurred when processing PayPal order.");O.paypalErrorMessage=u};var C=function(r){var e=r.checkoutSessionId,c=r.onPaypalFail,s=r.onPaypalSessionDone,l=r.overrideBorderRaidus,f=r.overridePrimaryColor;var p=f||n.appearance.colorPrimary;var w="#ffc33a";var h=A({backgroundColor1:w,backgroundColor2:p||""});return{createOrder:function(){return __awaiter(v,void 0,void 0,(function(){var r,n,a,u;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,6,,7]);O.paypalErrorMessage=null;t.inventoryCheckErrorMessage=null;s.label=1;case 1:s.trys.push([1,3,,4]);r=t;return[4,o()];case 2:r.inventoryCheckErrorMessage=s.sent();return[3,4];case 3:n=s.sent();t.inventoryCheckErrorMessage=i("Unable to check inventory. Please try again.");return[3,4];case 4:if(t.inventoryCheckErrorMessage){return[2,""]}return[4,L({checkoutSessionId:e})];case 5:a=s.sent();return[2,a];case 6:u=s.sent();d("Failed to create paypal order",u);O.paypalErrorMessage=i("Failed to create PayPal order. Please try again, or consider using an alternative method.");c===null||c===void 0?void 0:c();return[2,""];case 7:return[2]}}))}))},onApprove:function(r,n){return __awaiter(v,void 0,void 0,(function(){var r,n;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);O.paypalErrorMessage=null;S("zonos-checkout-payment-info");return[4,T({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:r=t.sent();O.orderIdCreated=r;s===null||s===void 0?void 0:s({orderId:r});a();u();return[3,3];case 2:n=t.sent();d("==== Failed to capture paypal order",n);if(n instanceof Error){return[2,B({error:n})]}c===null||c===void 0?void 0:c();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:l==="SHARP"?0:10,color:h?"gold":"blue",shape:"rect"}}};var D=function(){if(!O.paypalButtons.length){return}O.paypalButtons.forEach((function(r){return __awaiter(v,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,r.close()];case 1:n.sent();return[2]}}))}))}));O.paypalButtons=[]};var R=r("a",(function(r){return __awaiter(v,[r],void 0,(function(r){var e,t,o,i,a;var u=r.currency;return __generator(this,(function(r){switch(r.label){case 0:t=!!((e=n.checkoutSettings.externalPaymentMethods)===null||e===void 0?void 0:e.find((function(r){return r.type==="PAYPAL"&&r.status==="ENABLED"})));if(!t){s("=== Paypal is disabled for this store","warn");return[2]}o=n.checkoutSettings.externalServiceTokens.find((function(r){return r.type==="PAYPAL_CLIENT_ID"}));if(!o){s("Failed to load paypal -- missing paypal publishable key","warn");return[2]}i=n.zonosMode==="production"&&n.checkoutSettings.mode==="LIVE"?"production":"sandbox";a=window.Zonos;return[4,g({clientId:o.token,currency:u,environment:i})];case 1:a.paypal=r.sent();s("==== Paypal script loaded");return[2]}}))}))}));var F=r("d",(function(r){var n;var e=window.Zonos.paypal;if(!e){s("Paypal is not available");return null}var o=t.checkoutSessionId;if(!o){s("Paypal is not available due to checkoutSessionId is not available");return null}s("==== Loading Paypal buttons");D();var i=[(n=e.FUNDING)===null||n===void 0?void 0:n.PAYPAL].filter(Boolean);O.paypalButtons=i.map((function(n){var t;var i=null;try{i=((t=e.Buttons)===null||t===void 0?void 0:t.call(e,Object.assign(Object.assign({},C(Object.assign({checkoutSessionId:o,fundingSource:n},r))),{fundingSource:n})))||null}catch(r){s("===== Failed to load paypal's \"".concat(n,'" button'),"warn",r)}if(i===null||i===void 0?void 0:i.isEligible()){s("==== Paypal button ".concat(n," loaded"));return i}return null})).filter(Boolean);return O.paypalButtons}));var z=r("p",(function(){var r,e;var t=((e=(r=n.checkoutSettings.externalPaymentMethods)===null||r===void 0?void 0:r.find((function(r){return r.type==="PAYPAL"})))===null||e===void 0?void 0:e.status)==="ENABLED";return t||!!O.paypalButtons.length}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as o,H as s}from"./p-5b7da777.js";import{T as t,p as a,l as n}from"./p-
|
|
1
|
+
import{r as e,h as o,H as s}from"./p-5b7da777.js";import{T as t,p as a,l as n}from"./p-94146bc9.js";import{d as l}from"./p-91cfbf46.js";import{l as i}from"./p-97aceb11.js";import"./p-0cfb97ae.js";import"./p-e1ce04b1.js";import"./p-67a32cc5.js";const c=class{constructor(o){e(this,o),this.languageSelected=e=>{t(e),this.handleOnClose()},this.handleOnClose=()=>{}}render(){const{selectedLocale:e}=n;return o(s,{key:"eaca22844486965ba2b78c46571cdecd1f3002e7",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("div",{key:"2846ee489019e8c83d7b64b8a29dc67353b8f8c0",class:"zonos--language-select"},o("zonos-select-dialog-header",{key:"72c36cbf777562c15346c26716e07469a5889f8d",handleOnClose:()=>this.handleOnClose(),label:a("Select a language")}),o("div",{key:"d84fda6dc4aceaec2b3b8fda359ca60f78db448a",class:"zonos--language-select-content"},i.map((s=>o("button",{class:"zonos--language-select-button",onClick:()=>this.languageSelected(s.code)},o("zonos-text",{textColor:"gray-800"},s.translatedLabel),s.code===e&&o("zonos-icon",{content:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n',size:16})))))))}};c.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";const d=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.label=""}render(){return o(s,{key:"fbc386d771a9f1ee4b145b54c53a3ce31ac4aae5",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("zonos-v-stack",{key:"ed5cab44fd2b06a3d700602f4cb501608205e5b6",class:"zonos--select-dialog-header-wrapper",spacing:8},o("div",{key:"c2345cdad3bd812d7add7029b1f37d2f623de310",class:"zonos--select-dialog-header"},o("zonos-text",{key:"c43a9009db5e83ea96bc683ff99a36c4fcdef6fc",type:"boldLabel"},this.label),o("zonos-button",{key:"6884b1569d52688dbc74ee3772755e37eadb1e79",class:"zonos--close-button",icon:o("zonos-icon",{"aria-label":"Close select dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>',size:20}),noBackground:!0,onClick:()=>this.handleOnClose()})),o("slot",{key:"8af3df1a34ea6da62be137313e0c42cc90ba704d"})))}};d.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";export{c as zonos_language_select,d as zonos_select_dialog_header}
|