@ubnt/store.core 9.12.0-alpha.9 → 9.12.0

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 (685) hide show
  1. package/CHANGELOG.md +3 -93
  2. package/lib/_virtual/_virtual_multi-entry.js +2 -15
  3. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  4. package/lib/_virtual/_virtual_multi-entry.mjs +0 -2
  5. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  6. package/lib/assets/AITheta.jpg +0 -0
  7. package/lib/assets/MobileR.jpg +0 -0
  8. package/lib/assets/ProAV.jpg +0 -0
  9. package/lib/assets/ai360.jpg +0 -0
  10. package/lib/assets/ai3602.jpg +0 -0
  11. package/lib/assets/cloudgatewayultra.jpg +0 -0
  12. package/lib/assets/dreamRouter.jpg +0 -0
  13. package/lib/assets/dreamWall.jpg +0 -0
  14. package/lib/assets/g5-ptz.jpg +0 -0
  15. package/lib/assets/g5-ptz2.jpg +0 -0
  16. package/lib/assets/ucgMax.jpg +0 -0
  17. package/lib/assets/ucgMax2.jpg +0 -0
  18. package/lib/assets/ucgUltra.jpg +0 -0
  19. package/lib/assets/ucgUltra2.jpg +0 -0
  20. package/lib/assets/udmPro.jpg +0 -0
  21. package/lib/assets/udmPro2.jpg +0 -0
  22. package/lib/assets/udmProMax.jpg +0 -0
  23. package/lib/assets/udmProMax2.jpg +0 -0
  24. package/lib/assets/udmProSpecial.jpg +0 -0
  25. package/lib/assets/udmProSpecial2.jpg +0 -0
  26. package/lib/assets/udr.jpg +0 -0
  27. package/lib/assets/udw.jpg +0 -0
  28. package/lib/assets/umr.jpg +0 -0
  29. package/lib/assets/wideAngle.jpg +0 -0
  30. package/lib/assets/wideAngle2.jpg +0 -0
  31. package/lib/components/Explore/Explore.js +9 -2
  32. package/lib/components/Explore/Explore.js.map +1 -1
  33. package/lib/components/Explore/Explore.mjs +9 -2
  34. package/lib/components/Explore/Explore.mjs.map +1 -1
  35. package/lib/components/Explore/ExploreData.d.ts +7 -4
  36. package/lib/components/Explore/ExploreData.js +138 -87
  37. package/lib/components/Explore/ExploreData.js.map +1 -1
  38. package/lib/components/Explore/ExploreData.mjs +128 -79
  39. package/lib/components/Explore/ExploreData.mjs.map +1 -1
  40. package/lib/components/Explore/LensCompare/LensCompare.d.ts +2 -0
  41. package/lib/components/Explore/LensCompare/LensCompare.js +111 -0
  42. package/lib/components/Explore/LensCompare/LensCompare.js.map +1 -0
  43. package/lib/components/Explore/LensCompare/LensCompare.mjs +109 -0
  44. package/lib/components/Explore/LensCompare/LensCompare.mjs.map +1 -0
  45. package/lib/components/Explore/LensCompare/LensCompare.styles.d.ts +16 -0
  46. package/lib/components/Explore/LensCompare/LensCompare.styles.js +153 -0
  47. package/lib/components/Explore/LensCompare/LensCompare.styles.js.map +1 -0
  48. package/lib/components/Explore/LensCompare/LensCompare.styles.mjs +132 -0
  49. package/lib/components/Explore/LensCompare/LensCompare.styles.mjs.map +1 -0
  50. package/lib/components/Explore/LensCompare/LensCompare.types.d.ts +9 -0
  51. package/lib/components/Explore/LensCompare/LensCompare.utils.d.ts +2 -0
  52. package/lib/components/Explore/LensCompare/LensCompare.utils.js +23 -0
  53. package/lib/components/Explore/LensCompare/LensCompare.utils.js.map +1 -0
  54. package/lib/components/Explore/LensCompare/LensCompare.utils.mjs +21 -0
  55. package/lib/components/Explore/LensCompare/LensCompare.utils.mjs.map +1 -0
  56. package/lib/components/Explore/LensCompare/LensCompareData.d.ts +29 -0
  57. package/lib/components/Explore/LensCompare/LensCompareData.js +68 -0
  58. package/lib/components/Explore/LensCompare/LensCompareData.js.map +1 -0
  59. package/lib/components/Explore/LensCompare/LensCompareData.mjs +58 -0
  60. package/lib/components/Explore/LensCompare/LensCompareData.mjs.map +1 -0
  61. package/lib/{assets/keyFeatures/music.svg.js → components/Explore/LensCompare/assets/ai360.jpg.js} +6 -6
  62. package/lib/components/Explore/LensCompare/assets/ai360.jpg.js.map +1 -0
  63. package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs +3 -0
  64. package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs.map +1 -0
  65. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js +27 -0
  66. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js.map +1 -0
  67. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs +3 -0
  68. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs.map +1 -0
  69. package/lib/components/Explore/assets/AITheta.jpg.js +27 -0
  70. package/lib/components/Explore/assets/AITheta.jpg.js.map +1 -0
  71. package/lib/components/Explore/assets/AITheta.jpg.mjs +3 -0
  72. package/lib/components/Explore/assets/AITheta.jpg.mjs.map +1 -0
  73. package/lib/components/Explore/assets/MobileR.jpg.js +27 -0
  74. package/lib/components/Explore/assets/MobileR.jpg.js.map +1 -0
  75. package/lib/components/Explore/assets/MobileR.jpg.mjs +3 -0
  76. package/lib/components/Explore/assets/MobileR.jpg.mjs.map +1 -0
  77. package/lib/{assets/keyFeatures/group.svg.js → components/Explore/assets/ProAV.jpg.js} +6 -6
  78. package/lib/components/Explore/assets/ProAV.jpg.js.map +1 -0
  79. package/lib/components/Explore/assets/ProAV.jpg.mjs +3 -0
  80. package/lib/components/Explore/assets/ProAV.jpg.mjs.map +1 -0
  81. package/lib/components/Explore/assets/UISPConsole.jpg.js +5 -5
  82. package/lib/components/Explore/assets/{baseStation--mobile.jpg.js → baseStation-mobile.jpg.js} +6 -6
  83. package/lib/components/Explore/assets/baseStation-mobile.jpg.js.map +1 -0
  84. package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs +3 -0
  85. package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs.map +1 -0
  86. package/lib/components/Explore/assets/baseStation.jpg.js +5 -5
  87. package/lib/components/Explore/assets/cloudgatewayultra.jpg.js +27 -0
  88. package/lib/components/Explore/assets/cloudgatewayultra.jpg.js.map +1 -0
  89. package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs +3 -0
  90. package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs.map +1 -0
  91. package/lib/components/Explore/assets/dreamRouter.jpg.js +27 -0
  92. package/lib/components/Explore/assets/dreamRouter.jpg.js.map +1 -0
  93. package/lib/components/Explore/assets/dreamRouter.jpg.mjs +3 -0
  94. package/lib/components/Explore/assets/dreamRouter.jpg.mjs.map +1 -0
  95. package/lib/components/Explore/assets/dreamWall.jpg.js +27 -0
  96. package/lib/components/Explore/assets/dreamWall.jpg.js.map +1 -0
  97. package/lib/components/Explore/assets/dreamWall.jpg.mjs +3 -0
  98. package/lib/components/Explore/assets/dreamWall.jpg.mjs.map +1 -0
  99. package/lib/components/Explore/assets/{g4Ptz.jpg.js → g4-ptz.jpg.js} +2 -2
  100. package/lib/components/Explore/assets/g4-ptz.jpg.js.map +1 -0
  101. package/lib/components/Explore/assets/g4-ptz.jpg.mjs +3 -0
  102. package/lib/components/Explore/assets/g4-ptz.jpg.mjs.map +1 -0
  103. package/lib/components/Explore/assets/{g5Ptz.jpg.js → g5-ptz.jpg.js} +2 -2
  104. package/lib/components/Explore/assets/g5-ptz.jpg.js.map +1 -0
  105. package/lib/components/Explore/assets/g5-ptz.jpg.mjs +3 -0
  106. package/lib/components/Explore/assets/g5-ptz.jpg.mjs.map +1 -0
  107. package/lib/components/Explore/assets/unifiExpress.jpg.js +27 -0
  108. package/lib/components/Explore/assets/unifiExpress.jpg.js.map +1 -0
  109. package/lib/components/Explore/assets/unifiExpress.jpg.mjs +3 -0
  110. package/lib/components/Explore/assets/unifiExpress.jpg.mjs.map +1 -0
  111. package/lib/components/Explore/translations/ar.json.js +0 -19
  112. package/lib/components/Explore/translations/ar.json.js.map +1 -1
  113. package/lib/components/Explore/translations/ar.json.mjs +0 -19
  114. package/lib/components/Explore/translations/ar.json.mjs.map +1 -1
  115. package/lib/components/Explore/translations/de.json.js +0 -19
  116. package/lib/components/Explore/translations/de.json.js.map +1 -1
  117. package/lib/components/Explore/translations/de.json.mjs +0 -19
  118. package/lib/components/Explore/translations/de.json.mjs.map +1 -1
  119. package/lib/components/Explore/translations/el.json.js +0 -19
  120. package/lib/components/Explore/translations/el.json.js.map +1 -1
  121. package/lib/components/Explore/translations/el.json.mjs +0 -19
  122. package/lib/components/Explore/translations/el.json.mjs.map +1 -1
  123. package/lib/components/Explore/translations/en.json.js +30 -11
  124. package/lib/components/Explore/translations/en.json.js.map +1 -1
  125. package/lib/components/Explore/translations/en.json.mjs +30 -12
  126. package/lib/components/Explore/translations/en.json.mjs.map +1 -1
  127. package/lib/components/Explore/translations/es.json.js +82 -101
  128. package/lib/components/Explore/translations/es.json.js.map +1 -1
  129. package/lib/components/Explore/translations/es.json.mjs +82 -101
  130. package/lib/components/Explore/translations/es.json.mjs.map +1 -1
  131. package/lib/components/Explore/translations/fr.json.js +0 -19
  132. package/lib/components/Explore/translations/fr.json.js.map +1 -1
  133. package/lib/components/Explore/translations/fr.json.mjs +0 -19
  134. package/lib/components/Explore/translations/fr.json.mjs.map +1 -1
  135. package/lib/components/Explore/translations/it.json.js +0 -19
  136. package/lib/components/Explore/translations/it.json.js.map +1 -1
  137. package/lib/components/Explore/translations/it.json.mjs +0 -19
  138. package/lib/components/Explore/translations/it.json.mjs.map +1 -1
  139. package/lib/components/Explore/translations/ja.json.js +0 -19
  140. package/lib/components/Explore/translations/ja.json.js.map +1 -1
  141. package/lib/components/Explore/translations/ja.json.mjs +0 -19
  142. package/lib/components/Explore/translations/ja.json.mjs.map +1 -1
  143. package/lib/components/Explore/translations/pt-BR.json.js +0 -19
  144. package/lib/components/Explore/translations/pt-BR.json.js.map +1 -1
  145. package/lib/components/Explore/translations/pt-BR.json.mjs +0 -19
  146. package/lib/components/Explore/translations/pt-BR.json.mjs.map +1 -1
  147. package/lib/components/Explore/translations/zh-Hans.json.js +0 -19
  148. package/lib/components/Explore/translations/zh-Hans.json.js.map +1 -1
  149. package/lib/components/Explore/translations/zh-Hans.json.mjs +0 -19
  150. package/lib/components/Explore/translations/zh-Hans.json.mjs.map +1 -1
  151. package/lib/components/Explore/translations/zh-Hant-TW.json.js +0 -19
  152. package/lib/components/Explore/translations/zh-Hant-TW.json.js.map +1 -1
  153. package/lib/components/Explore/translations/zh-Hant-TW.json.mjs +0 -19
  154. package/lib/components/Explore/translations/zh-Hant-TW.json.mjs.map +1 -1
  155. package/lib/components/Header/Header.js +0 -1
  156. package/lib/components/Header/Header.js.map +1 -1
  157. package/lib/components/Header/Header.mjs +0 -1
  158. package/lib/components/Header/Header.mjs.map +1 -1
  159. package/lib/components/LandingPagePro/LandingPagePro.d.ts +0 -3
  160. package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
  161. package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
  162. package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
  163. package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
  164. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +0 -1
  165. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
  166. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
  167. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  168. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  169. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  170. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  171. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  172. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  173. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  174. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  175. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.js +1 -1
  176. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
  177. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.js +1 -1
  178. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.mjs +2 -2
  179. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
  180. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
  181. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  182. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  183. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  184. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  185. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  186. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  187. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  188. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  189. package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.js +1 -1
  190. package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.mjs +2 -2
  191. package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.js +1 -1
  192. package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.mjs +2 -2
  193. package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.js +1 -1
  194. package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.mjs +2 -2
  195. package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.js +1 -1
  196. package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.mjs +2 -2
  197. package/lib/components/ModelCompareV3/data/CloudGateways.js +17 -17
  198. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +12 -12
  199. package/lib/components/ModelCompareV3/data/Switching.js +1 -3
  200. package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
  201. package/lib/components/ModelCompareV3/data/Switching.mjs +1 -3
  202. package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
  203. package/lib/components/ModelCompareV3/data/products/aggregation.js +8 -16
  204. package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
  205. package/lib/components/ModelCompareV3/data/products/aggregation.mjs +8 -16
  206. package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
  207. package/lib/components/ModelCompareV3/data/products/connectDisplay.js +1 -1
  208. package/lib/components/ModelCompareV3/data/products/connectDisplay.js.map +1 -1
  209. package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs +1 -1
  210. package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs.map +1 -1
  211. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js +8 -16
  212. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js.map +1 -1
  213. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs +8 -16
  214. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs.map +1 -1
  215. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js +8 -16
  216. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js.map +1 -1
  217. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs +8 -16
  218. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs.map +1 -1
  219. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js +8 -16
  220. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js.map +1 -1
  221. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs +8 -16
  222. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs.map +1 -1
  223. package/lib/components/ModelCompareV3/data/products/g5Ptz.js +1 -1
  224. package/lib/components/ModelCompareV3/data/products/g5Ptz.mjs +1 -1
  225. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +8 -16
  226. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
  227. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +8 -16
  228. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
  229. package/lib/components/ModelCompareV3/data/products/missionCritical.js +0 -8
  230. package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
  231. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +0 -8
  232. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
  233. package/lib/components/ModelCompareV3/data/products/phoneTouch.js +3 -5
  234. package/lib/components/ModelCompareV3/data/products/phoneTouch.js.map +1 -1
  235. package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs +3 -5
  236. package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs.map +1 -1
  237. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js +2 -4
  238. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js.map +1 -1
  239. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs +2 -4
  240. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs.map +1 -1
  241. package/lib/components/ModelCompareV3/data/products/professional24.js +0 -8
  242. package/lib/components/ModelCompareV3/data/products/professional24.js.map +1 -1
  243. package/lib/components/ModelCompareV3/data/products/professional24.mjs +0 -8
  244. package/lib/components/ModelCompareV3/data/products/professional24.mjs.map +1 -1
  245. package/lib/components/ModelCompareV3/data/products/professional24PoE.js +0 -8
  246. package/lib/components/ModelCompareV3/data/products/professional24PoE.js.map +1 -1
  247. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs +0 -8
  248. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs.map +1 -1
  249. package/lib/components/ModelCompareV3/data/products/professional48.js +0 -8
  250. package/lib/components/ModelCompareV3/data/products/professional48.js.map +1 -1
  251. package/lib/components/ModelCompareV3/data/products/professional48.mjs +0 -8
  252. package/lib/components/ModelCompareV3/data/products/professional48.mjs.map +1 -1
  253. package/lib/components/ModelCompareV3/data/products/professional48PoE.js +0 -8
  254. package/lib/components/ModelCompareV3/data/products/professional48PoE.js.map +1 -1
  255. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs +0 -8
  256. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs.map +1 -1
  257. package/lib/components/ModelCompareV3/data/products/professionalMax16.js +0 -7
  258. package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
  259. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +0 -7
  260. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
  261. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +0 -7
  262. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
  263. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +0 -7
  264. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
  265. package/lib/components/ModelCompareV3/data/products/professionalMax24.js +0 -7
  266. package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
  267. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +0 -7
  268. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
  269. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +0 -7
  270. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
  271. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +0 -7
  272. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
  273. package/lib/components/ModelCompareV3/data/products/professionalMax48.js +0 -7
  274. package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
  275. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +0 -7
  276. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
  277. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +0 -7
  278. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
  279. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +0 -7
  280. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
  281. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +1 -11
  282. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
  283. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +1 -11
  284. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
  285. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +0 -8
  286. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
  287. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +0 -8
  288. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
  289. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +0 -8
  290. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
  291. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +0 -8
  292. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
  293. package/lib/components/ModelCompareV3/data/products/switchesStandard.js +0 -8
  294. package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
  295. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +0 -8
  296. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
  297. package/lib/components/ModelCompareV3/data/products/theta360.js +1 -1
  298. package/lib/components/ModelCompareV3/data/products/theta360.mjs +1 -1
  299. package/lib/components/ModelCompareV3/data/products/thetaWideAngle.js +1 -1
  300. package/lib/components/ModelCompareV3/data/products/thetaWideAngle.mjs +1 -1
  301. package/lib/components/ModelCompareV3/data/products/ucCast.js +1 -1
  302. package/lib/components/ModelCompareV3/data/products/ucCast.js.map +1 -1
  303. package/lib/components/ModelCompareV3/data/products/ucCast.mjs +1 -1
  304. package/lib/components/ModelCompareV3/data/products/ucCast.mjs.map +1 -1
  305. package/lib/components/ModelCompareV3/data/products/ucCastPro.js +1 -1
  306. package/lib/components/ModelCompareV3/data/products/ucCastPro.js.map +1 -1
  307. package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs +1 -1
  308. package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs.map +1 -1
  309. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  310. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  311. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  312. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  313. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  314. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  315. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  316. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  317. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  318. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  319. package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
  320. package/lib/components/ModelCompareV3/data/products/udr.mjs +1 -1
  321. package/lib/components/ModelCompareV3/data/products/udw.js +1 -1
  322. package/lib/components/ModelCompareV3/data/products/udw.mjs +1 -1
  323. package/lib/components/ModelCompareV3/data/products/umr.js +1 -1
  324. package/lib/components/ModelCompareV3/data/products/umr.mjs +1 -1
  325. package/lib/components/ModelCompareV3/data/properties/index.d.ts +0 -1
  326. package/lib/components/ModelCompareV3/data/properties/index.js +0 -2
  327. package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
  328. package/lib/components/ModelCompareV3/data/properties/index.mjs +0 -1
  329. package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
  330. package/lib/components/ModelCompareV3/data/property-sets/switching.js +4 -6
  331. package/lib/components/ModelCompareV3/data/property-sets/switching.js.map +1 -1
  332. package/lib/components/ModelCompareV3/data/property-sets/switching.mjs +4 -6
  333. package/lib/components/ModelCompareV3/data/property-sets/switching.mjs.map +1 -1
  334. package/lib/components/ModelCompareV3/translations/ar.json.js +0 -3
  335. package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
  336. package/lib/components/ModelCompareV3/translations/ar.json.mjs +0 -3
  337. package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
  338. package/lib/components/ModelCompareV3/translations/de.json.js +0 -3
  339. package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
  340. package/lib/components/ModelCompareV3/translations/de.json.mjs +0 -3
  341. package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
  342. package/lib/components/ModelCompareV3/translations/el.json.js +0 -3
  343. package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
  344. package/lib/components/ModelCompareV3/translations/el.json.mjs +0 -3
  345. package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
  346. package/lib/components/ModelCompareV3/translations/en.json.js +0 -3
  347. package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
  348. package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -3
  349. package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
  350. package/lib/components/ModelCompareV3/translations/es.json.js +0 -3
  351. package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
  352. package/lib/components/ModelCompareV3/translations/es.json.mjs +0 -3
  353. package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
  354. package/lib/components/ModelCompareV3/translations/fr.json.js +0 -3
  355. package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
  356. package/lib/components/ModelCompareV3/translations/fr.json.mjs +0 -3
  357. package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
  358. package/lib/components/ModelCompareV3/translations/it.json.js +0 -3
  359. package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
  360. package/lib/components/ModelCompareV3/translations/it.json.mjs +0 -3
  361. package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
  362. package/lib/components/ModelCompareV3/translations/ja.json.js +0 -3
  363. package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
  364. package/lib/components/ModelCompareV3/translations/ja.json.mjs +0 -3
  365. package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
  366. package/lib/components/ModelCompareV3/translations/pt-BR.json.js +0 -3
  367. package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
  368. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +0 -3
  369. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
  370. package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
  371. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +0 -3
  372. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
  373. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +0 -3
  374. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
  375. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +0 -3
  376. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
  377. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +0 -3
  378. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs.map +1 -1
  379. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +15 -311
  380. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
  381. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +15 -309
  382. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
  383. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +22 -38
  384. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
  385. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs +22 -38
  386. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
  387. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -10
  388. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
  389. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
  390. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
  391. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
  392. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.d.ts +1 -1
  393. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js +4 -5
  394. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
  395. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs +4 -5
  396. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
  397. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  398. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
  399. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  400. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
  401. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +0 -2
  402. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
  403. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +0 -2
  404. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
  405. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
  406. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
  407. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
  408. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
  409. package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -4
  410. package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
  411. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -4
  412. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
  413. package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
  414. package/lib/constants/icons/menu/index.d.ts +0 -1
  415. package/lib/constants/icons/menu/index.js +0 -9
  416. package/lib/constants/icons/menu/index.js.map +1 -1
  417. package/lib/constants/icons/menu/index.mjs +0 -2
  418. package/lib/constants/icons/menu/index.mjs.map +1 -1
  419. package/lib/constants/keyFeatureIcons.d.ts +0 -2
  420. package/lib/constants/keyFeatureIcons.js +0 -6
  421. package/lib/constants/keyFeatureIcons.js.map +1 -1
  422. package/lib/constants/keyFeatureIcons.mjs +0 -6
  423. package/lib/constants/keyFeatureIcons.mjs.map +1 -1
  424. package/lib/constants/proStoreCategories/mapping/index.d.ts +1 -3
  425. package/lib/constants/proStoreCategories/mapping/index.js +8 -18
  426. package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
  427. package/lib/constants/proStoreCategories/mapping/index.mjs +8 -18
  428. package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
  429. package/lib/constants/proStoreCategories/mapping/redirects.js +1 -8
  430. package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
  431. package/lib/constants/proStoreCategories/mapping/redirects.mjs +1 -8
  432. package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
  433. package/lib/constants/proStoreCategories/mapping/unifi.d.ts +2 -4
  434. package/lib/constants/proStoreCategories/mapping/unifi.js +1 -3
  435. package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
  436. package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -3
  437. package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
  438. package/lib/constants/proStoreCategories/translations/ar.json.js +2 -3
  439. package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
  440. package/lib/constants/proStoreCategories/translations/ar.json.mjs +2 -3
  441. package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
  442. package/lib/constants/proStoreCategories/translations/de.json.js +2 -3
  443. package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
  444. package/lib/constants/proStoreCategories/translations/de.json.mjs +2 -3
  445. package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
  446. package/lib/constants/proStoreCategories/translations/el.json.js +2 -3
  447. package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
  448. package/lib/constants/proStoreCategories/translations/el.json.mjs +2 -3
  449. package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
  450. package/lib/constants/proStoreCategories/translations/en.json.js +1 -5
  451. package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
  452. package/lib/constants/proStoreCategories/translations/en.json.mjs +2 -5
  453. package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
  454. package/lib/constants/proStoreCategories/translations/es.json.js +2 -3
  455. package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
  456. package/lib/constants/proStoreCategories/translations/es.json.mjs +2 -3
  457. package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
  458. package/lib/constants/proStoreCategories/translations/fr.json.js +3 -4
  459. package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
  460. package/lib/constants/proStoreCategories/translations/fr.json.mjs +3 -4
  461. package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
  462. package/lib/constants/proStoreCategories/translations/it.json.js +2 -3
  463. package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
  464. package/lib/constants/proStoreCategories/translations/it.json.mjs +2 -3
  465. package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
  466. package/lib/constants/proStoreCategories/translations/ja.json.js +2 -3
  467. package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
  468. package/lib/constants/proStoreCategories/translations/ja.json.mjs +2 -3
  469. package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
  470. package/lib/constants/proStoreCategories/translations/pt-BR.json.js +2 -3
  471. package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
  472. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +2 -3
  473. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
  474. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -4
  475. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
  476. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +3 -4
  477. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
  478. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -4
  479. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
  480. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +3 -4
  481. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
  482. package/lib/constants/shopify/keyFeatureIcons.js +0 -8
  483. package/lib/constants/shopify/keyFeatureIcons.js.map +1 -1
  484. package/lib/constants/shopify/keyFeatureIcons.mjs +0 -6
  485. package/lib/constants/shopify/keyFeatureIcons.mjs.map +1 -1
  486. package/lib/contexts/MenuContext/context.js +1 -1
  487. package/lib/contexts/MenuContext/context.js.map +1 -1
  488. package/lib/contexts/MenuContext/context.mjs +1 -1
  489. package/lib/contexts/MenuContext/context.mjs.map +1 -1
  490. package/lib/contexts/MenuContext/mapping.d.ts +3 -3
  491. package/lib/contexts/MenuContext/mapping.js +7 -21
  492. package/lib/contexts/MenuContext/mapping.js.map +1 -1
  493. package/lib/contexts/MenuContext/mapping.mjs +7 -20
  494. package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
  495. package/lib/contexts/MenuContext/presets.d.ts +4 -11
  496. package/lib/contexts/MenuContext/presets.js +12 -16
  497. package/lib/contexts/MenuContext/presets.js.map +1 -1
  498. package/lib/contexts/MenuContext/presets.mjs +13 -13
  499. package/lib/contexts/MenuContext/presets.mjs.map +1 -1
  500. package/lib/contexts/MenuContext/types.d.ts +1 -1
  501. package/lib/contexts/MenuContext/types.js.map +1 -1
  502. package/lib/contexts/MenuContext/types.mjs.map +1 -1
  503. package/lib/contexts/MenuContext/utils.js +1 -5
  504. package/lib/contexts/MenuContext/utils.js.map +1 -1
  505. package/lib/contexts/MenuContext/utils.mjs +1 -5
  506. package/lib/contexts/MenuContext/utils.mjs.map +1 -1
  507. package/lib/helpers/index.d.ts +0 -1
  508. package/lib/helpers/index.js +0 -11
  509. package/lib/helpers/index.js.map +1 -1
  510. package/lib/helpers/index.mjs +0 -1
  511. package/lib/helpers/index.mjs.map +1 -1
  512. package/lib/types/index.d.ts +0 -1
  513. package/lib/types/index.js +0 -2
  514. package/lib/types/index.js.map +1 -1
  515. package/lib/types/index.mjs +0 -1
  516. package/lib/types/index.mjs.map +1 -1
  517. package/lib/utils/array.d.ts +0 -4
  518. package/lib/utils/array.js +0 -10
  519. package/lib/utils/array.js.map +1 -1
  520. package/lib/utils/array.mjs +1 -10
  521. package/lib/utils/array.mjs.map +1 -1
  522. package/lib/utils/money/constants.d.ts +25 -56
  523. package/lib/utils/money/constants.js +7 -72
  524. package/lib/utils/money/constants.js.map +1 -1
  525. package/lib/utils/money/constants.mjs +7 -70
  526. package/lib/utils/money/constants.mjs.map +1 -1
  527. package/lib/utils/money/format.d.ts +5 -10
  528. package/lib/utils/money/format.js +14 -22
  529. package/lib/utils/money/format.js.map +1 -1
  530. package/lib/utils/money/format.mjs +16 -23
  531. package/lib/utils/money/format.mjs.map +1 -1
  532. package/lib/utils/money/index.d.ts +1 -4
  533. package/lib/utils/money/index.js +8 -26
  534. package/lib/utils/money/index.js.map +1 -1
  535. package/lib/utils/money/index.mjs +4 -8
  536. package/lib/utils/money/index.mjs.map +1 -1
  537. package/lib/utils/money/misc.d.ts +28 -68
  538. package/lib/utils/money/misc.js +64 -35
  539. package/lib/utils/money/misc.js.map +1 -1
  540. package/lib/utils/money/misc.mjs +43 -32
  541. package/lib/utils/money/misc.mjs.map +1 -1
  542. package/lib/utils/money/tax.d.ts +2 -38
  543. package/lib/utils/money/tax.js +10 -46
  544. package/lib/utils/money/tax.js.map +1 -1
  545. package/lib/utils/money/tax.mjs +11 -42
  546. package/lib/utils/money/tax.mjs.map +1 -1
  547. package/lib/utils/money/types.d.ts +3 -78
  548. package/lib/utils/nextjs/navigationPresets.d.ts +5 -7
  549. package/lib/utils/nextjs/navigationPresets.js +7 -13
  550. package/lib/utils/nextjs/navigationPresets.js.map +1 -1
  551. package/lib/utils/nextjs/navigationPresets.mjs +8 -14
  552. package/lib/utils/nextjs/navigationPresets.mjs.map +1 -1
  553. package/lib/utils/number.d.ts +1 -1
  554. package/lib/utils/number.js +1 -1
  555. package/lib/utils/number.js.map +1 -1
  556. package/lib/utils/number.mjs +1 -1
  557. package/lib/utils/number.mjs.map +1 -1
  558. package/lib/utils/validations.d.ts +15 -0
  559. package/lib/utils/validations.js +23 -0
  560. package/lib/utils/validations.js.map +1 -0
  561. package/lib/utils/validations.mjs +21 -0
  562. package/lib/utils/validations.mjs.map +1 -0
  563. package/package.json +54 -55
  564. package/lib/assets/efg.png +0 -0
  565. package/lib/assets/g5Ptz.jpg +0 -0
  566. package/lib/assets/group.svg +0 -6
  567. package/lib/assets/keyFeatures/group.svg +0 -6
  568. package/lib/assets/keyFeatures/group.svg.js.map +0 -1
  569. package/lib/assets/keyFeatures/group.svg.mjs +0 -3
  570. package/lib/assets/keyFeatures/group.svg.mjs.map +0 -1
  571. package/lib/assets/keyFeatures/music.svg +0 -3
  572. package/lib/assets/keyFeatures/music.svg.js.map +0 -1
  573. package/lib/assets/keyFeatures/music.svg.mjs +0 -3
  574. package/lib/assets/keyFeatures/music.svg.mjs.map +0 -1
  575. package/lib/assets/music.svg +0 -3
  576. package/lib/assets/powerAmp.jpg +0 -0
  577. package/lib/assets/powerAmp.svg +0 -3
  578. package/lib/assets/ucg-max.png +0 -0
  579. package/lib/assets/udr2.jpg +0 -0
  580. package/lib/assets/udw2.jpg +0 -0
  581. package/lib/assets/umr2.jpg +0 -0
  582. package/lib/assets/volume-on2.svg +0 -3
  583. package/lib/components/Explore/assets/baseStation--mobile.jpg.js.map +0 -1
  584. package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs +0 -3
  585. package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs.map +0 -1
  586. package/lib/components/Explore/assets/g4Ptz.jpg.js.map +0 -1
  587. package/lib/components/Explore/assets/g4Ptz.jpg.mjs +0 -3
  588. package/lib/components/Explore/assets/g4Ptz.jpg.mjs.map +0 -1
  589. package/lib/components/Explore/assets/g5Ptz.jpg.js.map +0 -1
  590. package/lib/components/Explore/assets/g5Ptz.jpg.mjs +0 -3
  591. package/lib/components/Explore/assets/g5Ptz.jpg.mjs.map +0 -1
  592. package/lib/components/Explore/assets/powerAmp.jpg.js +0 -27
  593. package/lib/components/Explore/assets/powerAmp.jpg.js.map +0 -1
  594. package/lib/components/Explore/assets/powerAmp.jpg.mjs +0 -3
  595. package/lib/components/Explore/assets/powerAmp.jpg.mjs.map +0 -1
  596. package/lib/components/Explore/assets/udr.jpg.js +0 -27
  597. package/lib/components/Explore/assets/udr.jpg.js.map +0 -1
  598. package/lib/components/Explore/assets/udr.jpg.mjs +0 -3
  599. package/lib/components/Explore/assets/udr.jpg.mjs.map +0 -1
  600. package/lib/components/Explore/assets/udw.jpg.js +0 -27
  601. package/lib/components/Explore/assets/udw.jpg.js.map +0 -1
  602. package/lib/components/Explore/assets/udw.jpg.mjs +0 -3
  603. package/lib/components/Explore/assets/udw.jpg.mjs.map +0 -1
  604. package/lib/components/Explore/assets/umr.jpg.js +0 -27
  605. package/lib/components/Explore/assets/umr.jpg.js.map +0 -1
  606. package/lib/components/Explore/assets/umr.jpg.mjs +0 -3
  607. package/lib/components/Explore/assets/umr.jpg.mjs.map +0 -1
  608. package/lib/components/Explore/assets/ux.jpg.js +0 -27
  609. package/lib/components/Explore/assets/ux.jpg.js.map +0 -1
  610. package/lib/components/Explore/assets/ux.jpg.mjs +0 -3
  611. package/lib/components/Explore/assets/ux.jpg.mjs.map +0 -1
  612. package/lib/components/ModelCompareV3/assets/volume-on.svg.js +0 -27
  613. package/lib/components/ModelCompareV3/assets/volume-on.svg.js.map +0 -1
  614. package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs +0 -3
  615. package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs.map +0 -1
  616. package/lib/components/ModelCompareV3/data/properties/proAvSupport.d.ts +0 -2
  617. package/lib/components/ModelCompareV3/data/properties/proAvSupport.js +0 -19
  618. package/lib/components/ModelCompareV3/data/properties/proAvSupport.js.map +0 -1
  619. package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs +0 -11
  620. package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs.map +0 -1
  621. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
  622. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
  623. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
  624. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
  625. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +0 -27
  626. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
  627. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
  628. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
  629. package/lib/constants/icons/menu/powerAmp.svg.js +0 -27
  630. package/lib/constants/icons/menu/powerAmp.svg.js.map +0 -1
  631. package/lib/constants/icons/menu/powerAmp.svg.mjs +0 -3
  632. package/lib/constants/icons/menu/powerAmp.svg.mjs.map +0 -1
  633. package/lib/helpers/product.d.ts +0 -87
  634. package/lib/helpers/product.js +0 -346
  635. package/lib/helpers/product.js.map +0 -1
  636. package/lib/helpers/product.mjs +0 -335
  637. package/lib/helpers/product.mjs.map +0 -1
  638. package/lib/types/product.d.ts +0 -87
  639. package/lib/types/product.js +0 -14
  640. package/lib/types/product.js.map +0 -1
  641. package/lib/types/product.mjs +0 -13
  642. package/lib/types/product.mjs.map +0 -1
  643. package/lib/utils/money/allocators/fixedAmount.d.ts +0 -26
  644. package/lib/utils/money/allocators/fixedAmount.js +0 -55
  645. package/lib/utils/money/allocators/fixedAmount.js.map +0 -1
  646. package/lib/utils/money/allocators/fixedAmount.mjs +0 -53
  647. package/lib/utils/money/allocators/fixedAmount.mjs.map +0 -1
  648. package/lib/utils/money/allocators/index.d.ts +0 -2
  649. package/lib/utils/money/allocators/index.js +0 -8
  650. package/lib/utils/money/allocators/index.js.map +0 -1
  651. package/lib/utils/money/allocators/index.mjs +0 -4
  652. package/lib/utils/money/allocators/index.mjs.map +0 -1
  653. package/lib/utils/money/allocators/productAmount.d.ts +0 -13
  654. package/lib/utils/money/allocators/productAmount.js +0 -110
  655. package/lib/utils/money/allocators/productAmount.js.map +0 -1
  656. package/lib/utils/money/allocators/productAmount.mjs +0 -108
  657. package/lib/utils/money/allocators/productAmount.mjs.map +0 -1
  658. package/lib/utils/money/exchangeRate.d.ts +0 -31
  659. package/lib/utils/money/exchangeRate.js +0 -27
  660. package/lib/utils/money/exchangeRate.js.map +0 -1
  661. package/lib/utils/money/exchangeRate.mjs +0 -23
  662. package/lib/utils/money/exchangeRate.mjs.map +0 -1
  663. package/lib/utils/money/misc.private.d.ts +0 -23
  664. package/lib/utils/money/misc.private.js +0 -46
  665. package/lib/utils/money/misc.private.js.map +0 -1
  666. package/lib/utils/money/misc.private.mjs +0 -21
  667. package/lib/utils/money/misc.private.mjs.map +0 -1
  668. package/lib/utils/money/shipping.d.ts +0 -5
  669. package/lib/utils/money/shipping.js +0 -8
  670. package/lib/utils/money/shipping.js.map +0 -1
  671. package/lib/utils/money/shipping.mjs +0 -6
  672. package/lib/utils/money/shipping.mjs.map +0 -1
  673. package/lib/utils/money/tax.private.d.ts +0 -17
  674. package/lib/utils/money/tax.private.js +0 -65
  675. package/lib/utils/money/tax.private.js.map +0 -1
  676. package/lib/utils/money/tax.private.mjs +0 -60
  677. package/lib/utils/money/tax.private.mjs.map +0 -1
  678. package/lib/utils/productSort.d.ts +0 -41
  679. package/lib/utils/productSort.js +0 -66
  680. package/lib/utils/productSort.js.map +0 -1
  681. package/lib/utils/productSort.mjs +0 -59
  682. package/lib/utils/productSort.mjs.map +0 -1
  683. /package/lib/assets/{baseStation--mobile.jpg → baseStation-mobile.jpg} +0 -0
  684. /package/lib/assets/{g4Ptz.jpg → g4-ptz.jpg} +0 -0
  685. /package/lib/assets/{ux.jpg → unifiExpress.jpg} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../src/contexts/MenuContext/utils.ts"],"sourcesContent":["import type { GlobalStoreId, StoreId } from \"../../types\";\nimport {\n assert,\n assertUnreachable,\n checkUnreachable,\n} from \"../../utils/errors\";\nimport { partsToPathname, pathnameToParts, slugify } from \"../../utils/url\";\nimport type {\n NavigationInvisibleItem,\n NavigationPath,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport { GENERIC_SITE_IDS, Language, SiteId } from \"./mapping\";\nimport type { BasicSiteConfig } from \"./types\";\nimport {\n type GlobalSiteConfig,\n type ParsedNavigationItem,\n type ParsedNavigationSubItem,\n type ParsedNavigationSubSubItem,\n SiteConfigType,\n} from \"./types\";\n\nexport const parseSiteUrl = ({\n siteUrl: [siteId, pathname, searchParams, fragment],\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n}: {\n siteUrl: SiteUrl;\n storeId: GlobalStoreId;\n addSiteConfigReferenceSearchParams: boolean;\n language: `${Language}`;\n targetSiteConfig: BasicSiteConfig;\n /** Current context where this function is called */\n context?: SiteId;\n}): string => {\n const { baseUrl, languages } = targetSiteConfig;\n\n const targetSiteSupportedLanguage =\n // OK to cast as we are verifying `languages` is type of Language[]\n languages && languages.includes(language as Language)\n ? language\n : targetSiteConfig.defaultLanguage;\n\n /**\n * Dynamic based url based on which side it is\n */\n const url = new URL(baseUrl);\n\n const pathnameParts = pathnameToParts(pathname);\n\n /**\n * Flag to include storeId and language in the URL\n *\n * If context is generic, we don't need to include storeId and language and we want\n * to allow the target site to handle the language and storeId\n */\n const includeStoreIdAndLanguage = !(\n context && GENERIC_SITE_IDS.includes(context)\n );\n\n switch (siteId) {\n case SiteId.Store: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n targetSiteSupportedLanguage\n ? [targetSiteSupportedLanguage, ...pathnameParts] // New platform stores (FUN-FACT: base urls already include store id)\n : pathnameParts, // Shopify stores\n )}`;\n break;\n }\n case SiteId.Ui: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n targetSiteSupportedLanguage && // Do not add storeId and language if language is not supported\n includeStoreIdAndLanguage // Do not add storeId and language if context is generic\n ? [slugify(storeId), targetSiteSupportedLanguage, ...pathnameParts] // URL to specific region + language combo\n : pathnameParts, // To \"root\" page\n )}`;\n break;\n }\n case SiteId.Uisp: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n includeStoreIdAndLanguage // Do not add storeId and language if context is generic\n ? [slugify(storeId), ...pathnameParts] // URL to specific region\n : pathnameParts, // To \"root\" page\n )}`;\n break;\n }\n case SiteId.Amplifi:\n case SiteId.TechSpecs:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${pathname}`;\n break;\n }\n // eslint-disable-next-line sonarjs/no-duplicated-branches\n case SiteId.Uwc: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n targetSiteSupportedLanguage\n ? [targetSiteSupportedLanguage, ...pathnameParts]\n : pathnameParts,\n )}`;\n break;\n }\n default: {\n checkUnreachable(siteId);\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${pathname}`;\n break;\n }\n }\n\n if (searchParams) {\n for (const [key, value] of Object.entries(searchParams)) {\n /**\n * Although we don't allow \"empty\" values, in runtime we had an issue if passing it, which failed this function,\n * seemed to be to dramatic so add actual runtime check if value is not null|undefined\n */\n if (value != null) {\n url.searchParams.set(key, value.toString());\n }\n }\n }\n\n /**\n * Add query parameters to force target site to use the correct store and language\n */\n if (addSiteConfigReferenceSearchParams) {\n // Add `s` for store query param\n if (storeId) {\n url.searchParams.set(\"s\", storeId);\n }\n\n // Add `l` for language query param\n if (targetSiteSupportedLanguage) {\n url.searchParams.set(\"l\", targetSiteSupportedLanguage);\n }\n }\n\n /**\n * Add fragment (a.k.a. hash #) if defined\n */\n if (fragment !== undefined) {\n url.hash = slugify(fragment.toString());\n }\n\n return url.toString();\n};\n\nexport const getPathname = (\n itemWithPath: Omit<NavigationPath, \"url\">,\n storeId: GlobalStoreId,\n) => {\n const storePath = itemWithPath.storePath?.[storeId];\n\n if (storePath === null) {\n return null;\n }\n\n return storePath ?? itemWithPath.path;\n};\n\nexport const getSubItemPath = (\n subItem: NavigationSubItem | NavigationSubSubItem,\n storeId: GlobalStoreId,\n isSubitemPathnameActive: (pathname: string) => boolean,\n): string | null => {\n // Multiple paths case\n if (subItem.path == null) {\n // Normalize paths\n const paths = (subItem.items ?? [])\n .map((item) => getSubItemPath(item, storeId, isSubitemPathnameActive))\n .filter((el): el is string => !!el);\n\n // Get the first active item\n const activePath = paths.find(isSubitemPathnameActive);\n\n // Return active path or the first item\n return activePath ?? paths[0] ?? null;\n }\n\n // Single path case\n return getPathname(subItem, storeId);\n};\n\nexport const getSubItemUrl = (\n subItem: NavigationSubItem | NavigationSubSubItem,\n isSubitemUrlActive: (siteUrl: SiteUrl) => boolean,\n): SiteUrl | null => {\n if (subItem.path === null && !subItem.url) {\n const urls = (subItem.items ?? [])\n .map((item) => getSubItemUrl(item, isSubitemUrlActive))\n .filter((el): el is SiteUrl => !!el);\n\n const activeUrl = urls.find(isSubitemUrlActive);\n\n return activeUrl ?? urls[0] ?? null;\n }\n\n return subItem.url ?? null;\n};\n\n/**\n * Util to check if given pathname (needle) is a subset of another path (haystack)\n */\nexport const isPartOfUrlPathname = (\n haystackPathname: string,\n needlePathname: string,\n): boolean => {\n /**\n * Ensure all paths end with a slash\n * This ensures \"some-path\" doesn't match \"some-path-extra\"\n * Since \"some-path/\" is not included in \"some-path-extra/\"\n */\n const normalisedHaystackPathname = ensureTrailingSlash(haystackPathname);\n const normalisedNeedlePathname = ensureTrailingSlash(needlePathname);\n return normalisedHaystackPathname.includes(normalisedNeedlePathname);\n};\n\n/**\n * Util that ensures given pathname ends with trailing slash\n * @example\n * ensureTrailingSlash('/a'); // '/a/'\n * ensureTrailingSlash('/a/'); // '/a/'\n */\nexport const ensureTrailingSlash = (pathname: string) =>\n pathname.replace(/\\/$/, \"\") + \"/\";\n\n/**\n * Util to easily find first possible link from nested \"subitem\"\n * @param items\n * @returns\n */\nexport const findFirstPossibleDeepNestedItemUrl = <\n Item extends\n | ParsedNavigationSubItem\n | ParsedNavigationItem\n | ParsedNavigationSubSubItem,\n>(\n items: Item[],\n): string | undefined => {\n return items.find((item) => item.possible)?.url;\n};\n\n/**\n * Filter out invisible products\n */\nexport const filterOutUnrenderableItems = <T extends NavigationInvisibleItem>(\n items: T[],\n) => {\n return items.filter((item) => !item.invisible);\n};\n\n// #############################################################################\n// Language\n// #############################################################################\n\nexport enum LanguageDirectionType {\n ltr = \"ltr\",\n rtl = \"rtl\",\n}\n\n/**\n * Get language direction from language\n */\nexport const getLanguageDirection = (language: Language) => {\n return language === Language.Ar\n ? LanguageDirectionType.rtl\n : LanguageDirectionType.ltr;\n};\n\n// #############################################################################\n// Global Site config\n// #############################################################################\nexport const getGlobalSiteConfig = (\n globalSiteConfig: GlobalSiteConfig,\n siteId: SiteId,\n storeId: GlobalStoreId | StoreId,\n): BasicSiteConfig => {\n const siteConfig = globalSiteConfig[siteId];\n\n assert(!!siteConfig, \"Missing SiteId in globalSiteConfig\");\n\n switch (siteConfig.type) {\n case SiteConfigType.Regional:\n return siteConfig.regions[storeId] ?? siteConfig.defaultRegion;\n case SiteConfigType.Basic:\n return siteConfig;\n default:\n assertUnreachable(siteConfig);\n }\n};\n"],"names":["parseSiteUrl","siteUrl","siteId","pathname","searchParams","fragment","storeId","addSiteConfigReferenceSearchParams","language","targetSiteConfig","context","baseUrl","languages","targetSiteSupportedLanguage","includes","defaultLanguage","url","URL","pathnameParts","pathnameToParts","includeStoreIdAndLanguage","GENERIC_SITE_IDS","SiteId","Store","replace","partsToPathname","Ui","slugify","Uisp","Amplifi","TechSpecs","ExpertsUi","ExpertsUisp","Uwc","checkUnreachable","key","value","Object","entries","set","toString","hash","getPathname","itemWithPath","storePath","path","getSubItemPath","subItem","isSubitemPathnameActive","paths","items","map","item","filter","el","activePath","find","getSubItemUrl","isSubitemUrlActive","urls","activeUrl","isPartOfUrlPathname","haystackPathname","needlePathname","normalisedHaystackPathname","ensureTrailingSlash","normalisedNeedlePathname","findFirstPossibleDeepNestedItemUrl","possible","filterOutUnrenderableItems","invisible","LanguageDirectionType","getLanguageDirection","Language","Ar","getGlobalSiteConfig","globalSiteConfig","siteConfig","assert","type","SiteConfigType","Regional","regions","defaultRegion","Basic","assertUnreachable"],"mappings":";;;;;;AAwBO,MAAMA,eAAeA,CAAC;EAC3BC,OAAS,EAAA,CAACC,MAAQ,EAAAC,QAAA,EAAUC,cAAcC,QAAQ,CAAA;EAClDC,OAAA;EACAC,kCAAA;EACAC,QAAA;EACAC,gBAAA;EACAC;AACF,CAQc,KAAA;EACN,MAAA;IAAEC,OAAS;IAAAC;EAAc,CAAA,GAAAH,gBAAA;EAEzB,MAAAI,2BAAA;EAAA;EAEJD,aAAaA,SAAU,CAAAE,QAAA,CAASN,QAAoB,CAAA,GAChDA,WACAC,gBAAiB,CAAAM,eAAA;EAKjB,MAAAC,GAAA,GAAM,IAAIC,GAAA,CAAIN,OAAO,CAAA;EAErB,MAAAO,aAAA,GAAgBC,gBAAgBhB,QAAQ,CAAA;EAQ9C,MAAMiB,yBAA4B,GAAA,EAChCV,OAAW,IAAAW,gBAAA,CAAiBP,SAASJ,OAAO,CAAA,CAAA;EAG9C,QAAQR,MAAQ;IACd,KAAKoB,OAAOC,KAAO;MAAA;QACbP,GAAA,CAAAb,QAAA,MAAca,GAAI,CAAAb,QAAA,CAASqB,QAAQ,KAAO,EAAA,EAAE,CAAI,GAAAC,eAAA,CAClDZ,2BACI,GAAA,CAACA,2BAA6B,EAAA,GAAGK,aAAa,CAC9C,GAAAA;QAAA;QACL,CAAA,EAAA;QACD;MACF;IACA,KAAKI,OAAOI,EAAI;MAAA;QACVV,GAAA,CAAAb,QAAA,MAAca,GAAI,CAAAb,QAAA,CAASqB,QAAQ,KAAO,EAAA,EAAE,CAAI,GAAAC,eAAA,CAClDZ,2BAAA;QAAA;QACEO,yBAAA,GACE,CAACO,OAAQ,CAAArB,OAAO,GAAGO,2BAA6B,EAAA,GAAGK,aAAa,CAChE,GAAAA;QAAA;QACL,CAAA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BAAA,GAAwBhE,QAAuB,IAAA;EACnD,OAAAA,QAAA,KAAaiE,QAAS,CAAAC,EAAA,GACzB,KACA,CAAA,YAAA,KAAA,CAAA;AACN,CAAA;AAKO,MAAMC,mBAAsB,GAAAA,CACjCC,gBACA,EAAA1E,MAAA,EACAI,OACoB,KAAA;EACd,MAAAuE,UAAA,GAAaD,iBAAiB1E,MAAM,CAAA;EAEnC4E,MAAA,CAAA,CAAC,CAACD,UAAA,EAAY,oCAAoC,CAAA;EAEzD,QAAQA,WAAWE,IAAM;IACvB,KAAKC,cAAe,CAAAC,QAAA;MAClB,OAAOJ,UAAW,CAAAK,OAAA,CAAQ5E,OAAO,CAAA,IAAKuE,UAAW,CAAAM,aAAA;IACnD,KAAKH,cAAe,CAAAI,KAAA;MACX,OAAAP,UAAA;IACT;MACEQ,iBAAA,CAAkBR,UAAU,CAAA;EAChC;AACF,CAAA;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../src/contexts/MenuContext/utils.ts"],"sourcesContent":["import type { GlobalStoreId, StoreId } from \"../../types\";\nimport {\n assert,\n assertUnreachable,\n checkUnreachable,\n} from \"../../utils/errors\";\nimport { partsToPathname, pathnameToParts, slugify } from \"../../utils/url\";\nimport type {\n NavigationInvisibleItem,\n NavigationPath,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport { GENERIC_SITE_IDS, Language, SiteId } from \"./mapping\";\nimport type { BasicSiteConfig } from \"./types\";\nimport {\n type GlobalSiteConfig,\n type ParsedNavigationItem,\n type ParsedNavigationSubItem,\n type ParsedNavigationSubSubItem,\n SiteConfigType,\n} from \"./types\";\n\nexport const parseSiteUrl = ({\n siteUrl: [siteId, pathname, searchParams, fragment],\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n}: {\n siteUrl: SiteUrl;\n storeId: GlobalStoreId;\n addSiteConfigReferenceSearchParams: boolean;\n language: `${Language}`;\n targetSiteConfig: BasicSiteConfig;\n /** Current context where this function is called */\n context?: SiteId;\n}): string => {\n const { baseUrl, languages } = targetSiteConfig;\n\n const targetSiteSupportedLanguage =\n // OK to cast as we are verifying `languages` is type of Language[]\n languages && languages.includes(language as Language)\n ? language\n : targetSiteConfig.defaultLanguage;\n\n /**\n * Dynamic based url based on which side it is\n */\n const url = new URL(baseUrl);\n\n const pathnameParts = pathnameToParts(pathname);\n\n /**\n * Flag to include storeId and language in the URL\n *\n * If context is generic, we don't need to include storeId and language and we want\n * to allow the target site to handle the language and storeId\n */\n const includeStoreIdAndLanguage = !(\n context && GENERIC_SITE_IDS.includes(context)\n );\n\n switch (siteId) {\n case SiteId.Store: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n targetSiteSupportedLanguage\n ? [targetSiteSupportedLanguage, ...pathnameParts] // New platform stores (FUN-FACT: base urls already include store id)\n : pathnameParts, // Shopify stores\n )}`;\n break;\n }\n case SiteId.Ui: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n targetSiteSupportedLanguage && // Do not add storeId and language if language is not supported\n includeStoreIdAndLanguage // Do not add storeId and language if context is generic\n ? [slugify(storeId), targetSiteSupportedLanguage, ...pathnameParts] // URL to specific region + language combo\n : pathnameParts, // To \"root\" page\n )}`;\n break;\n }\n case SiteId.Uisp: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${partsToPathname(\n includeStoreIdAndLanguage // Do not add storeId and language if context is generic\n ? [slugify(storeId), ...pathnameParts] // URL to specific region\n : pathnameParts, // To \"root\" page\n )}`;\n break;\n }\n case SiteId.Amplifi:\n case SiteId.TechSpecs:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp:\n case SiteId.Experts: {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${pathname}`;\n break;\n }\n default: {\n checkUnreachable(siteId);\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}${pathname}`;\n break;\n }\n }\n\n if (searchParams) {\n for (const [key, value] of Object.entries(searchParams)) {\n /**\n * Although we don't allow \"empty\" values, in runtime we had an issue if passing it, which failed this function,\n * seemed to be to dramatic so add actual runtime check if value is not null|undefined\n */\n if (value != null) {\n url.searchParams.set(key, value.toString());\n }\n }\n }\n\n /**\n * Add query parameters to force target site to use the correct store and language\n */\n if (addSiteConfigReferenceSearchParams) {\n // Add `s` for store query param\n if (storeId) {\n url.searchParams.set(\"s\", storeId);\n }\n\n // Add `l` for language query param\n if (targetSiteSupportedLanguage) {\n url.searchParams.set(\"l\", targetSiteSupportedLanguage);\n }\n }\n\n /**\n * Add fragment (a.k.a. hash #) if defined\n */\n if (fragment !== undefined) {\n url.hash = slugify(fragment.toString());\n }\n\n return url.toString();\n};\n\nexport const getPathname = (\n itemWithPath: Omit<NavigationPath, \"url\">,\n storeId: GlobalStoreId,\n) => {\n const storePath = itemWithPath.storePath?.[storeId];\n\n if (storePath === null) {\n return null;\n }\n\n return storePath ?? itemWithPath.path;\n};\n\nexport const getSubItemPath = (\n subItem: NavigationSubItem | NavigationSubSubItem,\n storeId: GlobalStoreId,\n isSubitemPathnameActive: (pathname: string) => boolean,\n): string | null => {\n // Multiple paths case\n if (subItem.path == null) {\n // Normalize paths\n const paths = (subItem.items ?? [])\n .map((item) => getSubItemPath(item, storeId, isSubitemPathnameActive))\n .filter((el): el is string => !!el);\n\n // Get the first active item\n const activePath = paths.find(isSubitemPathnameActive);\n\n // Return active path or the first item\n return activePath ?? paths[0] ?? null;\n }\n\n // Single path case\n return getPathname(subItem, storeId);\n};\n\nexport const getSubItemUrl = (\n subItem: NavigationSubItem | NavigationSubSubItem,\n isSubitemUrlActive: (siteUrl: SiteUrl) => boolean,\n): SiteUrl | null => {\n if (subItem.path === null && !subItem.url) {\n const urls = (subItem.items ?? [])\n .map((item) => getSubItemUrl(item, isSubitemUrlActive))\n .filter((el): el is SiteUrl => !!el);\n\n const activeUrl = urls.find(isSubitemUrlActive);\n\n return activeUrl ?? urls[0] ?? null;\n }\n\n return subItem.url ?? null;\n};\n\n/**\n * Util to check if given pathname (needle) is a subset of another path (haystack)\n */\nexport const isPartOfUrlPathname = (\n haystackPathname: string,\n needlePathname: string,\n): boolean => {\n /**\n * Ensure all paths end with a slash\n * This ensures \"some-path\" doesn't match \"some-path-extra\"\n * Since \"some-path/\" is not included in \"some-path-extra/\"\n */\n const normalisedHaystackPathname = ensureTrailingSlash(haystackPathname);\n const normalisedNeedlePathname = ensureTrailingSlash(needlePathname);\n return normalisedHaystackPathname.includes(normalisedNeedlePathname);\n};\n\n/**\n * Util that ensures given pathname ends with trailing slash\n * @example\n * ensureTrailingSlash('/a'); // '/a/'\n * ensureTrailingSlash('/a/'); // '/a/'\n */\nexport const ensureTrailingSlash = (pathname: string) =>\n pathname.replace(/\\/$/, \"\") + \"/\";\n\n/**\n * Util to easily find first possible link from nested \"subitem\"\n * @param items\n * @returns\n */\nexport const findFirstPossibleDeepNestedItemUrl = <\n Item extends\n | ParsedNavigationSubItem\n | ParsedNavigationItem\n | ParsedNavigationSubSubItem,\n>(\n items: Item[],\n): string | undefined => {\n return items.find((item) => item.possible)?.url;\n};\n\n/**\n * Filter out invisible products\n */\nexport const filterOutUnrenderableItems = <T extends NavigationInvisibleItem>(\n items: T[],\n) => {\n return items.filter((item) => !item.invisible);\n};\n\n// #############################################################################\n// Language\n// #############################################################################\n\nexport enum LanguageDirectionType {\n ltr = \"ltr\",\n rtl = \"rtl\",\n}\n\n/**\n * Get language direction from language\n */\nexport const getLanguageDirection = (language: Language) => {\n return language === Language.Ar\n ? LanguageDirectionType.rtl\n : LanguageDirectionType.ltr;\n};\n\n// #############################################################################\n// Global Site config\n// #############################################################################\nexport const getGlobalSiteConfig = (\n globalSiteConfig: GlobalSiteConfig,\n siteId: SiteId,\n storeId: GlobalStoreId | StoreId,\n): BasicSiteConfig => {\n const siteConfig = globalSiteConfig[siteId];\n\n assert(!!siteConfig, \"Missing SiteId in globalSiteConfig\");\n\n switch (siteConfig.type) {\n case SiteConfigType.Regional:\n return siteConfig.regions[storeId] ?? siteConfig.defaultRegion;\n case SiteConfigType.Basic:\n return siteConfig;\n default:\n assertUnreachable(siteConfig);\n }\n};\n"],"names":["parseSiteUrl","siteUrl","siteId","pathname","searchParams","fragment","storeId","addSiteConfigReferenceSearchParams","language","targetSiteConfig","context","baseUrl","languages","targetSiteSupportedLanguage","includes","defaultLanguage","url","URL","pathnameParts","pathnameToParts","includeStoreIdAndLanguage","GENERIC_SITE_IDS","SiteId","Store","replace","partsToPathname","Ui","slugify","Uisp","Amplifi","TechSpecs","ExpertsUi","ExpertsUisp","Experts","checkUnreachable","key","value","Object","entries","set","toString","hash","getPathname","itemWithPath","storePath","path","getSubItemPath","subItem","isSubitemPathnameActive","paths","items","map","item","filter","el","activePath","find","getSubItemUrl","isSubitemUrlActive","urls","activeUrl","isPartOfUrlPathname","haystackPathname","needlePathname","normalisedHaystackPathname","ensureTrailingSlash","normalisedNeedlePathname","findFirstPossibleDeepNestedItemUrl","possible","filterOutUnrenderableItems","invisible","LanguageDirectionType","getLanguageDirection","Language","Ar","getGlobalSiteConfig","globalSiteConfig","siteConfig","assert","type","SiteConfigType","Regional","regions","defaultRegion","Basic","assertUnreachable"],"mappings":";;;;;;AAwBO,MAAMA,eAAeA,CAAC;EAC3BC,OAAS,EAAA,CAACC,MAAQ,EAAAC,QAAA,EAAUC,cAAcC,QAAQ,CAAA;EAClDC,OAAA;EACAC,kCAAA;EACAC,QAAA;EACAC,gBAAA;EACAC;AACF,CAQc,KAAA;EACN,MAAA;IAAEC,OAAS;IAAAC;EAAc,CAAA,GAAAH,gBAAA;EAEzB,MAAAI,2BAAA;EAAA;EAEJD,aAAaA,SAAU,CAAAE,QAAA,CAASN,QAAoB,CAAA,GAChDA,WACAC,gBAAiB,CAAAM,eAAA;EAKjB,MAAAC,GAAA,GAAM,IAAIC,GAAA,CAAIN,OAAO,CAAA;EAErB,MAAAO,aAAA,GAAgBC,gBAAgBhB,QAAQ,CAAA;EAQ9C,MAAMiB,yBAA4B,GAAA,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CAAKgB,QAAQ,CAAG,EAAApD,GAAA;AAC9C,CAAA;AAKa,MAAAqD,0BAAA,GACXnB,KACG,IAAA;EACH,OAAOA,MAAMG,MAAO,CAACD,IAAS,IAAA,CAACA,KAAKkB,SAAS,CAAA;AAC/C,CAAA;AAMY,IAAAC,qBAAA,GAAA,gBAAAA,sBAAL,IAAA;EACLA,uBAAA,KAAM,CAAA,GAAA,KAAA;EACNA,uBAAA,KAAM,CAAA,GAAA,KAAA;EAFIA,OAAAA,sBAAAA;AAAA,CAAA,EAAAA,qBAAA,IAAA,CAAA,CAAA,CAAA;AAQC,MAAAC,oBAAA,GAAwBhE,QAAuB,IAAA;EACnD,OAAAA,QAAA,KAAaiE,QAAS,CAAAC,EAAA,GACzB,KACA,CAAA,YAAA,KAAA,CAAA;AACN,CAAA;AAKO,MAAMC,mBAAsB,GAAAA,CACjCC,gBACA,EAAA1E,MAAA,EACAI,OACoB,KAAA;EACd,MAAAuE,UAAA,GAAaD,iBAAiB1E,MAAM,CAAA;EAEnC4E,MAAA,CAAA,CAAC,CAACD,UAAA,EAAY,oCAAoC,CAAA;EAEzD,QAAQA,WAAWE,IAAM;IACvB,KAAKC,cAAe,CAAAC,QAAA;MAClB,OAAOJ,UAAW,CAAAK,OAAA,CAAQ5E,OAAO,CAAA,IAAKuE,UAAW,CAAAM,aAAA;IACnD,KAAKH,cAAe,CAAAI,KAAA;MACX,OAAAP,UAAA;IACT;MACEQ,iBAAA,CAAkBR,UAAU,CAAA;EAChC;AACF,CAAA;"}
