@zonos/elements 1.0.17-alpha.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/dist/cjs/{cart-108bc407.js → cart-a969ee0b.js} +8 -8
  2. package/dist/cjs/{cart-108bc407.js.map → cart-a969ee0b.js.map} +1 -1
  3. package/dist/cjs/{getBorderRadius-2904800c.js → getBorderRadius-ae52cae1.js} +2 -2
  4. package/dist/cjs/{getBorderRadius-2904800c.js.map → getBorderRadius-ae52cae1.js.map} +1 -1
  5. package/dist/cjs/{isDarkColor-a86b8a05.js → isDarkColor-e1a7bf45.js} +2 -2
  6. package/dist/cjs/{isDarkColor-a86b8a05.js.map → isDarkColor-e1a7bf45.js.map} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{localization-f6a1b679.js → localization-d510574c.js} +200 -12
  9. package/dist/cjs/localization-d510574c.js.map +1 -0
  10. package/dist/cjs/{submitGtag-b1b96579.js → submitGtag-4de4430f.js} +3 -3
  11. package/dist/cjs/{submitGtag-b1b96579.js.map → submitGtag-4de4430f.js.map} +1 -1
  12. package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
  13. package/dist/cjs/zonos-banner.cjs.entry.js +68 -0
  14. package/dist/cjs/zonos-banner.cjs.entry.js.map +1 -0
  15. package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +12 -12
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
  18. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-controller.cjs.entry.js.map +1 -1
  20. package/dist/cjs/zonos-country-flag_4.cjs.entry.js +6 -6
  21. package/dist/cjs/zonos-elements.cjs.js +1 -1
  22. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +12 -8
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js.map +1 -1
  24. package/dist/cjs/zonos-hello.cjs.entry.js +237 -22
  25. package/dist/cjs/zonos-hello.cjs.entry.js.map +1 -1
  26. package/dist/cjs/zonos-payment.cjs.entry.js +60 -0
  27. package/dist/cjs/zonos-payment.cjs.entry.js.map +1 -0
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js.map +1 -1
  30. package/dist/cjs/{zonosStore-960e5542.js → zonosStore-d9cdaec6.js} +6 -22
  31. package/dist/cjs/zonosStore-d9cdaec6.js.map +1 -0
  32. package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
  33. package/dist/collection/components/checkout/zonos-checkout/assets/MessageIcon.svg +1 -1
  34. package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/assets/InfoIcon.svg +1 -1
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
  40. package/dist/collection/components/common/zonos-banner/zonos-banner.css +6 -1
  41. package/dist/collection/components/common/zonos-banner/zonos-banner.js +1 -1
  42. package/dist/collection/components/common/zonos-banner/zonos-banner.js.map +1 -1
  43. package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +1 -1
  44. package/dist/collection/components/common/zonos-dialog/assets/removeIcon.svg +1 -1
  45. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
  46. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js.map +1 -1
  47. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +20 -2
  48. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +135 -20
  49. package/dist/collection/components/hello/zonos-hello/zonos-hello.js.map +1 -1
  50. package/dist/collection/components/hello/zonos-hello-dialog/assets/bagIcon.svg +1 -1
  51. package/dist/collection/components/hello/zonos-hello-dialog/assets/messageIcon.svg +1 -1
  52. package/dist/collection/components/hello/zonos-hello-dialog/assets/moneyIcon.svg +1 -1
  53. package/dist/collection/components/hello/zonos-hello-dialog/assets/removeIcon.svg +1 -1
  54. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
  55. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
  56. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +12 -4
  57. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +30 -1
  58. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js.map +1 -1
  59. package/dist/collection/components/store/hello/localization.js +2 -4
  60. package/dist/collection/components/store/hello/localization.js.map +1 -1
  61. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  62. package/dist/collection/components/store/translationStore/strings.arabic.js.map +1 -1
  63. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  64. package/dist/collection/components/store/translationStore/strings.base.js.map +1 -1
  65. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  66. package/dist/collection/components/store/translationStore/strings.chinese.js.map +1 -1
  67. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  68. package/dist/collection/components/store/translationStore/strings.danish.js.map +1 -1
  69. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  70. package/dist/collection/components/store/translationStore/strings.dutch.js.map +1 -1
  71. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  72. package/dist/collection/components/store/translationStore/strings.french.js.map +1 -1
  73. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  74. package/dist/collection/components/store/translationStore/strings.german.js.map +1 -1
  75. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  76. package/dist/collection/components/store/translationStore/strings.hebrew.js.map +1 -1
  77. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  78. package/dist/collection/components/store/translationStore/strings.indonesian.js.map +1 -1
  79. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  80. package/dist/collection/components/store/translationStore/strings.italian.js.map +1 -1
  81. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  82. package/dist/collection/components/store/translationStore/strings.japanese.js.map +1 -1
  83. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  84. package/dist/collection/components/store/translationStore/strings.korean.js.map +1 -1
  85. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  86. package/dist/collection/components/store/translationStore/strings.norwegian.js.map +1 -1
  87. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  88. package/dist/collection/components/store/translationStore/strings.polish.js.map +1 -1
  89. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  90. package/dist/collection/components/store/translationStore/strings.portuguese.js.map +1 -1
  91. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  92. package/dist/collection/components/store/translationStore/strings.russian.js.map +1 -1
  93. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  94. package/dist/collection/components/store/translationStore/strings.spanish.js.map +1 -1
  95. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  96. package/dist/collection/components/store/translationStore/strings.swedish.js.map +1 -1
  97. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  98. package/dist/collection/components/store/translationStore/strings.turkish.js.map +1 -1
  99. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  100. package/dist/collection/components/store/translationStore/strings.vietnamese.js.map +1 -1
  101. package/dist/collection/components/store/zonosStore.js +5 -3
  102. package/dist/collection/components/store/zonosStore.js.map +1 -1
  103. package/dist/collection/components/utils/api/checkItemRestrictions.js +18 -0
  104. package/dist/collection/components/utils/api/checkItemRestrictions.js.map +1 -0
  105. package/dist/collection/components/utils/hello/detectItemRestrictions.js +29 -0
  106. package/dist/collection/components/utils/hello/detectItemRestrictions.js.map +1 -0
  107. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js +8 -7
  108. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js.map +1 -1
  109. package/dist/collection/components/utils/hello/getProductsOnPage.js +49 -0
  110. package/dist/collection/components/utils/hello/getProductsOnPage.js.map +1 -0
  111. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js +10 -0
  112. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js.map +1 -0
  113. package/dist/collection/environment.js +34 -7
  114. package/dist/collection/environment.js.map +1 -1
  115. package/dist/collection/scripts/stripe.js.map +1 -1
  116. package/dist/collection/scripts/zonos.js +81 -28
  117. package/dist/collection/scripts/zonos.js.map +1 -1
  118. package/dist/collection/types/generated/graphql.customer.types.js +34 -0
  119. package/dist/collection/types/generated/graphql.customer.types.js.map +1 -1
  120. package/dist/collection/types/hello/HelloConfig.js.map +1 -1
  121. package/dist/collection/types/hello/Product.js +2 -0
  122. package/dist/collection/types/hello/Product.js.map +1 -0
  123. package/dist/collection/types/hello/RestrictedItem.js +2 -0
  124. package/dist/collection/types/hello/RestrictedItem.js.map +1 -0
  125. package/dist/components/localization.js +198 -11
  126. package/dist/components/localization.js.map +1 -1
  127. package/dist/components/stripe.js +3 -3
  128. package/dist/components/stripe.js.map +1 -1
  129. package/dist/components/zonos-banner2.js +2 -2
  130. package/dist/components/zonos-banner2.js.map +1 -1
  131. package/dist/components/zonos-cart-subtotal2.js +1 -1
  132. package/dist/components/zonos-checkout-finish2.js +2 -2
  133. package/dist/components/zonos-checkout.js +3 -3
  134. package/dist/components/zonos-controller.js +1 -1
  135. package/dist/components/zonos-controller.js.map +1 -1
  136. package/dist/components/zonos-country-select2.js +1 -1
  137. package/dist/components/zonos-dialog2.js +1 -1
  138. package/dist/components/zonos-hello-dialog-footer2.js +2 -2
  139. package/dist/components/zonos-hello-dialog2.js +18 -7
  140. package/dist/components/zonos-hello-dialog2.js.map +1 -1
  141. package/dist/components/zonos-hello.js +247 -22
  142. package/dist/components/zonos-hello.js.map +1 -1
  143. package/dist/components/zonos-review2.js +2 -2
  144. package/dist/components/zonos-shipping-rich-radio2.js +1 -1
  145. package/dist/components/zonos-shipping-rich-radio2.js.map +1 -1
  146. package/dist/components/zonosStore.js +5 -21
  147. package/dist/components/zonosStore.js.map +1 -1
  148. package/dist/{zonos-elements/cart-2f83e048.js → esm/cart-d00e1acb.js} +8 -8
  149. package/dist/esm/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  150. package/dist/{zonos-elements/getBorderRadius-82fbaf25.js → esm/getBorderRadius-e8ad5967.js} +2 -2
  151. package/dist/esm/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
  152. package/dist/{zonos-elements/isDarkColor-b21326ae.js → esm/isDarkColor-3bb345f4.js} +2 -2
  153. package/dist/{zonos-elements/isDarkColor-b21326ae.js.map → esm/isDarkColor-3bb345f4.js.map} +1 -1
  154. package/dist/esm/loader.js +1 -1
  155. package/dist/{zonos-elements/localization-4a424f49.js → esm/localization-1d92a557.js} +200 -13
  156. package/dist/esm/localization-1d92a557.js.map +1 -0
  157. package/dist/{zonos-elements/submitGtag-fbdb454b.js → esm/submitGtag-85914088.js} +3 -3
  158. package/dist/esm/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
  159. package/dist/esm/zonos-address_2.entry.js +5 -5
  160. package/dist/esm/zonos-banner.entry.js +64 -0
  161. package/dist/esm/zonos-banner.entry.js.map +1 -0
  162. package/dist/esm/zonos-button_2.entry.js +3 -3
  163. package/dist/esm/zonos-cart-items_10.entry.js +12 -12
  164. package/dist/esm/zonos-checkout.entry.js +9 -9
  165. package/dist/esm/zonos-controller.entry.js +6 -6
  166. package/dist/esm/zonos-controller.entry.js.map +1 -1
  167. package/dist/esm/zonos-country-flag_4.entry.js +6 -6
  168. package/dist/esm/zonos-elements.js +1 -1
  169. package/dist/esm/zonos-hello-dialog.entry.js +12 -8
  170. package/dist/esm/zonos-hello-dialog.entry.js.map +1 -1
  171. package/dist/esm/zonos-hello.entry.js +237 -22
  172. package/dist/esm/zonos-hello.entry.js.map +1 -1
  173. package/dist/esm/zonos-payment.entry.js +56 -0
  174. package/dist/esm/zonos-payment.entry.js.map +1 -0
  175. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  176. package/dist/esm/zonos-shipping-rich-radio.entry.js.map +1 -1
  177. package/dist/{zonos-elements/zonosStore-13a7b534.js → esm/zonosStore-1c9c7d76.js} +6 -22
  178. package/dist/esm/zonosStore-1c9c7d76.js.map +1 -0
  179. package/dist/esm-es5/cart-d00e1acb.js +2 -0
  180. package/dist/esm-es5/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  181. package/dist/esm-es5/{getBorderRadius-82fbaf25.js → getBorderRadius-e8ad5967.js} +2 -2
  182. package/dist/esm-es5/{isDarkColor-b21326ae.js → isDarkColor-3bb345f4.js} +2 -2
  183. package/dist/esm-es5/loader.js +1 -1
  184. package/dist/esm-es5/loader.js.map +1 -1
  185. package/dist/esm-es5/localization-1d92a557.js +2 -0
  186. package/dist/esm-es5/localization-1d92a557.js.map +1 -0
  187. package/dist/esm-es5/{submitGtag-fbdb454b.js → submitGtag-85914088.js} +2 -2
  188. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  189. package/dist/esm-es5/zonos-banner.entry.js +2 -0
  190. package/dist/esm-es5/zonos-banner.entry.js.map +1 -0
  191. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  192. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  193. package/dist/esm-es5/zonos-cart-items_10.entry.js.map +1 -1
  194. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  195. package/dist/esm-es5/zonos-checkout.entry.js.map +1 -1
  196. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  197. package/dist/esm-es5/zonos-controller.entry.js.map +1 -1
  198. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
  199. package/dist/esm-es5/zonos-country-flag_4.entry.js.map +1 -1
  200. package/dist/esm-es5/zonos-elements.js +1 -1
  201. package/dist/esm-es5/zonos-elements.js.map +1 -1
  202. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  203. package/dist/esm-es5/zonos-hello-dialog.entry.js.map +1 -1
  204. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  205. package/dist/esm-es5/zonos-hello.entry.js.map +1 -1
  206. package/dist/esm-es5/zonos-payment.entry.js +2 -0
  207. package/dist/esm-es5/zonos-payment.entry.js.map +1 -0
  208. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  209. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js.map +1 -1
  210. package/dist/esm-es5/zonosStore-1c9c7d76.js +2 -0
  211. package/dist/esm-es5/zonosStore-1c9c7d76.js.map +1 -0
  212. package/dist/scripts/loadZonos.js +86 -29
  213. package/dist/scripts/zonos.js +86 -29
  214. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +24 -1
  215. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +6 -0
  216. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  217. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  218. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  219. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  220. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  221. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  222. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  223. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  224. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  225. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  226. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  227. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  228. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  229. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  230. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  231. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  232. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  233. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  234. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  235. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  236. package/dist/types/components/store/zonosStore.d.ts +1 -1
  237. package/dist/types/components/utils/api/checkItemRestrictions.d.ts +22 -0
  238. package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +14 -0
  239. package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +2 -1
  240. package/dist/types/components/utils/hello/getProductsOnPage.d.ts +2 -0
  241. package/dist/types/components/utils/hello/setZonosCountryUrlParam.d.ts +2 -0
  242. package/dist/types/components.d.ts +12 -0
  243. package/dist/types/environment.d.ts +9 -0
  244. package/dist/types/scripts/zonos.d.ts +2 -0
  245. package/dist/types/types/generated/graphql.customer.types.d.ts +75 -1
  246. package/dist/types/types/generated/graphql.customer.types.ts +113 -1
  247. package/dist/types/types/hello/HelloConfig.d.ts +4 -0
  248. package/dist/types/types/hello/Product.d.ts +5 -0
  249. package/dist/types/types/hello/RestrictedItem.d.ts +6 -0
  250. package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
  251. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
  252. package/dist/zonos-elements/assets/InfoIcon.svg +1 -1
  253. package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
  254. package/dist/zonos-elements/assets/MessageIcon.svg +1 -1
  255. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  256. package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
  257. package/dist/zonos-elements/assets/bagIcon.svg +1 -1
  258. package/dist/zonos-elements/assets/messageIcon.svg +1 -1
  259. package/dist/zonos-elements/assets/moneyIcon.svg +1 -1
  260. package/dist/zonos-elements/assets/removeIcon.svg +1 -1
  261. package/dist/zonos-elements/cart-c641ddaf.system.js +2 -0
  262. package/dist/zonos-elements/{cart-9780fa28.system.js.map → cart-c641ddaf.system.js.map} +1 -1
  263. package/dist/{esm/cart-2f83e048.js → zonos-elements/cart-d00e1acb.js} +8 -8
  264. package/dist/zonos-elements/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  265. package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js → getBorderRadius-b59c3ada.system.js} +2 -2
  266. package/dist/{esm/getBorderRadius-82fbaf25.js → zonos-elements/getBorderRadius-e8ad5967.js} +2 -2
  267. package/dist/zonos-elements/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
  268. package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js → isDarkColor-231502d4.system.js} +2 -2
  269. package/dist/{esm/isDarkColor-b21326ae.js → zonos-elements/isDarkColor-3bb345f4.js} +2 -2
  270. package/dist/{esm/isDarkColor-b21326ae.js.map → zonos-elements/isDarkColor-3bb345f4.js.map} +1 -1
  271. package/dist/{esm/localization-4a424f49.js → zonos-elements/localization-1d92a557.js} +200 -13
  272. package/dist/zonos-elements/localization-1d92a557.js.map +1 -0
  273. package/dist/zonos-elements/localization-a6b6a5a5.system.js +2 -0
  274. package/dist/zonos-elements/localization-a6b6a5a5.system.js.map +1 -0
  275. package/dist/zonos-elements/submitGtag-764af8c4.system.js +2 -0
  276. package/dist/{esm/submitGtag-fbdb454b.js → zonos-elements/submitGtag-85914088.js} +3 -3
  277. package/dist/zonos-elements/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
  278. package/dist/zonos-elements/zonos-address_2.entry.js +5 -5
  279. package/dist/zonos-elements/zonos-address_2.system.entry.js +1 -1
  280. package/dist/zonos-elements/zonos-banner.entry.js +64 -0
  281. package/dist/zonos-elements/zonos-banner.entry.js.map +1 -0
  282. package/dist/zonos-elements/zonos-banner.system.entry.js +2 -0
  283. package/dist/zonos-elements/zonos-banner.system.entry.js.map +1 -0
  284. package/dist/zonos-elements/zonos-button_2.entry.js +3 -3
  285. package/dist/zonos-elements/zonos-button_2.system.entry.js +1 -1
  286. package/dist/zonos-elements/zonos-cart-items_10.entry.js +12 -12
  287. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +1 -1
  288. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +1 -1
  289. package/dist/zonos-elements/zonos-checkout.entry.js +9 -9
  290. package/dist/zonos-elements/zonos-checkout.system.entry.js +1 -1
  291. package/dist/zonos-elements/zonos-checkout.system.entry.js.map +1 -1
  292. package/dist/zonos-elements/zonos-controller.entry.js +6 -6
  293. package/dist/zonos-elements/zonos-controller.entry.js.map +1 -1
  294. package/dist/zonos-elements/zonos-controller.system.entry.js +1 -1
  295. package/dist/zonos-elements/zonos-controller.system.entry.js.map +1 -1
  296. package/dist/zonos-elements/zonos-country-flag_4.entry.js +6 -6
  297. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js +1 -1
  298. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js.map +1 -1
  299. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  300. package/dist/zonos-elements/zonos-elements.system.js +1 -1
  301. package/dist/zonos-elements/zonos-elements.system.js.map +1 -1
  302. package/dist/zonos-elements/zonos-hello-dialog.entry.js +12 -8
  303. package/dist/zonos-elements/zonos-hello-dialog.entry.js.map +1 -1
  304. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js +1 -1
  305. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js.map +1 -1
  306. package/dist/zonos-elements/zonos-hello.entry.js +237 -22
  307. package/dist/zonos-elements/zonos-hello.entry.js.map +1 -1
  308. package/dist/zonos-elements/zonos-hello.system.entry.js +1 -1
  309. package/dist/zonos-elements/zonos-hello.system.entry.js.map +1 -1
  310. package/dist/zonos-elements/zonos-payment.entry.js +56 -0
  311. package/dist/zonos-elements/zonos-payment.entry.js.map +1 -0
  312. package/dist/zonos-elements/zonos-payment.system.entry.js +2 -0
  313. package/dist/zonos-elements/zonos-payment.system.entry.js.map +1 -0
  314. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js +3 -3
  315. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js.map +1 -1
  316. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js +1 -1
  317. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js.map +1 -1
  318. package/dist/{esm/zonosStore-13a7b534.js → zonos-elements/zonosStore-1c9c7d76.js} +6 -22
  319. package/dist/zonos-elements/zonosStore-1c9c7d76.js.map +1 -0
  320. package/dist/zonos-elements/zonosStore-e5c545ea.system.js +2 -0
  321. package/dist/zonos-elements/zonosStore-e5c545ea.system.js.map +1 -0
  322. package/package.json +1 -1
  323. package/dist/cjs/localization-f6a1b679.js.map +0 -1
  324. package/dist/cjs/zonos-banner_2.cjs.entry.js +0 -120
  325. package/dist/cjs/zonos-banner_2.cjs.entry.js.map +0 -1
  326. package/dist/cjs/zonosStore-960e5542.js.map +0 -1
  327. package/dist/esm/localization-4a424f49.js.map +0 -1
  328. package/dist/esm/zonos-banner_2.entry.js +0 -115
  329. package/dist/esm/zonos-banner_2.entry.js.map +0 -1
  330. package/dist/esm/zonosStore-13a7b534.js.map +0 -1
  331. package/dist/esm-es5/cart-2f83e048.js +0 -2
  332. package/dist/esm-es5/localization-4a424f49.js +0 -2
  333. package/dist/esm-es5/localization-4a424f49.js.map +0 -1
  334. package/dist/esm-es5/zonos-banner_2.entry.js +0 -2
  335. package/dist/esm-es5/zonos-banner_2.entry.js.map +0 -1
  336. package/dist/esm-es5/zonosStore-13a7b534.js +0 -2
  337. package/dist/esm-es5/zonosStore-13a7b534.js.map +0 -1
  338. package/dist/zonos-elements/cart-9780fa28.system.js +0 -2
  339. package/dist/zonos-elements/localization-3c43290f.system.js +0 -2
  340. package/dist/zonos-elements/localization-3c43290f.system.js.map +0 -1
  341. package/dist/zonos-elements/localization-4a424f49.js.map +0 -1
  342. package/dist/zonos-elements/submitGtag-23ecdc20.system.js +0 -2
  343. package/dist/zonos-elements/zonos-banner_2.entry.js +0 -115
  344. package/dist/zonos-elements/zonos-banner_2.entry.js.map +0 -1
  345. package/dist/zonos-elements/zonos-banner_2.system.entry.js +0 -2
  346. package/dist/zonos-elements/zonos-banner_2.system.entry.js.map +0 -1
  347. package/dist/zonos-elements/zonosStore-13a7b534.js.map +0 -1
  348. package/dist/zonos-elements/zonosStore-77bcd7c0.system.js +0 -2
  349. package/dist/zonos-elements/zonosStore-77bcd7c0.system.js.map +0 -1
  350. /package/dist/esm-es5/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +0 -0
  351. /package/dist/esm-es5/{isDarkColor-b21326ae.js.map → isDarkColor-3bb345f4.js.map} +0 -0
  352. /package/dist/esm-es5/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +0 -0
  353. /package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js.map → getBorderRadius-b59c3ada.system.js.map} +0 -0
  354. /package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js.map → isDarkColor-231502d4.system.js.map} +0 -0
  355. /package/dist/zonos-elements/{submitGtag-23ecdc20.system.js.map → submitGtag-764af8c4.system.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"zonos-hello-dialog.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,++HAA++H;;MCoC9/H,gBAAgB;;;;IAqCnB,8BAAyB,GAAG,CAAC,CAAa;MAChD,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,I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AY,QACZ,OAAO,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GACtB,EAEf,IAAI,CAAC,iBAAiB,IACrB,eACE,4BACE,kBAAkB,EAAE,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GACpC,CACpB,KAEN,eACE,qBAAe,OAAO,EAAE,EAAE,IACxB,0BACE,KAAK,EAAC,2BAA2B,EACjC,WAAW,EAAE,mBAAmB,GACZ,EAEtB,qBAAe,OAAO,EAAE,CAAC,IACvB,kBAAY,IAAI,EAAC,eAAe,IAC7B,cAAc,CACJ,EACb,kBAAY,KAAK,EAAC,UAAU,IAAE,cAAc,CAAc,CAC5C,EAEhB,qBAAe,OAAO,EAAE,CAAC,IACvB,kBAAY,OAAO,EAAC,MAAM,IACxB,qBAAe,OAAO,EAAE,CAAC,IACvB,WAAK,KAAK,EAAC,qBAAqB,IAC9B,kBAAY,OAAO,EAAE,OAAO,GAAe,EAC3C,sBAAa,oBAAoB,CAAc,CAC3C,EAEN,WAAK,KAAK,EAAC,qBAAqB,IAC9B,kBAAY,OAAO,EAAE,SAAS,GAAe,EAC7C,sBAAa,mBAAmB,CAAc,CAC1C,CACQ,CACL,EAEZ,gBAAgB,CAAC,GAAG,CAAC,CAAC,KACrB,4BACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,CAAC,CAAC,OAAO,GACI,CACzB,CAAC,CACY,CACF,CACZ,CACP,CACG,EAEL,CAAC,IAAI,CAAC,iBAAiB,KACtB,iCACE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,oBAAoB,EAAE,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GACpC,CAC9B,CACG,CACD,EACP;GACH;;;;;;;;;;","names":[],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n text-align: center;\n z-index: 1001;\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-8;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={8}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-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AO,GAAe,EAC3C,sBAAa,oBAAoB,CAAc,CAC3C,EAEN,WAAK,KAAK,EAAC,qBAAqB,IAC9B,kBAAY,OAAO,EAAE,SAAS,GAAe,EAC7C,sBAAa,mBAAmB,CAAc,CAC1C,CACQ,CACL,EAEZ,gBAAgB,CAAC,GAAG,CAAC,CAAC,KACrB,4BACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,CAAC,CAAC,OAAO,GACI,CACzB,CAAC,CACY,CACF,CACZ,CACP,CACG,EAEL,CAAC,IAAI,CAAC,iBAAiB,KACtB,iCACE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,oBAAoB,EAAE,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GACpC,CAC9B,CACG,CACD,EACP;GACH;;;;;;;;;;","names":[],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n z-index: 1001;\n\n .zonos--hello-dialog-header {\n text-align: center;\n }\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-12;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\nimport type { RestrictedItem } from 'src/types/hello/RestrictedItem';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n /**\n * Item restrictions array if any\n * @default []\n */\n @Prop() restrictedItems: RestrictedItem[] = [];\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack class=\"zonos--hello-dialog-header\" spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n {this.restrictedItems.map(\n item =>\n item && (\n <zonos-banner bannerTitle={item.name} intent=\"error\">\n {item.itemRestrictions?.map(x => (\n <zonos-text color=\"red-800\">{x?.note}</zonos-text>\n ))}\n </zonos-banner>\n ),\n )}\n\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={12}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-footer>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-d1aa9293.js';
2
- import { _ as _root, i as isObjectLike_1, e as _baseGetTag, f as isObject_1, z as zonosStore, m as mergeConfig } from './zonosStore-13a7b534.js';
3
- import { t as translate, a as localizationStore, e as currencyDisplay, f as currencyConvertAndFormat, g as currencyConvert, j as currencyFormat, l as log } from './localization-4a424f49.js';
2
+ import { _ as _root, i as isObjectLike_1, e as _baseGetTag, f as isObject_1, z as zonosStore, m as mergeConfig } from './zonosStore-1c9c7d76.js';
3
+ import { h as handleFetch, b as logError, a as localizationStore, i as isValidSelector, t as translate, s as setZonosCountryUrlParam, e as currencyDisplay, f as currencyConvertAndFormat, g as currencyConvert, j as currencyFormat, l as log } from './localization-1d92a557.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-feba1ae2.js';
6
6
 
@@ -340,12 +340,131 @@ function debounce(func, wait, options) {
340
340
 
341
341
  var debounce_1 = debounce;
342
342
 
343
- const zonosHelloCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:0}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:0}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;width:100%;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--amino-text-color);position:absolute;background:var(--amino-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-16);padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";
343
+ const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
344
+ var _a;
345
+ const url = `${"https://v1.route.js.zonos.com"}/api/check-item-restrictions`;
346
+ const body = {
347
+ items,
348
+ shipFrom,
349
+ shipTo,
350
+ };
351
+ const { errors, json } = await handleFetch(url, { body, method: 'POST' });
352
+ if (errors.length || !json) {
353
+ logError(`Error fetching item restrictions: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
354
+ return [];
355
+ }
356
+ return json.filter(Boolean);
357
+ };
358
+
359
+ const detectItemRestrictions = async (newProducts) => {
360
+ if (!newProducts.length) {
361
+ return [];
362
+ }
363
+ const { selectedCountryCode } = localizationStore;
364
+ if (!selectedCountryCode) {
365
+ logError('Hello Could not check item restrictions - No country code selected');
366
+ return [];
367
+ }
368
+ const items = newProducts.map(product => ({
369
+ description: product.description,
370
+ name: product.title,
371
+ }));
372
+ const restrictedItems = await checkItemRestrictions({
373
+ items: items,
374
+ shipFrom: 'AD',
375
+ shipTo: selectedCountryCode,
376
+ });
377
+ const restrictedItemsWithName = restrictedItems.map(item => {
378
+ var _a;
379
+ const name = ((_a = items.filter(x => x.description === item.itemDescription).find(Boolean)) === null || _a === void 0 ? void 0 : _a.name) || '';
380
+ return Object.assign(Object.assign({}, item), { name });
381
+ });
382
+ return restrictedItemsWithName;
383
+ };
384
+
385
+ const getCurrentHelloLocalePage = () => {
386
+ const { href } = window.location;
387
+ const { cartUrlPattern, homepageUrlPattern, productDetailUrlPattern, productListUrlPattern, } = zonosStore.helloSettings;
388
+ // The 'if' statements are sorted by most specific to least specific to help with regex matching
389
+ if (cartUrlPattern && new RegExp(cartUrlPattern).test(href)) {
390
+ return 'cart';
391
+ }
392
+ if (productDetailUrlPattern &&
393
+ new RegExp(productDetailUrlPattern).test(href)) {
394
+ return 'productDetail';
395
+ }
396
+ if (productListUrlPattern && new RegExp(productListUrlPattern).test(href)) {
397
+ return 'productList';
398
+ }
399
+ if (homepageUrlPattern && new RegExp(homepageUrlPattern).test(href)) {
400
+ return 'home';
401
+ }
402
+ return '';
403
+ };
404
+
405
+ const getProductsOnPage = () => {
406
+ var _a, _b;
407
+ const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.helloSettings;
408
+ if (!productTitleElementSelector || !productDescriptionElementSelector) {
409
+ logError(`Hello Could not check item restrictions - must provide title and description selectors.`);
410
+ }
411
+ const titleNodes = (productTitleElementSelector &&
412
+ isValidSelector(productTitleElementSelector) &&
413
+ document.querySelectorAll(productTitleElementSelector)) ||
414
+ [];
415
+ const descriptionNodes = (productDescriptionElementSelector &&
416
+ isValidSelector(productDescriptionElementSelector) &&
417
+ document.querySelectorAll(productDescriptionElementSelector)) ||
418
+ [];
419
+ if (titleNodes.length !== descriptionNodes.length) {
420
+ // If the title and description selectors don't match, kill item restrictions altogether
421
+ logError('Hello Could not check item restrictions - Title and description selectors do not match');
422
+ return [];
423
+ }
424
+ const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
425
+ const cartButtonNodes = (shouldDisableCart &&
426
+ productAddToCartElementSelector &&
427
+ isValidSelector(productAddToCartElementSelector) &&
428
+ document.querySelectorAll(productAddToCartElementSelector)) ||
429
+ [];
430
+ if (shouldDisableCart && cartButtonNodes.length !== descriptionNodes.length) {
431
+ // If the "add to cart" selectors don't match, log the error and continue
432
+ logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');
433
+ }
434
+ const mergedElements = [];
435
+ for (let i = 0; i < titleNodes.length; i++) {
436
+ const titleNode = titleNodes[i];
437
+ const descriptionNode = descriptionNodes[i];
438
+ const cartButtonNode = cartButtonNodes[i];
439
+ if (titleNode && descriptionNode) {
440
+ const element = {
441
+ cartButtonNode: cartButtonNode || null,
442
+ description: ((_a = descriptionNode.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '',
443
+ title: ((_b = titleNode.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || '',
444
+ };
445
+ mergedElements.push(element);
446
+ }
447
+ }
448
+ return mergedElements;
449
+ };
344
450
 
451
+ const zonosHelloCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;width:100%;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--amino-text-color);position:absolute;background:var(--amino-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--amino-red-100);color:var(--amino-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-16);padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";
452
+
453
+ const PEEK_MESSAGE_DELAY_MS = 3000;
454
+ const RESIZE_DEBOUNCE_DELAY_MS = 500;
345
455
  const ZonosHello = class {
346
456
  constructor(hostRef) {
347
457
  registerInstance(this, hostRef);
348
458
  this.getHelloPeekMessage = () => {
459
+ const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
460
+ zonosStore.currentHelloPage === 'productList';
461
+ if (isRestrictionPage && this.allRestrictedItems.length) {
462
+ const clickMessage = translate('click to learn more');
463
+ const restrictMessage = zonosStore.currentHelloPage === 'productDetail'
464
+ ? translate('Restricted item')
465
+ : translate('Restricted items found');
466
+ return `${restrictMessage} - ${clickMessage}`;
467
+ }
349
468
  switch (zonosStore.currentHelloPage) {
350
469
  case 'cart':
351
470
  return translate(`Prepay duties and taxes at checkout`);
@@ -361,16 +480,116 @@ const ZonosHello = class {
361
480
  this.showPeekMessage = true;
362
481
  }
363
482
  };
483
+ this.getNewItemRestrictions = async (newProducts) => {
484
+ const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
485
+ zonosStore.currentHelloPage === 'productList';
486
+ // Only run detectItemRestrictions on product pages if the restrictionBehavior is not DISABLED
487
+ if (!isRestrictionPage ||
488
+ zonosStore.helloSettings.restrictionBehavior === 'DISABLED') {
489
+ return [];
490
+ }
491
+ const newRestrictions = await detectItemRestrictions(newProducts);
492
+ return newRestrictions;
493
+ };
494
+ this.triggerShowPeekMessage = () => {
495
+ this.peekMessage = this.getHelloPeekMessage();
496
+ const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;
497
+ // peek message delay is passed in seconds, but setTimeout expects milliseconds
498
+ const peekMessageDelayToUse = peekMessageDelay * 1000;
499
+ if (peekMessageBehavior === 'ENABLED') {
500
+ setTimeout(() => {
501
+ this.enableShowPeekMessage();
502
+ setTimeout(() => {
503
+ this.showPeekMessage = false;
504
+ }, PEEK_MESSAGE_DELAY_MS);
505
+ }, peekMessageDelayToUse);
506
+ }
507
+ };
508
+ this.disableAddToCartButtons = () => {
509
+ // Remove disabled attribute from all "add to cart" buttons
510
+ if (this.productsOnPage.length) {
511
+ this.productsOnPage.forEach(product => {
512
+ var _a, _b;
513
+ const isRestricted = this.allRestrictedItems.some(item => item.itemDescription === product.description);
514
+ // if a product description matches a restrictedItems itemDescription, then disable the add to cart button. Otherwise, enable it.
515
+ if (isRestricted) {
516
+ (_a = product.cartButtonNode) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'disabled');
517
+ }
518
+ else {
519
+ (_b = product.cartButtonNode) === null || _b === void 0 ? void 0 : _b.removeAttribute('disabled');
520
+ }
521
+ });
522
+ }
523
+ };
524
+ this.handleItemRestrictions = async () => {
525
+ this.productsOnPage = getProductsOnPage();
526
+ const newProducts = this.productsOnPage.filter(product => !this.allFoundProducts.some(foundProduct => foundProduct.title === product.title));
527
+ const newRestrictions = await this.getNewItemRestrictions(newProducts);
528
+ this.allRestrictedItems.push(...newRestrictions);
529
+ this.allFoundProducts.push(...newProducts);
530
+ this.disableAddToCartButtons();
531
+ };
532
+ this.reloadHelloData = async () => {
533
+ await this.handleItemRestrictions();
534
+ this.triggerShowPeekMessage();
535
+ void this.displayCurrency();
536
+ };
537
+ this.handleProductCountChange = debounce_1(() => {
538
+ const { productTitleElementSelector } = zonosStore.helloSettings;
539
+ if (productTitleElementSelector) {
540
+ const allProductsOnPage = getProductsOnPage();
541
+ if (this.allFoundProducts.length !== allProductsOnPage.length &&
542
+ window.location.href === this.initialUrl) {
543
+ // if allFoundProducts length is 0 (first render or no products), kill item restriction process as initial restrictions are handled in updateHelloOnPageChange
544
+ if (!this.allFoundProducts.length) {
545
+ return;
546
+ }
547
+ void this.reloadHelloData();
548
+ }
549
+ }
550
+ }, 1000);
551
+ this.watchProductCountChange = () => {
552
+ const observer = new MutationObserver(this.handleProductCountChange);
553
+ observer.observe(document.body, {
554
+ childList: true,
555
+ subtree: true,
556
+ });
557
+ };
558
+ this.updateHelloOnPageChange = () => {
559
+ // If the product count changes on the same url (loading more products), update the peek message and item restrictions
560
+ this.watchProductCountChange();
561
+ // Check url change on interval. If changed, update the peek message and item restrictions
562
+ setInterval(() => {
563
+ if (window.location.href !== this.initialUrl) {
564
+ const prevUrl = this.initialUrl && new URL(this.initialUrl);
565
+ const initialZonosCountry = prevUrl && prevUrl.searchParams.get('zonosCountry');
566
+ // If the zonosCountry url param changes, reset current item restriction tracking
567
+ if (initialZonosCountry !== localizationStore.selectedCountryCode) {
568
+ this.allFoundProducts = [];
569
+ this.allRestrictedItems = [];
570
+ this.productsOnPage = [];
571
+ }
572
+ this.initialUrl = window.location.href;
573
+ zonosStore.currentHelloPage = getCurrentHelloLocalePage();
574
+ const currentUrl = new URL(window.location.href);
575
+ const zonosCountry = currentUrl.searchParams.get('zonosCountry');
576
+ if (!zonosCountry) {
577
+ setZonosCountryUrlParam(localizationStore.selectedCountryCode);
578
+ return;
579
+ }
580
+ void this.reloadHelloData();
581
+ }
582
+ }, 1000);
583
+ };
364
584
  this.changeShowDialog = (value) => {
365
585
  this.showDialog = value;
366
586
  };
367
587
  this.shouldAnimateLeftDesktop = () => {
368
- // Get element position (relative = desktop, fixed = mobile)
588
+ // Get Hello position (relative = desktop, fixed = mobile)
369
589
  const elPosition = this.helloRef && getComputedStyle(this.helloRef).position;
370
590
  // If relative position, determine if peek message should animate left or right. Mobile is pre-determined.
371
591
  if (this.helloRef && elPosition === 'relative') {
372
592
  const hasMoreSpaceOnRight = getHasMoreSpaceOnRight(this.helloRef);
373
- // Determine peek message direction
374
593
  return hasMoreSpaceOnRight;
375
594
  }
376
595
  };
@@ -381,26 +600,19 @@ const ZonosHello = class {
381
600
  this.zonosStoreHelloSettings = zonosStore.helloSettings;
382
601
  this.showDialog = false;
383
602
  this.peekMessage = '';
603
+ this.initialUrl = '';
604
+ this.allRestrictedItems = [];
605
+ this.allFoundProducts = [];
606
+ this.productsOnPage = [];
384
607
  }
385
- componentDidLoad() {
386
- const initInterval = setInterval(() => {
608
+ componentWillLoad() {
609
+ const initInterval = setInterval(async () => {
387
610
  if (!this.helloRef) {
388
611
  return;
389
612
  }
390
613
  if (zonosStore.loadedConfig) {
391
614
  this.helloRef.setAttribute('data-zonos-hello-loaded', '');
392
- this.peekMessage = this.getHelloPeekMessage();
393
- const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;
394
- // peek message delay is passed in seconds, but setTimeout expects milliseconds
395
- const peekMessageDelayToUse = peekMessageDelay * 1000;
396
- if (peekMessageBehavior === 'ENABLED') {
397
- setTimeout(() => {
398
- this.enableShowPeekMessage();
399
- setTimeout(() => {
400
- this.showPeekMessage = false;
401
- }, 3000);
402
- }, peekMessageDelayToUse);
403
- }
615
+ this.updateHelloOnPageChange();
404
616
  clearInterval(initInterval);
405
617
  }
406
618
  }, 100);
@@ -439,10 +651,10 @@ const ZonosHello = class {
439
651
  currencyFormat(value);
440
652
  }
441
653
  handleResize() {
442
- debounce_1(this.render.bind(this), 500);
654
+ debounce_1(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
443
655
  }
444
656
  render() {
445
- var _a;
657
+ var _a, _b;
446
658
  const isExcludedUrl = (_a = zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
447
659
  if (isExcludedUrl) {
448
660
  log('Hello is excluded on this url', 'warn');
@@ -458,6 +670,7 @@ const ZonosHello = class {
458
670
  const isOnTop = mobileLocation.includes('TOP');
459
671
  const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride);
460
672
  const { theme } = appearanceSettings;
673
+ const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
461
674
  return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, selectedCountryCode && (h("div", { class: "zonos--hello-wrapper" }, h("button", { class: classes([
462
675
  'zonos--hello-widget',
463
676
  this.showPeekMessage && 'zonos--hello-show-peek-message',
@@ -465,13 +678,15 @@ const ZonosHello = class {
465
678
  isOnLeft &&
466
679
  'zonos--hello-widget-left zonos--hello-widget-animate-from-left',
467
680
  isOnTop && 'zonos--hello-widget-top',
681
+ !!this.allRestrictedItems.length &&
682
+ 'zonos--hello-has-restrictions',
468
683
  ]), onClick: () => {
469
684
  this.changeShowDialog(!this.showDialog);
470
685
  }, onMouseEnter: () => this.enableShowPeekMessage(), onMouseLeave: () => (this.showPeekMessage = false), ref: el => el && (this.helloRef = el) }, h("span", { class: "zonos--hello-message" }, this.peekMessage), selectedCountryCode && (h("div", { class: "zonos--hello-country-flag-wrapper" }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode })))), h("div", { class: classes([
471
686
  'zonos--hello-dialog-wrapper',
472
687
  this.mobileLocationOverride &&
473
688
  'zonos--hello-dialog-wrapper-mobile-override',
474
- ]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, setIsOpen: this.changeShowDialog }))))));
689
+ ]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, restrictedItems: restrictedItemsOnPage, setIsOpen: this.changeShowDialog }))))));
475
690
  }
476
691
  };
477
692
  ZonosHello.style = zonosHelloCss;