@zonos/elements 1.3.40 → 1.3.42

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 (247) hide show
  1. package/dist/cjs/{cart-775440b7.js → cart-99a1ed87.js} +67 -10
  2. package/dist/cjs/{getBorderRadius-9ae7890c.js → getBorderRadius-4413e191.js} +1 -1
  3. package/dist/cjs/{index-ef8b2c76.js → index-d56e0a8b.js} +9 -3
  4. package/dist/cjs/index.cjs.js +21 -7
  5. package/dist/cjs/{isDarkColor-5f56770b.js → isDarkColor-4eb96a1e.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/{paypal-25c84e33.js → paypal-5509a76f.js} +3 -3
  8. package/dist/cjs/{sendErrorLog-7818b288.js → sendErrorLog-21996939.js} +2 -2
  9. package/dist/cjs/zonos-address_8.cjs.entry.js +10 -10
  10. package/dist/cjs/zonos-badge_2.cjs.entry.js +4 -4
  11. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
  13. package/dist/cjs/zonos-card.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +10 -10
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +7 -7
  16. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  18. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  19. package/dist/cjs/{zonos-country-select_3.cjs.entry.js → zonos-country-select_4.cjs.entry.js} +100 -14
  20. package/dist/cjs/zonos-elements.cjs.js +2 -2
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
  22. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  23. package/dist/cjs/zonos-input.cjs.entry.js +7 -7
  24. package/dist/cjs/zonos-language-select_2.cjs.entry.js +9 -9
  25. package/dist/cjs/zonos-link.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-notification_3.cjs.entry.js +8 -8
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  30. package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
  31. package/dist/cjs/{zonosStore-b6c72408.js → zonosStore-56401fdb.js} +1 -1
  32. package/dist/collection/collection-manifest.json +1 -0
  33. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -0
  34. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +14 -4
  35. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  36. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  37. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  38. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  39. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  40. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  41. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  42. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  43. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  44. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  45. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.css +46 -0
  46. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +177 -0
  47. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  48. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +6 -1
  49. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  50. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  51. package/dist/collection/components/main/zonos-controller.js +1 -1
  52. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  53. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
  54. package/dist/collection/components/store/translationStore/strings.base.js +3 -0
  55. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
  56. package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
  57. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
  58. package/dist/collection/components/store/translationStore/strings.french.js +3 -0
  59. package/dist/collection/components/store/translationStore/strings.german.js +3 -0
  60. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
  61. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
  62. package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
  63. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
  64. package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
  65. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
  66. package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
  67. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
  68. package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
  69. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
  70. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
  71. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
  72. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
  73. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  74. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  75. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  76. package/dist/collection/components/utils/handleFetch.js +0 -6
  77. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +4 -1
  78. package/dist/collection/environment.js +6 -0
  79. package/dist/collection/scripts/_getNextFallbackUrl.js +1 -1
  80. package/dist/collection/scripts/_getZonosQaUrl.js +12 -1
  81. package/dist/collection/scripts/_zonosBase.js +4 -1
  82. package/dist/esm/{cart-e9cd8286.js → cart-bc217300.js} +67 -10
  83. package/dist/esm/{getBorderRadius-3c75c4c1.js → getBorderRadius-3ba98361.js} +1 -1
  84. package/dist/esm/{index-5a37ccde.js → index-86b8247e.js} +9 -3
  85. package/dist/esm/index.js +21 -7
  86. package/dist/esm/{isDarkColor-3eb31a6d.js → isDarkColor-3119e351.js} +1 -1
  87. package/dist/esm/loader.js +3 -3
  88. package/dist/esm/{paypal-da2b3db1.js → paypal-fa96e7c3.js} +3 -3
  89. package/dist/esm/{sendErrorLog-2fcf78a2.js → sendErrorLog-c40b553a.js} +2 -2
  90. package/dist/esm/zonos-address_8.entry.js +10 -10
  91. package/dist/esm/zonos-badge_2.entry.js +4 -4
  92. package/dist/esm/zonos-banner.entry.js +2 -2
  93. package/dist/esm/zonos-button_3.entry.js +4 -4
  94. package/dist/esm/zonos-card.entry.js +3 -3
  95. package/dist/esm/zonos-cart-items_12.entry.js +10 -10
  96. package/dist/esm/zonos-checkout.entry.js +7 -7
  97. package/dist/esm/zonos-component.entry.js +2 -2
  98. package/dist/esm/zonos-controller.entry.js +6 -6
  99. package/dist/esm/zonos-country-flag.entry.js +5 -5
  100. package/dist/esm/{zonos-country-select_3.entry.js → zonos-country-select_4.entry.js} +100 -15
  101. package/dist/esm/zonos-elements.js +3 -3
  102. package/dist/esm/zonos-hello-dialog.entry.js +9 -9
  103. package/dist/esm/zonos-hello.entry.js +5 -5
  104. package/dist/esm/zonos-input.entry.js +7 -7
  105. package/dist/esm/zonos-language-select_2.entry.js +9 -9
  106. package/dist/esm/zonos-link.entry.js +2 -2
  107. package/dist/esm/zonos-logo.entry.js +4 -4
  108. package/dist/esm/zonos-notification_3.entry.js +8 -8
  109. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  110. package/dist/esm/zonos-text.entry.js +2 -2
  111. package/dist/esm/zonos-v-stack.entry.js +4 -4
  112. package/dist/esm/{zonosStore-425abc1b.js → zonosStore-8fc9ceb2.js} +1 -1
  113. package/dist/esm-es5/cart-bc217300.js +1 -0
  114. package/dist/esm-es5/{getBorderRadius-3c75c4c1.js → getBorderRadius-3ba98361.js} +1 -1
  115. package/dist/esm-es5/{index-5a37ccde.js → index-86b8247e.js} +2 -2
  116. package/dist/esm-es5/index.js +1 -1
  117. package/dist/esm-es5/{isDarkColor-3eb31a6d.js → isDarkColor-3119e351.js} +1 -1
  118. package/dist/esm-es5/loader.js +1 -1
  119. package/dist/esm-es5/{paypal-da2b3db1.js → paypal-fa96e7c3.js} +1 -1
  120. package/dist/esm-es5/{sendErrorLog-2fcf78a2.js → sendErrorLog-c40b553a.js} +1 -1
  121. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  122. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  123. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  124. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  125. package/dist/esm-es5/zonos-card.entry.js +1 -1
  126. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  127. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  128. package/dist/esm-es5/zonos-component.entry.js +1 -1
  129. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  130. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  131. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -0
  132. package/dist/esm-es5/zonos-elements.js +1 -1
  133. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  134. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  135. package/dist/esm-es5/zonos-input.entry.js +1 -1
  136. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  137. package/dist/esm-es5/zonos-link.entry.js +1 -1
  138. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  139. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  140. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  141. package/dist/esm-es5/zonos-text.entry.js +1 -1
  142. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  143. package/dist/esm-es5/{zonosStore-425abc1b.js → zonosStore-8fc9ceb2.js} +1 -1
  144. package/dist/scripts/index.d.ts +141 -52
  145. package/dist/scripts/index.js +1 -1
  146. package/dist/scripts/loadZonos.js +1 -1
  147. package/dist/scripts/zonos.js +1 -1
  148. package/dist/types/components/common/zonos-virtual-scroll/zonos-virtual-scroll.d.ts +32 -0
  149. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +2 -1
  150. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
  151. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
  152. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
  153. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
  154. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
  155. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
  156. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
  157. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
  158. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
  159. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
  160. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
  161. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
  162. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
  163. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
  164. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
  165. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
  166. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
  167. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
  168. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
  169. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
  170. package/dist/types/components/store/translationStore.d.ts +1 -1
  171. package/dist/types/components.d.ts +82 -1
  172. package/dist/types/environment.d.ts +4 -0
  173. package/dist/types/scripts/_getNextFallbackUrl.d.ts +3 -3
  174. package/dist/types/types/LogLoadScriptRequestBody.d.ts +1 -1
  175. package/dist/zonos-elements/index.esm.js +1 -1
  176. package/dist/zonos-elements/{p-5f68f356.system.entry.js → p-0229282c.system.entry.js} +1 -1
  177. package/dist/zonos-elements/{p-92bebe7a.js → p-04054425.js} +1 -1
  178. package/dist/zonos-elements/{p-f98f7066.js → p-1041cbd0.js} +1 -1
  179. package/dist/zonos-elements/{p-2c03ac78.system.entry.js → p-14067782.system.entry.js} +1 -1
  180. package/dist/zonos-elements/p-16dd23e1.entry.js +1 -0
  181. package/dist/zonos-elements/{p-1daa3b1e.system.entry.js → p-1e4f7997.system.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-3d98f422.system.entry.js → p-211e3529.system.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-dc6a17fe.system.entry.js → p-23748211.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-6897be29.entry.js → p-23fd4673.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-efdc7748.entry.js → p-25633055.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-916adba7.entry.js → p-29ed14b8.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-36df9785.entry.js → p-2cc469c3.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-fa02dd07.system.entry.js → p-35679ed2.system.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-c5a5512a.system.entry.js → p-3b1ea7c8.system.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-b2007124.system.js → p-40c21634.system.js} +1 -1
  191. package/dist/zonos-elements/{p-e6efc2e1.system.entry.js → p-4f454a91.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-bfa5ec2b.entry.js → p-5230520c.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-da15b587.system.entry.js → p-52947dab.system.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-3da1bc42.js → p-52fb6876.js} +1 -1
  195. package/dist/zonos-elements/{p-d95cb86a.system.js → p-539974db.system.js} +1 -1
  196. package/dist/zonos-elements/{p-15ecad81.entry.js → p-558486eb.entry.js} +1 -1
  197. package/dist/zonos-elements/p-5b7da777.js +2 -0
  198. package/dist/zonos-elements/{p-54971a77.system.js → p-668fb530.system.js} +1 -1
  199. package/dist/zonos-elements/p-68bb8de4.entry.js +1 -0
  200. package/dist/zonos-elements/{p-890f5788.js → p-6ac72711.js} +1 -1
  201. package/dist/zonos-elements/{p-01bd2187.system.entry.js → p-6bb0b7d2.system.entry.js} +1 -1
  202. package/dist/zonos-elements/{p-d9d5ee2f.entry.js → p-6de38759.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-d46fa40a.entry.js → p-706d2bad.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-61842b4f.system.entry.js → p-717028a2.system.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-14b53e8f.system.entry.js → p-7338ea95.system.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-ca58f16e.system.entry.js → p-73c56565.system.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-8d149b99.entry.js → p-7a902328.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-c55a5fe4.system.entry.js → p-7d67bbb8.system.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-1b499bcc.system.js → p-8809964a.system.js} +1 -1
  210. package/dist/zonos-elements/{p-54101ed6.entry.js → p-8b01aafb.entry.js} +1 -1
  211. package/dist/zonos-elements/p-90f517f5.js +1 -0
  212. package/dist/zonos-elements/{p-f643035f.entry.js → p-9220f63d.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-3496183d.entry.js → p-9420f9db.entry.js} +1 -1
  214. package/dist/zonos-elements/p-98a0fda1.system.js +1 -0
  215. package/dist/zonos-elements/{p-5e55dcbc.entry.js → p-9a319774.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-657be9e9.entry.js → p-9d1f13c2.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-5a5d1a12.system.entry.js → p-9eadd9a7.system.entry.js} +1 -1
  218. package/dist/zonos-elements/p-a0581551.system.js +1 -0
  219. package/dist/zonos-elements/{p-70b024ad.system.entry.js → p-a3e2592b.system.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-3447ef24.system.js → p-a8a94872.system.js} +1 -1
  221. package/dist/zonos-elements/{p-e252d86f.entry.js → p-a9ae78e3.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-445fb353.system.entry.js → p-c0aec0ca.system.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-97dadd90.system.entry.js → p-c4bb2949.system.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-fa95c3dc.entry.js → p-c7301a88.entry.js} +1 -1
  225. package/dist/zonos-elements/p-c78dd680.system.js +1 -0
  226. package/dist/zonos-elements/p-d27489bb.system.entry.js +1 -0
  227. package/dist/zonos-elements/{p-7f96d3b4.entry.js → p-dc368ad5.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-71037fe5.entry.js → p-e07bf9ea.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-2bfb5e4b.system.entry.js → p-e8f7fb29.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-c87113fb.system.entry.js → p-f59666e6.system.entry.js} +1 -1
  231. package/dist/zonos-elements/{p-d6135575.js → p-f97ffbfb.js} +1 -1
  232. package/dist/zonos-elements/{p-3b6a7200.entry.js → p-fc2676e3.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-b55b557a.system.js → p-fd061229.system.js} +2 -2
  234. package/dist/zonos-elements/zonos-elements.css +1 -1
  235. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  236. package/dist/zonos-elements/zonos-elements.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/esm-es5/cart-e9cd8286.js +0 -1
  239. package/dist/esm-es5/zonos-country-select_3.entry.js +0 -1
  240. package/dist/zonos-elements/p-1debb7b2.entry.js +0 -1
  241. package/dist/zonos-elements/p-3996d025.system.js +0 -1
  242. package/dist/zonos-elements/p-6f39051c.system.entry.js +0 -1
  243. package/dist/zonos-elements/p-7dd54a63.entry.js +0 -1
  244. package/dist/zonos-elements/p-800db524.system.js +0 -1
  245. package/dist/zonos-elements/p-94279862.system.js +0 -1
  246. package/dist/zonos-elements/p-dd61b7a0.js +0 -2
  247. package/dist/zonos-elements/p-fb63bd03.js +0 -1
@@ -0,0 +1,177 @@
1
+ import { h, Host } from "@stencil/core";
2
+ /**
3
+ * The idea is from
4
+ * @ref https://github.com/beenotung/stencil-virtual-scroll/blob/master/src/components/virtual-scroll-list/virtual-scroll-list.scss
5
+ * @ref https://github.dev/ionic-team/ionic-framework/blob/v6.7.5/core/src/components/virtual-scroll/virtual-scroll.tsx
6
+ */
7
+ export class ZonosVirtualScroll {
8
+ constructor() {
9
+ this.scrollListener = (_ev) => {
10
+ this.scrollTop = this.ele.scrollTop;
11
+ };
12
+ this.container = undefined;
13
+ this.renderItem = undefined;
14
+ this.itemWidth = undefined;
15
+ this.fallbackItemHeight = undefined;
16
+ this.itemHeights = undefined;
17
+ this.scrollTop = 0;
18
+ this.totalHeight = 1;
19
+ }
20
+ updateTotalHeight() {
21
+ this.totalHeight = this.itemHeights.reduce((acc, height) => acc + (height || this.fallbackItemHeight), 0);
22
+ }
23
+ connectedCallback() {
24
+ this.ele.addEventListener('scroll', this.scrollListener);
25
+ this.updateTotalHeight();
26
+ }
27
+ disconnectedCallback() {
28
+ this.ele.removeEventListener('scroll', this.scrollListener);
29
+ }
30
+ render() {
31
+ const W = this.ele.clientWidth;
32
+ const H = this.ele.clientHeight;
33
+ const heights = this.itemHeights;
34
+ const fallbackItemHeight = this.fallbackItemHeight;
35
+ const N = this.itemHeights.length;
36
+ const scrollTop = this.scrollTop;
37
+ const children = [];
38
+ let accHeight = 0;
39
+ // buffer for pre-rendering for item outside of viewport
40
+ const buffer = 100;
41
+ for (let i = 0; i < N; i++) {
42
+ const itemHeight = heights[i] || fallbackItemHeight;
43
+ if (scrollTop > accHeight + itemHeight + buffer) {
44
+ accHeight += itemHeight;
45
+ continue; // this item is above the viewport
46
+ }
47
+ if (scrollTop + H < accHeight - buffer) {
48
+ break; // this item is below the viewport
49
+ }
50
+ const x = 0;
51
+ const y = accHeight;
52
+ children.push(h("div", { class: "item", style: {
53
+ height: `${itemHeight}px`,
54
+ transform: `translate(${x}px,${y}px)`,
55
+ width: this.itemWidth ? `${this.itemWidth}px` : `${W}px`,
56
+ } }, this.renderItem(i)));
57
+ accHeight += itemHeight;
58
+ }
59
+ return (h(Host, { key: '6faa73cacfefee42781f87e6f697980941139d12' }, h("div", { key: '5411c13934b8b997f68bc6678e6e1c475d6d453c',
60
+ // to capture scroll action
61
+ class: "scroller", style: {
62
+ height: `${this.totalHeight}px`,
63
+ width: `${W}px`,
64
+ } }), h("div", { key: '46c402a5a0df3242b9022e16b15d5e348210bc32',
65
+ // to display items
66
+ class: "item-container", ref: el => (this.container = el), style: {
67
+ height: `${this.totalHeight}px`,
68
+ left: `${-W}px`,
69
+ } }, children)));
70
+ }
71
+ static get is() { return "zonos-virtual-scroll"; }
72
+ static get encapsulation() { return "scoped"; }
73
+ static get originalStyleUrls() {
74
+ return {
75
+ "$": ["zonos-virtual-scroll.scss"]
76
+ };
77
+ }
78
+ static get styleUrls() {
79
+ return {
80
+ "$": ["zonos-virtual-scroll.css"]
81
+ };
82
+ }
83
+ static get properties() {
84
+ return {
85
+ "renderItem": {
86
+ "type": "unknown",
87
+ "mutable": false,
88
+ "complexType": {
89
+ "original": "(\n itemIndex: number,\n ) =>\n | HTMLElement\n | Promise<HTMLElement>\n | HTMLElement[]\n | Promise<HTMLElement[]>\n | Promise<HTMLElement>[]",
90
+ "resolved": "(itemIndex: number) => HTMLElement | HTMLElement[] | Promise<HTMLElement> | Promise<HTMLElement[]> | Promise<HTMLElement>[]",
91
+ "references": {
92
+ "HTMLElement": {
93
+ "location": "global",
94
+ "id": "global::HTMLElement"
95
+ },
96
+ "Promise": {
97
+ "location": "global",
98
+ "id": "global::Promise"
99
+ }
100
+ }
101
+ },
102
+ "required": true,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": "Render item"
107
+ }
108
+ },
109
+ "itemWidth": {
110
+ "type": "number",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "number",
114
+ "resolved": "number | undefined",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": true,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "Width of each item"
122
+ },
123
+ "attribute": "item-width",
124
+ "reflect": false
125
+ },
126
+ "fallbackItemHeight": {
127
+ "type": "number",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "number",
131
+ "resolved": "number",
132
+ "references": {}
133
+ },
134
+ "required": true,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Height that is used as a fallback if height is not provided"
139
+ },
140
+ "attribute": "fallback-item-height",
141
+ "reflect": false
142
+ },
143
+ "itemHeights": {
144
+ "type": "unknown",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "number[]",
148
+ "resolved": "number[]",
149
+ "references": {}
150
+ },
151
+ "required": true,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": "Heights list of each item"
156
+ }
157
+ }
158
+ };
159
+ }
160
+ static get states() {
161
+ return {
162
+ "container": {},
163
+ "scrollTop": {},
164
+ "totalHeight": {}
165
+ };
166
+ }
167
+ static get elementRef() { return "ele"; }
168
+ static get watchers() {
169
+ return [{
170
+ "propName": "itemHeights",
171
+ "methodName": "updateTotalHeight"
172
+ }, {
173
+ "propName": "fallbackItemHeight",
174
+ "methodName": "updateTotalHeight"
175
+ }];
176
+ }
177
+ }
@@ -10,7 +10,7 @@ export class ZonosComponent {
10
10
  return format(this.first, this.middle, this.last);
11
11
  }