@@ -1,2 +1 @@
1
1
  export * from "./proStoreCategories";
2
- export * from "./product";
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var proStoreCategories = require('./proStoreCategories.js');
4
- var product = require('./product.js');
5
4
  "use strict";
6
5
  exports.getCategoriesBySubcategory = proStoreCategories.getCategoriesBySubcategory;
7
6
  exports.getLocalizedCategories = proStoreCategories.getLocalizedCategories;
@@ -11,14 +10,4 @@ exports.getSubCategoryIdByCollectionSlug = proStoreCategories.getSubCategoryIdBy
11
10
  exports.isValidSubCategory = proStoreCategories.isValidSubCategory;
12
11
  exports.parseCategories = proStoreCategories.parseCategories;
13
12
  exports.useTranslatedCategories = proStoreCategories.useTranslatedCategories;
14
- exports.COLLECTION_SECTION_OTHER_ID = product.COLLECTION_SECTION_OTHER_ID;
15
- exports.HDDProductSlugs = product.HDDProductSlugs;
16
- exports.MagicCollectionTags = product.MagicCollectionTags;
17
- exports.ProductOptions = product.ProductOptions;
18
- exports.createSectionHierarchy = product.createSectionHierarchy;
19
- exports.getProStoreCategory = product.getProStoreCategory;
20
- exports.getProductGroups = product.getProductGroups;
21
- exports.getStoreProducts = product.getStoreProducts;
22
- exports.isNonNullish = product.isNonNullish;
23
- exports.removeExcludedProducts = product.removeExcludedProducts;
24
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,4 +1,3 @@
1
1
  export { getCategoriesBySubcategory, getLocalizedCategories, getProductLineByCategory, getProductLineBySubcategory, getSubCategoryIdByCollectionSlug, isValidSubCategory, parseCategories, useTranslatedCategories } from './proStoreCategories.mjs';
