@zonos/elements 1.3.121 → 1.3.123

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.
Files changed (104) hide show
  1. package/dist/cjs/{CheckoutConfig-222be92b.js → CheckoutConfig-00c7333a.js} +1 -1
  2. package/dist/cjs/{cart-b2ba04a6.js → cart-d2676914.js} +38 -16
  3. package/dist/cjs/{handleFetch-bd39d5cc.js → handleFetch-83c97d08.js} +1 -1
  4. package/dist/cjs/index.cjs.js +9 -9
  5. package/dist/cjs/{paypal-1209340d.js → paypal-617669c3.js} +2 -2
  6. package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
  7. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-checkout.cjs.entry.js +5 -4
  9. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  10. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
  16. package/dist/collection/__tests__/build-utils/urlCheckOne.js +7 -15
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -1
  18. package/dist/collection/components/store/checkout/stripe.js +37 -15
  19. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  20. package/dist/collection/types/generated/graphql.internal.types.js +37 -4
  21. package/dist/collection/utils/formattedUrl.js +2 -1
  22. package/dist/esm/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
  23. package/dist/esm/{cart-c2a7dbf4.js → cart-5346e4d9.js} +38 -17
  24. package/dist/esm/{handleFetch-752697c2.js → handleFetch-7424d200.js} +1 -1
  25. package/dist/esm/index.js +10 -10
  26. package/dist/esm/{paypal-47ce80b4.js → paypal-db99e15a.js} +2 -2
  27. package/dist/esm/zonos-address_7.entry.js +2 -2
  28. package/dist/esm/zonos-cart-items_13.entry.js +3 -3
  29. package/dist/esm/zonos-checkout.entry.js +5 -4
  30. package/dist/esm/zonos-controller.entry.js +2 -2
  31. package/dist/esm/zonos-country-flag.entry.js +2 -2
  32. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  33. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  34. package/dist/esm/zonos-hello.entry.js +2 -2
  35. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  36. package/dist/esm/zonos-notification_3.entry.js +3 -3
  37. package/dist/esm-es5/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
  38. package/dist/esm-es5/cart-5346e4d9.js +1 -0
  39. package/dist/esm-es5/handleFetch-7424d200.js +1 -0
  40. package/dist/esm-es5/index.js +1 -1
  41. package/dist/esm-es5/{paypal-47ce80b4.js → paypal-db99e15a.js} +1 -1
  42. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  43. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  44. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  45. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  46. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  47. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  48. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  49. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  50. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  51. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  52. package/dist/scripts/index.d.ts +2 -1
  53. package/dist/scripts/index.js +1 -1
  54. package/dist/scripts/loadZonos.js +1 -1
  55. package/dist/scripts/zonos.js +1 -1
  56. package/dist/types/__tests__/build-utils/urlCheckOne.d.ts +1 -3
  57. package/dist/types/components/store/checkout/cart.d.ts +1 -0
  58. package/dist/types/components/store/checkout/stripe.d.ts +2 -1
  59. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +1 -1
  60. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
  61. package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
  62. package/dist/types/types/generated/graphql.internal.types.d.ts +47 -7
  63. package/dist/types/types/generated/graphql.internal.types.ts +60 -8
  64. package/dist/zonos-elements/index.esm.js +1 -1
  65. package/dist/zonos-elements/{p-02495901.entry.js → p-06636f62.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-76251f26.system.entry.js → p-20411dc5.system.entry.js} +1 -1
  67. package/dist/zonos-elements/p-3a3dd0a7.entry.js +1 -0
  68. package/dist/zonos-elements/p-3ef38f02.system.js +1 -0
  69. package/dist/zonos-elements/{p-2251fc7e.entry.js → p-4f5da154.entry.js} +1 -1
  70. package/dist/zonos-elements/{p-d4ae2bd4.system.js → p-5fe1e3f6.system.js} +2 -2
  71. package/dist/zonos-elements/{p-34fb869f.js → p-62384488.js} +1 -1
  72. package/dist/zonos-elements/{p-9af218f8.entry.js → p-6efffc06.entry.js} +1 -1
  73. package/dist/zonos-elements/p-81055154.system.js +1 -0
  74. package/dist/zonos-elements/p-8231711f.js +1 -0
  75. package/dist/zonos-elements/{p-0af2a53c.entry.js → p-860716a1.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-b8e00fdf.system.js → p-8c7715aa.system.js} +1 -1
  77. package/dist/zonos-elements/{p-c0fc4490.js → p-8e317f73.js} +1 -1
  78. package/dist/zonos-elements/{p-f4b06db0.system.entry.js → p-8f7935f6.system.entry.js} +1 -1
  79. package/dist/zonos-elements/{p-b1b7ac58.system.entry.js → p-97334e5a.system.entry.js} +1 -1
  80. package/dist/zonos-elements/{p-d8e4b363.entry.js → p-9afea72c.entry.js} +1 -1
  81. package/dist/zonos-elements/{p-8a64b0c4.system.entry.js → p-9ea5037d.system.entry.js} +1 -1
  82. package/dist/zonos-elements/{p-3a70faa7.system.entry.js → p-b00508d3.system.entry.js} +1 -1
  83. package/dist/zonos-elements/{p-81dbd74c.entry.js → p-b3b1c105.entry.js} +1 -1
  84. package/dist/zonos-elements/p-b98e54b2.system.entry.js +1 -0
  85. package/dist/zonos-elements/{p-9b5f28ba.system.js → p-bc2efe24.system.js} +1 -1
  86. package/dist/zonos-elements/{p-b1373482.system.entry.js → p-c504e50e.system.entry.js} +1 -1
  87. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  88. package/dist/zonos-elements/{p-addf0048.entry.js → p-c97b9a45.entry.js} +1 -1
  89. package/dist/zonos-elements/{p-9143b174.entry.js → p-ccfd1d50.entry.js} +1 -1
  90. package/dist/zonos-elements/{p-3f464965.entry.js → p-cfaac5aa.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-14b0dc71.system.entry.js → p-d1f1f84d.system.entry.js} +1 -1
  92. package/dist/zonos-elements/{p-d5bd3c3a.system.entry.js → p-d5cf05b7.system.entry.js} +1 -1
  93. package/dist/zonos-elements/{p-63e67e78.system.entry.js → p-eb94b8c5.system.entry.js} +1 -1
  94. package/dist/zonos-elements/p-f3cdaa23.js +1 -0
  95. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  96. package/package.json +1 -1
  97. package/dist/esm-es5/cart-c2a7dbf4.js +0 -1
  98. package/dist/esm-es5/handleFetch-752697c2.js +0 -1
  99. package/dist/zonos-elements/p-1cdec61a.system.js +0 -1
  100. package/dist/zonos-elements/p-6cbcdee3.system.js +0 -1
  101. package/dist/zonos-elements/p-7780ded7.entry.js +0 -1
  102. package/dist/zonos-elements/p-a70da456.system.entry.js +0 -1
  103. package/dist/zonos-elements/p-d4110fa4.js +0 -1
  104. package/dist/zonos-elements/p-ee89e172.js +0 -1
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.121.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.121.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.121",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1730844268093",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.121",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.121";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.121";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
1
+ (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.123.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.123.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.123",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1730930907003",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.123",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.123";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.123";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
@@ -1,6 +1,4 @@
1
- export declare const urlCheckOne: ({ branch, filePath, packageVersion, }: {
2
- /** Branch that the build is compiled for */
3
- branch: string;
1
+ export declare const urlCheckOne: ({ filePath, packageVersion, }: {
4
2
  filePath: string;
5
3
  packageVersion: string;
6
4
  }) => Promise<boolean>;
@@ -150,6 +150,7 @@ declare const cartStoreCheckItemRestrictions: (itemsWorkflow: ItemWorkflowInfo[]
150
150
  id: string;
151
151
  imageUrl: string | null;
152
152
  name: string | null;
153
+ productId: string;
153
154
  quantity: number;
154
155
  sku: string | null;
155
156
  matchedItem: CartItemToUse | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { PaymentIntent, Stripe, StripeAddressElement, StripeAddressElementChangeEvent, StripeElements, StripeElementsOptions, StripeLinkAuthenticationElement, StripeLinkAuthenticationElementChangeEvent, StripePaymentElement, StripePaymentElementChangeEvent } from '@stripe/stripe-js';
2
2
  import type { containsNonLatinChars } from "../../utils/containsNonLatinChars";
3
- import type { CheckoutSessionUpdateRequest } from "../../../types/checkout/api/CheckoutSession";
3
+ import type { CheckoutSessionCreateRequest, CheckoutSessionUpdateRequest } from "../../../types/checkout/api/CheckoutSession";
4
4
  import type { TranslatedAddressObject } from "../../../types/checkout/TranslatedText";
5
5
  import type { CheckoutSessionUpdateMutation, ElementsUiStyle, ElementsUiTheme } from "../../../types/generated/graphql.internal.types";
6
6
  export type StripeStoreContactOption = {
@@ -125,6 +125,7 @@ declare const stripeStoreRetrievePayment: ({ clientSecret: _clientSecret, storyb
125
125
  message?: undefined;
126
126
  }>;
127
127
  declare const stripeStoreConfirmPayment: () => Promise<void>;
128
+ export declare const getCheckoutSessionBody: () => CheckoutSessionCreateRequest;
128
129
  /**
129
130
  * Init checkout session
130
131
  * @returns {boolean} whether or not the checkout session is successfully created
@@ -26,7 +26,7 @@ export type NormalizedTempCart = {
26
26
  adjustments: {
27
27
  amount: number;
28
28
  currencyCode: CurrencyCode;
29
- description: string;
29
+ description: string | null;
30
30
  productId: string | null;
31
31
  promoCode?: string | null;
32
32
  sku: string | null;
@@ -94,6 +94,7 @@ export declare const featureAspectKeyEnum: {
94
94
  readonly ExploreFrontendMutation: "explore_frontend_mutation";
95
95
  readonly ExploreWeaviateMutation: "explore_weaviate_mutation";
96
96
  readonly FeatureAspect: "feature_aspect";
97
+ readonly FeatureFlagManagement: "feature_flag_management";
97
98
  readonly LocaleMessage: "locale_message";
98
99
  readonly NewCheckoutBeta: "new_checkout_beta";
99
100
  readonly NewPayoutReport: "new_payout_report";
@@ -113,6 +114,7 @@ export declare const featureAudienceNameEnum: {
113
114
  readonly DocsContributor: "docs_contributor";
114
115
  readonly Executive: "executive";
115
116
  readonly ExecutiveAssistant: "executive_assistant";
117
+ readonly FeatureFlagAdmin: "feature_flag_admin";
116
118
  readonly Finance: "finance";
117
119
  readonly FrontendEngineer: "frontend_engineer";
118
120
  readonly I18nKnownLanguage: "i18n_known_language";
@@ -73,6 +73,7 @@ export const featureAspectKeyEnum = {
73
73
  ExploreFrontendMutation: 'explore_frontend_mutation',
74
74
  ExploreWeaviateMutation: 'explore_weaviate_mutation',
75
75
  FeatureAspect: 'feature_aspect',
76
+ FeatureFlagManagement: 'feature_flag_management',
76
77
  LocaleMessage: 'locale_message',
77
78
  NewCheckoutBeta: 'new_checkout_beta',
78
79
  NewPayoutReport: 'new_payout_report',
@@ -96,6 +97,7 @@ export const featureAudienceNameEnum = {
96
97
  DocsContributor: 'docs_contributor',
97
98
  Executive: 'executive',
98
99
  ExecutiveAssistant: 'executive_assistant',
100
+ FeatureFlagAdmin: 'feature_flag_admin',
99
101
  Finance: 'finance',
100
102
  FrontendEngineer: 'frontend_engineer',
101
103
  I18nKnownLanguage: 'i18n_known_language',
@@ -459,11 +459,6 @@ export declare const classifyMissingHsCodesStatus: {
459
459
  readonly Enabled: "ENABLED";
460
460
  };
461
461
  export type ClassifyMissingHsCodesStatus = (typeof classifyMissingHsCodesStatus)[keyof typeof classifyMissingHsCodesStatus];
462
- export declare const clearanceType: {
463
- readonly Commercial: "COMMERCIAL";
464
- readonly Postal: "POSTAL";
465
- };
466
- export type ClearanceType = (typeof clearanceType)[keyof typeof clearanceType];
467
462
  export declare const collectFeeCalculationType: {
468
463
  readonly Flat: "FLAT";
469
464
  readonly Percent: "PERCENT";
@@ -1233,11 +1228,17 @@ export type CustomsDocumentType = (typeof customsDocumentType)[keyof typeof cust
1233
1228
  export declare const customsSpecAttributeType: {
1234
1229
  readonly AccountNumber: "ACCOUNT_NUMBER";
1235
1230
  readonly B13A: "B13A";
1231
+ readonly DutyTaxBillingAccountNumber: "DUTY_TAX_BILLING_ACCOUNT_NUMBER";
1236
1232
  readonly Eccn: "ECCN";
1237
1233
  readonly Eori: "EORI";
1234
+ readonly Gst: "GST";
1235
+ readonly Ioss: "IOSS";
1238
1236
  readonly Itn: "ITN";
1239
1237
  readonly OrderNumber: "ORDER_NUMBER";
1240
1238
  readonly PurchaseOrderNumber: "PURCHASE_ORDER_NUMBER";
1239
+ readonly ShippingBillingAccountNumber: "SHIPPING_BILLING_ACCOUNT_NUMBER";
1240
+ readonly Vat: "VAT";
1241
+ readonly Voec: "VOEC";
1241
1242
  };
1242
1243
  export type CustomsSpecAttributeType = (typeof customsSpecAttributeType)[keyof typeof customsSpecAttributeType];
1243
1244
  export declare const customsSpecSourceType: {
@@ -1362,6 +1363,7 @@ export declare const elementsUiTheme: {
1362
1363
  };
1363
1364
  export type ElementsUiTheme = (typeof elementsUiTheme)[keyof typeof elementsUiTheme];
1364
1365
  export declare const emailTemplateProviderType: {
1366
+ readonly Custom: "CUSTOM";
1365
1367
  readonly Sendgrid: "SENDGRID";
1366
1368
  };
1367
1369
  export type EmailTemplateProviderType = (typeof emailTemplateProviderType)[keyof typeof emailTemplateProviderType];
@@ -1374,7 +1376,10 @@ export declare const emailTemplateType: {
1374
1376
  readonly AbandonedCart: "ABANDONED_CART";
1375
1377
  readonly CatalogExport: "CATALOG_EXPORT";
1376
1378
  readonly ClassificationExport: "CLASSIFICATION_EXPORT";
1379
+ readonly Custom: "CUSTOM";
1380
+ readonly InclusivePriceExport: "INCLUSIVE_PRICE_EXPORT";
1377
1381
  readonly ManualClassificationExport: "MANUAL_CLASSIFICATION_EXPORT";
1382
+ readonly MerchantOrderConfirmation: "MERCHANT_ORDER_CONFIRMATION";
1378
1383
  readonly OrderCanceled: "ORDER_CANCELED";
1379
1384
  readonly OrderConfirmation: "ORDER_CONFIRMATION";
1380
1385
  readonly OrderReceipt: "ORDER_RECEIPT";
@@ -1573,6 +1578,13 @@ export declare const inclusivePriceCatalogValidationJobComplianceStatus: {
1573
1578
  readonly Pending: "PENDING";
1574
1579
  };
1575
1580
  export type InclusivePriceCatalogValidationJobComplianceStatus = (typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
1581
+ export declare const inclusivePriceExportJobStatus: {
1582
+ readonly Completed: "COMPLETED";
1583
+ readonly Error: "ERROR";
1584
+ readonly Initialized: "INITIALIZED";
1585
+ readonly Processing: "PROCESSING";
1586
+ };
1587
+ export type InclusivePriceExportJobStatus = (typeof inclusivePriceExportJobStatus)[keyof typeof inclusivePriceExportJobStatus];
1576
1588
  export declare const inclusivePriceHistoryCsvJobStatus: {
1577
1589
  readonly Completed: "COMPLETED";
1578
1590
  readonly Error: "ERROR";
@@ -2139,6 +2151,20 @@ export declare const packageLocation: {
2139
2151
  readonly Side: "SIDE";
2140
2152
  };
2141
2153
  export type PackageLocation = (typeof packageLocation)[keyof typeof packageLocation];
2154
+ export declare const packagingOptionBulkExportJobStatus: {
2155
+ readonly Completed: "COMPLETED";
2156
+ readonly CompletedWithErrors: "COMPLETED_WITH_ERRORS";
2157
+ readonly Error: "ERROR";
2158
+ readonly Initialized: "INITIALIZED";
2159
+ };
2160
+ export type PackagingOptionBulkExportJobStatus = (typeof packagingOptionBulkExportJobStatus)[keyof typeof packagingOptionBulkExportJobStatus];
2161
+ export declare const packagingOptionBulkJobStatus: {
2162
+ readonly Completed: "COMPLETED";
2163
+ readonly CompletedWithErrors: "COMPLETED_WITH_ERRORS";
2164
+ readonly Error: "ERROR";
2165
+ readonly Initialized: "INITIALIZED";
2166
+ };
2167
+ export type PackagingOptionBulkJobStatus = (typeof packagingOptionBulkJobStatus)[keyof typeof packagingOptionBulkJobStatus];
2142
2168
  export declare const packagingOptionDeleteAction: {
2143
2169
  readonly Delete: "DELETE";
2144
2170
  readonly Disable: "DISABLE";
@@ -2262,6 +2288,11 @@ export declare const propertyType: {
2262
2288
  readonly Residential: "RESIDENTIAL";
2263
2289
  };
2264
2290
  export type PropertyType = (typeof propertyType)[keyof typeof propertyType];
2291
+ export declare const providedHsCodeSource: {
2292
+ readonly Classify: "CLASSIFY";
2293
+ readonly User: "USER";
2294
+ };
2295
+ export type ProvidedHsCodeSource = (typeof providedHsCodeSource)[keyof typeof providedHsCodeSource];
2265
2296
  export declare const providedHsCodeVisibilityStatus: {
2266
2297
  readonly NotVisible: "NOT_VISIBLE";
2267
2298
  readonly Visible: "VISIBLE";
@@ -2558,6 +2589,11 @@ export declare const trackingEventTypeCode: {
2558
2589
  readonly PreTransit: "PRE_TRANSIT";
2559
2590
  };
2560
2591
  export type TrackingEventTypeCode = (typeof trackingEventTypeCode)[keyof typeof trackingEventTypeCode];
2592
+ export declare const trackingType: {
2593
+ readonly Package: "PACKAGE";
2594
+ readonly Shipment: "SHIPMENT";
2595
+ };
2596
+ export type TrackingType = (typeof trackingType)[keyof typeof trackingType];
2561
2597
  export declare const transactionFeeType: {
2562
2598
  readonly DutyTax: "DUTY_TAX";
2563
2599
  readonly LcgPerShipment: "LCG_PER_SHIPMENT";
@@ -2655,6 +2691,7 @@ export declare const webhookType: {
2655
2691
  readonly IpSettingStatusChanged: "IP_SETTING_STATUS_CHANGED";
2656
2692
  readonly OrderCanceled: "ORDER_CANCELED";
2657
2693
  readonly OrderCreated: "ORDER_CREATED";
2694
+ readonly OrderShipping: "ORDER_SHIPPING";
2658
2695
  readonly OrderStatusChanged: "ORDER_STATUS_CHANGED";
2659
2696
  readonly OrderUpdated: "ORDER_UPDATED";
2660
2697
  readonly ShipmentCanceled: "SHIPMENT_CANCELED";
@@ -2691,6 +2728,7 @@ export type CartCalculateLandedCostMutation = {
2691
2728
  id: string;
2692
2729
  imageUrl: string | null;
2693
2730
  name: string | null;
2731
+ productId: string;
2694
2732
  quantity: number;
2695
2733
  restriction: {
2696
2734
  action: RestrictedItemAction;
@@ -2831,6 +2869,7 @@ export type CalculateLandedCostMutation = {
2831
2869
  id: string;
2832
2870
  imageUrl: string | null;
2833
2871
  name: string | null;
2872
+ productId: string;
2834
2873
  quantity: number;
2835
2874
  restriction: {
2836
2875
  action: RestrictedItemAction;
@@ -2909,6 +2948,7 @@ export type CartItemFragmentFragment = {
2909
2948
  id: string;
2910
2949
  imageUrl: string | null;
2911
2950
  name: string | null;
2951
+ productId: string;
2912
2952
  quantity: number;
2913
2953
  restriction: {
2914
2954
  action: RestrictedItemAction;
@@ -3665,7 +3705,7 @@ export type CartQuery = {
3665
3705
  adjustments: Array<{
3666
3706
  amount: number;
3667
3707
  currencyCode: CurrencyCode;
3668
- description: string;
3708
+ description: string | null;
3669
3709
  productId: string | null;
3670
3710
  sku: string | null;
3671
3711
  type: CartAdjustmentType;
@@ -3715,7 +3755,7 @@ export type CartCreateMutation = {
3715
3755
  adjustments: Array<{
3716
3756
  amount: number;
3717
3757
  currencyCode: CurrencyCode;
3718
- description: string;
3758
+ description: string | null;
3719
3759
  productId: string | null;
3720
3760
  sku: string | null;
3721
3761
  type: CartAdjustmentType;
@@ -581,12 +581,6 @@ export const classifyMissingHsCodesStatus = {
581
581
 
582
582
  export type ClassifyMissingHsCodesStatus =
583
583
  (typeof classifyMissingHsCodesStatus)[keyof typeof classifyMissingHsCodesStatus];
584
- export const clearanceType = {
585
- Commercial: 'COMMERCIAL',
586
- Postal: 'POSTAL',
587
- } as const;
588
-
589
- export type ClearanceType = (typeof clearanceType)[keyof typeof clearanceType];
590
584
  export const collectFeeCalculationType = {
591
585
  Flat: 'FLAT',
592
586
  Percent: 'PERCENT',
@@ -1411,11 +1405,17 @@ export type CustomsDocumentType =
1411
1405
  export const customsSpecAttributeType = {
1412
1406
  AccountNumber: 'ACCOUNT_NUMBER',
1413
1407
  B13A: 'B13A',
1408
+ DutyTaxBillingAccountNumber: 'DUTY_TAX_BILLING_ACCOUNT_NUMBER',
1414
1409
  Eccn: 'ECCN',
1415
1410
  Eori: 'EORI',
1411
+ Gst: 'GST',
1412
+ Ioss: 'IOSS',
1416
1413
  Itn: 'ITN',
1417
1414
  OrderNumber: 'ORDER_NUMBER',
1418
1415
  PurchaseOrderNumber: 'PURCHASE_ORDER_NUMBER',
1416
+ ShippingBillingAccountNumber: 'SHIPPING_BILLING_ACCOUNT_NUMBER',
1417
+ Vat: 'VAT',
1418
+ Voec: 'VOEC',
1419
1419
  } as const;
1420
1420
 
1421
1421
  export type CustomsSpecAttributeType =
@@ -1581,6 +1581,7 @@ export type ElementsUiTheme =
1581
1581
  (typeof elementsUiTheme)[keyof typeof elementsUiTheme];
1582
1582
 
1583
1583
  export const emailTemplateProviderType = {
1584
+ Custom: 'CUSTOM',
1584
1585
  Sendgrid: 'SENDGRID',
1585
1586
  } as const;
1586
1587
 
@@ -1597,7 +1598,10 @@ export const emailTemplateType = {
1597
1598
  AbandonedCart: 'ABANDONED_CART',
1598
1599
  CatalogExport: 'CATALOG_EXPORT',
1599
1600
  ClassificationExport: 'CLASSIFICATION_EXPORT',
1601
+ Custom: 'CUSTOM',
1602
+ InclusivePriceExport: 'INCLUSIVE_PRICE_EXPORT',
1600
1603
  ManualClassificationExport: 'MANUAL_CLASSIFICATION_EXPORT',
1604
+ MerchantOrderConfirmation: 'MERCHANT_ORDER_CONFIRMATION',
1601
1605
  OrderCanceled: 'ORDER_CANCELED',
1602
1606
  OrderConfirmation: 'ORDER_CONFIRMATION',
1603
1607
  OrderReceipt: 'ORDER_RECEIPT',
@@ -1863,6 +1867,16 @@ export const inclusivePriceCatalogValidationJobComplianceStatus = {
1863
1867
  export type InclusivePriceCatalogValidationJobComplianceStatus =
1864
1868
  (typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
1865
1869
 
1870
+ export const inclusivePriceExportJobStatus = {
1871
+ Completed: 'COMPLETED',
1872
+ Error: 'ERROR',
1873
+ Initialized: 'INITIALIZED',
1874
+ Processing: 'PROCESSING',
1875
+ } as const;
1876
+
1877
+ export type InclusivePriceExportJobStatus =
1878
+ (typeof inclusivePriceExportJobStatus)[keyof typeof inclusivePriceExportJobStatus];
1879
+
1866
1880
  export const inclusivePriceHistoryCsvJobStatus = {
1867
1881
  Completed: 'COMPLETED',
1868
1882
  Error: 'ERROR',
@@ -2574,6 +2588,26 @@ export const packageLocation = {
2574
2588
  export type PackageLocation =
2575
2589
  (typeof packageLocation)[keyof typeof packageLocation];
2576
2590
 
2591
+ export const packagingOptionBulkExportJobStatus = {
2592
+ Completed: 'COMPLETED',
2593
+ CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
2594
+ Error: 'ERROR',
2595
+ Initialized: 'INITIALIZED',
2596
+ } as const;
2597
+
2598
+ export type PackagingOptionBulkExportJobStatus =
2599
+ (typeof packagingOptionBulkExportJobStatus)[keyof typeof packagingOptionBulkExportJobStatus];
2600
+
2601
+ export const packagingOptionBulkJobStatus = {
2602
+ Completed: 'COMPLETED',
2603
+ CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
2604
+ Error: 'ERROR',
2605
+ Initialized: 'INITIALIZED',
2606
+ } as const;
2607
+
2608
+ export type PackagingOptionBulkJobStatus =
2609
+ (typeof packagingOptionBulkJobStatus)[keyof typeof packagingOptionBulkJobStatus];
2610
+
2577
2611
  export const packagingOptionDeleteAction = {
2578
2612
  Delete: 'DELETE',
2579
2613
  Disable: 'DISABLE',
@@ -2738,6 +2772,13 @@ export const propertyType = {
2738
2772
  } as const;
2739
2773
 
2740
2774
  export type PropertyType = (typeof propertyType)[keyof typeof propertyType];
2775
+ export const providedHsCodeSource = {
2776
+ Classify: 'CLASSIFY',
2777
+ User: 'USER',
2778
+ } as const;
2779
+
2780
+ export type ProvidedHsCodeSource =
2781
+ (typeof providedHsCodeSource)[keyof typeof providedHsCodeSource];
2741
2782
  export const providedHsCodeVisibilityStatus = {
2742
2783
  NotVisible: 'NOT_VISIBLE',
2743
2784
  Visible: 'VISIBLE',
@@ -3130,6 +3171,13 @@ export const trackingEventTypeCode = {
3130
3171
 
3131
3172
  export type TrackingEventTypeCode =
3132
3173
  (typeof trackingEventTypeCode)[keyof typeof trackingEventTypeCode];
3174
+
3175
+ export const trackingType = {
3176
+ Package: 'PACKAGE',
3177
+ Shipment: 'SHIPMENT',
3178
+ } as const;
3179
+
3180
+ export type TrackingType = (typeof trackingType)[keyof typeof trackingType];
3133
3181
  export const transactionFeeType = {
3134
3182
  DutyTax: 'DUTY_TAX',
3135
3183
  LcgPerShipment: 'LCG_PER_SHIPMENT',
@@ -3245,6 +3293,7 @@ export const webhookType = {
3245
3293
  IpSettingStatusChanged: 'IP_SETTING_STATUS_CHANGED',
3246
3294
  OrderCanceled: 'ORDER_CANCELED',
3247
3295
  OrderCreated: 'ORDER_CREATED',
3296
+ OrderShipping: 'ORDER_SHIPPING',
3248
3297
  OrderStatusChanged: 'ORDER_STATUS_CHANGED',
3249
3298
  OrderUpdated: 'ORDER_UPDATED',
3250
3299
  ShipmentCanceled: 'SHIPMENT_CANCELED',
@@ -3290,6 +3339,7 @@ export type CartCalculateLandedCostMutation = {
3290
3339
  id: string;
3291
3340
  imageUrl: string | null;
3292
3341
  name: string | null;
3342
+ productId: string;
3293
3343
  quantity: number;
3294
3344
  restriction: { action: RestrictedItemAction; reason: string } | null;
3295
3345
  sku: string | null;
@@ -3405,6 +3455,7 @@ export type CalculateLandedCostMutation = {
3405
3455
  id: string;
3406
3456
  imageUrl: string | null;
3407
3457
  name: string | null;
3458
+ productId: string;
3408
3459
  quantity: number;
3409
3460
  restriction: { action: RestrictedItemAction; reason: string } | null;
3410
3461
  sku: string | null;
@@ -3463,6 +3514,7 @@ export type CartItemFragmentFragment = {
3463
3514
  id: string;
3464
3515
  imageUrl: string | null;
3465
3516
  name: string | null;
3517
+ productId: string;
3466
3518
  quantity: number;
3467
3519
  restriction: { action: RestrictedItemAction; reason: string } | null;
3468
3520
  sku: string | null;
@@ -4161,7 +4213,7 @@ export type CartQuery = {
4161
4213
  adjustments: Array<{
4162
4214
  amount: number;
4163
4215
  currencyCode: CurrencyCode;
4164
- description: string;
4216
+ description: string | null;
4165
4217
  productId: string | null;
4166
4218
  sku: string | null;
4167
4219
  type: CartAdjustmentType;
@@ -4204,7 +4256,7 @@ export type CartCreateMutation = {
4204
4256
  adjustments: Array<{
4205
4257
  amount: number;
4206
4258
  currencyCode: CurrencyCode;
4207
- description: string;
4259
+ description: string | null;
4208
4260
  productId: string | null;
4209
4261
  sku: string | null;
4210
4262
  type: CartAdjustmentType;
@@ -1 +1 @@
1
- import{l as e,a as n}from"./p-d4110fa4.js";import{s as o,c as t}from"./p-c0fc4490.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-c0fc4490.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.121.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},u="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${u}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&a.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${u}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.121.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.121",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1730844222999",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.121",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:u,overrideCurrencyFormat:a,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:u,overrideCurrencyFormat:a}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.121";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.121";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}
1
+ import{l as e,a as n}from"./p-f3cdaa23.js";import{s as o,c as t}from"./p-8e317f73.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-8e317f73.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.123.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},a="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&u.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${a}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.123.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.123",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1730930859534",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.123",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.123";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.123";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}