@zonos/elements 1.3.37 → 1.3.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-0cac4ec9.js → cart-c7212410.js} +29 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{submitGtag-2c66e270.js → submitGtag-7a679d92.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +5 -7
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +7 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_2.cjs.entry.js +1 -1
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +4 -6
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +23 -0
- package/dist/collection/components/store/hello/localization.js +29 -0
- package/dist/collection/types/generated/graphql.customer.types.js +8 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +4 -0
- package/dist/esm/{cart-f4204129.js → cart-eb75b113.js} +29 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{submitGtag-1df655bc.js → submitGtag-0bc0baa0.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.entry.js +5 -7
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +7 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_2.entry.js +1 -1
- package/dist/esm-es5/{cart-f4204129.js → cart-eb75b113.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{submitGtag-1df655bc.js → submitGtag-0bc0baa0.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +62 -7
- 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/hello/zonos-hello/zonos-hello.d.ts +4 -0
- package/dist/types/components/store/hello/localization.d.ts +1 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components.d.ts +4 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +11 -2
- package/dist/types/types/generated/graphql.customer.types.ts +13 -2
- package/dist/types/types/generated/graphql.frontend.types.d.ts +5 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +7 -1
- package/dist/types/types/hello/HelloConfig.d.ts +6 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-19241859.system.entry.js → p-02405211.system.entry.js} +1 -1
- package/dist/zonos-elements/p-085548f2.entry.js +1 -0
- package/dist/zonos-elements/{p-af996985.entry.js → p-18b28104.entry.js} +1 -1
- package/dist/zonos-elements/{p-9a27550a.system.entry.js → p-357322ea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c993d267.system.entry.js → p-3f5e2e5c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0d029fb3.system.entry.js → p-467f934c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c7b07f80.js → p-53acc999.js} +1 -1
- package/dist/zonos-elements/{p-e3631ac5.entry.js → p-548ac127.entry.js} +1 -1
- package/dist/zonos-elements/{p-57cbbf1e.system.entry.js → p-5609876a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e3c43972.entry.js → p-57617755.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee4e6e08.entry.js → p-59f37de3.entry.js} +1 -1
- package/dist/zonos-elements/{p-de71eaea.entry.js → p-62ed4236.entry.js} +1 -1
- package/dist/zonos-elements/{p-acb75c06.entry.js → p-6f9448bb.entry.js} +1 -1
- package/dist/zonos-elements/{p-22a4f8a9.system.js → p-70262120.system.js} +1 -1
- package/dist/zonos-elements/{p-2aac5bc8.js → p-878293fe.js} +1 -1
- package/dist/zonos-elements/{p-c2a9555c.system.entry.js → p-8acdf43b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e46d19e.system.entry.js → p-9d29f3f4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ce1e237.system.entry.js → p-a21ec316.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a8b934c2.entry.js +1 -0
- package/dist/zonos-elements/{p-4d8ad8e2.system.js → p-abe8ea12.system.js} +1 -1
- package/dist/zonos-elements/{p-ab117c05.system.js → p-ad37d20e.system.js} +1 -1
- package/dist/zonos-elements/{p-1f350060.entry.js → p-ae04d3ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-8de3cf00.system.entry.js → p-b684f8aa.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/p-e1db1bc9.entry.js +1 -0
- package/dist/zonos-elements/{p-ab43d893.system.entry.js → p-f06bb776.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-720e9236.entry.js +0 -1
- package/dist/zonos-elements/p-74c85d7f.entry.js +0 -1
- package/dist/zonos-elements/p-e4888976.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as s,H as e,F as t}from"./p-ce347974.js";import{l as n,s as c,a as i,b as r,c as a,i as h,d as l,e as u,f as d,g as z,h as m,j as k,k as p,t as g,m as f,n as b,o as v,p as y,q as w}from"./p-2aac5bc8.js";import{z as C,g as x,m as I}from"./p-5821856c.js";import{c as O,s as S,a as A,t as T,g as H}from"./p-c7b07f80.js";import{i as L}from"./p-81a54668.js";import{l as N,a as j}from"./p-eaa335e1.js";import{c as B}from"./p-b4b7f705.js";import{g as P}from"./p-31b3d26b.js";import{i as D}from"./p-9a1c0d02.js";import{R as M}from"./p-08e7107d.js";const E=({key:o,value:s})=>s?{key:o,value:s}:null,R=o=>[E({key:"brand",value:o.itemBrand}),E({key:"material",value:o.itemMaterial}),E({key:"category",value:o.itemCategory}),E({key:"color",value:o.itemColor}),E({key:"customization",value:o.itemCustomization}),E({key:"descriptionDetailed",value:o.itemDescriptionDetailed}),E({key:"fabricContent",value:o.itemFabricContent}),E({key:"ltlClass",value:o.itemLtlClass}),E({key:"pickingLocation",value:o.itemPickingLocation}),E({key:"shipFromLocation",value:o.itemShipFromLocation}),E({key:"size",value:o.itemSize}),E({key:"status",value:o.status})].filter(Boolean),$=o=>{if(!o)return"POUND";switch(o.toUpperCase()){case"KG":return"KILOGRAM";case"OZ":return"OUNCE";case"G":return"GRAM";default:return"POUND"}},U=o=>{if(!o)return[];const s=[];return o.length&&s.push({type:"LENGTH",unitOfMeasure:"INCH",value:o.length}),o.width&&s.push({type:"WIDTH",unitOfMeasure:"INCH",value:o.width}),o.weight&&s.push({type:"WEIGHT",unitOfMeasure:$(o.weightUnits),value:o.weight}),o.height&&s.push({type:"HEIGHT",unitOfMeasure:"INCH",value:o.height}),s},_=(o=!0)=>!(!n.localizationLoaded||!n.isShippableCountry&&(document.dispatchEvent(O("legacyCheckoutError","Unable to initiate checkout process in a country where shipping is not available")),o&&N("Checkout: not shippable country"),1)),G='<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',F=class{constructor(s){o(this,s),this.onChangeLocaleListener=()=>{},this.applyStripeTheme=async()=>{var o,s,e,t;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||C.appearance.theme;await h({overrideBorderRaidus:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.style,overridePrimaryColor:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.colorPrimary,overrideSecondaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorSecondary,overrideTheme:this.isMobile?n:void 0})},this.getCurrentLocalePageEnum=()=>{switch(l.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.appearanceSettingsOverride=void 0,this.preview=!1,this.mobile=!1,this.defaultAddress=null,this.forceDialogOpen=!1,this.open=this.forceDialogOpen,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.paymentError=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.zonosReviewRef=void 0,this.storybookPaymentStatusOverride=void 0,this.domesticRedirectedBtnSelector="#zonos--domestic-redirected-checkout-button",this.legacyCheckoutHiddenBtnSelector="#legacy-checkout-hidden-button",this.isLegacyCheckout=!1,this.confirmDialogOpen=!1,this.showSessionTimoutScreen=!1,this.checkoutTimeoutInterval=null,this.inventoryCheckErrorMessage=null}async initCartInfoHandler(o){u(o.detail)}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var s,e;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,A("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==l.step||d(),l.step="customer-info",z(),this.clearCheckoutTimeoutInterval(),null===(e=(s=C.checkoutSettings).onClose)||void 0===e||e.call(s)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if(window.Zonos.tempCartData){const o=(o=>{var s;return(null===(s=null==o?void 0:o.items)||void 0===s?void 0:s.map((o=>({amount:o.unitPrice||0,attributes:R(o),countryOfOrigin:o.countryOfOrigin||void 0,currencyCode:"USD",description:o.itemDescriptionLong||"",imageUrl:o.imageURL||"",itemType:"PHYSICAL_GOOD",measurements:U(o),name:o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}))))||[]})(window.Zonos.tempCartData);await u(o)}else if(C.checkoutSettings.buildCartDetail&&n.selectedCountryCode){N("build cart detail");const o=await C.checkoutSettings.buildCartDetail({countryCode:n.selectedCountryCode,currencyCode:n.targetCurrency});await u(o)}if(!m.clientSecret){const o=await k();if(N(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return await this.applyStripeTheme(),!0}clearCheckoutTimeoutInterval(){this.checkoutTimeoutInterval&&(clearTimeout(this.checkoutTimeoutInterval),this.checkoutTimeoutInterval=null)}startCheckoutTimeoutInterval(){if(this.preview)return;const o=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout"),s=o&&!isNaN(parseInt(o,10))?parseInt(o,10):54e5;N(`==START CHECKOUT TIMEOUT - ${s}==`),this.checkoutTimeoutInterval=setTimeout((()=>{this.showSessionTimoutScreen=!0}),s)}reloadCheckoutSession(){window.location.reload()}attachCheckout(){const o=C.checkoutSettings.placeOrderButtonSelector;N(`attach checkout ${o}`),o&&document.querySelectorAll(`${o}, ${this.domesticRedirectedBtnSelector}`).forEach((o=>{o.getAttribute("data-zonos-checkout-attached")||(o.addEventListener("click",(async o=>{if(_()){o.preventDefault(),o.stopPropagation(),N("zonos checkout button clicked"),m.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");this.startCheckoutTimeoutInterval(),A("zonos-checkout-start"),T("checkout_open")}catch(o){m.isFetchingSession=!1,p({messages:[g("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:g("Error creating Checkout")})}}})),C.checkoutSettings.disablePlaceOrderButtonActivation||o.removeAttribute("disabled"),o.setAttribute("data-zonos-checkout-attached","true"),o.matches(this.domesticRedirectedBtnSelector)&&(o.dispatchEvent(O("click")),r(),o.remove()),o.matches(this.legacyCheckoutHiddenBtnSelector)&&(this.isLegacyCheckout=!0,o.dispatchEvent(O("click")),o.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useLegacyQueryParam(){const o=new URLSearchParams(window.location.search),s={country:o.get("country"),customerAddress1:o.get("customerAddress1"),customerAddress2:o.get("customerAddress2"),customerCity:o.get("customerCity"),customerEmail:o.get("customerEmail"),customerName:o.get("customerName"),customerPhone:o.get("customerPhone"),customerState:o.get("customerState"),customerZip:o.get("customerZip")};s.customerAddress1&&s.customerCity&&s.customerName&&s.customerPhone&&s.customerState&&s.customerZip&&s.country&&(this.defaultAddress={address:{city:s.customerCity,country:s.country,line1:s.customerAddress1,line2:s.customerAddress2||"",postal_code:s.customerZip,state:s.customerState},email:s.customerEmail||"",name:s.customerName,phone:s.customerPhone})}async init(){m.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,(({domesticRedirectedBtnSelector:o,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const e=new MutationObserver((async()=>{const t=document.querySelector(o),n=c();if(!t&&n){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(n),void e.disconnect()}const h=document.querySelector('select[name="shippingAddress.countryCode"]'),l=document.querySelector("#checkout-shipping-continue");h&&l&&(e.disconnect(),l.addEventListener("click",(async o=>{var s,e;const t=h.value;if(!t)return;if(i(t),!_(!1))return void r();const n=document.querySelector("form");if(!n)return;const c=new FormData(n),l=document.querySelector("input#addressLine1Input"),u={address1:null!==(s=c.get("shippingAddress.address1"))&&void 0!==s?s:l&&l.value,address2:c.get("shippingAddress.address2"),city:c.get("shippingAddress.city"),countryCode:c.get("shippingAddress.countryCode"),firstName:c.get("shippingAddress.firstName"),lastName:c.get("shippingAddress.lastName"),phone:c.get("shippingAddress.phone"),postalCode:c.get("shippingAddress.postalCode"),stateOrProvince:null!==(e=c.get("shippingAddress.stateOrProvince"))&&void 0!==e?e:c.get("shippingAddress.stateOrProvinceCode")};if(Object.values(u).some((o=>null==o)))return j("One or more shipping address field is missing",Object.entries(u)),void S({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(u))],metadata:{domain:window.location.hostname,storeId:C.storeId}});a({address1:u.address1,address2:u.address2,city:u.city,countryCode:u.countryCode,firstName:u.firstName,lastName:u.lastName,phone:u.phone,postalCode:u.postalCode,state:u.stateOrProvince}),o.preventDefault(),o.stopPropagation(),window.location.href="/"})))}));e.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:this.domesticRedirectedBtnSelector,onShippingAddressSessionFound:o=>{this.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}}}),window.Zonos.tempCartData&&this.useLegacyQueryParam();const o=setInterval((()=>{m.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(N("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):N("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){l.step="finish",this.storybookPaymentStatusOverride=o}async handleCustomerInfoContinue(){this.submitLoading=!0,await f();const o=setInterval((()=>{!l.landedCostData&&m.isFetchingLandedCost||(l.landedCostData&&b(),this.submitLoading=!1,clearInterval(o))}),500)}async handleShippingContinue(){this.submitLoading=!0,setTimeout((()=>{b(),this.submitLoading=!1}),500)}handleInventoryCheckDialogCancel(){this.inventoryCheckErrorMessage=null}handleInventoryCheckDialogConfirm(){this.inventoryCheckErrorMessage=null,this.closeDialogHandler({confirmed:!0})}async handleInventoryCheck(){const{onInventoryCheck:o}=C.checkoutSettings;return"function"!=typeof o?null:await o({items:l.items})}async handleCheckoutPaymentContinue(){this.paymentError=!1,this.submitLoading=!0,this.inventoryCheckErrorMessage=null;try{this.inventoryCheckErrorMessage=await this.handleInventoryCheck()}catch(o){this.inventoryCheckErrorMessage=g("Unable to check inventory. Please try again.")}if(this.inventoryCheckErrorMessage)this.submitLoading=!1;else{try{await v(),b(),this.clearCheckoutTimeoutInterval()}catch(o){j(o),this.paymentError=!0}this.submitLoading=!1}}async handleFinishClick(){if(y(),this.preview)return l.step="customer-info",void await this.init();if(d(),this.isLegacyCheckout&&window.Zonos.tempCartData){const o=window.Zonos.tempCartData.contShoppingURL;return void(window.location.href=o)}const o=window.location.href.split("?")[0],s=H();this.open=!1,s||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=L(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=L(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=x(this.appearanceSettingsOverride.theme))}handleAddressChange(){y()}componentWillLoad(){this.init(),this.isMobile=L(this.mobile),this.handleAppearanceSettingsOverrideChange(),this.onChangeLocaleListener=w("selectedLocale",(()=>{this.applyStripeTheme()})),N(`mobile: ${this.isMobile}`)}disconnectedCallback(){y(),d(),this.onChangeLocaleListener()}render(){var o;const c="finish"!==l.step&&"error"!==l.step&&!m.stripeElements||m.isFetchingSession,{colorPrimary:i,colorSecondary:r,logoUrl:a,style:h}=I(C.appearance,this.appearanceSettingsOverride),u="ENABLED"===C.appearance.zonosAttribution,d=C.appearance.theme,z=i&&D(i)?"DARK":"LIGHT",k=this.isMobile?d:z,p=this.isMobile?void 0:r,{customMessages:f}=n,b=null===(o=f.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,v=this.getCurrentLocalePageEnum(),y=f.filter((o=>o.pageName===v)),w=()=>{const o=this.preview?`${a}?timestamp=${Date.now()}`:a;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${C.organizationName} logo`,src:o,width:100}))},x=H(),O=()=>s("zonos-v-stack",null,s("div",{class:"zonos--logo-wrapper"},w(),x&&s("zonos-badge",{badgeColor:"orange",size:"small"},g("Test mode"))),s("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),y.map((o=>s("zonos-custom-message",{icon:G,message:o.message})))),S=()=>this.showSessionTimoutScreen?s("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:g("Your checkout session has expired. Please reload the page to continue."),restStateTitle:g("Session timed out"),restStateType:"Warning"},s("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},g("Reload"))):s("div",{class:"zonos--content",style:{"--border-radius":P({overrideBorderStyle:h})}},"finish"!==l.step&&"error"!==l.step&&s(t,null,s("div",{class:"zonos--left","data-theme":k,style:{"--primary-color":this.isMobile?"":i}},!this.isMobile&&O(),"customer-info"===l.step&&s("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.defaultAddress,isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:p}),"shipping"===l.step&&s("zonos-shipping",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:p}),"payment"===l.step&&s("zonos-checkout-payment",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleCheckoutPaymentContinue(),paymentError:this.paymentError,submitBtnColor:p})),s("div",{class:"zonos--right","data-theme":d},this.isMobile&&O(),!this.isLegacyCheckout&&s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:M}),noBackground:!0,onClick:()=>this.closeDialogHandler()}),s("div",{class:"flex--wrapper"},s("div",{class:"zonos--wrapper"},s("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),s("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},s("zonos-cart-items",null),this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:G,message:b})))),s("zonos-cart-restricted-items",null),!this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:G,message:b}))))),("finish"===l.step||"error"===l.step)&&s("div",{class:"zonos--done","data-theme":d},s("div",{class:"zonos--header"},w(),s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:M}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:d})),s("zonos-checkout-finish",{borderRadius:h,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===l.step&&l.error?Object.assign(Object.assign({},l.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),s("zonos-checkout-footer",{"data-theme":d,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return s(e,{class:B(["zonos--checkout zonos--elements",u&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?S():s("zonos-dialog",{borderStyle:h,"data-theme":d,height:"980px",isLoading:c,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},S()),s("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:g("Don't close"),dialogConfirmBtnText:g("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:g("Would you like to close checkout and return to the site?"),dialogTitle:g("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),s("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:g("Return to cart"),dialogIntent:"danger",dialogOpen:!!this.inventoryCheckErrorMessage,dialogSubtitle:this.inventoryCheckErrorMessage,dialogTitle:g("Couldn't place order"),dialogType:"alert",onCancelClicked:()=>{this.handleInventoryCheckDialogCancel()},onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}}};F.style=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}";export{F as zonos_checkout}
|
|
1
|
+
import{r as o,h as s,H as e,F as t}from"./p-ce347974.js";import{l as n,s as c,a as i,b as r,c as a,i as h,d as l,e as u,f as d,g as z,h as m,j as k,k as p,t as g,m as f,n as b,o as v,p as y,q as w}from"./p-878293fe.js";import{z as C,g as x,m as I}from"./p-5821856c.js";import{c as O,s as S,a as A,t as T,g as H}from"./p-53acc999.js";import{i as L}from"./p-81a54668.js";import{l as N,a as j}from"./p-eaa335e1.js";import{c as B}from"./p-b4b7f705.js";import{g as P}from"./p-31b3d26b.js";import{i as D}from"./p-9a1c0d02.js";import{R as M}from"./p-08e7107d.js";const E=({key:o,value:s})=>s?{key:o,value:s}:null,R=o=>[E({key:"brand",value:o.itemBrand}),E({key:"material",value:o.itemMaterial}),E({key:"category",value:o.itemCategory}),E({key:"color",value:o.itemColor}),E({key:"customization",value:o.itemCustomization}),E({key:"descriptionDetailed",value:o.itemDescriptionDetailed}),E({key:"fabricContent",value:o.itemFabricContent}),E({key:"ltlClass",value:o.itemLtlClass}),E({key:"pickingLocation",value:o.itemPickingLocation}),E({key:"shipFromLocation",value:o.itemShipFromLocation}),E({key:"size",value:o.itemSize}),E({key:"status",value:o.status})].filter(Boolean),$=o=>{if(!o)return"POUND";switch(o.toUpperCase()){case"KG":return"KILOGRAM";case"OZ":return"OUNCE";case"G":return"GRAM";default:return"POUND"}},U=o=>{if(!o)return[];const s=[];return o.length&&s.push({type:"LENGTH",unitOfMeasure:"INCH",value:o.length}),o.width&&s.push({type:"WIDTH",unitOfMeasure:"INCH",value:o.width}),o.weight&&s.push({type:"WEIGHT",unitOfMeasure:$(o.weightUnits),value:o.weight}),o.height&&s.push({type:"HEIGHT",unitOfMeasure:"INCH",value:o.height}),s},_=(o=!0)=>!(!n.localizationLoaded||!n.isShippableCountry&&(document.dispatchEvent(O("legacyCheckoutError","Unable to initiate checkout process in a country where shipping is not available")),o&&N("Checkout: not shippable country"),1)),G='<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',F=class{constructor(s){o(this,s),this.onChangeLocaleListener=()=>{},this.applyStripeTheme=async()=>{var o,s,e,t;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||C.appearance.theme;await h({overrideBorderRaidus:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.style,overridePrimaryColor:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.colorPrimary,overrideSecondaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorSecondary,overrideTheme:this.isMobile?n:void 0})},this.getCurrentLocalePageEnum=()=>{switch(l.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.appearanceSettingsOverride=void 0,this.preview=!1,this.mobile=!1,this.defaultAddress=null,this.forceDialogOpen=!1,this.open=this.forceDialogOpen,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.paymentError=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.zonosReviewRef=void 0,this.storybookPaymentStatusOverride=void 0,this.domesticRedirectedBtnSelector="#zonos--domestic-redirected-checkout-button",this.legacyCheckoutHiddenBtnSelector="#legacy-checkout-hidden-button",this.isLegacyCheckout=!1,this.confirmDialogOpen=!1,this.showSessionTimoutScreen=!1,this.checkoutTimeoutInterval=null,this.inventoryCheckErrorMessage=null}async initCartInfoHandler(o){u(o.detail)}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var s,e;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,A("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==l.step||d(),l.step="customer-info",z(),this.clearCheckoutTimeoutInterval(),null===(e=(s=C.checkoutSettings).onClose)||void 0===e||e.call(s)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if(window.Zonos.tempCartData){const o=(o=>{var s;return(null===(s=null==o?void 0:o.items)||void 0===s?void 0:s.map((o=>({amount:o.unitPrice||0,attributes:R(o),countryOfOrigin:o.countryOfOrigin||void 0,currencyCode:"USD",description:o.itemDescriptionLong||"",imageUrl:o.imageURL||"",itemType:"PHYSICAL_GOOD",measurements:U(o),name:o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}))))||[]})(window.Zonos.tempCartData);await u(o)}else if(C.checkoutSettings.buildCartDetail&&n.selectedCountryCode){N("build cart detail");const o=await C.checkoutSettings.buildCartDetail({countryCode:n.selectedCountryCode,currencyCode:n.targetCurrency});await u(o)}if(!m.clientSecret){const o=await k();if(N(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return await this.applyStripeTheme(),!0}clearCheckoutTimeoutInterval(){this.checkoutTimeoutInterval&&(clearTimeout(this.checkoutTimeoutInterval),this.checkoutTimeoutInterval=null)}startCheckoutTimeoutInterval(){if(this.preview)return;const o=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout"),s=o&&!isNaN(parseInt(o,10))?parseInt(o,10):54e5;N(`==START CHECKOUT TIMEOUT - ${s}==`),this.checkoutTimeoutInterval=setTimeout((()=>{this.showSessionTimoutScreen=!0}),s)}reloadCheckoutSession(){window.location.reload()}attachCheckout(){const o=C.checkoutSettings.placeOrderButtonSelector;N(`attach checkout ${o}`),o&&document.querySelectorAll(`${o}, ${this.domesticRedirectedBtnSelector}`).forEach((o=>{o.getAttribute("data-zonos-checkout-attached")||(o.addEventListener("click",(async o=>{if(_()){o.preventDefault(),o.stopPropagation(),N("zonos checkout button clicked"),m.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");this.startCheckoutTimeoutInterval(),A("zonos-checkout-start"),T("checkout_open")}catch(o){m.isFetchingSession=!1,p({messages:[g("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:g("Error creating Checkout")})}}})),C.checkoutSettings.disablePlaceOrderButtonActivation||o.removeAttribute("disabled"),o.setAttribute("data-zonos-checkout-attached","true"),o.matches(this.domesticRedirectedBtnSelector)&&(o.dispatchEvent(O("click")),r(),o.remove()),o.matches(this.legacyCheckoutHiddenBtnSelector)&&(this.isLegacyCheckout=!0,o.dispatchEvent(O("click")),o.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useLegacyQueryParam(){const o=new URLSearchParams(window.location.search),s={country:o.get("country"),customerAddress1:o.get("customerAddress1"),customerAddress2:o.get("customerAddress2"),customerCity:o.get("customerCity"),customerEmail:o.get("customerEmail"),customerName:o.get("customerName"),customerPhone:o.get("customerPhone"),customerState:o.get("customerState"),customerZip:o.get("customerZip")};s.customerAddress1&&s.customerCity&&s.customerName&&s.customerPhone&&s.customerState&&s.customerZip&&s.country&&(this.defaultAddress={address:{city:s.customerCity,country:s.country,line1:s.customerAddress1,line2:s.customerAddress2||"",postal_code:s.customerZip,state:s.customerState},email:s.customerEmail||"",name:s.customerName,phone:s.customerPhone})}async init(){m.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,(({domesticRedirectedBtnSelector:o,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const e=new MutationObserver((async()=>{const t=document.querySelector(o),n=c();if(!t&&n){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(n),void e.disconnect()}const h=document.querySelector('select[name="shippingAddress.countryCode"]'),l=document.querySelector("#checkout-shipping-continue");h&&l&&(e.disconnect(),l.addEventListener("click",(async o=>{var s,e;const t=h.value;if(!t)return;if(i(t),!_(!1))return void r();const n=document.querySelector("form");if(!n)return;const c=new FormData(n),l=document.querySelector("input#addressLine1Input"),u={address1:null!==(s=c.get("shippingAddress.address1"))&&void 0!==s?s:l&&l.value,address2:c.get("shippingAddress.address2"),city:c.get("shippingAddress.city"),countryCode:c.get("shippingAddress.countryCode"),firstName:c.get("shippingAddress.firstName"),lastName:c.get("shippingAddress.lastName"),phone:c.get("shippingAddress.phone"),postalCode:c.get("shippingAddress.postalCode"),stateOrProvince:null!==(e=c.get("shippingAddress.stateOrProvince"))&&void 0!==e?e:c.get("shippingAddress.stateOrProvinceCode")};if(Object.values(u).some((o=>null==o)))return j("One or more shipping address field is missing",Object.entries(u)),void S({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(u))],metadata:{domain:window.location.hostname,storeId:C.storeId}});a({address1:u.address1,address2:u.address2,city:u.city,countryCode:u.countryCode,firstName:u.firstName,lastName:u.lastName,phone:u.phone,postalCode:u.postalCode,state:u.stateOrProvince}),o.preventDefault(),o.stopPropagation(),window.location.href="/"})))}));e.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:this.domesticRedirectedBtnSelector,onShippingAddressSessionFound:o=>{this.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}}}),window.Zonos.tempCartData&&this.useLegacyQueryParam();const o=setInterval((()=>{m.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(N("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):N("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){l.step="finish",this.storybookPaymentStatusOverride=o}async handleCustomerInfoContinue(){this.submitLoading=!0,await f();const o=setInterval((()=>{!l.landedCostData&&m.isFetchingLandedCost||(l.landedCostData&&b(),this.submitLoading=!1,clearInterval(o))}),500)}async handleShippingContinue(){this.submitLoading=!0,setTimeout((()=>{b(),this.submitLoading=!1}),500)}handleInventoryCheckDialogCancel(){this.inventoryCheckErrorMessage=null}handleInventoryCheckDialogConfirm(){this.inventoryCheckErrorMessage=null,this.closeDialogHandler({confirmed:!0})}async handleInventoryCheck(){const{onInventoryCheck:o}=C.checkoutSettings;return"function"!=typeof o?null:await o({items:l.items})}async handleCheckoutPaymentContinue(){this.paymentError=!1,this.submitLoading=!0,this.inventoryCheckErrorMessage=null;try{this.inventoryCheckErrorMessage=await this.handleInventoryCheck()}catch(o){this.inventoryCheckErrorMessage=g("Unable to check inventory. Please try again.")}if(this.inventoryCheckErrorMessage)this.submitLoading=!1;else{try{await v(),b(),this.clearCheckoutTimeoutInterval()}catch(o){j(o),this.paymentError=!0}this.submitLoading=!1}}async handleFinishClick(){if(y(),this.preview)return l.step="customer-info",void await this.init();if(d(),this.isLegacyCheckout&&window.Zonos.tempCartData){const o=window.Zonos.tempCartData.contShoppingURL;return void(window.location.href=o)}const o=window.location.href.split("?")[0],s=H();this.open=!1,s||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=L(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=L(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=x(this.appearanceSettingsOverride.theme))}handleAddressChange(){y()}componentWillLoad(){this.init(),this.isMobile=L(this.mobile),this.handleAppearanceSettingsOverrideChange(),this.onChangeLocaleListener=w("selectedLocale",(()=>{this.applyStripeTheme()})),N(`mobile: ${this.isMobile}`)}disconnectedCallback(){y(),d(),this.onChangeLocaleListener()}render(){var o;const c="finish"!==l.step&&"error"!==l.step&&!m.stripeElements||m.isFetchingSession,{colorPrimary:i,colorSecondary:r,logoUrl:a,style:h}=I(C.appearance,this.appearanceSettingsOverride),u="ENABLED"===C.appearance.zonosAttribution,d=C.appearance.theme,z=i&&D(i)?"DARK":"LIGHT",k=this.isMobile?d:z,p=this.isMobile?void 0:r,{customMessages:f}=n,b=null===(o=f.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,v=this.getCurrentLocalePageEnum(),y=f.filter((o=>o.pageName===v)),w=()=>{const o=this.preview?`${a}?timestamp=${Date.now()}`:a;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${C.organizationName} logo`,src:o,width:100}))},x=H(),O=()=>s("zonos-v-stack",null,s("div",{class:"zonos--logo-wrapper"},w(),x&&s("zonos-badge",{badgeColor:"orange",size:"small"},g("Test mode"))),s("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),y.map((o=>s("zonos-custom-message",{icon:G,message:o.message})))),S=()=>this.showSessionTimoutScreen?s("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:g("Your checkout session has expired. Please reload the page to continue."),restStateTitle:g("Session timed out"),restStateType:"Warning"},s("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},g("Reload"))):s("div",{class:"zonos--content",style:{"--border-radius":P({overrideBorderStyle:h})}},"finish"!==l.step&&"error"!==l.step&&s(t,null,s("div",{class:"zonos--left","data-theme":k,style:{"--primary-color":this.isMobile?"":i}},!this.isMobile&&O(),"customer-info"===l.step&&s("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.defaultAddress,isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:p}),"shipping"===l.step&&s("zonos-shipping",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:p}),"payment"===l.step&&s("zonos-checkout-payment",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleCheckoutPaymentContinue(),paymentError:this.paymentError,submitBtnColor:p})),s("div",{class:"zonos--right","data-theme":d},this.isMobile&&O(),!this.isLegacyCheckout&&s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:M}),noBackground:!0,onClick:()=>this.closeDialogHandler()}),s("div",{class:"flex--wrapper"},s("div",{class:"zonos--wrapper"},s("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),s("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},s("zonos-cart-items",null),this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:G,message:b})))),s("zonos-cart-restricted-items",null),!this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:G,message:b}))))),("finish"===l.step||"error"===l.step)&&s("div",{class:"zonos--done","data-theme":d},s("div",{class:"zonos--header"},w(),s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:M}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:d})),s("zonos-checkout-finish",{borderRadius:h,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===l.step&&l.error?Object.assign(Object.assign({},l.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),s("zonos-checkout-footer",{"data-theme":d,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return s(e,{class:B(["zonos--checkout zonos--elements",u&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?S():s("zonos-dialog",{borderStyle:h,"data-theme":d,height:"980px",isLoading:c,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},S()),s("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:g("Don't close"),dialogConfirmBtnText:g("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:g("Would you like to close checkout and return to the site?"),dialogTitle:g("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),s("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:g("Return to cart"),dialogIntent:"danger",dialogOpen:!!this.inventoryCheckErrorMessage,dialogSubtitle:this.inventoryCheckErrorMessage,dialogTitle:g("Couldn't place order"),dialogType:"alert",onCancelClicked:()=>{this.handleInventoryCheckDialogCancel()},onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}}};F.style=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}";export{F as zonos_checkout}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as o,h as e,H as t,d as i}from"./p-ce347974.js";import{h as n,l as a,t as d}from"./p-2aac5bc8.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-eaa335e1.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-5821856c.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-31b3d26b.js";import{i as z}from"./p-9a1c0d02.js";const y=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:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.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 r("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 i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),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"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())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:d,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:"f5729bb12351fedbb82e0fa80a7f094faad3a526",class:"zonos--address zonos--elements"},e("zonos-text",{key:"b2c50846e6da81a598ba670b14d01861703e5c78",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"bb401f27626d88d883aaaab71bc0907a28bf35d3",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--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 g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";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"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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-1200);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 v=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,i,n;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===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=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"},d("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"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("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:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),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:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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 x=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,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=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===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).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"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.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:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]: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||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["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"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("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"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),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"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,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"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}: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 k=["blue","cyan","green","orange","purple","red","gray","glass"],w=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=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","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:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;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(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--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(--background-color);border-radius:var(--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 A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";const C=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=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"018771d0e01311ae520abcf33fbd64316794b202",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"a86c9f8465054fde894bbdd71149e59d97e8cbcf",class:"zonos--backdrop"}),e("div",{key:"b2f0c86fa0e768474ba4d522f8c2b8157f89cd56",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"26cd8a7b98d38c53dcf4789c8781f0c1ced99633",class:"zonos--dialog"},this.isLoading&&e("div",{key:"34d0ba841a9af9ca2ff6d21d0471113cc86cdec3",class:"zonos--loading"},e("zonos-spinner",{key:"0109778b1a9734de0959035e3975414fb1cac1be",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"f80a4c337727500ee1ad92c1d80d7b3088eccc0f",class:"zonos--header"},this.headerText&&e("h3",{key:"92b078fbbcd9ca5f8bf178fc67f2bee817d1e961",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"698e45fffd466f22b6179aa220d35fe39ee5374c",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:"a4012e5a48d5fbcc77cac038d8a39fe05f332008",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"d64b381cb91afde4ddbde58348a62612d9871c8e"})),e("slot",{key:"4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left: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(--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(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--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)}: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 I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.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=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"5dfff9d2fcadfebdea65359e7b2bfdb525c3b242",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"fb080d667fdfc1a3f41e9cc128d2177af8dc7195",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"b79693e8082c7c341895c81ad0787bb2bf152ca9",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--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}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
1
|
+
import{r as s,c as o,h as e,H as t,d as i}from"./p-ce347974.js";import{h as n,l as a,t as d}from"./p-878293fe.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-eaa335e1.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-5821856c.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-31b3d26b.js";import{i as z}from"./p-9a1c0d02.js";const y=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:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.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 r("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 i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),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"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())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:d,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:"f5729bb12351fedbb82e0fa80a7f094faad3a526",class:"zonos--address zonos--elements"},e("zonos-text",{key:"b2c50846e6da81a598ba670b14d01861703e5c78",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"bb401f27626d88d883aaaab71bc0907a28bf35d3",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--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 g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";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"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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-1200);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 v=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,i,n;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===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=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"},d("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"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("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:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),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:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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 x=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,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=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===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).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"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.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:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]: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||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["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"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("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"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),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"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,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"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}: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 k=["blue","cyan","green","orange","purple","red","gray","glass"],w=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=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","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:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;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(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--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(--background-color);border-radius:var(--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 A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";const C=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=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"018771d0e01311ae520abcf33fbd64316794b202",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"a86c9f8465054fde894bbdd71149e59d97e8cbcf",class:"zonos--backdrop"}),e("div",{key:"b2f0c86fa0e768474ba4d522f8c2b8157f89cd56",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"26cd8a7b98d38c53dcf4789c8781f0c1ced99633",class:"zonos--dialog"},this.isLoading&&e("div",{key:"34d0ba841a9af9ca2ff6d21d0471113cc86cdec3",class:"zonos--loading"},e("zonos-spinner",{key:"0109778b1a9734de0959035e3975414fb1cac1be",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"f80a4c337727500ee1ad92c1d80d7b3088eccc0f",class:"zonos--header"},this.headerText&&e("h3",{key:"92b078fbbcd9ca5f8bf178fc67f2bee817d1e961",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"698e45fffd466f22b6179aa220d35fe39ee5374c",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:"a4012e5a48d5fbcc77cac038d8a39fe05f332008",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"d64b381cb91afde4ddbde58348a62612d9871c8e"})),e("slot",{key:"4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left: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(--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(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--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)}: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 I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.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=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"5dfff9d2fcadfebdea65359e7b2bfdb525c3b242",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"fb080d667fdfc1a3f41e9cc128d2177af8dc7195",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"b79693e8082c7c341895c81ad0787bb2bf152ca9",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--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}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as o,H as t}from"./p-ce347974.js";import{H as s,t as a,l as n}from"./p-
|
|
1
|
+
import{r as e,h as o,H as t}from"./p-ce347974.js";import{H as s,t as a,l as n}from"./p-878293fe.js";import{d as l}from"./p-5821856c.js";import{l as i}from"./p-97aceb11.js";import"./p-eaa335e1.js";import"./p-9a1c0d02.js";import"./p-31b3d26b.js";const c=class{constructor(o){e(this,o),this.languageSelected=e=>{s(e),this.handleOnClose()},this.handleOnClose=()=>{}}render(){const{selectedLocale:e}=n;return o(t,{key:"6682af3d631bac1a8d3783418c30364ff7694792",class:"zonos--elements",style:{"--font-family":l()}},o("div",{key:"9f7e60bc5c4e9d1c0cc31afcbbaec444a7da630e",class:"zonos--language-select"},o("zonos-select-dialog-header",{key:"f790ef85eeb0bed05773d98793437ab4d6e64c8d",handleOnClose:()=>this.handleOnClose(),label:a("Select a language")}),o("div",{key:"7385a1134b21ae4b39947483ee643da021e6c54c",class:"zonos--language-select-content"},i.map((t=>o("button",{class:"zonos--language-select-button",onClick:()=>this.languageSelected(t.code)},o("zonos-text",{textColor:"gray-800"},t.translatedLabel),t.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(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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 r=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.label=""}render(){return o(t,{key:"21cd3c3e35baf172ecad7f47a76810e8f39bdeff",class:"zonos--elements",style:{"--font-family":l()}},o("zonos-v-stack",{key:"0470633326b6fca9b45a8be67e0d77819561f634",class:"zonos--select-dialog-header-wrapper",spacing:8},o("div",{key:"8713cbf368658af22bb88825d32175117d47c95b",class:"zonos--select-dialog-header"},o("zonos-text",{key:"2f94e9f6139570398897ca55934c5244df7f82e8",type:"boldLabel"},this.label),o("zonos-button",{key:"c247dabcc8f487a4cc5a814fb1aa4d9a68fa4ba3",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:"26727e634ec09a3b9e3912ada3b920a87a1ba4d0"})))}};r.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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,r as zonos_select_dialog_header}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as t,H as s,d as n}from"./p-ce347974.js";import{d as e}from"./p-5821856c.js";import{c as i}from"./p-b4b7f705.js";import{h as a}from"./p-
|
|
1
|
+
import{r as o,h as t,H as s,d as n}from"./p-ce347974.js";import{d as e}from"./p-5821856c.js";import{c as i}from"./p-b4b7f705.js";import{h as a}from"./p-878293fe.js";import{a as c}from"./p-eaa335e1.js";import"./p-9a1c0d02.js";import"./p-31b3d26b.js";const r=class{constructor(t){o(this,t),this.notificationArray=[]}async showNotification(o){const t=`id-${Math.random().toString(36).substring(2,9)}`,s=Object.assign(Object.assign({},o),{id:t,timeout:o.timeout||5e3,transitionClass:"",type:o.type||"success"});this.notificationArray=[...this.notificationArray,s],setTimeout((()=>{this.updateTransitionClass({id:t,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(t)}),s.timeout)}updateTransitionClass({id:o,transitionClass:t}){this.notificationArray=this.notificationArray.map((s=>s.id===o?Object.assign(Object.assign({},s),{transitionClass:t}):s))}removeNotification(o){this.updateTransitionClass({id:o,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((t=>t.id!==o))}),300)}render(){return t(s,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:i(["zonos--elements zonos--notification"]),style:{"--font-family":e()}},t("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((o=>t("div",{"aria-hidden":"true",class:i(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:()=>{this.removeNotification(o.id)}},t("zonos-text",{textColor:"gray-0"},o.message))))))}};r.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";const m=class{constructor(t){o(this,t),this.titleText=void 0,this.stripe=a.stripe,this.stripeElements=a.stripeElements}watchInitStripe(){if(!this.stripeElements)return;const o=a.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"}),t=this.el.querySelector(".zonos--payment-component");t?(o.mount(t),o.on("change",(o=>{a.stripePaymentEventData=o})),a.stripePaymentElement=o):c("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return t(s,{key:"c940b38c3bb7e8a7856ce28e62ee40d60eb445a1",class:"zonos--payment zonos--elements"},this.titleText&&t("zonos-text",{key:"7625e3865a13cdf4fc6c05d7a2e0c7b84ae5ebd4",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"92cde315378611a675b19cdce46b1bf6ac2221a1",class:"zonos--payment-component"}))}get el(){return n(this)}static get watchers(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};m.style=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";export{r as zonos_notification,m as zonos_payment}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,e,o){function r(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,i){function u(n){try{c(o.next(n))}catch(n){i(n)}}function a(n){try{c(o["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):r(n.value).then(u,a)}c((o=o.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(n){return function(t){return c([n,t])}}function c(a){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(e=0)),e)try{if(o=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;r=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){e.label=a[1];break}if(a[0]===6&&e.label<i[1]){e.label=i[1];i=a;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(a);break}if(i[2])e.ops.pop();e.trys.pop();continue}a=t.call(n,e)}catch(n){a=[6,n];r=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,e,o){function r(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,i){function u(n){try{c(o.next(n))}catch(n){i(n)}}function a(n){try{c(o["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):r(n.value).then(u,a)}c((o=o.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(n){return function(t){return c([n,t])}}function c(a){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(e=0)),e)try{if(o=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;r=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){e.label=a[1];break}if(a[0]===6&&e.label<i[1]){e.label=i[1];i=a;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(a);break}if(i[2])e.ops.pop();e.trys.pop();continue}a=t.call(n,e)}catch(n){a=[6,n];r=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-abe8ea12.system.js","./p-0b538ed4.system.js","./p-63db40b9.system.js"],(function(n){"use strict";var t,e,o,r,i;return{setters:[function(n){t=n.r;e=n.d;o=n.l},function(n){r=n.z},function(n){i=n.l}],execute:function(){var u=this;var a=n("t",(function(n,i){return __awaiter(u,void 0,void 0,(function(){var u,a,c,s,f,d,v,w;return __generator(this,(function(l){switch(l.label){case 0:c=window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||!!((u=window.Zonos)===null||u===void 0?void 0:u.zonosQaUrl)||!!((a=window.Zonos)===null||a===void 0?void 0:a.debug);if(c&&!window.Zonos.zonosConversionTest){return[2]}s="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/track-conversion-event");f=o.selectedCountryCode;d=r.organizationId;v=e.checkoutSessionId;if(!v){return[2]}w={checkoutSessionId:v,countryCode:f,eventName:n,metadata:i,organizationId:d};return[4,t(s,{body:w,method:"POST"})];case 1:l.sent();return[2]}}))}))}));var c=n("g",(function(){var n;return(n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test")}));var s=n("c",(function(n,t){return new CustomEvent(n,{detail:t})}));var f=n("s",(function(n){return __awaiter(u,[n],void 0,(function(n){var e,o;var r=n.endpoint,i=n.errors,u=n.metadata;return __generator(this,(function(n){e="userAgentData"in window.navigator?window.navigator.userAgentData:null;o={endpoint:r,errors:i,metadata:Object.assign({href:window.location.href,userAgent:e&&e.brands.length>0?e:window.navigator.userAgent},u)};void t("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/log-error"),{body:o,method:"POST"});return[2]}))}))}));var d=n("a",(function(n){var t=r.checkoutSettings.analyticsProviders.find((function(n){return n.type==="GOOGLE_ANALYTICS"}));if(!t||(t===null||t===void 0?void 0:t.status)==="DISABLED"){return}if(typeof window.gtag==="function"){i("Zonos submits gtag event","log",n);window.gtag("event",n,{})}}))}}}));
|