2
- export { COLLECTION_SECTION_OTHER_ID, HDDProductSlugs, MagicCollectionTags, ProductOptions, createSectionHierarchy, getProStoreCategory, getProductGroups, getStoreProducts, isNonNullish, removeExcludedProducts } from './product.mjs';
3
2
  "use strict";
4
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -3,4 +3,3 @@ export * from "./constants";
3
3
  export * from "./generated";
4
4
  export * from "./object";
5
5
  export * from "./utils";
6
- export * from "./product";
@@ -5,7 +5,6 @@ var constants = require('./constants.js');
5
5
  var generated = require('./generated.js');
6
6
  require('./object.js');
7
7
  require('./utils.js');
8
- var product = require('./product.js');
9
8
  "use strict";
10
9
  exports.AddressUsageType = constants.AddressUsageType;
11
10
  exports.Language = constants.Language;
@@ -19,5 +18,4 @@ exports.Unit = generated.Unit;
19
18
  exports.UnitSystem = generated.UnitSystem;
20
19
  exports.UserAssignedCountryCode = generated.UserAssignedCountryCode;
21
20
  exports.ValidateTaxStatus = generated.ValidateTaxStatus;
22
- exports.DisplayProductStatus = product.DisplayProductStatus;
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,5 @@ export { AddressUsageType, Language } from './constants.mjs';
3
3
  export { AddressType, CountryCode, Currency, GlobalStoreId, ProductLine, StoreId, Unit, UnitSystem, UserAssignedCountryCode, ValidateTaxStatus } from './generated.mjs';
