@zonos/elements 1.3.140 → 1.3.142

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 (232) hide show
  1. package/dist/cjs/{CheckoutConfig-165db6b6.js → CheckoutConfig-eaaf62a1.js} +1 -1
  2. package/dist/cjs/{cart-e1b59d03.js → cart-199b0751.js} +7 -7
  3. package/dist/cjs/{getBorderRadius-f72d8edf.js → getBorderRadius-f97c99ad.js} +1 -1
  4. package/dist/cjs/{handleFetch-4a90f091.js → handleFetch-864d3c53.js} +5 -5
  5. package/dist/cjs/{index-d56e0a8b.js → index-b678ce0c.js} +42 -8
  6. package/dist/cjs/index.cjs.js +38 -9
  7. package/dist/cjs/{isDarkColor-dd6d723b.js → isDarkColor-434d71dd.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{paypal-86cc51e4.js → paypal-4f1ee604.js} +5 -5
  10. package/dist/cjs/zonos-address_7.cjs.entry.js +6 -6
  11. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
  14. package/dist/cjs/zonos-card.cjs.entry.js +3 -3
  15. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +10 -10
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
  17. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  19. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +6 -6
  21. package/dist/cjs/zonos-country-select_4.cjs.entry.js +6 -6
  22. package/dist/cjs/zonos-elements.cjs.js +2 -2
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +7 -7
  24. package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-input.cjs.entry.js +3 -3
  26. package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  29. package/dist/cjs/zonos-notification_3.cjs.entry.js +7 -7
  30. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  31. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  32. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  33. package/dist/cjs/zonos-tooltip.cjs.entry.js +1 -1
  34. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  35. package/dist/cjs/{zonosStore-293bb3ba.js → zonosStore-8971eb65.js} +1 -1
  36. package/dist/collection/collection-manifest.json +2 -2
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.js +2 -2
  40. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +1 -1
  41. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +1 -1
  42. package/dist/collection/components/store/checkout/paypal.js +1 -1
  43. package/dist/collection/components/utils/api/getCountries.js +1 -1
  44. package/dist/collection/components/utils/api/getLocalization.js +1 -1
  45. package/dist/collection/components/utils/handleFetch.js +2 -2
  46. package/dist/collection/components/utils/isValidSelector.js +1 -1
  47. package/dist/collection/components/utils/jsonParse.js +1 -1
  48. package/dist/collection/components/utils/logging/log.js +1 -1
  49. package/dist/collection/components/utils/logging/sendErrorLog.js +1 -1
  50. package/dist/collection/environment.js +1 -1
  51. package/dist/collection/scripts/_zonosBase.js +29 -0
  52. package/dist/collection/types/stripe/Apperance.js +0 -58
  53. package/dist/esm/{CheckoutConfig-930107d4.js → CheckoutConfig-262008fe.js} +1 -1
  54. package/dist/esm/{cart-709f053f.js → cart-cf87ec6f.js} +7 -7
  55. package/dist/esm/{getBorderRadius-bdd709e7.js → getBorderRadius-4aca63d4.js} +1 -1
  56. package/dist/esm/{handleFetch-22cb914b.js → handleFetch-badf4543.js} +5 -5
  57. package/dist/esm/{index-86b8247e.js → index-986b5ff2.js} +42 -8
  58. package/dist/esm/index.js +39 -10
  59. package/dist/esm/{isDarkColor-c6924924.js → isDarkColor-4915739f.js} +1 -1
  60. package/dist/esm/loader.js +2 -2
  61. package/dist/esm/{paypal-77a60c44.js → paypal-b7124cc4.js} +5 -5
  62. package/dist/esm/zonos-address_7.entry.js +6 -6
  63. package/dist/esm/zonos-badge.entry.js +2 -2
  64. package/dist/esm/zonos-banner.entry.js +2 -2
  65. package/dist/esm/zonos-button_3.entry.js +4 -4
  66. package/dist/esm/zonos-card.entry.js +3 -3
  67. package/dist/esm/zonos-cart-items_13.entry.js +10 -10
  68. package/dist/esm/zonos-checkout.entry.js +9 -9
  69. package/dist/esm/zonos-collapse.entry.js +2 -2
  70. package/dist/esm/zonos-component.entry.js +1 -1
  71. package/dist/esm/zonos-controller.entry.js +6 -6
  72. package/dist/esm/zonos-country-flag.entry.js +6 -6
  73. package/dist/esm/zonos-country-select_4.entry.js +6 -6
  74. package/dist/esm/zonos-elements.js +3 -3
  75. package/dist/esm/zonos-hello-dialog.entry.js +7 -7
  76. package/dist/esm/zonos-hello.entry.js +6 -6
  77. package/dist/esm/zonos-input.entry.js +3 -3
  78. package/dist/esm/zonos-language-select_2.entry.js +6 -6
  79. package/dist/esm/zonos-link.entry.js +1 -1
  80. package/dist/esm/zonos-logo.entry.js +2 -2
  81. package/dist/esm/zonos-notification_3.entry.js +7 -7
  82. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  83. package/dist/esm/zonos-text.entry.js +2 -2
  84. package/dist/esm/zonos-toggle.entry.js +2 -2
  85. package/dist/esm/zonos-tooltip.entry.js +1 -1
  86. package/dist/esm/zonos-v-stack.entry.js +2 -2
  87. package/dist/esm/{zonosStore-c493c4fe.js → zonosStore-708637e7.js} +1 -1
  88. package/dist/esm-es5/{CheckoutConfig-930107d4.js → CheckoutConfig-262008fe.js} +1 -1
  89. package/dist/esm-es5/{cart-709f053f.js → cart-cf87ec6f.js} +1 -1
  90. package/dist/esm-es5/{getBorderRadius-bdd709e7.js → getBorderRadius-4aca63d4.js} +1 -1
  91. package/dist/esm-es5/index-986b5ff2.js +2 -0
  92. package/dist/esm-es5/index.js +1 -1
  93. package/dist/esm-es5/{isDarkColor-c6924924.js → isDarkColor-4915739f.js} +1 -1
  94. package/dist/esm-es5/loader.js +1 -1
  95. package/dist/esm-es5/{paypal-77a60c44.js → paypal-b7124cc4.js} +1 -1
  96. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  97. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  98. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  99. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  100. package/dist/esm-es5/zonos-card.entry.js +1 -1
  101. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  102. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  103. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  104. package/dist/esm-es5/zonos-component.entry.js +1 -1
  105. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  106. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  107. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  108. package/dist/esm-es5/zonos-elements.js +1 -1
  109. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  110. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  111. package/dist/esm-es5/zonos-input.entry.js +1 -1
  112. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  113. package/dist/esm-es5/zonos-link.entry.js +1 -1
  114. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  115. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  116. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  117. package/dist/esm-es5/zonos-text.entry.js +1 -1
  118. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  119. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  120. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  121. package/dist/esm-es5/{zonosStore-c493c4fe.js → zonosStore-708637e7.js} +1 -1
  122. package/dist/scripts/index.d.ts +5 -9
  123. package/dist/scripts/index.js +1 -1
  124. package/dist/scripts/loadZonos.js +1 -1
  125. package/dist/scripts/zonos.js +1 -1
  126. package/dist/types/components/store/checkout/cart.d.ts +2 -3
  127. package/dist/types/components/store/checkout/stripe.d.ts +2 -2
  128. package/dist/types/components/store/hello/localization.d.ts +0 -1
  129. package/dist/types/components/store/translationStore.d.ts +1 -1
  130. package/dist/types/components/store/zonosStore.d.ts +1 -1
  131. package/dist/types/components/utils/api/checkItemRestrictions.d.ts +3 -3
  132. package/dist/types/components/utils/api/getLocaleMessages.d.ts +3 -3
  133. package/dist/types/components/utils/changeDeepProperty.d.ts +2 -2
  134. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +2 -1
  135. package/dist/types/components/utils/createCustomEvent.d.ts +3 -3
  136. package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +3 -3
  137. package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +1 -1
  138. package/dist/types/components/utils/hello/initHello.d.ts +2 -2
  139. package/dist/types/components/utils/resetToSelectedTab.d.ts +1 -1
  140. package/dist/types/components.d.ts +2 -2
  141. package/dist/types/environment.d.ts +2 -2
  142. package/dist/types/scripts/_stripe.d.ts +1 -1
  143. package/dist/types/scripts/_zonosBase.d.ts +1 -0
  144. package/dist/types/stencil-public-runtime.d.ts +6 -0
  145. package/dist/types/styles/stripe/defaultVariable.d.ts +1 -1
  146. package/dist/types/types/global.d.ts +0 -5
  147. package/dist/types/types/stripe/Apperance.d.ts +1 -2
  148. package/dist/types/utils/formattedUrl.d.ts +1 -1
  149. package/dist/zonos-elements/index.esm.js +1 -1
  150. package/dist/zonos-elements/{p-e205ef1c.system.entry.js → p-0197a9bf.system.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-be2feba6.entry.js → p-076388d3.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-0c027d2e.entry.js → p-0920500d.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-87ed2e17.system.entry.js → p-0b5f4ca7.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-a58731ec.system.js → p-0cda2818.system.js} +1 -1
  155. package/dist/zonos-elements/p-0d2cf216.entry.js +1 -0
  156. package/dist/zonos-elements/{p-3dd503fd.system.entry.js → p-0e54432c.system.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-b7307c61.js → p-1460f917.js} +1 -1
  158. package/dist/zonos-elements/{p-9589bd08.entry.js → p-1e3ea4ae.entry.js} +1 -1
  159. package/dist/zonos-elements/p-21b538ea.system.js +1 -0
  160. package/dist/zonos-elements/{p-22d69480.system.entry.js → p-232963d3.system.entry.js} +1 -1
  161. package/dist/zonos-elements/p-272052bd.system.entry.js +1 -0
  162. package/dist/zonos-elements/{p-0fc96872.system.entry.js → p-2761ad55.system.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-bc8b22ad.entry.js → p-28295342.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-b9efc660.entry.js → p-2949faf3.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-04a6a167.entry.js → p-2b8cddb7.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-ad1d6ea2.entry.js → p-2c19f5e2.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-f07c01c5.system.entry.js → p-2cfc00b8.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-289ded20.system.entry.js → p-2d514c1d.system.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-1c4ff7b2.system.entry.js → p-2e152517.system.entry.js} +1 -1
  170. package/dist/zonos-elements/{p-4319600a.system.entry.js → p-33e1d25e.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-10efff62.system.js → p-36dfc7ac.system.js} +1 -1
  172. package/dist/zonos-elements/{p-7a60deef.system.entry.js → p-381874b0.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-00d4bff1.entry.js → p-39cac2c1.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-64a04391.system.entry.js → p-3cb4468f.system.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-b832ec52.entry.js → p-3cf30d83.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-afffdfc2.js → p-3d82e70e.js} +1 -1
  177. package/dist/zonos-elements/{p-9b59704a.entry.js → p-44dd4269.entry.js} +1 -1
  178. package/dist/zonos-elements/{p-edc16f69.js → p-4b685549.js} +1 -1
  179. package/dist/zonos-elements/{p-ad4bc6a2.entry.js → p-545c05ce.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-8368a79e.entry.js → p-58a09715.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-d35376d3.js → p-6271e108.js} +2 -2
  182. package/dist/zonos-elements/{p-5c32689e.entry.js → p-65069140.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-8f9affb3.system.entry.js → p-673b4402.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-5b90dd6d.entry.js → p-675f60b4.entry.js} +1 -1
  185. package/dist/zonos-elements/p-680d3694.js +2 -0
  186. package/dist/zonos-elements/{p-f2867195.entry.js → p-68d79b58.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-896d62a4.system.entry.js → p-6b490b0a.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-d633ced9.entry.js → p-72256333.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-10d6fe23.js → p-766dd01f.js} +1 -1
  190. package/dist/zonos-elements/{p-7ef573f0.entry.js → p-7c5c0a85.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-bb418544.system.js → p-7c643376.system.js} +1 -1
  192. package/dist/zonos-elements/p-866bb93e.system.js +1 -0
  193. package/dist/zonos-elements/{p-f8ca3e71.entry.js → p-8c487480.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-fce202ab.entry.js → p-9306a835.entry.js} +1 -1
  195. package/dist/zonos-elements/{p-ffe4a999.system.entry.js → p-983f23a1.system.entry.js} +1 -1
  196. package/dist/zonos-elements/{p-35b8dcde.entry.js → p-9b720cf4.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-cd1fd09e.entry.js → p-9dec2b74.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-ee1e1d94.system.entry.js → p-a13d5957.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-dc09df19.system.entry.js → p-a2bce31d.system.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-cf72603f.system.entry.js → p-a8bd492d.system.entry.js} +1 -1
  201. package/dist/zonos-elements/{p-d10ffd69.js → p-b0174a8f.js} +1 -1
  202. package/dist/zonos-elements/{p-fd061229.system.js → p-b50667b6.system.js} +1 -1
  203. package/dist/zonos-elements/{p-46a5ec52.system.js → p-c0164a3c.system.js} +1 -1
  204. package/dist/zonos-elements/{p-6b0aa1bb.system.js → p-c1b098de.system.js} +1 -1
  205. package/dist/zonos-elements/{p-010f5797.system.entry.js → p-d198421b.system.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-7acf6802.entry.js → p-d381288e.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-896ab1ed.system.entry.js → p-d5a3851d.system.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-25c7e4fa.system.entry.js → p-ded984d9.system.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-0aee2e4c.system.entry.js → p-e6554a6f.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-c78dd680.system.js → p-e9964a5a.system.js} +1 -1
  211. package/dist/zonos-elements/{p-461624ce.system.entry.js → p-ebdd9b64.system.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-01ad5be8.system.entry.js → p-f295030e.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-3a26cae5.entry.js → p-fc4658a6.entry.js} +1 -1
  214. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  215. package/dist/zonos-elements/zonos-elements.js +1 -1
  216. package/package.json +68 -67
  217. package/dist/collection/__mocks__/vercel-app/loadZonos.js +0 -492
  218. package/dist/collection/__mocks__/vercel-app/localization.js +0 -1
  219. package/dist/collection/__mocks__/vercel-app/zonos-hello.entry.js +0 -1
  220. package/dist/collection/__mocks__/zonos-url/index.js +0 -1
  221. package/dist/collection/__mocks__/zonos-url/loadZonos.js +0 -492
  222. package/dist/collection/__mocks__/zonos-url/localization.js +0 -2899
  223. package/dist/collection/__mocks__/zonos-url/zonos-hello.entry.js +0 -1
  224. package/dist/esm-es5/index-86b8247e.js +0 -2
  225. package/dist/zonos-elements/p-26b24d0b.system.js +0 -1
  226. package/dist/zonos-elements/p-49e4ca08.system.entry.js +0 -1
  227. package/dist/zonos-elements/p-5b7da777.js +0 -2
  228. package/dist/zonos-elements/p-6b6cd6c3.system.js +0 -1
  229. package/dist/zonos-elements/p-e6c31531.entry.js +0 -1
  230. /package/dist/esm-es5/{handleFetch-22cb914b.js → handleFetch-badf4543.js} +0 -0
  231. /package/dist/zonos-elements/{p-860e46ab.js → p-a5b294d7.js} +0 -0
  232. /package/dist/zonos-elements/{p-febc72e7.system.js → p-bfcfd29b.system.js} +0 -0
@@ -1 +1 @@
1
- import{r as o,h as e,H as t}from"./p-5b7da777.js";import{_ as s,e as i,i as n,f as l,z as r,g as h,m as a}from"./p-edc16f69.js";import{l as d,D as c,q as f,r as m,F as p,G as g,H as u,I as w,J as z}from"./p-afffdfc2.js";import{c as b}from"./p-b4b7f705.js";import{h as v,a as x,l as y}from"./p-860e46ab.js";import{g as k}from"./p-5883217a.js";import"./p-10d6fe23.js";import"./p-d10ffd69.js";var L=s,T=/\s/,C=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&T.test(o.charAt(e)););return e}(o)+1).replace(C,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,F=parseInt,H=l,X=function(){return L.Date.now()},B=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?F(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello could not check item restrictions - must provide title and description selectors.");const l=i&&c(i)&&document.querySelectorAll(i)||[],h=s&&c(s)&&document.querySelectorAll(s)||[];if(l.length!==h.length)return x("Hello could not check item restrictions - Title and description selectors do not match"),[];const a="RESTRICT_AND_BLOCK"===n,d=a&&t&&c(t)&&document.querySelectorAll(t)||[];a&&d.length!==h.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const f=[];for(let t=0;t<l.length;t++){const s=l[t],i=h[t];if(s&&i){const n={cartButtonNode:d[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())||""};f.push(n)}}return f},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=f("click to learn more");return`${f("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return f("Prepay duties and taxes at checkout");case"productList":case"productDetail":return f("See duty and tax thresholds");default:return f("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=d;if(!e)return x("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:l}=await v("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.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(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.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=R();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.handleProductCountChange=function(o,e,t){var s,i,n,l,r,h,a=0,d=!1,c=!1,f=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function m(e){var t=s,n=i;return s=i=void 0,a=e,l=o.apply(n,t)}function p(o){var t=o-h;return void 0===h||t>=e||t<0||c&&o-a>=n}function g(){var o=X();if(p(o))return u(o);r=setTimeout(g,function(o){var t=e-(o-h);return c?M(t,n-(o-a)):t}(o))}function u(o){return r=void 0,f&&s?m(o):(s=i=void 0,l)}function w(){var o=X(),t=p(o);if(s=arguments,i=this,h=o,t){if(void 0===r)return function(o){return a=o,r=setTimeout(g,e),d?m(o):l}(h);if(c)return clearTimeout(r),r=setTimeout(g,e),m(h)}return void 0===r&&(r=setTimeout(g,e)),l}return e=B(e)||0,H(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(B(t.maxWait)||0,e):n,f="trailing"in t?!!t.trailing:f),w.cancel=function(){void 0!==r&&clearTimeout(r),a=0,s=h=i=r=void 0},w.flush=function(){return void 0===r?l:u(X())},w}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();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.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&m(o.searchParams))!==d.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!m(e.searchParams))return void p(d.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 k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!d.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(d.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?d.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(d.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return d.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(d.exchangeRate?g():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return u(o)}async convert(o){return w(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||d.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=h(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>o&&new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=d,{isOnLeft:l,isOnTop:h,shouldFloat:c}=this.getHelloLocation(),f=a(r.appearance,this.appearanceSettingsOverride||null),{theme:m}=f,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":m},g&&e("div",{class:b(["zonos--hello-wrapper",c&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",c&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{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:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",c&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:f,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display: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 .zonos--hello-dialog-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(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-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;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(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-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% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-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(--zonos-elements-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:16px;border:var(--zonos-elements-border)}: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>.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:16px;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% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;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(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;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-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;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-float.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-widget-float.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-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
1
+ import{r as o,h as e,H as t}from"./p-680d3694.js";import{_ as s,e as i,i as n,f as l,z as r,g as h,m as a}from"./p-4b685549.js";import{l as d,D as c,q as m,r as f,F as p,G as g,H as u,I as w,J as z}from"./p-3d82e70e.js";import{c as b}from"./p-b4b7f705.js";import{h as v,a as x,l as y}from"./p-a5b294d7.js";import{g as k}from"./p-5883217a.js";import"./p-766dd01f.js";import"./p-b0174a8f.js";var L=s,T=/\s/,C=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&T.test(o.charAt(e)););return e}(o)+1).replace(C,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,F=parseInt,H=l,X=function(){return L.Date.now()},B=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?F(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello could not check item restrictions - must provide title and description selectors.");const l=i&&c(i)&&document.querySelectorAll(i)||[],h=s&&c(s)&&document.querySelectorAll(s)||[];if(l.length!==h.length)return x("Hello could not check item restrictions - Title and description selectors do not match"),[];const a="RESTRICT_AND_BLOCK"===n,d=a&&t&&c(t)&&document.querySelectorAll(t)||[];a&&d.length!==h.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const m=[];for(let t=0;t<l.length;t++){const s=l[t],i=h[t];if(s&&i){const n={cartButtonNode:d[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())||""};m.push(n)}}return m},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=m("click to learn more");return`${m("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return m("Prepay duties and taxes at checkout");case"productList":case"productDetail":return m("See duty and tax thresholds");default:return m("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=d;if(!e)return x("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:l}=await v("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.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(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.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=R();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.handleProductCountChange=function(o,e,t){var s,i,n,l,r,h,a=0,d=!1,c=!1,m=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,a=e,l=o.apply(n,t)}function p(o){var t=o-h;return void 0===h||t>=e||t<0||c&&o-a>=n}function g(){var o=X();if(p(o))return u(o);r=setTimeout(g,function(o){var t=e-(o-h);return c?M(t,n-(o-a)):t}(o))}function u(o){return r=void 0,m&&s?f(o):(s=i=void 0,l)}function w(){var o=X(),t=p(o);if(s=arguments,i=this,h=o,t){if(void 0===r)return function(o){return a=o,r=setTimeout(g,e),d?f(o):l}(h);if(c)return clearTimeout(r),r=setTimeout(g,e),f(h)}return void 0===r&&(r=setTimeout(g,e)),l}return e=B(e)||0,H(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(B(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m),w.cancel=function(){void 0!==r&&clearTimeout(r),a=0,s=h=i=r=void 0},w.flush=function(){return void 0===r?l:u(X())},w}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();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.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&f(o.searchParams))!==d.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!f(e.searchParams))return void p(d.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 k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!d.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(d.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?d.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(d.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return d.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(d.exchangeRate?g():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return u(o)}async convert(o){return w(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||d.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=h(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>o&&new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=d,{isOnLeft:l,isOnTop:h,shouldFloat:c}=this.getHelloLocation(),m=a(r.appearance,this.appearanceSettingsOverride||null),{theme:f}=m,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":f},g&&e("div",{class:b(["zonos--hello-wrapper",c&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",c&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{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:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",c&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:m,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display: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 .zonos--hello-dialog-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(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-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;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(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-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% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-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(--zonos-elements-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:16px;border:var(--zonos-elements-border)}: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>.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:16px;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% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;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(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;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-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;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-float.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-widget-float.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-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
@@ -1 +1 @@
1
- System.register(["./p-fd061229.system.js","./p-10efff62.system.js","./p-23e7c655.system.js","./p-6b6cd6c3.system.js"],(function(e){"use strict";var s,t,a,o,r,n;return{setters:[function(e){s=e.r;t=e.h;a=e.H},function(e){o=e.d},function(e){r=e.c},function(e){n=e.g}],execute:function(){var i=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";var d=i;var c=e("zonos_card",function(){function e(e){s(this,e);this.actions=undefined;this.backgroundColor=undefined;this.borderRadius=6;this.footerActions=undefined;this.footerContent=undefined;this.footerHeight=undefined;this.label=undefined;this.spacing="24px"}e.prototype.render=function(){var e=this.backgroundColor?"var(--zonos-elements-".concat(this.backgroundColor,")"):"transparent";var s=n({customRoundRadius:"".concat(this.borderRadius,"px"),overrideBorderStyle:"ROUNDED"});return t(a,{key:"d1a2b02f3d33492fc76bd88cf92e68bf1603cbd0",style:{"--zonos--font-family":o()}},t("div",{key:"0c9acee7938dc95d1f6267dff6fa399bd8a65b95",class:r(["styled-card"]),style:{"--zonos--background-color":e,"--zonos--border-radius":s,padding:this.spacing}},this.label&&t("header",{key:"2559a7fd78c4c4a97ce466e0eefbc4db8409c97f",class:"card-header",style:{padding:this.spacing}},t("zonos-text",{key:"287e0e64461cb5206a653711346fd8eb62524a00",type:"subheader"},this.label),t("h-stack",{key:"9ac80b9c555a93232bbcdd0e1769a4b78ded2fa8",spacing:8},this.actions)),t("slot",{key:"3342bd7f5d2af58740c49d353f311ce1c4101f13"}),(this.footerActions||this.footerContent)&&t("footer",{key:"dee65ea527dfac5821ece452426e2d33f127e356",class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},t("div",{key:"13a23726ada09eb39783ea261b760cbe83587f5b"},this.footerContent),t("h-stack",{key:"1389bcbce376431f3008669e9f55a69b0a177d85",spacing:8},this.footerActions))))};return e}());c.style=d}}}));
1
+ System.register(["./p-b50667b6.system.js","./p-36dfc7ac.system.js","./p-23e7c655.system.js","./p-21b538ea.system.js"],(function(e){"use strict";var s,t,a,o,r,n;return{setters:[function(e){s=e.r;t=e.h;a=e.H},function(e){o=e.d},function(e){r=e.c},function(e){n=e.g}],execute:function(){var i=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";var d=i;var c=e("zonos_card",function(){function e(e){s(this,e);this.actions=undefined;this.backgroundColor=undefined;this.borderRadius=6;this.footerActions=undefined;this.footerContent=undefined;this.footerHeight=undefined;this.label=undefined;this.spacing="24px"}e.prototype.render=function(){var e=this.backgroundColor?"var(--zonos-elements-".concat(this.backgroundColor,")"):"transparent";var s=n({customRoundRadius:"".concat(this.borderRadius,"px"),overrideBorderStyle:"ROUNDED"});return t(a,{key:"d1a2b02f3d33492fc76bd88cf92e68bf1603cbd0",style:{"--zonos--font-family":o()}},t("div",{key:"0c9acee7938dc95d1f6267dff6fa399bd8a65b95",class:r(["styled-card"]),style:{"--zonos--background-color":e,"--zonos--border-radius":s,padding:this.spacing}},this.label&&t("header",{key:"2559a7fd78c4c4a97ce466e0eefbc4db8409c97f",class:"card-header",style:{padding:this.spacing}},t("zonos-text",{key:"287e0e64461cb5206a653711346fd8eb62524a00",type:"subheader"},this.label),t("h-stack",{key:"9ac80b9c555a93232bbcdd0e1769a4b78ded2fa8",spacing:8},this.actions)),t("slot",{key:"3342bd7f5d2af58740c49d353f311ce1c4101f13"}),(this.footerActions||this.footerContent)&&t("footer",{key:"dee65ea527dfac5821ece452426e2d33f127e356",class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},t("div",{key:"13a23726ada09eb39783ea261b760cbe83587f5b"},this.footerContent),t("h-stack",{key:"1389bcbce376431f3008669e9f55a69b0a177d85",spacing:8},this.footerActions))))};return e}());c.style=d}}}));