12
12
  render() {
13
- return h("div", { key: '23fbe02ded67e42f94b5c3641aae55970cef052d' }, "Hello, World! I'm ", this.getText());
13
+ return h("div", { key: 'ece01ba1df61d0c15e60d2cf9fffbf4c01268612' }, "Hello, World! I'm ", this.getText());
14
14
  }
15
15
  static get is() { return "zonos-component"; }
16
16
  static get encapsulation() { return "shadow"; }
@@ -447,12 +447,17 @@ export class ZonosHello {
447
447
  return {
448
448
  "getCountryList": {
449
449
  "complexType": {
450
- "signature": "() => Promise<import(\"/home/runner/work/zonos-elements/zonos-elements/src/types/ICountryJson\").ICountryJson | null>",
450
+ "signature": "() => Promise<ICountryJson | null>",
451
451
  "parameters": [],
452
452
  "references": {
453
453
  "Promise": {
454
454
  "location": "global",
455
455
  "id": "global::Promise"
456
+ },
457
+ "ICountryJson": {
458
+ "location": "import",
459
+ "path": "src/types/ICountryJson",
460
+ "id": "src/types/ICountryJson.ts::ICountryJson"
456
461
  }
457
462
  },
458
463
  "return": "Promise<ICountryJson | null>"
@@ -18,9 +18,9 @@ export class ZonosHelloDialogFooter {
18
18
  const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
19
19
  // Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
20
20
  const mainColor = primaryColor && isDarkColor(primaryColor) ? 'white' : 'black';
21
- return (h(Host, { key: '49ed5ba840bd0d1e813b8eb4b89d0508930928a2', class: "zonos--elements" }, h("div", { key: 'ae66c6a3e8c824189b4eae2208c873943f8687ca', class: "zonos--hello-dialog-footer", style: {
21
+ return (h(Host, { key: 'a9b52a67a2db1967fe6fde4f19dc8d2785469f8a', class: "zonos--elements" }, h("div", { key: '1b36f45f0f00fe2b6494fb04373b12b4848b9484', class: "zonos--hello-dialog-footer", style: {
22
22
  '--primary-color': primaryColor,
23
- } }, h("a", { key: '61226c77fe20c817efd58e12c5d5c16dad6375ac', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '7dc60e603c7f64fc42359632190249caf0a18317', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: 'a6875d4c4dcf5804570d47409567f87728b8c8b5', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '51083ce07a51f62469afce508c79a7ebbf4eeacf', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: '46b826f2fc8f819507db9d432da459124b65cee8', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
23
+ } }, h("a", { key: '7ca110d30f9266d021069af41766588ffce3d2ad', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'f9f4866c18bc75577e5a3961ffdd67f48977fd68', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: '2bacafbd2c2d9c79935b7a2c69ae9fd3e1ede48a', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: 'a223f6706d319da505e8f013bff6863a433effd3', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'aa94f1e06b80f6bec8433c3c8a7b066f0d91df08', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
24
24
  }
25
25
  static get is() { return "zonos-hello-dialog-footer"; }
26
26
  static get encapsulation() { return "shadow"; }
@@ -198,18 +198,18 @@ export class ZonosHelloDialog {
198
198
  const defaultMessage = formatStringWithLinks(defaultMessageStr);
199
199
  const currentPage = this.getCurrentPageEnum();
200
200
  const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
201
- return (h(Host, { key: '7fa136af625bb72bb9f14ba4f3ff3aa70a95074b', class: "zonos--elements" }, h("div", { key: '94839999d9a9f2ff182f50ba24ad3183c44c6a31', class: classes([
201
+ return (h(Host, { key: '7dec47839d142b9d3580dffda8b8eea28af9974f', class: "zonos--elements" }, h("div", { key: 'ea71e8885de2be45be5a2dcc9dbe44ef99261102', class: classes([
202
202
  'zonos--hello-dialog',
203
203
  animateLeft && 'zonos--hello-dialog-animate-from-left',
204
204
  animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
205
205
  !!this.mobileLocationOverride &&
206
206
  'zonos--hello-dialog-mobile-override',
207
207
  this.isOpen && 'zonos--hello-dialog-open',
208
- ]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '7c412fd167248e55b4b285cd77f4cfc85a6a038f' }, h("div", { key: '78d376fffe7289f3a4e144aca964e6a11da45600', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: 'b1c03836ef2825d4f0cf7c395aab0905008f2d5d', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: '91249ab433e0c29ca013c8cba607693a7a6bed02', spacing: 24 }, h("zonos-country-flag", { key: 'f11acc0b2f96f3fd0e5af6f4abb34c64bd290dae', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: '7322b563606ae3e6f5e0751305ef5779c99f3b36', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: 'cc6b7618a289bb0b001e2f1268b30e2ef18a6e54', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: 'f60575298db7743c942bfaa922baff1e93ea6774', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: '28c6a3bd2b49078ee337ae1e755519de332cda5d', spacing: 8 }, this.restrictedItems.map(item => {
208
+ ]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '2e66e1610e534de2fd4f4f5bce29e899f6c65877' }, h("div", { key: '598ffd431b5fcab10f7a7cb3c453fd959abdd881', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '68998e9634998a6b6d244540776c2bc18fb54c27', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: '660c8ae672b70185a046280d9e27b3fce8ad3e00', spacing: 24 }, h("zonos-country-flag", { key: '46f9733add5cf8038944e2c7c48a14f6f39f831a', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: 'e0571eae7cfd1a6555b16dd3ac450a8545095231', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: 'fffa08e2519973aafc2813246b7df2f9e4895a0d', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: 'ef78eead5a3fd2ce7ad881deb6472ca70e18032d', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: 'cd2632bb7a2655a240715601c32df6c807c283a1', spacing: 8 }, this.restrictedItems.map(item => {
209
209
  var _a;
210
210
  return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
211
- }), h("zonos-card", { key: '3fe69193fa354dcd592957333d8ddb484a88f309', spacing: "12px" }, h("zonos-v-stack", { key: '327079d7ead3a16af25b9131e1882f97c6ebe2be', spacing: 12 }, hasInclusivePrices ? (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), h("zonos-text", null, inclusivePriceMessage))) : (h(Fragment, null, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), additionalInformation === null || additionalInformation === void 0 ? void 0 :
212
- additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: 'ce8ca134e3918406bf69c0ab8dd883fd1af802c2', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: '03f07b6d622b1bc0ac918e9c910e5d5d815bd886' }, h("zonos-country-select", { key: 'fcbc3374d29c7b52f5316450956671340e0dd45c', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: '32e7c6391b5299fc845f7404745ee768a6f5e7bf' }, h("zonos-language-select", { key: 'b82087d23130629c339f02236d18dab598f33993', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
211
+ }), h("zonos-card", { key: 'ad5f69b84e2fd80864a6772216aa28b6558f12c4', spacing: "12px" }, h("zonos-v-stack", { key: '86b8c89c17b9b1348bf56c9a6fa2be3de11cb841', spacing: 12 }, hasInclusivePrices ? (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), h("zonos-text", null, inclusivePriceMessage))) : (h(Fragment, null, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), additionalInformation === null || additionalInformation === void 0 ? void 0 :
212
+ additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '2dc162a5dc40d781009379ef8276ebcd38a26494', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: 'a86eaaa8536432db2d4e63c3d3b4122349edeba6' }, h("zonos-country-select", { key: '2d0ec209c2500763b1656f07f8685818ee329e1e', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: 'd1c7f801e301635028dd2f6a478a93d72fc968f7' }, h("zonos-language-select", { key: '95e40b3c1e44d437d466fbc704c7e95ebdf8ec3c', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
213
213
  }
214
214
  static get is() { return "zonos-hello-dialog"; }
215
215
  static get encapsulation() { return "shadow"; }
@@ -186,7 +186,7 @@ export class ZonosController {
186
186
  zonosStore.organizationName = organizationName;
187
187
  }
188
188
  render() {
189
- return h(Host, { key: '4d1ae97e6273df35aeab31462394a189c17090b6', class: "zonos--elements" });
189
+ return h(Host, { key: '8738fa5324977321764af1c89181550d948955a6', class: "zonos--elements" });
190
190
  }
191
191
  static get is() { return "zonos-controller"; }
192
192
  static get encapsulation() { return "shadow"; }
@@ -41,7 +41,7 @@ export class ZonosPaypalPayment {
41
41
  void this.loadPaypal();
42
42
  }
43
43
  render() {
44
- return (h(Host, { key: '036a9d43da99e1c08293936d89ca5f97d5acdf10', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: 'f38290dce670024e001d8219d2d8d1e9fde1f9e2', class: "zonos--payment-paypal-container" })));
44
+ return (h(Host, { key: 'a09fe5b66b1ac971c10529ecb6213479f2870f08', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: '6ba337785b8a90965e0cba05fd62681bc92633fe', class: "zonos--payment-paypal-container" })));
45
45
  }
46
46
  static get is() { return "zonos-paypal-payment"; }
47
47
  static get encapsulation() { return "scoped"; }
@@ -131,6 +131,9 @@ export const stringsArabic = {
131
131
  Name: {
132
132
  value: 'اسم',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'لم يتم العثور على دول',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'لم يتم تحديد طريقة الشحن',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsBase = {
131
131
  Name: {
132
132
  value: 'Name',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'No countries found',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'No shipping method selected',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsChinese = {
131
131
  Name: {
132
132
  value: '名称',
133
133
  },
134
+ 'No countries found': {
135
+ value: '未找到国家',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: '未选择运输方式',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsDanish = {
131
131
  Name: {
132
132
  value: 'Navn',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Ingen lande fundet',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Ingen leveringsmetode valgt',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsDutch = {
131
131
  Name: {
132
132
  value: 'Naam',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Geen landen gevonden',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Geen verzendmethode geselecteerd',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsFrench = {
131
131
  Name: {
132
132
  value: 'Nom',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Aucun pays trouvé',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Aucune méthode de livraison sélectionnée',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsGerman = {
131
131
  Name: {
132
132
  value: 'Name',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Keine Länder gefunden',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Keine Versandart ausgewählt',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsHebrew = {
131
131
  Name: {
132
132
  value: 'שם',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'לא נמצאו מדינות',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'לא נבחרה שיטת משלוח',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsIndonesian = {
131
131
  Name: {
132
132
  value: 'Nama',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Tidak ada negara yang ditemukan',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Tidak ada metode pengiriman yang dipilih',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsItalian = {
131
131
  Name: {
132
132
  value: 'Nome',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Nessun paese trovato',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Nessun metodo di spedizione selezionato',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsJapanese = {
131
131
  Name: {
132
132
  value: '名前',
133
133
  },
134
+ 'No countries found': {
135
+ value: '国が見つかりません',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: '配送方法が選択されていません',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsKorean = {
131
131
  Name: {
132
132
  value: '이름',
133
133
  },
134
+ 'No countries found': {
135
+ value: '국가를 찾을 수 없습니다',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: '선택된 배송 방법이 없습니다',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsNorwegian = {
131
131
  Name: {
132
132
  value: 'Navn',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Ingen land funnet',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Ingen fraktmetode valgt',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsPolish = {
131
131
  Name: {
132
132
  value: 'Nazwa',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Nie znaleziono krajów',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Nie wybrano metody wysyłki',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsPortuguese = {
131
131
  Name: {
132
132
  value: 'Nome',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Nenhum país encontrado',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Nenhum método de envio selecionado',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsRussian = {
131
131
  Name: {
132
132
  value: 'Имя',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Страны не найдены',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Метод доставки не выбран',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsSpanish = {
131
131
  Name: {
132
132
  value: 'Nombre',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'No se encontraron países',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'No se ha seleccionado un método de envío',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsSwedish = {
131
131
  Name: {
132
132
  value: 'Namn',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Inga länder hittades',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Ingen fraktmetod vald',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsTurkish = {
131
131
  Name: {
132
132
  value: 'Ad',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Ülke bulunamadı',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Kargo yöntemi seçilmedi',
136
139
  },
@@ -131,6 +131,9 @@ export const stringsVietnamese = {
131
131
  Name: {
132
132
  value: 'Tên',
133
133
  },
134
+ 'No countries found': {
135
+ value: 'Không tìm thấy quốc gia nào',
136
+ },
134
137
  'No shipping method selected': {
135
138
  value: 'Chưa chọn phương thức vận chuyển',
136
139
  },
@@ -135,7 +135,7 @@ export class ZonosAddress {
135
135
  }
136
136
  render() {
137
137
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
138
- return (h(Host, { key: 'f19f690b4086d3b9446508c3af12a469b2283d25', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '3c908adcb0afd025fba6898e0fcb066e0884d696', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '42eb32ea6de83b0a24c139f8fc5849551d442174', class: "zonos--address-component" })));
138
+ return (h(Host, { key: '2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '101635210ab6cb3b9a44b47eec101187d1c3a4ac', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '049f2b86986471d45bd413813307ec489d9f1993', class: "zonos--address-component" })));
139
139
  }
140
140
  static get is() { return "zonos-address"; }
141
141
  static get encapsulation() { return "scoped"; }
@@ -42,7 +42,7 @@ export class ZonosLinkAuthentication {
42
42
  }
43
43
  render() {
44
44
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
45
- return (h(Host, { key: 'd3b232c0da0ef1f0d018398a36df06383bcdfe87', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: '7b6af818ae8628b204c3ea75fc58bee864b84069', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '068456f666b9d43595cb85c6ef51ab4f1113d268', class: "zonos--link-authentication-component" })));
45
+ return (h(Host, { key: 'f0b26abf99ef99c6665dabdddebc9ff086b6816c', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: '898dbdffac06fe2a68af90610a22044bb72391ce', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'e2ec9abb0cf76a39a1262e1366e375dd898450cd', class: "zonos--link-authentication-component" })));
46
46
  }
47
47
  static get is() { return "zonos-link-authentication"; }
48
48
  static get encapsulation() { return "scoped"; }
@@ -36,7 +36,7 @@ export class ZonosPayment {
36
36
  }
37
37
  render() {
38
38
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
39
- return (h(Host, { key: 'a6df9bab4826d7c4e4027bf6b7e58f176cb25ca1', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: 'a2f3d1288537a8e63c26bef9c87cae7f3a6f94fa', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '4e30103e4b6fa407450afc71474b663377233310', class: "zonos--payment-component" }), h("div", { key: '66a9798018fb25e86933a839014ed0d2ed16d8b3', class: "zonos--payment-paypal-container" })));
39
+ return (h(Host, { key: 'ab601d9a0cc6fe2fee19f45d6321dcc81b418cff', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '27857c99c59e4913fa403ef5b23b5b7d7f32bd45', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '329b5a5617f0c5942b209df1ccf3bfcb4ddabb0c', class: "zonos--payment-component" }), h("div", { key: '7abb08922e9f607314713fc9fa762a3bb8a35b13', class: "zonos--payment-paypal-container" })));
40
40
  }
41
41
  static get is() { return "zonos-payment"; }
42
42
  static get encapsulation() { return "scoped"; }
@@ -52,12 +52,6 @@ const handleRequest = async (url, options) => {
52
52
  const usingZonosPreview = window.Zonos.zonosQaUrl;
53
53
  // We only want to alert once if the user is in preview mode and it's also using production environment
54
54
  if (!window.Zonos.modeAlerted && zonosMode && usingZonosPreview) {
55
- if (zonosMode === 'production') {
56
- alert(`Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!`);
57
- }
58
- if (zonosMode === 'test') {
59
- alert(`For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration`);
60
- }
61
55
  window.Zonos.modeAlerted = true;
62
56
  }
63
57
  if (response.ok) {
@@ -40,7 +40,10 @@ const convertCurrency = (element) => {
40
40
  });
41
41
  // default to the currencyConvertAndFormat if the currencyConverter function does not return a value, or invalid value. This is to make sure we don't break the merchant's price.
42
42
  const observedFormattedValue = customizedCurrencyFormat || currencyConvertAndFormat(amount);
43
- element.textContent = observedFormattedValue;
43
+ if (observedFormattedValue !== element.textContent) {
44
+ // Only set textContent if the value has changed, this is to prevent it redrawing the element if the value is the same
45
+ element.textContent = observedFormattedValue;
46
+ }
44
47
  // save the new rate to the data-zrate attribute
45
48
  element.setAttribute('data-zrate', rate.toString());
46
49
  // save the new value to the data-zintl attribute
@@ -21,6 +21,10 @@ const JS_DELIVR_ZONOS_URL = `https://cdn.jsdelivr.net/npm/@zonos/elements@${pack
21
21
  * @example https://unpkg.com/@zonos/elements@1.3.15/dist/scripts/zonos.js
22
22
  */
23
23
  const UNPKG_ZONOS_URL = `https://unpkg.com/@zonos/elements@${packageVersion}`;
24
+ /**
25
+ * @example https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.41/dist/scripts/loadZonos.js
26
+ */
27
+ const CDNJS_ZONOS_URL = `https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/${packageVersion}`;
24
28
  const currentBranch = process.env.VERCEL_GIT_COMMIT_REF || process.env.BRANCH_NAME;
25
29
  export const formattedUrl = ({ branchName, inCI: _inCI, inVercel: _inVercel, isVercelPreview: _isVercelPreview, packageVersion: _packageVersion, type = 'full', url, }) => {
26
30
  if (!url) {
@@ -121,6 +125,7 @@ else {
121
125
  const envClient = {
122
126
  NEXT_PUBLIC_FLAG_URL: z.string(),
123
127
  NEXT_PUBLIC_ZONOS_API_KEY: z.string(),
128
+ NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.string(),
124
129
  NEXT_PUBLIC_ZONOS_CDN_URL: z.string(),
125
130
  NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.string(),
126
131
  NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.string(),
@@ -145,6 +150,7 @@ export const env = createEnv({
145
150
  runtimeEnvStrict: {
146
151
  NEXT_PUBLIC_FLAG_URL: process.env.NEXT_PUBLIC_FLAG_URL,
147
152
  NEXT_PUBLIC_ZONOS_API_KEY: process.env.NEXT_PUBLIC_ZONOS_API_KEY,
153
+ NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: CDNJS_ZONOS_URL,
148
154
  /**
149
155
  * Versioning url for production environment
150
156
  * @example v1.2.3.js.zonos.com
@@ -1,4 +1,4 @@
1
- export const fallbackList = ['jsdelivr', 'unpkg', 'vercel'];
1
+ export const fallbackList = ['jsdelivr', 'cdnjs', 'unpkg', 'vercel'];
2
2
  /**
3
3
  * Get the next cdn type in the fallback list
4
4
  * @param currentCdnType The current cdn type that want to get the next fallback url
@@ -4,10 +4,21 @@ import { extractZonosQaUrl } from "./_extractZonosQaUrl";
4
4
  * Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
5
5
  */
6
6
  export const getZonosQaUrl = () => {
7
- if (typeof window === 'undefined') {
7
+ /**
8
+ * This is flag to force load cdn for testing purpose
9
+ * When developing, if the script load is from `dev.elements.zonos.com`,
10
+ * it would load script from that same domain instead of loading from cdn
11
+ */
12
+ const shoudForceLoadCdn = window && window.location.href.includes('forceLoadCdn');
13
+ if (typeof window === 'undefined' || shoudForceLoadCdn) {
8
14
  return null;
9
15
  }
10
16
  const qaUrl = extractZonosQaUrl(window.location.href);
17
+ const cdnUrl = process.env.NEXT_PUBLIC_ZONOS_CDN_URL;
18
+ // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
19
+ if (!qaUrl && cdnUrl.includes('test.')) {
20
+ return cdnUrl;
21
+ }
11
22
  // when local demo app is running, it needs to use the local dev script unless the qaUrl is set
12
23
  if (!qaUrl && window.location.hostname === 'dev.demo.elements.zonos.com') {
13
24
  return 'https://dev.elements.zonos.com';