4
4
  import './object.mjs';
5
5
  import './utils.mjs';
6
- export { DisplayProductStatus } from './product.mjs';
7
6
  "use strict";
8
7
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -28,7 +28,3 @@ export declare const arraySafeIndexFind: <T>(array: T[], index: number) => T | u
28
28
  * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts
29
29
  */
30
30
  export declare const normalizeSortResult: (sortResult: number) => number;
31
- /**
32
- * Combine multiple sort functions into one
33
- */
34
- export declare const combineSorts: <T>(sorts: ((a: T, b: T) => number)[]) => ((a: T, b: T) => number);
@@ -24,19 +24,9 @@ const arraySafeIndexFind = (array, index) => {
24
24
  return array[safeIndex];
25
25
  };
26
26
  const normalizeSortResult = sortResult => number.clamp(sortResult, -1, 1);
27
- const combineSorts = sorts => (a, b) => {
28
- for (const sort of sorts) {
29
- const result = sort(a, b);
30
- if (result !== 0) {
31
- return result;
32
- }
33
- }
34
- return 0;
35
- };
36
27
  exports.areEqualArrays = areEqualArrays;
37
28
  exports.arraySafeIndex = arraySafeIndex;
38
29
  exports.arraySafeIndexFind = arraySafeIndexFind;
