@zonos/elements 1.2.0 → 1.2.2
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-ac9a3c40.js → cart-d4b52ae8.js} +5 -15
- package/dist/cjs/{getBorderRadius-1f9c0fa3.js → getBorderRadius-fdd605c6.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{isDarkColor-0651a165.js → isDarkColor-f3446afd.js} +1 -1
- package/dist/cjs/{localization-3a4b4a43.js → localization-d7fe7290.js} +41 -14
- package/dist/cjs/{submitGtag-9e873a0a.js → submitGtag-d65003f9.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +10 -5
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +20 -20
- package/dist/cjs/zonos-checkout.cjs.entry.js +17 -10
- package/dist/cjs/zonos-controller.cjs.entry.js +15 -6
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +16 -8
- package/dist/cjs/zonos-hello.cjs.entry.js +17 -3
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/{zonosStore-270f79cc.js → zonosStore-a430ec5b.js} +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +6 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +10 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +6 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +7 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -5
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +5 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +15 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +15 -7
- package/dist/collection/components/main/zonos-controller.js +10 -1
- package/dist/collection/components/store/hello/localization.js +31 -9
- package/dist/collection/components/store/zonosStore.js +2 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +5 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +9 -4
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -11
- package/dist/collection/types/generated/graphql.customer.types.js +4 -1
- package/dist/components/cart.js +1 -11
- package/dist/components/localization.js +40 -13
- package/dist/components/zonos-address2.js +5 -0
- package/dist/components/zonos-cart-subtotal2.js +4 -3
- package/dist/components/zonos-checkout-payment2.js +3 -3
- package/dist/components/zonos-checkout.js +11 -4
- package/dist/components/zonos-controller.js +10 -1
- package/dist/components/zonos-customer-info2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +15 -7
- package/dist/components/zonos-hello.js +16 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +5 -6
- package/dist/components/zonosStore.js +2 -0
- package/dist/esm/{cart-cf46a264.js → cart-e1b93711.js} +5 -15
- package/dist/esm/{getBorderRadius-278281bf.js → getBorderRadius-45764ad7.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/{isDarkColor-8fd3a24e.js → isDarkColor-6fbb9b14.js} +1 -1
- package/dist/esm/{localization-add1d9e9.js → localization-f3828793.js} +41 -14
- package/dist/esm/{submitGtag-aa5fe441.js → submitGtag-a901ece5.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +10 -5
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-cart-items_10.entry.js +20 -20
- package/dist/esm/zonos-checkout.entry.js +17 -10
- package/dist/esm/zonos-controller.entry.js +15 -6
- package/dist/esm/zonos-country-flag_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +16 -8
- package/dist/esm/zonos-hello.entry.js +17 -3
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/{zonosStore-e5291656.js → zonosStore-05a62104.js} +2 -0
- package/dist/esm-es5/cart-e1b93711.js +1 -0
- package/dist/esm-es5/{getBorderRadius-278281bf.js → getBorderRadius-45764ad7.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-8fd3a24e.js → isDarkColor-6fbb9b14.js} +1 -1
- package/dist/esm-es5/{localization-add1d9e9.js → localization-f3828793.js} +1 -1
- package/dist/esm-es5/{submitGtag-aa5fe441.js → submitGtag-a901ece5.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e5291656.js → zonosStore-05a62104.js} +1 -1
- package/dist/scripts/loadZonos.js +3 -3
- package/dist/scripts/zonos.js +3 -3
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
- package/dist/types/components/store/checkout/cart.d.ts +1 -0
- package/dist/types/components/store/hello/localization.d.ts +2 -0
- package/dist/types/components/utils/api/getExchangeRate.d.ts +9 -3
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +2 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +37 -8
- package/dist/types/types/generated/graphql.customer.types.ts +49 -8
- package/dist/types/types/generated/graphql.frontend.types.d.ts +4 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-05256415.system.entry.js +1 -0
- package/dist/zonos-elements/{p-01990dcd.js → p-08695f4e.js} +1 -1
- package/dist/zonos-elements/p-0e0b46a5.js +1 -0
- package/dist/zonos-elements/{p-0cd4b073.system.js → p-164fae93.system.js} +1 -1
- package/dist/zonos-elements/p-25db3885.js +1 -0
- package/dist/zonos-elements/p-28681677.entry.js +1 -0
- package/dist/zonos-elements/p-34a49bce.entry.js +1 -0
- package/dist/zonos-elements/p-365970ff.entry.js +1 -0
- package/dist/zonos-elements/p-3f3fbcea.entry.js +1 -0
- package/dist/zonos-elements/p-40083e93.system.entry.js +1 -0
- package/dist/zonos-elements/{p-8fa1244b.entry.js → p-40778e43.entry.js} +1 -1
- package/dist/zonos-elements/{p-6cd7a90e.system.js → p-53649e16.system.js} +1 -1
- package/dist/zonos-elements/p-5d7ffddb.entry.js +1 -0
- package/dist/zonos-elements/p-60821b2a.entry.js +1 -0
- package/dist/zonos-elements/{p-9d06e3a3.system.js → p-6dcd752e.system.js} +1 -1
- package/dist/zonos-elements/{p-0f64d234.entry.js → p-6e7cd3f7.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee671d13.js → p-770c959e.js} +1 -1
- package/dist/zonos-elements/{p-847a1b9a.system.entry.js → p-81c699f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-18d37ad9.system.js → p-85ab35c9.system.js} +1 -1
- package/dist/zonos-elements/{p-ddc11127.system.entry.js → p-8a75b765.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1781245e.system.js → p-8aabbb9b.system.js} +1 -1
- package/dist/zonos-elements/{p-1b6d064d.system.js → p-8c867835.system.js} +1 -1
- package/dist/zonos-elements/p-8db8cc05.system.js +1 -0
- package/dist/zonos-elements/p-914ce305.system.entry.js +1 -0
- package/dist/zonos-elements/{p-466bae3a.entry.js → p-96a3c767.entry.js} +1 -1
- package/dist/zonos-elements/{p-d0ecfe92.system.entry.js → p-a3641931.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3f394b7.system.entry.js → p-aca66238.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-86825d4a.js → p-bf070bf6.js} +1 -1
- package/dist/zonos-elements/{p-083b951d.system.entry.js → p-c8ad044e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ebb4de4e.entry.js → p-cc070c1c.entry.js} +1 -1
- package/dist/zonos-elements/{p-96fbce98.system.entry.js → p-cc1c785c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-de9d8a4f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1293796f.js → p-f7875c40.js} +1 -1
- package/dist/zonos-elements/p-f8491335.system.js +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-cf46a264.js +0 -1
- package/dist/zonos-elements/p-0a33b542.system.js +0 -1
- package/dist/zonos-elements/p-1835470b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6bb67f2e.system.entry.js +0 -1
- package/dist/zonos-elements/p-82ab16e2.js +0 -1
- package/dist/zonos-elements/p-a014d540.entry.js +0 -1
- package/dist/zonos-elements/p-aed841bf.entry.js +0 -1
- package/dist/zonos-elements/p-b0a39955.js +0 -1
- package/dist/zonos-elements/p-bb35713f.entry.js +0 -1
- package/dist/zonos-elements/p-c4eb37b5.entry.js +0 -1
- package/dist/zonos-elements/p-de86c2e4.system.entry.js +0 -1
- package/dist/zonos-elements/p-e80aae7d.entry.js +0 -1
- package/dist/zonos-elements/p-eb6cc449.system.entry.js +0 -1
- package/dist/zonos-elements/p-f5392f7e.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,z as t}from"./p-01990dcd.js";import{h as n,l as o,a as r,b as s,t as i}from"./p-ee671d13.js";import{i as a}from"./p-86825d4a.js";import{g as l}from"./p-b0a39955.js";const d=()=>{const e=m.stripeLinkEventData,t=m.stripeAddressEventData;if(!t||!t.complete)throw new Error("Missing stripe address data");return{checkoutSessionId:O.checkoutSessionId||"",contact:{email:(null==e?void 0:e.value.email)||"",firstName:t.value.firstName||"",lastName:t.value.lastName||"",phone:t.value.phone||""},items:O.items.map((e=>({amount:e.amount,countryOfOrigin:e.countryOfOrigin,currencyCode:e.currencyCode,imageUrl:e.imageUrl,measurements:e.measurements,metadata:e.metadata,name:e.name,productId:e.productId,quantity:e.quantity}))),shippingAddress:{addressLine1:t.value.address.line1,addressLine2:t.value.address.line2||"",city:t.value.address.city,country:t.value.address.country,postalCode:t.value.address.postal_code,state:t.value.address.state}}},c=({borderStyle:e,theme:t})=>"DARK"===t?{borderRadius:l(e),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"}:{borderRadius:l(e)},{onChange:u,reset:p,state:m}=e((()=>({clientSecret:sessionStorage.getItem("zonos--client-secret")||null,fetchingLandedCostAbordController:null,isFetchingLandedCost:!1,isFetchingSession:!1,stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenFetchingLC:null,stripeElements:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null}))),h=async e=>{var n;const s=m.clientSecret;if(m.stripe){if(s){const i=(({clientSecret:e,overrideBorderRaidus:n,overridePrimaryColor:o,overrideTheme:s})=>{const i=o||t.appearance.colorPrimary,l=i&&a(i)?"night":"flat",d="DARK"===s?"night":"flat";return{appearance:{labels:"floating",rules:Object.assign({},{".Input":{padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"}}),theme:s?d:l,variables:Object.assign({},c({borderStyle:n,theme:"LIGHT"}))},clientSecret:e,locale:r.selectedLocale}})({clientSecret:s,overrideBorderRaidus:null==e?void 0:e.overrideBorderRaidus,overridePrimaryColor:null==e?void 0:e.overridePrimaryColor,overrideTheme:null==e?void 0:e.overrideTheme});m.stripeElements?m.stripeElements.update(i):m.stripeElements=null===(n=m.stripe)||void 0===n?void 0:n.elements(i),o("Stripe elements initialized")}}else o("Skip. Stripe is not initialized")},v=()=>{sessionStorage.removeItem("zonos--client-secret"),p(),m.stripe=window.Zonos.stripe},g=async()=>{var e,t,o,r;const i=!!(null===(e=m.stripeAddressEventData)||void 0===e?void 0:e.complete),a=!!(null===(t=m.stripeLinkEventData)||void 0===t?void 0:t.complete),l=(()=>{var e,t,n,o;if(!m.fetchingLandedCostAbordController)return!1;const r=JSON.stringify(null===(e=m.stripeLinkUsedWhenFetchingLC)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=m.stripeLinkEventData)||void 0===t?void 0:t.value),s=JSON.stringify(null===(n=m.stripeAddressUsedWhenFetchingLC)||void 0===n?void 0:n.value)!==JSON.stringify(null===(o=m.stripeAddressEventData)||void 0===o?void 0:o.value);return r||s})();if(l&&(null===(o=m.fetchingLandedCostAbordController)||void 0===o||o.abort(),m.fetchingLandedCostAbordController=null),i&&a&&(l||!m.isFetchingLandedCost)){m.isFetchingLandedCost=!0,m.stripeAddressEventData&&(m.stripeAddressUsedWhenFetchingLC=Object.assign({},m.stripeAddressEventData)),m.stripeLinkEventData&&(m.stripeLinkUsedWhenFetchingLC=Object.assign({},m.stripeLinkEventData));try{const e=new AbortController;m.fetchingLandedCostAbordController=e;const{checkoutSessionWorkflow:t,shipmentRatingCalculateWorkflow:o}=await(async e=>{const{errors:t,json:o}=await n("https://v1.route.js.zonos.com/api/calculate-landed-cost",{body:d(),method:"POST",signal:null==e?void 0:e.signal});if(t.length||!o)throw new Error("Failed to calculate landed cost");return o})(e);m.fetchingLandedCostAbordController=null,O.landedCostData=(null==t?void 0:t.filter(Boolean))||null,O.shippingData=(null==o?void 0:o.filter(Boolean))||null;const s=null===(r=O.landedCostData)||void 0===r?void 0:r.find(Boolean),i=s?s.subtotals:null;i&&A({exchangeRate:i.exchangeRate,items:i.items,landedCostTotal:0,presentmentCurrencyCode:i.presentmentCurrencyCode,shipping:0,total:i.items})}catch(e){s(e)}m.isFetchingLandedCost=!1}},y=e=>{let t=[],n=!0;switch(e){case"succeeded":t=[i("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"","",i("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")],n=!1;break;case"requires_capture":case"processing":t=[i("Payment processing. We'll update you when payment is received.")],n=!1;break;case"requires_payment_method":t=[i("Payment failed. Please try another payment method.")];break;default:t=[i("Something went wrong.")]}return{isError:n,messages:t}},f=async({clientSecret:e,storybookForceStatus:t})=>{if(t){const{isError:e,messages:n}=y(t);return{error:e,messages:n}}const n=e||m.clientSecret;if(!m.stripe||!n)return s("Failed to retrieve payment intent. Stripe is not initialized"),{error:!0,message:[i("Something went wrong.")]};const{paymentIntent:o}=await m.stripe.retrievePaymentIntent(n),r=null==o?void 0:o.status,{isError:a,messages:l}=y(r);return{error:a,messages:l}},S=async()=>{var e,t,n;const o=!!(null===(e=m.stripePaymentEventData)||void 0===e?void 0:e.complete),r=m.stripeElements,s=m.stripe;if(s&&r&&o&&m.clientSecret){const{error:e}=await s.confirmPayment({confirmParams:{receipt_email:null===(n=null===(t=m.stripeLinkEventData)||void 0===t?void 0:t.value)||void 0===n?void 0:n.email,return_url:window.location.href},elements:r,redirect:"if_required"});if(e){if("card_error"===e.type||"validation_error"===e.type)throw new Error(e.message);if("invalid_request_error"===e.type&&"payment_intent_unexpected_state"===e.code)return;throw new Error("An unexpected error occurred.")}}},w=async()=>{var e;const t=O.items.reduce(((e,t)=>e+t.amount*t.quantity),0);if(!t||!r.targetCurrency)return s("Fail to create checkout session - invalid total or currency"),!1;m.isFetchingSession=!0;const{errors:i,json:a}=await n("https://v1.route.js.zonos.com/api/create-checkout-session",{body:{currency:(null===(e=O.items.find(Boolean))||void 0===e?void 0:e.currencyCode)||"",itemsAmount:t,presentmentCountryCode:r.selectedCountryCode||null},method:"POST"});if(m.isFetchingSession=!1,i.length||!a)return s("Error occurs when creating checkout session",JSON.stringify(i,null,2)),!1;const l=a.checkoutSessionCreate;return m.clientSecret=l.clientSecret,O.checkoutSessionId=l.id,A(Object.assign(Object.assign({},l.subtotals),{landedCostTotal:0,shipping:0,total:l.subtotals.items})),o("Exchange rate updated for cart items (checkout session create)","info",O.exchangeRate),o("done-init-checkout-session"),!0};u("clientSecret",(e=>{e&&m.stripe&&sessionStorage.setItem("zonos--client-secret",e),e||sessionStorage.removeItem("zonos--client-secret")}));const C=e=>{const t=new Date,n=e.getTime()-t.getTime();return Math.floor(n/864e5)},{onChange:k,reset:b,state:O}=e((()=>({checkoutSessionId:sessionStorage.getItem("zonos--checkout-session-id")||null,currency:"USD",dutiesTaxFees:0,error:null,exchangeRate:null,isSelectedShippingAboveDeminimis:!1,isSelectedShippingGuarantee:!1,items:[],landedCostData:null,selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,step:"customer-info",subtotal:0,total:0}))),E=e=>{const t=e.minTransitAt?C(new Date(e.minTransitAt)):"",n=e.maxTransitAt?C(new Date(e.maxTransitAt)):"";return{expectedDate:e.minTransitAt?(({date:e,formatOptions:t={day:"numeric",weekday:"long",year:"numeric"}})=>new Intl.DateTimeFormat("en-US",t).format(e))({date:new Date(e.minTransitAt)}):"",maxTransit:n,minTransit:t}},T=()=>{sessionStorage.removeItem("zonos--checkout-session-id"),b()},x=({messages:e,title:t})=>{O.step="error",O.error={messages:e,title:t}},A=e=>{O.exchangeRate=e.exchangeRate,O.dutiesTaxFees=e.landedCostTotal,O.subtotal=e.items,O.total=e.total,O.currency=e.presentmentCurrencyCode},j=async({currency:e,itemsAmount:t,landedCostId:a})=>{if(a&&O.selectedLandedCost&&(A(O.selectedLandedCost.subtotals),o("Exchange rate updated for cart items (landed cost subtotal)","info",O.exchangeRate)),!O.checkoutSessionId)return s("Could update cart total without checkout session id"),!1;const{json:l}=await(async({currency:e,id:t,itemsAmount:o,landedCostId:r,presentmentCountryCode:i})=>{const{errors:a,json:l}=await n("https://v1.route.js.zonos.com/api/update-checkout-session",{body:{currency:e,id:t,itemsAmount:o,landedCostId:r,presentmentCountryCode:i},method:"POST"});return a.length||!l?(s("Error occurs when updating checkout session",JSON.stringify(a,null,2)),{errors:a,json:l}):{errors:[],json:l}})({currency:e,id:O.checkoutSessionId,itemsAmount:t,landedCostId:a,presentmentCountryCode:r.selectedCountryCode});return l?(a||(A(l.checkoutSessionUpdate.subtotals),o("Exchange rate updated for cart items (checkout session update)","info",O.exchangeRate)),!0):(s("Error occurs when updating checkout session"),x({messages:[i("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists")],title:i("Error updating Checkout")}),!1)},D=async e=>{var t,n,o,r,s;O.selectedShippingOption=e;const{expectedDate:i,maxTransit:a,minTransit:l}=E(O.selectedShippingOption);O.selectedShippingOptionExpectedDate=i,O.selectedShippingOptionTransitTime=l&&a?`${l}-${a}`:`${l||a}`;const d=null===(t=O.landedCostData)||void 0===t?void 0:t.find((e=>{var t,n,o;return(null===(n=null===(t=e.landedCost)||void 0===t?void 0:t.shipmentRating)||void 0===n?void 0:n.id)===(null===(o=O.selectedShippingOption)||void 0===o?void 0:o.id)}));if(O.selectedLandedCost=d||null,!d)return!1;O.shipping=d.subtotals.shipping;const c="ZONOS"===(null===(n=null==d?void 0:d.landedCost)||void 0===n?void 0:n.landedCostGuaranteeCode),u=!!(null===(r=null===(o=null==d?void 0:d.landedCost)||void 0===o?void 0:o.deMinimis)||void 0===r?void 0:r.find((e=>["DUTY","TAX"].includes(e.type)&&"ABOVE"===e.threshold)));return O.isSelectedShippingAboveDeminimis=u,O.isSelectedShippingGuarantee=c,await j({landedCostId:null===(s=d.landedCost)||void 0===s?void 0:s.id})};k("checkoutSessionId",(()=>{O.checkoutSessionId?sessionStorage.setItem("zonos--checkout-session-id",O.checkoutSessionId):sessionStorage.removeItem("zonos--checkout-session-id")}));const z=async e=>{var t;O.items=e;const n=null===(t=e.find(Boolean))||void 0===t?void 0:t.currencyCode,o=e.reduce(((e,t)=>e+t.amount*t.quantity),0);n&&o&&(O.currency=n,m.isFetchingSession=!0,await j({currency:n,itemsAmount:o}),m.isFetchingSession=!1)},I=()=>{"customer-info"===O.step?O.step="shipping":"shipping"===O.step?O.step="payment":"payment"===O.step&&(O.step="finish")},P=()=>{"payment"===O.step?O.step="shipping":"shipping"===O.step&&(O.step="customer-info",O.selectedShippingOption=null,O.isSelectedShippingAboveDeminimis=!1,O.isSelectedShippingGuarantee=!1,O.selectedShippingOptionExpectedDate="",O.selectedShippingOptionTransitTime="",O.shipping=0)};export{A as a,E as b,O as c,I as d,P as e,j as f,T as g,z as h,D as i,x as j,h as k,w as l,g as m,S as n,v as o,f as p,m as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as s,H as n}from"./p-dc8d7000.js";import{s as i}from"./p-82ab16e2.js";import{h as e,b as r,i as a,l as c,c as l,d as h}from"./p-ee671d13.js";import{z as d,d as u}from"./p-01990dcd.js";import"./p-86825d4a.js";import"./p-b0a39955.js";const m=class{constructor(s){o(this,s),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){o?(i.stripe=o,(async o=>{o.placeOrderButtonSelector&&(a(o.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():r(`Selector checkoutButtonAnchor "${o.placeOrderButtonSelector}" is not a valid selector`))})(d.checkoutSettings),c("init checkout element")):c("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async componentWillLoad(){d.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:s,json:n}=await(async()=>{const{errors:o,json:t}=await e("https://v1.route.js.zonos.com/api/zonos-setting");return o.length?(r("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting"),{errors:o,json:null}):{errors:[],json:t}})();if("403"===(null===(o=s[0])||void 0===o?void 0:o.type.toString()))return void c("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification(),u({overrideSettings:this.config,zonosSettings:n}),d.helloSettings&&(async o=>{const{anchorElementSelector:t}=o;if(!t||!a(t))return void r(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`);const s=document.querySelector(t);c("Hello init complete"),(o=>{if(!document.querySelector("zonos-hello")&&o){const t=document.createElement("zonos-hello");o.appendChild(t)}})(s)})(d.helloSettings),await l();const i=(null===(t=null==n?void 0:n.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;i&&this.stripeInitEvent?(this.stripeInitEvent.emit({publishableKey:i.token}),c("zonos controller loaded")):c("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):c("Failed to show notification - zonos-notification not found","warn")}async overrideConfig(o){u({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){h(o)}render(){return s(n,{class:"zonos--elements"})}};m.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{m as zonos_controller}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as e,H as t}from"./p-dc8d7000.js";import{_ as s,i,e as n,f as r,z as a,m as l}from"./p-01990dcd.js";import{h,b as d,a as m,i as c,t as p,s as f,e as g,f as u,g as w,j as z,l as b}from"./p-ee671d13.js";import{c as v}from"./p-b4b7f705.js";import{g as x}from"./p-b6c499d4.js";var y=function(){return s.Date.now()},k=/\s/,T=/^\s+/,E=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&k.test(o.charAt(e)););return e}(o)+1).replace(T,""):o},C=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,j=/^0o[0-7]+$/i,D=parseInt,R=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||i(o)&&"[object Symbol]"==n(o)}(o))return NaN;if(r(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=r(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=E(o);var t=L.test(o);return t||j.test(o)?D(o.slice(2),t?2:8):C.test(o)?NaN:+o},X=Math.max,S=Math.min,O=function(o,e,t){var s,i,n,a,l,h,d=0,m=!1,c=!1,p=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,d=e,a=o.apply(n,t)}function g(o){var t=o-h;return void 0===h||t>=e||t<0||c&&o-d>=n}function u(){var o=y();if(g(o))return w(o);l=setTimeout(u,function(o){var t=e-(o-h);return c?S(t,n-(o-d)):t}(o))}function w(o){return l=void 0,p&&s?f(o):(s=i=void 0,a)}function z(){var o=y(),t=g(o);if(s=arguments,i=this,h=o,t){if(void 0===l)return function(o){return d=o,l=setTimeout(u,e),m?f(o):a}(h);if(c)return clearTimeout(l),l=setTimeout(u,e),f(h)}return void 0===l&&(l=setTimeout(u,e)),a}return e=R(e)||0,r(t)&&(m=!!t.leading,n=(c="maxWait"in t)?X(R(t.maxWait)||0,e):n,p="trailing"in t?!!t.trailing:p),z.cancel=function(){void 0!==l&&clearTimeout(l),d=0,s=h=i=l=void 0},z.flush=function(){return void 0===l?a:w(y())},z};const B=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=a.helloSettings;i&&s||d("Hello Could not check item restrictions - must provide title and description selectors.");const r=i&&c(i)&&document.querySelectorAll(i)||[],l=s&&c(s)&&document.querySelectorAll(s)||[];if(r.length!==l.length)return d("Hello Could not check item restrictions - Title and description selectors do not match"),[];const h="RESTRICT_AND_BLOCK"===n,m=h&&t&&c(t)&&document.querySelectorAll(t)||[];h&&m.length!==l.length&&d('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const p=[];for(let t=0;t<r.length;t++){const s=r[t],i=l[t];if(s&&i){const n={cartButtonNode:m[t]||null,description:(null===(o=i.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};p.push(n)}}return p},I=class{constructor(e){o(this,e),this.getHelloPeekMessage=()=>{if(("productDetail"===a.currentHelloPage||"productList"===a.currentHelloPage)&&this.allRestrictedItems.length){const o=p("click to learn more");return`${p("productDetail"===a.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(a.currentHelloPage){case"cart":return p("Prepay duties and taxes at checkout");case"productList":case"productDetail":return p("See duty and tax thresholds");default:return`${p("Welcome to")} ${a.organizationName}`}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==a.currentHelloPage&&"productList"!==a.currentHelloPage||"DISABLED"===a.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=m;if(!e)return d("Hello Could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const i={items:o,shipFrom:e,shipTo:t},{errors:n,json:r}=await h("https://v1.route.js.zonos.com/api/check-item-restrictions",{body:i,method:"POST"});return n.length||!r?(d(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):r.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage();const{peekMessageBehavior:o,peekMessageDelay:e}=a.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=B();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage(),this.displayCurrency()},this.handleProductCountChange=O((()=>{const{productTitleElementSelector:o}=a.helloSettings;if(o){const o=B();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{new MutationObserver(this.handleProductCountChange).observe(document.body,{childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);if((o&&o.searchParams.get("zonosCountry"))!==m.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,a.currentHelloPage=(()=>{const{href:o}=window.location,{cartUrlPattern:e,homepageUrlPattern:t,productDetailUrlPattern:s,productListUrlPattern:i}=a.helloSettings;return e&&new RegExp(e).test(o)?"cart":s&&new RegExp(s).test(o)?"productDetail":i&&new RegExp(i).test(o)?"productList":t&&new RegExp(t).test(o)?"home":""})(),!new URL(window.location.href).searchParams.get("zonosCountry"))return void f(m.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return x(this.helloRef)},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=a.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[]}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&a.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),clearInterval(o))}),100)}async displayCurrency(){m.exchangeRate?g():console.error("Could not display currency. Exchange rate and format data is not available.")}async convertAndFormat(o){u(o)}async convert(o){w(o)}async format(o){z(o)}handleResize(){O(this.render.bind(this),500)}render(){var o,s;if(null===(o=a.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>new RegExp(o).test(window.location.href))))return b("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i}=m,n=this.mobileLocationOverride||a.helloSettings.mobileLocation,r=window.innerWidth<768,h=this.animateFromLeftOverride||r&&n.includes("LEFT")||this.shouldAnimateLeftDesktop()||!1,d=n.includes("TOP"),c=l(a.appearance,this.appearanceSettingsOverride),{theme:p}=c,f=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));return e(t,{class:"zonos--hello zonos--elements","data-theme":p},i&&e("div",{class:"zonos--hello-wrapper"},e("button",{class:v(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",h&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",d&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("span",{class:"zonos--hello-message"},this.peekMessage),i&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:i}))),e("div",{class:v(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:c,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:f,setIsOpen:this.changeShowDialog}))))}};I.style=":host{font-family:Inter;display:block}: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:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;width:100%;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--amino-text-color);position:absolute;background:var(--amino-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--amino-red-100);color:var(--amino-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-16);padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";export{I as zonos_hello}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as p}from"./p-01990dcd.js";const x=x=>x?"SHARP"===x?"0px":"10px":"SHARP"===p.appearance.style?"0px":"10px";export{x as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as e,H as s}from"./p-dc8d7000.js";import{f as i,t as n,a as l}from"./p-ee671d13.js";import{z as a}from"./p-01990dcd.js";import{c as r}from"./p-b4b7f705.js";import{g as h}from"./p-b6c499d4.js";const d=class{constructor(e){o(this,e),this.closeDialog=t(this,"closeDialog",7),this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(a.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.isOpen=!1,this.setIsOpen=()=>{},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettings=void 0,this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||this.setShowCountrySelect(!1)}render(){var o;const{countryLandedCost:t,selectedCountryCode:d}=l,c=(null==t?void 0:t.dutyDeminimus)?i(t.dutyDeminimus):null,g=c?`${n("Spend")} ${c} ${n("duty free")}`:n("Duties will apply to all orders"),m=(null==t?void 0:t.vatTaxDeminimus)?i(t.vatTaxDeminimus):null,f=m?`${n("Spend")} ${m} ${n("tax free")}`:n("Taxes will apply to all orders"),u=this.animateFromLeftOverride||this.dialogRef&&h(this.dialogRef),p=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:b}=l,w=`${n("Welcome to")} ${a.organizationName}!`,z=(null===(o=b.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||n("Know about duties and taxes before you buy. Shop with confidence!"),v=this.getCurrentPageEnum(),x=b.filter((o=>o.pageName===v));return e(s,{class:"zonos--elements"},e("div",{"aria-hidden":"true",class:r(["zonos--hello-dialog",u&&"zonos--hello-dialog-animate-from-left",p&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),ref:o=>o&&(this.dialogRef=o)},e("div",{class:"zonos--hello-dialog-content"},e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),e("div",null,this.showCountrySelect?e("zonos-country-select",{closeCountrySelect:()=>this.setShowCountrySelect(!1)}):e("zonos-v-stack",{spacing:24},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:d}),e("zonos-v-stack",{class:"zonos--hello-dialog-header",spacing:4},e("zonos-text",{type:"boldSubheader"},w),e("zonos-text",{color:"gray-800"},z)),e("zonos-v-stack",{spacing:8},this.restrictedItems.map((o=>{var t;return o&&e("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(t=o.itemRestrictions)||void 0===t?void 0:t.map((o=>e("zonos-text",{color:"red-800"},null==o?void 0:o.note))))})),e("zonos-card",{spacing:"12px"},e("zonos-v-stack",{spacing:12},e("div",{class:"zonos--flex-message"},e("zonos-icon",{content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),e("zonos-text",null,g)),e("div",{class:"zonos--flex-message"},e("zonos-icon",{content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n'}),e("zonos-text",null,f)))),x.map((o=>e("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message}))))))),!this.showCountrySelect&&e("zonos-hello-dialog-footer",{appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o)})))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};d.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--amino-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--amino-radius-12);outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--amino-radius-12);border-bottom-right-radius:var(--amino-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:var(--amino-space-8);top:var(--amino-space-8);width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--amino-hover-color);border-radius:var(--amino-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:var(--amino-space-16)}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-12)}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{d as zonos_hello_dialog}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as s,F as c,H as t}from"./p-dc8d7000.js";import{k as e,c as n,h as i,g as a,s as h,l as r,j as l,m as u,d,n as z,o as m,e as k}from"./p-82ab16e2.js";import{a as p,l as g,t as f}from"./p-ee671d13.js";import{z as v,m as b}from"./p-01990dcd.js";import{s as w,i as x}from"./p-1293796f.js";import{c as y}from"./p-b4b7f705.js";import{g as C}from"./p-b0a39955.js";import{i as B}from"./p-86825d4a.js";const j='<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',L='<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',H=class{constructor(s){o(this,s),this.applyStripeTheme=async()=>{var o,s,c;const t=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||v.appearance.theme;await e({overrideBorderRaidus:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.style,overridePrimaryColor:null===(c=this.appearanceSettingsOverride)||void 0===c?void 0:c.colorPrimary,overrideTheme:this.isMobile?t:void 0})},this.isShippableCountry=(o=!0)=>!(!p.localizationLoaded||!p.isShippableCountry&&(o&&g("not shippable country"),1)),this.getCurrentLocalePageEnum=()=>{switch(n.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=!1,this.isAttachError=!1,this.isMobile=!1,this.zonosReviewRef=void 0,this.storybookPaymentStatusOverride=void 0}async initCartInfoHandler(o){i(o.detail)}async closeDialogHandler(){w("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==n.step||a(),n.step="customer-info"}async buildCartAndInit(){if(v.checkoutSettings.buildCartDetail){g("build cart detail");const o=await v.checkoutSettings.buildCartDetail();await i(o)}if(!h.clientSecret){const o=await r();if(g(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return await this.applyStripeTheme(),!0}attachCheckout(){const o=v.checkoutSettings.placeOrderButtonSelector;o&&document.querySelectorAll(o).forEach((o=>{o.getAttribute("data-zonos-checkout-attached")||(o.addEventListener("click",(async o=>{if(this.isShippableCountry()){o.preventDefault(),o.stopPropagation(),g("zonos checkout button clicked"),this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");w("zonos-checkout-start")}catch(o){l({messages:[f("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:f("Error creating Checkout")})}}})),o.setAttribute("data-zonos-checkout-attached","true"))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}async init(){h.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe;const o=setInterval((()=>{const s=window.Zonos.internationalHideSelector;if(!s)return void clearInterval(o);const c=this.isShippableCountry(!1),t=document.querySelectorAll(s);c?null==t||t.forEach((o=>{const s=o;s.setAttribute("data-zonos-checkout-original-display",s.style.display),s.style.display="none"})):null==t||t.forEach((o=>{const s=o,c=s.getAttribute("data-zonos-checkout-original-display");s.style.display=c||"initial"}))}),100),s=setInterval((()=>{h.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(g("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():(this.attachCheckout(),setInterval((()=>{this.attachCheckout()}),50))),clearInterval(s)):g("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(s)}),1e4)}async setToFinishStep(o){n.step="finish",this.storybookPaymentStatusOverride=o}async handleCustomerInfoContinue(){this.submitLoading=!0,await u();const o=setInterval((()=>{!n.landedCostData&&h.isFetchingLandedCost||(n.landedCostData&&d(),this.submitLoading=!1,clearInterval(o))}),500)}async handleShippingContinue(){this.submitLoading=!0,setTimeout((()=>{d(),this.submitLoading=!1}),500)}async handleCheckoutPaymentContinue(){this.paymentError=!1,this.submitLoading=!0;try{await z(),d()}catch(o){console.error(o),this.paymentError=!0}this.submitLoading=!1}async handleFinishClick(){if(m(),this.preview)return n.step="customer-info",void await this.init();a();const o=window.location.href.split("?")[0];window.history.replaceState({},document.title,o),this.open=!1}async handleBackClick(){"customer-info"!==n.step?k():await this.closeDialogHandler()}handleWindowResize(){this.isMobile=x(this.mobile),this.applyStripeTheme(),g(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=x(this.mobile),this.applyStripeTheme(),g(`mobile: ${this.isMobile}`)}componentWillLoad(){this.init(),this.isMobile=x(this.mobile),g(`mobile: ${this.isMobile}`)}disconnectedCallback(){m(),a()}render(){var o;const e="finish"!==n.step&&"error"!==n.step&&!h.stripeElements||h.isFetchingSession,{colorPrimary:i,colorSecondary:a,logoUrl:r,style:l}=b(v.appearance,this.appearanceSettingsOverride),u="ENABLED"===v.appearance.zonosAttribution,d=v.appearance.theme,z=i&&B(i)?"DARK":"LIGHT",m=this.isMobile?d:z,k=this.isMobile?void 0:a,{customMessages:g}=p,w=(null===(o=g.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message)||"Know about duties and taxes before you buy. Shop with confidence!",x=this.getCurrentLocalePageEnum(),H=g.filter((o=>o.pageName===x)),I=()=>s("div",{class:"zonos--logo"},r&&s("img",{alt:`${v.organizationName} logo`,src:r,width:100})),S=()=>s("zonos-v-stack",null,I(),H.map((o=>s("zonos-custom-message",{icon:j,message:o.message}))),s("div",null,s("zonos-button",{class:"zonos--back-button",icon:s("zonos-icon",{content:'<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>'}),noBackground:!0,noPaddingLeft:!0,noPaddingRight:!0,onClick:()=>this.handleBackClick(),theme:m},f("Back")))),M=()=>u&&s("div",{class:"zonos--footer","data-theme":d},s("zonos-text",{type:"hintText"},f("Powered by")),s("zonos-logo",{theme:d,width:"100px"})),T=()=>{var o;const t=this.isMobile?"primary":void 0,e=null===(o=this.zonosReviewRef)||void 0===o?void 0:o.scrollHeight;return s("div",{class:"zonos--content",style:{"--border-radius":C(l)}},"finish"!==n.step&&"error"!==n.step&&s(c,null,s("div",{class:"zonos--left","data-theme":m,style:{"--primary-color":this.isMobile?"":i}},!this.isMobile&&S(),"customer-info"===n.step&&s("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.defaultAddress,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:k,submitBtnType:t}),"shipping"===n.step&&s("zonos-shipping",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:k,submitBtnType:t}),"payment"===n.step&&s("zonos-checkout-payment",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleCheckoutPaymentContinue(),paymentError:this.paymentError,submitBtnColor:k,submitBtnType:t})),s("div",{class:"zonos--right","data-theme":d},this.isMobile&&S(),!this.isMobile&&s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{content:L}),noBackground:!0,onClick:()=>this.closeDialogHandler()}),s("div",{class:"flex--wrapper"},s("div",{class:"zonos--wrapper"},s("zonos-collapse",{collapseSize:e,collapsed:this.collapseReviewMobile},s("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.collapseReviewMobile=!this.collapseReviewMobile},ref:o=>this.zonosReviewRef=o}),s("zonos-cart-items",null))),s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:j,message:w}))),!this.isMobile&&M()),this.isMobile&&M()),("finish"===n.step||"error"===n.step)&&s("div",{class:"zonos--done","data-theme":d},s("div",{class:"zonos--header"},I(),s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{content:L}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:d})),s("zonos-checkout-finish",{borderRadius:l,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===n.step&&n.error?Object.assign(Object.assign({},n.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})))};return s(t,{class:y(["zonos--checkout zonos--elements",u&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?T():s("zonos-dialog",{borderStyle:l,"data-theme":d,height:"980px",isLoading:e,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},T()))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}}};H.style=".sc-zonos-checkout-h{font-family:Inter;display:block}.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(--amino-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(--amino-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:var(--amino-space-48) var(--amino-space-56)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--amino-gray-0));border-right:1px solid var(--amino-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--amino-gray-0);padding-bottom:var(--amino-space-80)}.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(--amino-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--amino-space-24);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}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--back-button.sc-zonos-checkout{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 var(--amino-space-8) var(--amino-space-8)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:var(--amino-space-24)}.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:var(--amino-space-32);top:var(--amino-space-32)}.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;position:absolute;bottom:var(--amino-space-32);right:var(--amino-space-56);gap:var(--amino-space-8)}.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.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:var(--amino-space-76);margin-bottom:var(--amino-space-8)}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--amino-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:var(--amino-space-32)}.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:var(--amino-space-12)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:var(--amino-space-16)}.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;gap:var(--amino-space-16);margin-top:var(--amino-space-24);border:var(--amino-border);border-radius:var(--border-radius, var(--amino-radius-10));background-color:var(--amino-gray-50);padding:var(--amino-space-12);margin-top:var(--amino-space-32)}.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}.mobile.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{bottom:0;left:0;padding:var(--amino-space-12);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-gray-0)}";export{H as zonos_checkout}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,e,o){function r(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function u(t){try{c(o["throw"](t))}catch(t){i(t)}}function c(t){t.done?e(t.value):r(t.value).then(s,u)}c((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return c([t,n])}}function c(u){if(o)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(o=1,r&&(i=u[0]&2?r["return"]:u[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;if(r=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;r=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-68d06767.system.js","./p-0a33b542.system.js","./p-0cd4b073.system.js","./p-9d06e3a3.system.js","./p-18d37ad9.system.js","./p-1b6d064d.system.js"],(function(t){"use strict";var n,e,o,r,i,s,u,c,a,l,h,f,d;return{setters:[function(t){n=t.r;e=t.c;o=t.h;r=t.H},function(t){i=t.s},function(t){s=t.h;u=t.b;c=t.i;a=t.l;l=t.c;h=t.d},function(t){f=t.z;d=t.d},function(){},function(){}],execute:function(){var v=this;var p=function(){return __awaiter(v,void 0,void 0,(function(){var t,n,e,o;return __generator(this,(function(r){switch(r.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-setting");return[4,s(t)];case 1:n=r.sent(),e=n.errors,o=n.json;if(e.length){u("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting");return[2,{errors:e,json:null}]}return[2,{errors:[],json:o}]}}))}))};var y=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var _=function(t){return __awaiter(v,void 0,void 0,(function(){return __generator(this,(function(n){if(!t.placeOrderButtonSelector){return[2]}if(!c(t.placeOrderButtonSelector)){u('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return[2]}y();return[2]}))}))};var m=function(t){var n=document.querySelector("zonos-hello");if(!n&&t){var e=document.createElement("zonos-hello");t.appendChild(e)}};var g=function(t){return __awaiter(v,void 0,void 0,(function(){var n,e;return __generator(this,(function(o){n=t.anchorElementSelector;if(!n||!c(n)){u('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}e=document.querySelector(n);a("Hello init complete");m(e);return[2]}))}))};var w=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var b=t("zonos_controller",function(){function t(t){n(this,t);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){a("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}i.stripe=t;void _(f.checkoutSettings);a("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:return[4,p()];case 1:e=s.sent(),o=e.errors,r=e.json;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){a("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();d({overrideSettings:this.config,zonosSettings:r});if(f.helloSettings){void g(f.helloSettings)}return[4,l()];case 2:s.sent();i=((n=r===null||r===void 0?void 0:r.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!i||!this.stripeInitEvent){a("Checkout failed to load -- missing publishable key","warn");return[2]}this.stripeInitEvent.emit({publishableKey:i.token});a("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){a("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){void h(t);return[2]}))}))};t.prototype.render=function(){return o(r,{class:"zonos--elements"})};return t}());b.style=w}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,a as s,h as t,H as n,F as i,c as e,d as a}from"./p-dc8d7000.js";import{c,s as r,p as h,o as l,i as d,b as p}from"./p-82ab16e2.js";import{t as m}from"./p-ee671d13.js";import{g as u}from"./p-b0a39955.js";import{s as z,i as g}from"./p-1293796f.js";import{c as f}from"./p-b4b7f705.js";import{z as b}from"./p-01990dcd.js";import"./p-86825d4a.js";const y=({amount:o,currency:s,showCurrencyText:t})=>t?`${new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(o)} ${s}`:new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(o),v=class{constructor(s){o(this,s),this.errorImages=[]}render(){var o;const i=s("./assets/empty-item.jpeg"),e=(null===(o=c.exchangeRate)||void 0===o?void 0:o.rate)||1;return t(n,{class:"zonos--cart-items zonos--elements"},t("table",{class:"zonos--cart-table"},t("tbody",null,c.items.map((o=>{const s=o.imageUrl;return t("tr",{class:"zonos--cart-item"},t("td",{class:"zonos--column zonos--cart-item-image"},s&&!this.errorImages.includes(s)?t("img",{alt:o.name,onError:()=>{this.errorImages=[...this.errorImages,s]},src:o.imageUrl,style:{"min-width":"40px"},width:40}):t("img",{alt:o.name,src:i,width:40})),t("td",{class:"zonos--column zonos--cart-item-name"},t("zonos-text",{type:"label"},o.name)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"semiBoldLabel"},y({amount:o.amount*o.quantity*e,currency:c.currency}))))})))))}static get assetsDirs(){return["assets"]}};v.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-8);font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}";const x=class{constructor(s){o(this,s)}render(){const o=c.total-c.dutiesTaxFees;return t(n,{class:"zonos--cart-subtotal zonos--elements"},t("table",{class:"zonos--cart-table"},t("tr",{class:"zonos--row zonos--cart-subtotal"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("zonos-text",{type:"semiBoldLabel"},m("Cart subtotal"))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{type:"semiBoldLabel"},y({amount:c.subtotal,currency:c.currency})))),t("tr",{class:"zonos--row zonos--cart-shipping"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},c.selectedShippingOption?t(i,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},c.selectedShippingOption.displayName),c.selectedShippingOptionTransitTime&&t("zonos-text",{class:"zonos--caption",type:"caption"},c.selectedShippingOptionTransitTime," ",m("business days"))):t(i,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Shipping")),t("zonos-text",{class:"zonos--caption",type:"caption"},m("No shipping method selected")))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},c.shipping?y({amount:c.shipping,currency:c.currency}):"-")),"payment"===c.step&&t("tr",{class:"zonos--row zonos--cart-duties"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("div",{class:"zonos--title-with-icon"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Duties, taxes, and fees")),t("zonos-icon",{content:'<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.96704 8.00065C1.96704 4.31875 4.93024 1.33398 8.58554 1.33398C12.2408 1.33398 15.204 4.31875 15.204 8.00065C15.204 11.6826 12.2408 14.6673 8.58554 14.6673C4.93024 14.6673 1.96704 11.6825 1.96704 8.00065Z" fill="#C5C6CA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.58543 4.66016C8.95096 4.66016 9.24728 4.95863 9.24728 5.32682V5.33349C9.24728 5.70168 8.95096 6.00016 8.58543 6.00016C8.2199 6.00016 7.92358 5.70168 7.92358 5.33349V5.32682C7.92358 4.95863 8.2199 4.66016 8.58543 4.66016ZM8.58543 7.33349C8.95096 7.33349 9.24728 7.63197 9.24728 8.00016V10.6668C9.24728 11.035 8.95096 11.3335 8.58543 11.3335C8.2199 11.3335 7.92358 11.035 7.92358 10.6668V8.00016C7.92358 7.63197 8.2199 7.33349 8.58543 7.33349Z" fill="#4D505A"/>\n</svg>\n',size:16})),!!c.isSelectedShippingAboveDeminimis&&t("zonos-text",{color:"gray-800",type:"body"},m("Order is over the de minimis threshold for both duty and tax"))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},c.dutiesTaxFees?y({amount:c.dutiesTaxFees,currency:c.currency}):"-",c.isSelectedShippingGuarantee&&t("zonos-badge",null,m("Guaranteed")))),t("tr",{class:"zonos--row zonos--cart-pay-total"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},m("Order total"))),t("td",{class:"zonos--column"},t("zonos-text",{type:"semiBoldLabel"},y({amount:"shipping"===c.step?o:c.total,currency:c.currency}))))))}static get assetsDirs(){return["assets"]}};x.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-subtotal-price{text-align:right}";const w=class{constructor(s){o(this,s),this.closeClick=e(this,"closeClick",7),this.checkPaymentStatus=async()=>{this.isLoading=!0;const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||r.clientSecret;if(o||this.storybookForceStatus){const{error:s,messages:t}=await h({clientSecret:o,storybookForceStatus:this.storybookForceStatus});if(this.notificationType=s?"error":"success",this.notificationMessages=t||[],this.notificationTitle=m(s?"Payment failed":"You're all set!"),s)z("zonos-checkout-payment-fail");else{z("zonos-checkout-success");const o=new CustomEvent("zonos-checkout-success",{detail:{message:"Zonos Checkout successfully processed order"}});document.dispatchEvent(o)}}l(),this.isLoading=!1},this.closeClickHandler=()=>{this.closeClick.emit()},this.borderRadius="ROUNDED",this.storybookForceStatus=void 0,this.overrideNotification=void 0,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[]}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);this.checkPaymentStatus()}render(){return t(n,{class:"zonos--checkout-finish zonos--elements",style:{"--border-radius":u(this.borderRadius)}},this.isLoading&&t("div",{class:"loading-wrapper"},t("zonos-spinner",null)),!this.isLoading&&t("div",{class:"zonos--group"},t("zonos-icon","success"===this.notificationType?{color:"blue-800",content:'<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>',size:50}:{color:"red-800",content:'<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',size:50}),t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),t("zonos-text",null,this.notificationMessages.map((o=>t(i,null,o,t("br",null))))),t("zonos-button",{onClick:()=>this.closeClickHandler(),size:"md",variant:"primary"},m("Keep shopping"))))}static get assetsDirs(){return["assets"]}};w.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--amino-space-24);border-radius:var(--border-radius, 10px);gap:var(--amino-space-24);max-width:360px;width:auto;margin:auto;margin-top:var(--amino-space-24);background-color:var(--amino-gray-50);padding:var(--amino-space-20)}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}";const k=class{constructor(s){o(this,s),this.continueClicked=e(this,"continueClicked",7),this.continueClickHandler=()=>{this.continueClicked.emit()},this.paymentError=!1,this.submitBtnType=void 0,this.continueLoading=!1,this.submitBtnColor=void 0,this.disabled=!0}watchFormComplete(){this.disabled||z("zonos-checkout-payment-info")}render(){var o;return r.stripeElements?(this.disabled=!(null===(o=r.stripePaymentEventData)||void 0===o?void 0:o.complete),t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Payment method")),this.paymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},m("We couldn't complete your payment. Please verify the payment details and try again.")),t("zonos-payment",null)),t("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},"Pay"," ",y({amount:c.total,currency:c.currency})))):null}static get watchers(){return{disabled:["watchFormComplete"]}}};k.style=".sc-zonos-checkout-payment-h{font-family:Inter;display:block}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:0 5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h zonos-button.sc-zonos-checkout-payment{width:100%}";const C=class{constructor(s){o(this,s),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var o,s,t;null===(t=null===(s=null===(o=this.el.shadowRoot)||void 0===o?void 0:o.querySelector("iframe"))||void 0===s?void 0:s.contentWindow)||void 0===t||t.addEventListener("resize",(()=>{this.height=this.el.scrollHeight}))}render(){return this.height=this.el.scrollHeight,t(n,{class:"zonos--elements zonos--collapse",style:{height:this.getElementHeight()}},t("div",null,t("iframe",{class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),t("slot",null)))}get el(){return a(this)}};C.style=":host{font-family:Inter;display:block}: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 L=class{constructor(s){o(this,s),this.continueClicked=e(this,"continueClicked",7),this.continueClickHandler=()=>{this.continueClicked.emit()},this.continueLoading=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.defaultAddress=null,this.disabled=!0}watchFormComplete(){this.disabled||z("zonos-checkout-customer-info")}render(){var o,s;return r.stripeElements?(this.disabled=!(null===(o=r.stripeAddressEventData)||void 0===o?void 0:o.complete)||!(null===(s=r.stripeLinkEventData)||void 0===s?void 0:s.complete),t(n,{class:"zonos--customer-info zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Customer information")),t("zonos-link-authentication",{titleText:m("Contact")}),t("zonos-address",{defaultAddress:this.defaultAddress,titleText:m("Address"),type:"shipping"})),t("zonos-button",{backgroundColor:this.submitBtnColor,isDisabled:this.disabled,loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},m("Continue to shipping")))):null}static get watchers(){return{disabled:["watchFormComplete"]}}};L.style=".sc-zonos-customer-info-h{font-family:Inter;display:block}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{width:100%}";const B=class{constructor(s){o(this,s),this.closeDialog=e(this,"closeDialog",7),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.closeDialog.emit()},this.clickOutsideDialogHandler=o=>{o.target!==o.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.footerRightAction=null,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const o=u(this.borderStyle);return t(n,{class:f(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":o,"--height":this.height||"initial","--width":this.width}},t("div",{class:"zonos--backdrop"}),t("div",{"aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},t("div",{class:"zonos--dialog"},this.isLoading&&t("div",{class:"zonos--loading"},t("zonos-spinner",{size:30})),(this.headerText||!this.noCloseButton)&&t("div",{class:"zonos--header"},this.headerText&&t("h3",{class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{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})),t("div",{class:f(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",null)),this.footerRightAction&&t("div",{class:"zonos--footer"},t("div",{class:"zonos--footer-right-action"},this.footerRightAction)))))}static get assetsDirs(){return["assets"]}};B.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:1002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:1001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";const D=class{constructor(s){o(this,s),this.theme="LIGHT",this.width="auto",this.class=""}render(){const o="DARK"===this.theme?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return t(n,{class:f(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--width":this.width}},t("img",{alt:"Zonos Logo",src:s("./assets/ZonosLogo.png")}))}static get assetsDirs(){return["assets"]}};D.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";const j=class{constructor(s){o(this,s),this.mobile=!1,this.collapsed=!1,this.isMobile=!1}handleWindowResize(){this.isMobile=g(this.mobile)}componentWillLoad(){this.isMobile=g(this.mobile)}render(){const o=this.isMobile?"boldSubheader":"semiBoldLabel",s=this.isMobile?"boldSubheader":"secondaryPageHeader",i=this.isMobile?"gray-1200":"gray-800",e=c.total-c.dutiesTaxFees;return t(n,{class:f(["zonos--review zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--title"},t("zonos-text",{color:i,type:o},m("Pay")," ",b.organizationName),(()=>this.isMobile?t("zonos-icon",this.collapsed?{color:"gray-1200",content:'<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>'}:{color:"gray-1200",content:'<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>'}):null)()),t("div",{class:"zonos--total-pay"},t("zonos-text",{type:s},y({amount:"shipping"===c.step?e:c.total,currency:c.currency}))))}static get assetsDirs(){return["assets"]}};j.style=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--total-pay{margin:var(--amino-space-16) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8)}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";const S=class{constructor(s){o(this,s),this.continueClicked=e(this,"continueClicked",7),this.handleRadioSelected=async o=>{var s;if(this.selectedShippingMethod=o.detail,!this.selectedShippingMethod)return;const t=(null===(s=c.shippingData)||void 0===s?void 0:s.find((o=>{var s;return o.id===(null===(s=this.selectedShippingMethod)||void 0===s?void 0:s.value)})))||null;t&&await d(t)&&(this.disabled=!1)},this.continueClickHandler=()=>{this.continueClicked.emit()},this.continueLoading=!1,this.submitBtnColor=void 0,this.submitBtnType=void 0,this.selectedShippingMethod=null,this.disabled=!0}watchFormComplete(){this.disabled||z("zonos-checkout-shipping-info")}render(){var o,s;const i=null===(o=r.stripeAddressEventData)||void 0===o?void 0:o.value.address.country,e=null===(s=c.shippingData)||void 0===s?void 0:s.flatMap((o=>{var s,t;const{expectedDate:n,maxTransit:i,minTransit:e}=p(o),a=n?`${m("Expected delivery")} ${n}`:"",r=e&&i?`(${e}-${i} ${m("business days")})`:"",h=(null===(t=null===(s=c.landedCostData)||void 0===s?void 0:s.find((s=>{var t;return(null===(t=s.landedCost)||void 0===t?void 0:t.shipmentRating.id)===o.id})))||void 0===t?void 0:t.subtotals.shipping)||0;return{caption:r,label:o.displayName,price:y({amount:h,currency:c.currency}),sublabel:a,value:o.id}}));return t(n,{class:"zonos--shipping zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},m("Shipping information")),t("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},m("Shipping method")),(null==e?void 0:e.length)?t("zonos-shipping-rich-radio",{items:e||[],onRadioSelected:o=>this.handleRadioSelected(o)}):t("zonos-banner",{bannerTitle:"No shipping methods found - try editing your address or contacting support if the error persists",intent:"error"}),c.isSelectedShippingAboveDeminimis&&t("zonos-banner",{intent:"warning"},m("Above de minimis threshold for")," ",i,"."," ",m("Duties and taxes will be applied to items and shipping."))),t("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},m("Go to payment")))}static get watchers(){return{disabled:["watchFormComplete"]}}};S.style=".sc-zonos-shipping-h{font-family:Inter;display:block}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding-right:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";export{v as zonos_cart_items,x as zonos_cart_subtotal,w as zonos_checkout_finish,k as zonos_checkout_payment,C as zonos_collapse,L as zonos_customer_info,B as zonos_dialog,D as zonos_logo,j as zonos_review,S as zonos_shipping}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-68d06767.system.js","./p-9d06e3a3.system.js","./p-23e7c655.system.js","./p-1b6d064d.system.js","./p-64fdb7b6.system.js"],(function(e){"use strict";var i,o,s,t,r,a,n,l;return{setters:[function(e){i=e.r;o=e.c;s=e.h;t=e.H},function(e){r=e.z},function(e){a=e.c},function(e){n=e.g},function(e){l=e.i}],execute:function(){var d=":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-left-radius:var(--border-radius, var(--amino-radius-10));border-bottom-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item.selected{border-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";var c=e("zonos_shipping_rich_radio",function(){function e(e){var s=this;i(this,e);this.radioSelected=o(this,"radioSelected",7);this.handleRichRadioSelect=function(e){var i;s.selectedItem=e;(i=s.radioSelected)===null||i===void 0?void 0:i.emit(e)};this.getRadioItemStyleVariables=function(){var e=s.borderColor||r.appearance.colorSecondary;var i=l(e)?"var(--amino-".concat(e,")"):e;return{"--border-radius":n(s.borderStyle),"--selected-border-color":i||"unset"}};this.items=undefined;this.borderColor=undefined;this.borderStyle=undefined;this.theme=undefined;this.selectedItem=null}e.prototype.render=function(){var e=this;var i;return s(t,{class:"zonos--shipping-rich-radio zonos--elements","data-theme":this.theme,style:this.getRadioItemStyleVariables()},(i=this.items)===null||i===void 0?void 0:i.map((function(i){var o;var t=((o=e.selectedItem)===null||o===void 0?void 0:o.value)===i.value;return s("div",{"aria-hidden":"true",class:a(["zonos--shipping-rich-radio-item",t&&"selected"]),onClick:function(){return e.handleRichRadioSelect(i)}},s("input",{checked:t,class:"zonos--shipping-rich-radio-input",name:"zonos--shipping-rich-radio",type:"radio",value:i.value}),s("div",{class:"zonos--shipping-info"},s("div",{class:"zonos--shipping-detail"},s("zonos-text",{class:"zonos--shipping-label",type:"label"},i.label),(i.sublabel||i.caption)&&s("div",{class:"zonos--sub-detail"},i.sublabel&&s("zonos-text",{color:"gray-800"},i.sublabel),i.caption&&s("zonos-text",{color:"gray-400"},i.caption))),s("zonos-text",{type:"semiBoldLabel"},i.price)))})))};return e}());c.style=d}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as o,H as n,d as t}from"./p-dc8d7000.js";import{s as i,m as a}from"./p-82ab16e2.js";import{b as e,a as c}from"./p-ee671d13.js";import"./p-01990dcd.js";import"./p-86825d4a.js";import"./p-b0a39955.js";const d=class{constructor(o){s(this,o),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe}async watchInitStripe(){var s,o;if(this.stripe=window.Zonos.stripe,!this.stripe||!i.stripeElements)return void e("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const n=c.shippingZoneCountries,t=i.stripeAddressElement||i.stripeElements.create("address",{allowedCountries:n?Object.values(n).map((s=>s.code)):[],contacts:this.defaultAddress?[this.defaultAddress]:void 0,display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});t.mount(this.el.querySelector(".zonos--address-component")),t.on("change",(s=>{const o=s.value;i.stripeAddressEventData=Object.assign(Object.assign({},s),{elementMode:"shipping",elementType:"address",empty:!1,value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ").pop()})}),a()})),i.stripeAddressElement=t}componentDidLoad(){this.watchInitStripe()}render(){return o(n,{class:"zonos--address zonos--elements"},o("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{class:"zonos--address-component"}))}get el(){return t(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};d.style=".sc-zonos-address-h{font-family:Inter;display:block}.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:var(--amino-space-16)}";const h=class{constructor(o){s(this,o),this.titleText=void 0,this.stripe=i.stripe}watchInitStripe(){if(!this.stripe||!i.stripeElements)return;const s=i.stripeLinkElement||i.stripeElements.create("linkAuthentication"),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{i.stripeLinkEventData=s,a()})),i.stripeLinkElement=s):console.error("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return o(n,{class:"zonos--link-authentication zonos--elements"},o("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{class:"zonos--link-authentication-component"}))}get el(){return t(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};h.style=".sc-zonos-link-authentication-h{font-family:Inter;display:block}.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:var(--amino-space-16)}";export{d as zonos_address,h as zonos_link_authentication}
|