39
- exports.combineSorts = combineSorts;
40
30
  exports.dedupe = dedupe;
41
31
  exports.ensureArray = ensureArray;
42
32
  exports.normalizeSortResult = normalizeSortResult;
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n\n/**\n * Combine multiple sort functions into one\n */\nexport const combineSorts =\n <T>(sorts: ((a: T, b: T) => number)[]): ((a: T, b: T) => number) =>\n (a, b) => {\n for (const sort of sorts) {\n const result = sort(a, b);\n\n if (result !== 0) {\n return result;\n }\n }\n\n return 0;\n };\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp","combineSorts","sorts","sort","result"],"mappings":";;;;AAMO,SAASA,YAAeC,KAAqB,EAAA;EAClD,OAAOC,MAAMC,OAAQ,CAAAF,KAAK,CAAI,GAAAA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOa,MAAAG,MAAA,GAAaC,GAAa,IAAA,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAS1C,MAAAE,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAyB,KAAA;EAC/D,IAAAD,CAAA,CAAEE,MAAW,KAAAD,CAAA,CAAEC,MAAQ,EAAA;IAClB,OAAA,KAAA;EACT;EACI,IAAA,CAACF,EAAEG,KAAM,CAACC,MAAOH,CAAE,CAAAI,QAAA,CAASD,EAAE,CAAC,CAAG,EAAA;IAC7B,OAAA,KAAA;EACT;EACO,OAAA,CAACH,CAAE,CAAAE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAS,CAAAD,EAAE,CAAC,CAAA,GAAI,KAAQ,GAAA,IAAA;AACpD,CAAA;AAOa,MAAAE,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAA0B,KAAA;EACtE,MAAMC,YAAYF,KAAM,CAAAL,MAAA;EAEf,OAAA,CAAAM,KAAA,GAAQC,YAAaA,SAAa,IAAAA,SAAA;AAC7C,CAAA;AAEa,MAAAC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KACkB,KAAA;EACZ,MAAAG,SAAA,GAAYL,cAAe,CAAAC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,MAAAA,CAAAA,KAAM,CAAAD,UAAA,EAAY,IAAI,CAAC,CAAA;AAKlB,MAAME,YACX,GAAIC,KACJ,IAAA,CAAChB,GAAGC,CAAM,KAAA;EACR,KAAA,MAAWgB,QAAQD,KAAO,EAAA;IAClB,MAAAE,MAAA,GAASD,IAAK,CAAAjB,CAAA,EAAGC,CAAC,CAAA;IAExB,IAAIiB,WAAW,CAAG,EAAA;MACT,OAAAA,MAAA;IACT;EACF;EAEO,OAAA,CAAA;AACT,CAAA;;;;;;;"}
1
+ {"version":3,"file":"array.js","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp"],"mappings":";;;;AAMO,SAASA,YAAeC,KAAqB,EAAA;EAClD,OAAOC,MAAMC,OAAQ,CAAAF,KAAK,CAAI,GAAAA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOa,MAAAG,MAAA,GAAaC,GAAa,IAAA,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAS1C,MAAAE,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAyB,KAAA;EAC/D,IAAAD,CAAA,CAAEE,MAAW,KAAAD,CAAA,CAAEC,MAAQ,EAAA;IAClB,OAAA,KAAA;EACT;EACI,IAAA,CAACF,EAAEG,KAAM,CAACC,MAAOH,CAAE,CAAAI,QAAA,CAASD,EAAE,CAAC,CAAG,EAAA;IAC7B,OAAA,KAAA;EACT;EACO,OAAA,CAACH,CAAE,CAAAE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAS,CAAAD,EAAE,CAAC,CAAA,GAAI,KAAQ,GAAA,IAAA;AACpD,CAAA;AAOa,MAAAE,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAA0B,KAAA;EACtE,MAAMC,YAAYF,KAAM,CAAAL,MAAA;EAEf,OAAA,CAAAM,KAAA,GAAQC,YAAaA,SAAa,IAAAA,SAAA;AAC7C,CAAA;AAEa,MAAAC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KACkB,KAAA;EACZ,MAAAG,SAAA,GAAYL,cAAe,CAAAC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,MAAAA,CAAAA,KAAM,CAAAD,UAAA,EAAY,IAAI,CAAC,CAAA;;;;;;"}
@@ -22,14 +22,5 @@ const arraySafeIndexFind = (array, index) => {
22
22
  return array[safeIndex];
23
23
  };
24
24
  const normalizeSortResult = sortResult => clamp(sortResult, -1, 1);
25
- const combineSorts = sorts => (a, b) => {
26
- for (const sort of sorts) {
27
- const result = sort(a, b);
28
- if (result !== 0) {
29
- return result;
30
- }
31
- }
32
- return 0;
33
- };
34
- export { areEqualArrays, arraySafeIndex, arraySafeIndexFind, combineSorts, dedupe, ensureArray, normalizeSortResult };
25
+ export { areEqualArrays, arraySafeIndex, arraySafeIndexFind, dedupe, ensureArray, normalizeSortResult };
35
26
  //# sourceMappingURL=array.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.mjs","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n\n/**\n * Combine multiple sort functions into one\n */\nexport const combineSorts =\n <T>(sorts: ((a: T, b: T) => number)[]): ((a: T, b: T) => number) =>\n (a, b) => {\n for (const sort of sorts) {\n const result = sort(a, b);\n\n if (result !== 0) {\n return result;\n }\n }\n\n return 0;\n };\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp","combineSorts","sorts","sort","result"],"mappings":";;AAMO,SAASA,YAAeC,KAAqB,EAAA;EAClD,OAAOC,MAAMC,OAAQ,CAAAF,KAAK,CAAI,GAAAA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOa,MAAAG,MAAA,GAAaC,GAAa,IAAA,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAS1C,MAAAE,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAyB,KAAA;EAC/D,IAAAD,CAAA,CAAEE,MAAW,KAAAD,CAAA,CAAEC,MAAQ,EAAA;IAClB,OAAA,KAAA;EACT;EACI,IAAA,CAACF,EAAEG,KAAM,CAACC,MAAOH,CAAE,CAAAI,QAAA,CAASD,EAAE,CAAC,CAAG,EAAA;IAC7B,OAAA,KAAA;EACT;EACO,OAAA,CAACH,CAAE,CAAAE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAS,CAAAD,EAAE,CAAC,CAAA,GAAI,KAAQ,GAAA,IAAA;AACpD,CAAA;AAOa,MAAAE,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAA0B,KAAA;EACtE,MAAMC,YAAYF,KAAM,CAAAL,MAAA;EAEf,OAAA,CAAAM,KAAA,GAAQC,YAAaA,SAAa,IAAAA,SAAA;AAC7C,CAAA;AAEa,MAAAC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KACkB,KAAA;EACZ,MAAAG,SAAA,GAAYL,cAAe,CAAAC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,KAAM,CAAAD,UAAA,EAAY,IAAI,CAAC,CAAA;AAKlB,MAAME,YACX,GAAIC,KACJ,IAAA,CAAChB,GAAGC,CAAM,KAAA;EACR,KAAA,MAAWgB,QAAQD,KAAO,EAAA;IAClB,MAAAE,MAAA,GAASD,IAAK,CAAAjB,CAAA,EAAGC,CAAC,CAAA;IAExB,IAAIiB,WAAW,CAAG,EAAA;MACT,OAAAA,MAAA;IACT;EACF;EAEO,OAAA,CAAA;AACT,CAAA;"}
1
+ {"version":3,"file":"array.mjs","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp"],"mappings":";;AAMO,SAASA,YAAeC,KAAqB,EAAA;EAClD,OAAOC,MAAMC,OAAQ,CAAAF,KAAK,CAAI,GAAAA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOa,MAAAG,MAAA,GAAaC,GAAa,IAAA,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAS1C,MAAAE,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAyB,KAAA;EAC/D,IAAAD,CAAA,CAAEE,MAAW,KAAAD,CAAA,CAAEC,MAAQ,EAAA;IAClB,OAAA,KAAA;EACT;EACI,IAAA,CAACF,EAAEG,KAAM,CAACC,MAAOH,CAAE,CAAAI,QAAA,CAASD,EAAE,CAAC,CAAG,EAAA;IAC7B,OAAA,KAAA;EACT;EACO,OAAA,CAACH,CAAE,CAAAE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAS,CAAAD,EAAE,CAAC,CAAA,GAAI,KAAQ,GAAA,IAAA;AACpD,CAAA;AAOa,MAAAE,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAA0B,KAAA;EACtE,MAAMC,YAAYF,KAAM,CAAAL,MAAA;EAEf,OAAA,CAAAM,KAAA,GAAQC,YAAaA,SAAa,IAAAA,SAAA;AAC7C,CAAA;AAEa,MAAAC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KACkB,KAAA;EACZ,MAAAG,SAAA,GAAYL,cAAe,CAAAC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,KAAM,CAAAD,UAAA,EAAY,IAAI,CAAC,CAAA;"}
@@ -1,68 +1,37 @@
1
- import { Currency, StoreId } from "../../types";
2
- import type { LocalizedCurrency, RoundingFn } from "./types";
3
- export declare const Round: {
4
- /**
5
- * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
6
- * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to
7
- * normalise the values so we use this method.
8
- *
9
- * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.
10
- * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts
11
- * @see
12
- *
13
- * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded
14
- * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.
15
- * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):
16
- * https://youtu.be/yuRdYlZvs1E
17
- *
18
- * If you really want to get knee-deep in the rounding subject, you can read the following:
19
- * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero
20
- */
21
- Financial: import("@dinero.js/core").RoundingMode;
22
- Shipping: import("@dinero.js/core").RoundingMode;
23
- Prettify: import("@dinero.js/core").RoundingMode;
24
- Subunit: import("@dinero.js/core").RoundingMode;
25
- };
1
+ import { Currency } from "../../types";
2
+ import type { CurrencyObj } from "./types";
26
3
  /**
27
4
  * Mapping of how prices should be rounded down to "whole numbers" after certain threshold
28
5
  */
29
6
  export declare const prettifyPriceLookup: Map<string, number>;
30
7
  /**
31
- * Map of dinero code to subunit digit count.
8
+ * Map of currencycode to subunit digit count.
32
9
  */
33
- export declare const smallestSubunitLookup: Map<string, [number, RoundingFn]>;
10
+ export declare const smallestSubunitLookup: Map<string, [number, (value: number) => number]>;
34
11
  /**
35
- * Precompiled list for faster currency and locale lookups
12
+ * Mapping of maximum price filter
13
+ * TODO: Add all possible currencies
36
14
  */
37
- export declare const localizedCurrencyLookup: Map<Currency, LocalizedCurrency>;
15
+ export declare const maximumPriceFilterLookup: Map<string, number>;
38
16
  /**
39
- * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a
40
- * single line. Rest of the stores inherit default behavior that tax calculated on whole line item
17
+ * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
18
+ * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to
19
+ * normalise the values so we use this method.
20
+ *
21
+ * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.
22
+ * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts
23
+ * @see
24
+ *
25
+ * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded
26
+ * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.
27
+ * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):
28
+ * https://youtu.be/yuRdYlZvs1E
29
+ *
30
+ * If you really want to get knee-deep in the rounding subject, you can read the following:
31
+ * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero
41
32
  */
42
- export declare const storesWithPerItemTaxRate: Set<StoreId>;
33
+ export declare const financialRound: import("@dinero.js/core").RoundingMode;
43
34
  /**
44
- * Dinero currency option block for working with tax rates within dinero
35
+ * Precompiled list for faster currency and locale lookups
45
36
  */
46
- export declare const TAX_RATE_DINERO_CURRENCY: {
47
- base: number;
48
- /**
49
- * We expect the tax rate to be in the range of 0..1
50
- * 0 --> 0%
51
- * 1 --> 100%
52
- * 0.21 --> 21%
53
- * 0.2169 --> 21.69%
54
- * 0.12345678 --> 12.345678%
55
- * !!! Don't change as this value is tied to store.backend DB schema !!!
56
- */
57
- exponent: number;
58
- code: string;
59
- };
60
- export declare const EXCHANGE_RATE_DINERO_CURRENCY: {
61
- base: number;
62
- /**
63
- * We support having certain decimal places for exchange rates
64
- * !!! Don't change as this value is tied to store.backend DB schema !!!
65
- */
66
- exponent: number;
67
- code: string;
68
- };
37
+ export declare const currencyObjLookup: Map<Currency, CurrencyObj>;
@@ -5,33 +5,6 @@ var dinero_js = require('dinero.js');
5
5
  require('../../types/index.js');
6
6
  var generated = require('../../types/generated.js');
7
7
  "use strict";
8
- const Round = {
9
- /**
10
- * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
11
- * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to
12
- * normalise the values so we use this method.
13
- *
14
- * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.
15
- * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts
16
- * @see
17
- *
18
- * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded
19
- * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.
20
- * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):
21
- * https://youtu.be/yuRdYlZvs1E
22
- *
23
- * If you really want to get knee-deep in the rounding subject, you can read the following:
24
- * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero
25
- */
26
- Financial: dinero_js.halfEven,
27
- // TODO: maybe we should have separate rounding functions depending on the input value?
28
- // Reading from wiki "Round half toward zero" is better if the value is already "normalized to cents"
29
- // But the "Round half to even" seems better for when working with float like values
30
- // financialRound = Math.round;
31
- Shipping: dinero_js.down,
32
- Prettify: dinero_js.down,
33
- Subunit: dinero_js.halfUp
34
- };
35
8
  const prettifyPriceLookup = /* @__PURE__ */new Map([[currencies.USD.code, 20], [currencies.CAD.code, 20], [currencies.EUR.code, 20], [currencies.GBP.code, 20], [currencies.AED.code, 50],
36
9
  // Approximately every price above ~1.1 usd will be rounded in ZAR
37
10
  [currencies.ZAR.code, 20]]);
@@ -39,8 +12,10 @@ const smallestSubunitLookup = /* @__PURE__ */new Map([
39
12
  /**
40
13
  * TWD does not use subunits at all in day to day transactions.
41
14
  */
42
- [currencies.TWD.code, [0, Round.Subunit]]]);
43
- const localizedCurrencyLookup = /* @__PURE__ */new Map([[generated.Currency.Aed, {
15
+ [currencies.TWD.code, [0, dinero_js.halfUp]]]);
16
+ const maximumPriceFilterLookup = /* @__PURE__ */new Map([[currencies.CAD.code, 7e4], [currencies.EUR.code, 7e4], [currencies.AED.code, 7e4]]);
17
+ const financialRound = dinero_js.halfEven;
18
+ const currencyObjLookup = /* @__PURE__ */new Map([[generated.Currency.Aed, {
44
19
  currency: currencies.AED,
45
20
  locale: "ar-AE"
46
21
  }], [generated.Currency.Bgn, {
@@ -111,49 +86,9 @@ const localizedCurrencyLookup = /* @__PURE__ */new Map([[generated.Currency.Aed,
111
86
  currency: currencies.MXN,
112
87
  locale: "es-MX"
113
88
  }]]);
114
- const storesWithPerItemTaxRate = /* @__PURE__ */new Set([
115
- // #############################################################################
116
- // Stores with custom tax rates
117
- // #############################################################################
118
- generated.StoreId.Br, generated.StoreId.Tw
119
- // #############################################################################
120
- // Stores with Avalara, but will have custom company codes to treat
121
- // FIXME: as PR is rushed we where able to test stores avalara custom codes that enable logic that calculates tax
122
- // "per quantity", so for now disabling this logic and only applying to store with custom tax rates
123
- // #############################################################################
124
- // StoreId.Jp,
125
- // StoreId.Sg,
126
- ]);
127
- const TAX_RATE_DINERO_CURRENCY = {
128
- base: 10,
129
- /**
130
- * We expect the tax rate to be in the range of 0..1
131
- * 0 --> 0%
132
- * 1 --> 100%
133
- * 0.21 --> 21%
134
- * 0.2169 --> 21.69%
135
- * 0.12345678 --> 12.345678%
136
- * !!! Don't change as this value is tied to store.backend DB schema !!!
137
- */
138
- exponent: 8,
139
- code: ""
140
- // Not important
141
- };
142
- const EXCHANGE_RATE_DINERO_CURRENCY = {
143
- base: 10,
144
- /**
145
- * We support having certain decimal places for exchange rates
146
- * !!! Don't change as this value is tied to store.backend DB schema !!!
147
- */
148
- exponent: 6,
149
- code: ""
150
- // Not important
151
- };
152
- exports.EXCHANGE_RATE_DINERO_CURRENCY = EXCHANGE_RATE_DINERO_CURRENCY;
153
- exports.Round = Round;
154
- exports.TAX_RATE_DINERO_CURRENCY = TAX_RATE_DINERO_CURRENCY;
155
- exports.localizedCurrencyLookup = localizedCurrencyLookup;
89
+ exports.currencyObjLookup = currencyObjLookup;
90
+ exports.financialRound = financialRound;
91
+ exports.maximumPriceFilterLookup = maximumPriceFilterLookup;
156
92
  exports.prettifyPriceLookup = prettifyPriceLookup;
157
93
  exports.smallestSubunitLookup = smallestSubunitLookup;
158
- exports.storesWithPerItemTaxRate = storesWithPerItemTaxRate;
159
94
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfEven, halfUp } from \"dinero.js\";\n\nimport { Currency, StoreId } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\nexport const Round = {\n /**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\n Financial: halfEven,\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: down,\n Prettify: down,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 20],\n [EUR.code, 20],\n [GBP.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n StoreId.Br,\n StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to treat\n // FIXME: as PR is rushed we where able to test stores avalara custom codes that enable logic that calculates tax\n // \"per quantity\", so for now disabling this logic and only applying to store with custom tax rates\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["Round","Financial","halfEven","Shipping","down","Prettify","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","Gbp","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","MXN","storesWithPerItemTaxRate","Set","StoreId","Br","Tw","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;;;AAsCO,MAAMA,KAAQ,GAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAkBnBC,SAAW,EAAAC,SAAA,CAAAA,QAAA;EAAA;EAAA;EAAA;EAAA;EAKXC,QAAU,EAAAC,SAAA,CAAAA,IAAA;EACVC,QAAU,EAAAD,SAAA,CAAAA,IAAA;EACVE,OAAS,EAAAC,SAAA,CAAAA;AACX,CAAA;AAKa,MAAAC,mBAAA,GAAA,mBAA0BC,GAAI,CAAA,CACzC,CAACC,UAAI,CAAAA,GAAA,CAAAC,IAAA,EAAM,EAAE,CAAA,EACb,CAACC,UAAI,CAAAA,GAAA,CAAAD,IAAA,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DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { halfEven, halfUp } from \"dinero.js\";\n\nimport { Currency } from \"../../types\";\nimport type { CurrencyObj } from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 20],\n [EUR.code, 20],\n [GBP.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of currencycode to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<\n string,\n [number, (value: number) => number]\n>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, halfUp]],\n]);\n\n/**\n * Mapping of maximum price filter\n * TODO: Add all possible currencies\n */\nexport const maximumPriceFilterLookup = new Map([\n [CAD.code, 70000],\n [EUR.code, 70000],\n [AED.code, 70000],\n]);\n\n/**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\nexport const financialRound = halfEven;\n// TODO: maybe we should have separate rounding functions depending on the input value?\n// Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n// But the \"Round half to even\" seems better for when working with float like values\n// export const financialRound = Math.round;\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const currencyObjLookup = new Map<Currency, CurrencyObj>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n"],"names":["prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","halfUp","maximumPriceFilterLookup","financialRound","halfEven","currencyObjLookup","Currency","Aed","currency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S,CAAA,CAClD,CAAA;;;;;"}
@@ -1,35 +1,8 @@
1
1
  import { USD, CAD, EUR, GBP, AED, ZAR, TWD, BGN, CHF, CZK, DKK, HRK, HUF, NOK, PLN, RON, SEK, INR, SGD, BRL, JPY, MXN } from '@dinero.js/currencies';
2
- import { halfEven, down, halfUp } from 'dinero.js';
2
+ import { halfUp, halfEven } from 'dinero.js';
3
3
  import '../../types/index.mjs';
4
- import { Currency, StoreId } from '../../types/generated.mjs';
4
+ import { Currency } from '../../types/generated.mjs';
5
5
  "use strict";
6
- const Round = {
7
- /**
8
- * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
9
- * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to
10
- * normalise the values so we use this method.
11
- *
12
- * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.
13
- * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts
14
- * @see
15
- *
16
- * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded
17
- * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.
18
- * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):
19
- * https://youtu.be/yuRdYlZvs1E
20
- *
21
- * If you really want to get knee-deep in the rounding subject, you can read the following:
22
- * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero
23
- */
24
- Financial: halfEven,
25
- // TODO: maybe we should have separate rounding functions depending on the input value?
26
- // Reading from wiki "Round half toward zero" is better if the value is already "normalized to cents"
27
- // But the "Round half to even" seems better for when working with float like values
28
- // financialRound = Math.round;
29
- Shipping: down,
30
- Prettify: down,
31
- Subunit: halfUp
32
- };
33
6
  const prettifyPriceLookup = /* @__PURE__ */new Map([[USD.code, 20], [CAD.code, 20], [EUR.code, 20], [GBP.code, 20], [AED.code, 50],
34
7
  // Approximately every price above ~1.1 usd will be rounded in ZAR
35
8
  [ZAR.code, 20]]);
@@ -37,8 +10,10 @@ const smallestSubunitLookup = /* @__PURE__ */new Map([
37
10
  /**
38
11
  * TWD does not use subunits at all in day to day transactions.
39
12
  */
40
- [TWD.code, [0, Round.Subunit]]]);
41
- const localizedCurrencyLookup = /* @__PURE__ */new Map([[Currency.Aed, {
13
+ [TWD.code, [0, halfUp]]]);
14
+ const maximumPriceFilterLookup = /* @__PURE__ */new Map([[CAD.code, 7e4], [EUR.code, 7e4], [AED.code, 7e4]]);
15
+ const financialRound = halfEven;
16
+ const currencyObjLookup = /* @__PURE__ */new Map([[Currency.Aed, {
42
17
  currency: AED,
43
18
  locale: "ar-AE"
44
19
  }], [Currency.Bgn, {
@@ -109,43 +84,5 @@ const localizedCurrencyLookup = /* @__PURE__ */new Map([[Currency.Aed, {
109
84
  currency: MXN,
110
85
  locale: "es-MX"
111
86
  }]]);
112
- const storesWithPerItemTaxRate = /* @__PURE__ */new Set([
113
- // #############################################################################
114
- // Stores with custom tax rates
115
- // #############################################################################
116
- StoreId.Br, StoreId.Tw
117
- // #############################################################################
118
- // Stores with Avalara, but will have custom company codes to treat
119
- // FIXME: as PR is rushed we where able to test stores avalara custom codes that enable logic that calculates tax
120
- // "per quantity", so for now disabling this logic and only applying to store with custom tax rates
121
- // #############################################################################
122
- // StoreId.Jp,
123
- // StoreId.Sg,
124
- ]);
125
- const TAX_RATE_DINERO_CURRENCY = {
126
- base: 10,
127
- /**
128
- * We expect the tax rate to be in the range of 0..1
129
- * 0 --> 0%
130
- * 1 --> 100%
131
- * 0.21 --> 21%
132
- * 0.2169 --> 21.69%
133
- * 0.12345678 --> 12.345678%
134
- * !!! Don't change as this value is tied to store.backend DB schema !!!
135
- */
136
- exponent: 8,
137
- code: ""
138
- // Not important
139
- };
140
- const EXCHANGE_RATE_DINERO_CURRENCY = {
141
- base: 10,
142
- /**
143
- * We support having certain decimal places for exchange rates
144
- * !!! Don't change as this value is tied to store.backend DB schema !!!
145
- */
146
- exponent: 6,
147
- code: ""
148
- // Not important
149
- };
150
- export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, smallestSubunitLookup, storesWithPerItemTaxRate };
87
+ export { currencyObjLookup, financialRound, maximumPriceFilterLookup, prettifyPriceLookup, smallestSubunitLookup };
151
88
  //# sourceMappingURL=constants.mjs.map