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

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 (694) hide show
  1. package/CHANGELOG.md +5 -91
  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/close.svg +3 -1
  12. package/lib/assets/close2.svg +1 -4
  13. package/lib/assets/close3.svg +3 -2
  14. package/lib/assets/cloudgatewayultra.jpg +0 -0
  15. package/lib/assets/dreamRouter.jpg +0 -0
  16. package/lib/assets/dreamWall.jpg +0 -0
  17. package/lib/assets/g5-ptz.jpg +0 -0
  18. package/lib/assets/g5-ptz2.jpg +0 -0
  19. package/lib/assets/minus4.svg +8 -8
  20. package/lib/assets/minus5.svg +8 -8
  21. package/lib/assets/pause.svg +3 -3
  22. package/lib/assets/pause2.svg +3 -3
  23. package/lib/assets/plus5.svg +9 -9
  24. package/lib/assets/plus6.svg +9 -9
  25. package/lib/assets/udr.jpg +0 -0
  26. package/lib/assets/udw.jpg +0 -0
  27. package/lib/assets/umr.jpg +0 -0
  28. package/lib/assets/wideAngle.jpg +0 -0
  29. package/lib/assets/wideAngle2.jpg +0 -0
  30. package/lib/components/CustomImage/CustomImage.js +1 -1
  31. package/lib/components/CustomImage/CustomImage.mjs +1 -1
  32. package/lib/components/Explore/Explore.js +9 -2
  33. package/lib/components/Explore/Explore.js.map +1 -1
  34. package/lib/components/Explore/Explore.mjs +9 -2
  35. package/lib/components/Explore/Explore.mjs.map +1 -1
  36. package/lib/components/Explore/ExploreData.d.ts +7 -4
  37. package/lib/components/Explore/ExploreData.js +138 -87
  38. package/lib/components/Explore/ExploreData.js.map +1 -1
  39. package/lib/components/Explore/ExploreData.mjs +128 -79
  40. package/lib/components/Explore/ExploreData.mjs.map +1 -1
  41. package/lib/components/Explore/LensCompare/LensCompare.d.ts +2 -0
  42. package/lib/components/Explore/LensCompare/LensCompare.js +111 -0
  43. package/lib/components/Explore/LensCompare/LensCompare.js.map +1 -0
  44. package/lib/components/Explore/LensCompare/LensCompare.mjs +109 -0
  45. package/lib/components/Explore/LensCompare/LensCompare.mjs.map +1 -0
  46. package/lib/components/Explore/LensCompare/LensCompare.styles.d.ts +16 -0
  47. package/lib/components/Explore/LensCompare/LensCompare.styles.js +153 -0
  48. package/lib/components/Explore/LensCompare/LensCompare.styles.js.map +1 -0
  49. package/lib/components/Explore/LensCompare/LensCompare.styles.mjs +132 -0
  50. package/lib/components/Explore/LensCompare/LensCompare.styles.mjs.map +1 -0
  51. package/lib/components/Explore/LensCompare/LensCompare.types.d.ts +9 -0
  52. package/lib/components/Explore/LensCompare/LensCompare.utils.d.ts +2 -0
  53. package/lib/components/Explore/LensCompare/LensCompare.utils.js +23 -0
  54. package/lib/components/Explore/LensCompare/LensCompare.utils.js.map +1 -0
  55. package/lib/components/Explore/LensCompare/LensCompare.utils.mjs +21 -0
  56. package/lib/components/Explore/LensCompare/LensCompare.utils.mjs.map +1 -0
  57. package/lib/components/Explore/LensCompare/LensCompareData.d.ts +29 -0
  58. package/lib/components/Explore/LensCompare/LensCompareData.js +68 -0
  59. package/lib/components/Explore/LensCompare/LensCompareData.js.map +1 -0
  60. package/lib/components/Explore/LensCompare/LensCompareData.mjs +58 -0
  61. package/lib/components/Explore/LensCompare/LensCompareData.mjs.map +1 -0
  62. package/lib/{assets/keyFeatures/music.svg.js → components/Explore/LensCompare/assets/ai360.jpg.js} +6 -6
  63. package/lib/components/Explore/LensCompare/assets/ai360.jpg.js.map +1 -0
  64. package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs +3 -0
  65. package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs.map +1 -0
  66. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js +27 -0
  67. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js.map +1 -0
  68. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs +3 -0
  69. package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs.map +1 -0
  70. package/lib/components/Explore/assets/AITheta.jpg.js +27 -0
  71. package/lib/components/Explore/assets/AITheta.jpg.js.map +1 -0
  72. package/lib/components/Explore/assets/AITheta.jpg.mjs +3 -0
  73. package/lib/components/Explore/assets/AITheta.jpg.mjs.map +1 -0
  74. package/lib/components/Explore/assets/MobileR.jpg.js +27 -0
  75. package/lib/components/Explore/assets/MobileR.jpg.js.map +1 -0
  76. package/lib/components/Explore/assets/MobileR.jpg.mjs +3 -0
  77. package/lib/components/Explore/assets/MobileR.jpg.mjs.map +1 -0
  78. package/lib/{assets/keyFeatures/group.svg.js → components/Explore/assets/ProAV.jpg.js} +6 -6
  79. package/lib/components/Explore/assets/ProAV.jpg.js.map +1 -0
  80. package/lib/components/Explore/assets/ProAV.jpg.mjs +3 -0
  81. package/lib/components/Explore/assets/ProAV.jpg.mjs.map +1 -0
  82. package/lib/components/Explore/assets/UISPConsole.jpg.js +5 -5
  83. package/lib/components/Explore/assets/{baseStation--mobile.jpg.js → baseStation-mobile.jpg.js} +6 -6
  84. package/lib/components/Explore/assets/baseStation-mobile.jpg.js.map +1 -0
  85. package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs +3 -0
  86. package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs.map +1 -0
  87. package/lib/components/Explore/assets/baseStation.jpg.js +5 -5
  88. package/lib/components/Explore/assets/cloudgatewayultra.jpg.js +27 -0
  89. package/lib/components/Explore/assets/cloudgatewayultra.jpg.js.map +1 -0
  90. package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs +3 -0
  91. package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs.map +1 -0
  92. package/lib/components/Explore/assets/dreamRouter.jpg.js +27 -0
  93. package/lib/components/Explore/assets/dreamRouter.jpg.js.map +1 -0
  94. package/lib/components/Explore/assets/dreamRouter.jpg.mjs +3 -0
  95. package/lib/components/Explore/assets/dreamRouter.jpg.mjs.map +1 -0
  96. package/lib/components/Explore/assets/dreamWall.jpg.js +27 -0
  97. package/lib/components/Explore/assets/dreamWall.jpg.js.map +1 -0
  98. package/lib/components/Explore/assets/dreamWall.jpg.mjs +3 -0
  99. package/lib/components/Explore/assets/dreamWall.jpg.mjs.map +1 -0
  100. package/lib/components/Explore/assets/{g4Ptz.jpg.js → g4-ptz.jpg.js} +2 -2
  101. package/lib/components/Explore/assets/g4-ptz.jpg.js.map +1 -0
  102. package/lib/components/Explore/assets/g4-ptz.jpg.mjs +3 -0
  103. package/lib/components/Explore/assets/g4-ptz.jpg.mjs.map +1 -0
  104. package/lib/components/Explore/assets/{g5Ptz.jpg.js → g5-ptz.jpg.js} +2 -2
  105. package/lib/components/Explore/assets/g5-ptz.jpg.js.map +1 -0
  106. package/lib/components/Explore/assets/g5-ptz.jpg.mjs +3 -0
  107. package/lib/components/Explore/assets/g5-ptz.jpg.mjs.map +1 -0
  108. package/lib/components/Explore/assets/unifiExpress.jpg.js +27 -0
  109. package/lib/components/Explore/assets/unifiExpress.jpg.js.map +1 -0
  110. package/lib/components/Explore/assets/unifiExpress.jpg.mjs +3 -0
  111. package/lib/components/Explore/assets/unifiExpress.jpg.mjs.map +1 -0
  112. package/lib/components/Explore/translations/ar.json.js +0 -19
  113. package/lib/components/Explore/translations/ar.json.js.map +1 -1
  114. package/lib/components/Explore/translations/ar.json.mjs +0 -19
  115. package/lib/components/Explore/translations/ar.json.mjs.map +1 -1
  116. package/lib/components/Explore/translations/de.json.js +0 -19
  117. package/lib/components/Explore/translations/de.json.js.map +1 -1
  118. package/lib/components/Explore/translations/de.json.mjs +0 -19
  119. package/lib/components/Explore/translations/de.json.mjs.map +1 -1
  120. package/lib/components/Explore/translations/el.json.js +0 -19
  121. package/lib/components/Explore/translations/el.json.js.map +1 -1
  122. package/lib/components/Explore/translations/el.json.mjs +0 -19
  123. package/lib/components/Explore/translations/el.json.mjs.map +1 -1
  124. package/lib/components/Explore/translations/en.json.js +30 -11
  125. package/lib/components/Explore/translations/en.json.js.map +1 -1
  126. package/lib/components/Explore/translations/en.json.mjs +30 -12
  127. package/lib/components/Explore/translations/en.json.mjs.map +1 -1
  128. package/lib/components/Explore/translations/es.json.js +82 -101
  129. package/lib/components/Explore/translations/es.json.js.map +1 -1
  130. package/lib/components/Explore/translations/es.json.mjs +82 -101
  131. package/lib/components/Explore/translations/es.json.mjs.map +1 -1
  132. package/lib/components/Explore/translations/fr.json.js +0 -19
  133. package/lib/components/Explore/translations/fr.json.js.map +1 -1
  134. package/lib/components/Explore/translations/fr.json.mjs +0 -19
  135. package/lib/components/Explore/translations/fr.json.mjs.map +1 -1
  136. package/lib/components/Explore/translations/it.json.js +0 -19
  137. package/lib/components/Explore/translations/it.json.js.map +1 -1
  138. package/lib/components/Explore/translations/it.json.mjs +0 -19
  139. package/lib/components/Explore/translations/it.json.mjs.map +1 -1
  140. package/lib/components/Explore/translations/ja.json.js +0 -19
  141. package/lib/components/Explore/translations/ja.json.js.map +1 -1
  142. package/lib/components/Explore/translations/ja.json.mjs +0 -19
  143. package/lib/components/Explore/translations/ja.json.mjs.map +1 -1
  144. package/lib/components/Explore/translations/pt-BR.json.js +0 -19
  145. package/lib/components/Explore/translations/pt-BR.json.js.map +1 -1
  146. package/lib/components/Explore/translations/pt-BR.json.mjs +0 -19
  147. package/lib/components/Explore/translations/pt-BR.json.mjs.map +1 -1
  148. package/lib/components/Explore/translations/zh-Hans.json.js +0 -19
  149. package/lib/components/Explore/translations/zh-Hans.json.js.map +1 -1
  150. package/lib/components/Explore/translations/zh-Hans.json.mjs +0 -19
  151. package/lib/components/Explore/translations/zh-Hans.json.mjs.map +1 -1
  152. package/lib/components/Explore/translations/zh-Hant-TW.json.js +0 -19
  153. package/lib/components/Explore/translations/zh-Hant-TW.json.js.map +1 -1
  154. package/lib/components/Explore/translations/zh-Hant-TW.json.mjs +0 -19
  155. package/lib/components/Explore/translations/zh-Hant-TW.json.mjs.map +1 -1
  156. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
  157. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
  158. package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
  159. package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
  160. package/lib/components/GridGallery/GridModal/GridModal.js +1 -1
  161. package/lib/components/GridGallery/GridModal/GridModal.mjs +1 -1
  162. package/lib/components/Header/CartModalV2/CartModal.js +1 -1
  163. package/lib/components/Header/CartModalV2/CartModal.mjs +1 -1
  164. package/lib/components/Header/Header.js +1 -2
  165. package/lib/components/Header/Header.js.map +1 -1
  166. package/lib/components/Header/Header.mjs +1 -2
  167. package/lib/components/Header/Header.mjs.map +1 -1
  168. package/lib/components/LandingPagePro/LandingPagePro.d.ts +0 -3
  169. package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
  170. package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
  171. package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
  172. package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
  173. package/lib/components/LandingPageSidebar/LandingPageSidebar.js +1 -1
  174. package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs +1 -1
  175. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
  176. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
  177. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
  178. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
  179. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +0 -1
  180. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.js +1 -1
  181. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
  182. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.js +1 -1
  183. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.mjs +2 -2
  184. package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.js +1 -1
  185. package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.mjs +2 -2
  186. package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.js +1 -1
  187. package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.mjs +2 -2
  188. package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.js +1 -1
  189. package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.mjs +2 -2
  190. package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.js +1 -1
  191. package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.mjs +2 -2
  192. package/lib/components/ModelCompareV3/data/CloudGateways.js +2 -2
  193. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +2 -2
  194. package/lib/components/ModelCompareV3/data/Switching.js +1 -3
  195. package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
  196. package/lib/components/ModelCompareV3/data/Switching.mjs +1 -3
  197. package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
  198. package/lib/components/ModelCompareV3/data/products/aggregation.js +8 -16
  199. package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
  200. package/lib/components/ModelCompareV3/data/products/aggregation.mjs +8 -16
  201. package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
  202. package/lib/components/ModelCompareV3/data/products/connectDisplay.js +1 -1
  203. package/lib/components/ModelCompareV3/data/products/connectDisplay.js.map +1 -1
  204. package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs +1 -1
  205. package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs.map +1 -1
  206. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js +8 -16
  207. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js.map +1 -1
  208. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs +8 -16
  209. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs.map +1 -1
  210. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js +8 -16
  211. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js.map +1 -1
  212. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs +8 -16
  213. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs.map +1 -1
  214. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js +8 -16
  215. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js.map +1 -1
  216. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs +8 -16
  217. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs.map +1 -1
  218. package/lib/components/ModelCompareV3/data/products/g5Ptz.js +1 -1
  219. package/lib/components/ModelCompareV3/data/products/g5Ptz.mjs +1 -1
  220. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +8 -16
  221. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
  222. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +8 -16
  223. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
  224. package/lib/components/ModelCompareV3/data/products/missionCritical.js +0 -8
  225. package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
  226. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +0 -8
  227. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
  228. package/lib/components/ModelCompareV3/data/products/phoneTouch.js +3 -5
  229. package/lib/components/ModelCompareV3/data/products/phoneTouch.js.map +1 -1
  230. package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs +3 -5
  231. package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs.map +1 -1
  232. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js +2 -4
  233. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js.map +1 -1
  234. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs +2 -4
  235. package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs.map +1 -1
  236. package/lib/components/ModelCompareV3/data/products/professional24.js +0 -8
  237. package/lib/components/ModelCompareV3/data/products/professional24.js.map +1 -1
  238. package/lib/components/ModelCompareV3/data/products/professional24.mjs +0 -8
  239. package/lib/components/ModelCompareV3/data/products/professional24.mjs.map +1 -1
  240. package/lib/components/ModelCompareV3/data/products/professional24PoE.js +0 -8
  241. package/lib/components/ModelCompareV3/data/products/professional24PoE.js.map +1 -1
  242. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs +0 -8
  243. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs.map +1 -1
  244. package/lib/components/ModelCompareV3/data/products/professional48.js +0 -8
  245. package/lib/components/ModelCompareV3/data/products/professional48.js.map +1 -1
  246. package/lib/components/ModelCompareV3/data/products/professional48.mjs +0 -8
  247. package/lib/components/ModelCompareV3/data/products/professional48.mjs.map +1 -1
  248. package/lib/components/ModelCompareV3/data/products/professional48PoE.js +0 -8
  249. package/lib/components/ModelCompareV3/data/products/professional48PoE.js.map +1 -1
  250. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs +0 -8
  251. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs.map +1 -1
  252. package/lib/components/ModelCompareV3/data/products/professionalMax16.js +0 -7
  253. package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
  254. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +0 -7
  255. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
  256. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +0 -7
  257. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
  258. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +0 -7
  259. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
  260. package/lib/components/ModelCompareV3/data/products/professionalMax24.js +0 -7
  261. package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
  262. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +0 -7
  263. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
  264. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +0 -7
  265. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
  266. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +0 -7
  267. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
  268. package/lib/components/ModelCompareV3/data/products/professionalMax48.js +0 -7
  269. package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
  270. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +0 -7
  271. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
  272. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +0 -7
  273. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
  274. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +0 -7
  275. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
  276. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +1 -11
  277. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
  278. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +1 -11
  279. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
  280. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +0 -8
  281. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
  282. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +0 -8
  283. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
  284. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +0 -8
  285. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
  286. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +0 -8
  287. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
  288. package/lib/components/ModelCompareV3/data/products/switchesStandard.js +0 -8
  289. package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
  290. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +0 -8
  291. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
  292. package/lib/components/ModelCompareV3/data/products/theta360.js +1 -1
  293. package/lib/components/ModelCompareV3/data/products/theta360.mjs +1 -1
  294. package/lib/components/ModelCompareV3/data/products/thetaWideAngle.js +1 -1
  295. package/lib/components/ModelCompareV3/data/products/thetaWideAngle.mjs +1 -1
  296. package/lib/components/ModelCompareV3/data/products/ucCast.js +1 -1
  297. package/lib/components/ModelCompareV3/data/products/ucCast.js.map +1 -1
  298. package/lib/components/ModelCompareV3/data/products/ucCast.mjs +1 -1
  299. package/lib/components/ModelCompareV3/data/products/ucCast.mjs.map +1 -1
  300. package/lib/components/ModelCompareV3/data/products/ucCastPro.js +1 -1
  301. package/lib/components/ModelCompareV3/data/products/ucCastPro.js.map +1 -1
  302. package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs +1 -1
  303. package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs.map +1 -1
  304. package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
  305. package/lib/components/ModelCompareV3/data/products/udr.mjs +1 -1
  306. package/lib/components/ModelCompareV3/data/products/udw.js +1 -1
  307. package/lib/components/ModelCompareV3/data/products/udw.mjs +1 -1
  308. package/lib/components/ModelCompareV3/data/products/umr.js +1 -1
  309. package/lib/components/ModelCompareV3/data/products/umr.mjs +1 -1
  310. package/lib/components/ModelCompareV3/data/properties/index.d.ts +0 -1
  311. package/lib/components/ModelCompareV3/data/properties/index.js +0 -2
  312. package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
  313. package/lib/components/ModelCompareV3/data/properties/index.mjs +0 -1
  314. package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
  315. package/lib/components/ModelCompareV3/data/property-sets/switching.js +4 -6
  316. package/lib/components/ModelCompareV3/data/property-sets/switching.js.map +1 -1
  317. package/lib/components/ModelCompareV3/data/property-sets/switching.mjs +4 -6
  318. package/lib/components/ModelCompareV3/data/property-sets/switching.mjs.map +1 -1
  319. package/lib/components/ModelCompareV3/translations/ar.json.js +0 -3
  320. package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
  321. package/lib/components/ModelCompareV3/translations/ar.json.mjs +0 -3
  322. package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
  323. package/lib/components/ModelCompareV3/translations/de.json.js +0 -3
  324. package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
  325. package/lib/components/ModelCompareV3/translations/de.json.mjs +0 -3
  326. package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
  327. package/lib/components/ModelCompareV3/translations/el.json.js +0 -3
  328. package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
  329. package/lib/components/ModelCompareV3/translations/el.json.mjs +0 -3
  330. package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
  331. package/lib/components/ModelCompareV3/translations/en.json.js +0 -3
  332. package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
  333. package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -3
  334. package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
  335. package/lib/components/ModelCompareV3/translations/es.json.js +0 -3
  336. package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
  337. package/lib/components/ModelCompareV3/translations/es.json.mjs +0 -3
  338. package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
  339. package/lib/components/ModelCompareV3/translations/fr.json.js +0 -3
  340. package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
  341. package/lib/components/ModelCompareV3/translations/fr.json.mjs +0 -3
  342. package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
  343. package/lib/components/ModelCompareV3/translations/it.json.js +0 -3
  344. package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
  345. package/lib/components/ModelCompareV3/translations/it.json.mjs +0 -3
  346. package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
  347. package/lib/components/ModelCompareV3/translations/ja.json.js +2 -5
  348. package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
  349. package/lib/components/ModelCompareV3/translations/ja.json.mjs +2 -5
  350. package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
  351. package/lib/components/ModelCompareV3/translations/pt-BR.json.js +0 -3
  352. package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
  353. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +0 -3
  354. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
  355. package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
  356. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +0 -3
  357. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
  358. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +0 -3
  359. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
  360. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +0 -3
  361. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
  362. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +0 -3
  363. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs.map +1 -1
  364. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +15 -311
  365. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
  366. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +15 -309
  367. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
  368. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +22 -38
  369. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
  370. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs +22 -38
  371. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
  372. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -10
  373. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
  374. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
  375. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
  376. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
  377. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.d.ts +1 -1
  378. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js +4 -5
  379. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
  380. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs +4 -5
  381. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
  382. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  383. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
  384. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  385. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
  386. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +0 -2
  387. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
  388. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +0 -2
  389. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
  390. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  391. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  392. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  393. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  394. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  395. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  396. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
  397. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
  398. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
  399. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
  400. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  401. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  402. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  403. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  404. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  405. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  406. package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -4
  407. package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
  408. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -4
  409. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
  410. package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
  411. package/lib/components/Search/Input/Input.js +1 -1
  412. package/lib/components/Search/Input/Input.mjs +1 -1
  413. package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
  414. package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
  415. package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
  416. package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
  417. package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
  418. package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
  419. package/lib/constants/icons/generic/close.svg.js +1 -1
  420. package/lib/constants/icons/generic/close.svg.mjs +2 -2
  421. package/lib/constants/icons/generic/index.js +1 -1
  422. package/lib/constants/icons/generic/index.mjs +1 -1
  423. package/lib/constants/icons/menu/index.d.ts +0 -1
  424. package/lib/constants/icons/menu/index.js +0 -9
  425. package/lib/constants/icons/menu/index.js.map +1 -1
  426. package/lib/constants/icons/menu/index.mjs +0 -2
  427. package/lib/constants/icons/menu/index.mjs.map +1 -1
  428. package/lib/constants/keyFeatureIcons.d.ts +0 -2
  429. package/lib/constants/keyFeatureIcons.js +0 -6
  430. package/lib/constants/keyFeatureIcons.js.map +1 -1
  431. package/lib/constants/keyFeatureIcons.mjs +0 -6
  432. package/lib/constants/keyFeatureIcons.mjs.map +1 -1
  433. package/lib/constants/proStoreCategories/mapping/index.d.ts +1 -3
  434. package/lib/constants/proStoreCategories/mapping/index.js +8 -18
  435. package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
  436. package/lib/constants/proStoreCategories/mapping/index.mjs +8 -18
  437. package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
  438. package/lib/constants/proStoreCategories/mapping/redirects.js +1 -8
  439. package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
  440. package/lib/constants/proStoreCategories/mapping/redirects.mjs +1 -8
  441. package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
  442. package/lib/constants/proStoreCategories/mapping/unifi.d.ts +2 -4
  443. package/lib/constants/proStoreCategories/mapping/unifi.js +1 -3
  444. package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
  445. package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -3
  446. package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
  447. package/lib/constants/proStoreCategories/translations/ar.json.js +2 -3
  448. package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
  449. package/lib/constants/proStoreCategories/translations/ar.json.mjs +2 -3
  450. package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
  451. package/lib/constants/proStoreCategories/translations/de.json.js +2 -3
  452. package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
  453. package/lib/constants/proStoreCategories/translations/de.json.mjs +2 -3
  454. package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
  455. package/lib/constants/proStoreCategories/translations/el.json.js +2 -3
  456. package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
  457. package/lib/constants/proStoreCategories/translations/el.json.mjs +2 -3
  458. package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
  459. package/lib/constants/proStoreCategories/translations/en.json.js +1 -5
  460. package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
  461. package/lib/constants/proStoreCategories/translations/en.json.mjs +2 -5
  462. package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
  463. package/lib/constants/proStoreCategories/translations/es.json.js +2 -3
  464. package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
  465. package/lib/constants/proStoreCategories/translations/es.json.mjs +2 -3
  466. package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
  467. package/lib/constants/proStoreCategories/translations/fr.json.js +3 -4
  468. package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
  469. package/lib/constants/proStoreCategories/translations/fr.json.mjs +3 -4
  470. package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
  471. package/lib/constants/proStoreCategories/translations/it.json.js +2 -3
  472. package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
  473. package/lib/constants/proStoreCategories/translations/it.json.mjs +2 -3
  474. package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
  475. package/lib/constants/proStoreCategories/translations/ja.json.js +2 -3
  476. package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
  477. package/lib/constants/proStoreCategories/translations/ja.json.mjs +2 -3
  478. package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
  479. package/lib/constants/proStoreCategories/translations/pt-BR.json.js +2 -3
  480. package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
  481. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +2 -3
  482. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
  483. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -4
  484. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
  485. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +3 -4
  486. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
  487. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -4
  488. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
  489. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +3 -4
  490. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
  491. package/lib/constants/shopify/keyFeatureIcons.js +0 -8
  492. package/lib/constants/shopify/keyFeatureIcons.js.map +1 -1
  493. package/lib/constants/shopify/keyFeatureIcons.mjs +0 -6
  494. package/lib/constants/shopify/keyFeatureIcons.mjs.map +1 -1
  495. package/lib/contexts/MenuContext/context.js +1 -1
  496. package/lib/contexts/MenuContext/context.js.map +1 -1
  497. package/lib/contexts/MenuContext/context.mjs +1 -1
  498. package/lib/contexts/MenuContext/context.mjs.map +1 -1
  499. package/lib/contexts/MenuContext/mapping.d.ts +3 -3
  500. package/lib/contexts/MenuContext/mapping.js +7 -21
  501. package/lib/contexts/MenuContext/mapping.js.map +1 -1
  502. package/lib/contexts/MenuContext/mapping.mjs +7 -20
  503. package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
  504. package/lib/contexts/MenuContext/presets.d.ts +4 -11
  505. package/lib/contexts/MenuContext/presets.js +12 -16
  506. package/lib/contexts/MenuContext/presets.js.map +1 -1
  507. package/lib/contexts/MenuContext/presets.mjs +13 -13
  508. package/lib/contexts/MenuContext/presets.mjs.map +1 -1
  509. package/lib/contexts/MenuContext/types.d.ts +1 -1
  510. package/lib/contexts/MenuContext/types.js.map +1 -1
  511. package/lib/contexts/MenuContext/types.mjs.map +1 -1
  512. package/lib/contexts/MenuContext/utils.js +1 -5
  513. package/lib/contexts/MenuContext/utils.js.map +1 -1
  514. package/lib/contexts/MenuContext/utils.mjs +1 -5
  515. package/lib/contexts/MenuContext/utils.mjs.map +1 -1
  516. package/lib/helpers/index.d.ts +0 -1
  517. package/lib/helpers/index.js +0 -11
  518. package/lib/helpers/index.js.map +1 -1
  519. package/lib/helpers/index.mjs +0 -1
  520. package/lib/helpers/index.mjs.map +1 -1
  521. package/lib/types/index.d.ts +0 -1
  522. package/lib/types/index.js +0 -2
  523. package/lib/types/index.js.map +1 -1
  524. package/lib/types/index.mjs +0 -1
  525. package/lib/types/index.mjs.map +1 -1
  526. package/lib/utils/array.d.ts +0 -4
  527. package/lib/utils/array.js +0 -10
  528. package/lib/utils/array.js.map +1 -1
  529. package/lib/utils/array.mjs +1 -10
  530. package/lib/utils/array.mjs.map +1 -1
  531. package/lib/utils/money/constants.d.ts +25 -56
  532. package/lib/utils/money/constants.js +7 -72
  533. package/lib/utils/money/constants.js.map +1 -1
  534. package/lib/utils/money/constants.mjs +7 -70
  535. package/lib/utils/money/constants.mjs.map +1 -1
  536. package/lib/utils/money/format.d.ts +5 -10
  537. package/lib/utils/money/format.js +14 -22
  538. package/lib/utils/money/format.js.map +1 -1
  539. package/lib/utils/money/format.mjs +16 -23
  540. package/lib/utils/money/format.mjs.map +1 -1
  541. package/lib/utils/money/index.d.ts +1 -4
  542. package/lib/utils/money/index.js +8 -26
  543. package/lib/utils/money/index.js.map +1 -1
  544. package/lib/utils/money/index.mjs +4 -8
  545. package/lib/utils/money/index.mjs.map +1 -1
  546. package/lib/utils/money/misc.d.ts +28 -68
  547. package/lib/utils/money/misc.js +64 -35
  548. package/lib/utils/money/misc.js.map +1 -1
  549. package/lib/utils/money/misc.mjs +43 -32
  550. package/lib/utils/money/misc.mjs.map +1 -1
  551. package/lib/utils/money/tax.d.ts +2 -38
  552. package/lib/utils/money/tax.js +10 -46
  553. package/lib/utils/money/tax.js.map +1 -1
  554. package/lib/utils/money/tax.mjs +11 -42
  555. package/lib/utils/money/tax.mjs.map +1 -1
  556. package/lib/utils/money/types.d.ts +3 -78
  557. package/lib/utils/nextjs/navigationPresets.d.ts +5 -7
  558. package/lib/utils/nextjs/navigationPresets.js +7 -13
  559. package/lib/utils/nextjs/navigationPresets.js.map +1 -1
  560. package/lib/utils/nextjs/navigationPresets.mjs +8 -14
  561. package/lib/utils/nextjs/navigationPresets.mjs.map +1 -1
  562. package/lib/utils/number.d.ts +1 -1
  563. package/lib/utils/number.js +1 -1
  564. package/lib/utils/number.js.map +1 -1
  565. package/lib/utils/number.mjs +1 -1
  566. package/lib/utils/number.mjs.map +1 -1
  567. package/lib/utils/validations.d.ts +15 -0
  568. package/lib/utils/validations.js +23 -0
  569. package/lib/utils/validations.js.map +1 -0
  570. package/lib/utils/validations.mjs +21 -0
  571. package/lib/utils/validations.mjs.map +1 -0
  572. package/package.json +54 -55
  573. package/lib/assets/efg.png +0 -0
  574. package/lib/assets/g5Ptz.jpg +0 -0
  575. package/lib/assets/group.svg +0 -6
  576. package/lib/assets/keyFeatures/group.svg +0 -6
  577. package/lib/assets/keyFeatures/group.svg.js.map +0 -1
  578. package/lib/assets/keyFeatures/group.svg.mjs +0 -3
  579. package/lib/assets/keyFeatures/group.svg.mjs.map +0 -1
  580. package/lib/assets/keyFeatures/music.svg +0 -3
  581. package/lib/assets/keyFeatures/music.svg.js.map +0 -1
  582. package/lib/assets/keyFeatures/music.svg.mjs +0 -3
  583. package/lib/assets/keyFeatures/music.svg.mjs.map +0 -1
  584. package/lib/assets/music.svg +0 -3
  585. package/lib/assets/powerAmp.jpg +0 -0
  586. package/lib/assets/powerAmp.svg +0 -3
  587. package/lib/assets/ucg-max.png +0 -0
  588. package/lib/assets/udr2.jpg +0 -0
  589. package/lib/assets/udw2.jpg +0 -0
  590. package/lib/assets/umr2.jpg +0 -0
  591. package/lib/assets/volume-on2.svg +0 -3
  592. package/lib/components/Explore/assets/baseStation--mobile.jpg.js.map +0 -1
  593. package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs +0 -3
  594. package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs.map +0 -1
  595. package/lib/components/Explore/assets/g4Ptz.jpg.js.map +0 -1
  596. package/lib/components/Explore/assets/g4Ptz.jpg.mjs +0 -3
  597. package/lib/components/Explore/assets/g4Ptz.jpg.mjs.map +0 -1
  598. package/lib/components/Explore/assets/g5Ptz.jpg.js.map +0 -1
  599. package/lib/components/Explore/assets/g5Ptz.jpg.mjs +0 -3
  600. package/lib/components/Explore/assets/g5Ptz.jpg.mjs.map +0 -1
  601. package/lib/components/Explore/assets/powerAmp.jpg.js +0 -27
  602. package/lib/components/Explore/assets/powerAmp.jpg.js.map +0 -1
  603. package/lib/components/Explore/assets/powerAmp.jpg.mjs +0 -3
  604. package/lib/components/Explore/assets/powerAmp.jpg.mjs.map +0 -1
  605. package/lib/components/Explore/assets/udr.jpg.js +0 -27
  606. package/lib/components/Explore/assets/udr.jpg.js.map +0 -1
  607. package/lib/components/Explore/assets/udr.jpg.mjs +0 -3
  608. package/lib/components/Explore/assets/udr.jpg.mjs.map +0 -1
  609. package/lib/components/Explore/assets/udw.jpg.js +0 -27
  610. package/lib/components/Explore/assets/udw.jpg.js.map +0 -1
  611. package/lib/components/Explore/assets/udw.jpg.mjs +0 -3
  612. package/lib/components/Explore/assets/udw.jpg.mjs.map +0 -1
  613. package/lib/components/Explore/assets/umr.jpg.js +0 -27
  614. package/lib/components/Explore/assets/umr.jpg.js.map +0 -1
  615. package/lib/components/Explore/assets/umr.jpg.mjs +0 -3
  616. package/lib/components/Explore/assets/umr.jpg.mjs.map +0 -1
  617. package/lib/components/Explore/assets/ux.jpg.js +0 -27
  618. package/lib/components/Explore/assets/ux.jpg.js.map +0 -1
  619. package/lib/components/Explore/assets/ux.jpg.mjs +0 -3
  620. package/lib/components/Explore/assets/ux.jpg.mjs.map +0 -1
  621. package/lib/components/ModelCompareV3/assets/volume-on.svg.js +0 -27
  622. package/lib/components/ModelCompareV3/assets/volume-on.svg.js.map +0 -1
  623. package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs +0 -3
  624. package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs.map +0 -1
  625. package/lib/components/ModelCompareV3/data/properties/proAvSupport.d.ts +0 -2
  626. package/lib/components/ModelCompareV3/data/properties/proAvSupport.js +0 -19
  627. package/lib/components/ModelCompareV3/data/properties/proAvSupport.js.map +0 -1
  628. package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs +0 -11
  629. package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs.map +0 -1
  630. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
  631. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
  632. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
  633. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
  634. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +0 -27
  635. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
  636. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
  637. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
  638. package/lib/constants/icons/menu/powerAmp.svg.js +0 -27
  639. package/lib/constants/icons/menu/powerAmp.svg.js.map +0 -1
  640. package/lib/constants/icons/menu/powerAmp.svg.mjs +0 -3
  641. package/lib/constants/icons/menu/powerAmp.svg.mjs.map +0 -1
  642. package/lib/helpers/product.d.ts +0 -87
  643. package/lib/helpers/product.js +0 -346
  644. package/lib/helpers/product.js.map +0 -1
  645. package/lib/helpers/product.mjs +0 -335
  646. package/lib/helpers/product.mjs.map +0 -1
  647. package/lib/types/product.d.ts +0 -87
  648. package/lib/types/product.js +0 -14
  649. package/lib/types/product.js.map +0 -1
  650. package/lib/types/product.mjs +0 -13
  651. package/lib/types/product.mjs.map +0 -1
  652. package/lib/utils/money/allocators/fixedAmount.d.ts +0 -26
  653. package/lib/utils/money/allocators/fixedAmount.js +0 -55
  654. package/lib/utils/money/allocators/fixedAmount.js.map +0 -1
  655. package/lib/utils/money/allocators/fixedAmount.mjs +0 -53
  656. package/lib/utils/money/allocators/fixedAmount.mjs.map +0 -1
  657. package/lib/utils/money/allocators/index.d.ts +0 -2
  658. package/lib/utils/money/allocators/index.js +0 -8
  659. package/lib/utils/money/allocators/index.js.map +0 -1
  660. package/lib/utils/money/allocators/index.mjs +0 -4
  661. package/lib/utils/money/allocators/index.mjs.map +0 -1
  662. package/lib/utils/money/allocators/productAmount.d.ts +0 -13
  663. package/lib/utils/money/allocators/productAmount.js +0 -110
  664. package/lib/utils/money/allocators/productAmount.js.map +0 -1
  665. package/lib/utils/money/allocators/productAmount.mjs +0 -108
  666. package/lib/utils/money/allocators/productAmount.mjs.map +0 -1
  667. package/lib/utils/money/exchangeRate.d.ts +0 -31
  668. package/lib/utils/money/exchangeRate.js +0 -27
  669. package/lib/utils/money/exchangeRate.js.map +0 -1
  670. package/lib/utils/money/exchangeRate.mjs +0 -23
  671. package/lib/utils/money/exchangeRate.mjs.map +0 -1
  672. package/lib/utils/money/misc.private.d.ts +0 -23
  673. package/lib/utils/money/misc.private.js +0 -46
  674. package/lib/utils/money/misc.private.js.map +0 -1
  675. package/lib/utils/money/misc.private.mjs +0 -21
  676. package/lib/utils/money/misc.private.mjs.map +0 -1
  677. package/lib/utils/money/shipping.d.ts +0 -5
  678. package/lib/utils/money/shipping.js +0 -8
  679. package/lib/utils/money/shipping.js.map +0 -1
  680. package/lib/utils/money/shipping.mjs +0 -6
  681. package/lib/utils/money/shipping.mjs.map +0 -1
  682. package/lib/utils/money/tax.private.d.ts +0 -17
  683. package/lib/utils/money/tax.private.js +0 -65
  684. package/lib/utils/money/tax.private.js.map +0 -1
  685. package/lib/utils/money/tax.private.mjs +0 -60
  686. package/lib/utils/money/tax.private.mjs.map +0 -1
  687. package/lib/utils/productSort.d.ts +0 -41
  688. package/lib/utils/productSort.js +0 -66
  689. package/lib/utils/productSort.js.map +0 -1
  690. package/lib/utils/productSort.mjs +0 -59
  691. package/lib/utils/productSort.mjs.map +0 -1
  692. /package/lib/assets/{baseStation--mobile.jpg → baseStation-mobile.jpg} +0 -0
  693. /package/lib/assets/{g4Ptz.jpg → g4-ptz.jpg} +0 -0
  694. /package/lib/assets/{ux.jpg → unifiExpress.jpg} +0 -0
@@ -1,53 +0,0 @@
1
- import { allocate, subtract, greaterThan } from 'dinero.js';
2
- import { assert } from '../../errors.mjs';
3
- import { getDinero, getDineroCurrency, amount } from '../misc.mjs';
4
- "use strict";
5
- var __defProp = Object.defineProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value
11
- }) : obj[key] = value;
12
- var __publicField = (obj, key, value) => {
13
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
14
- return value;
15
- };
16
- class FixedAmountAllocator {
17
- constructor({
18
- initialAllocateAmount,
19
- initialTotalAmount,
20
- currency
21
- }) {
22
- /**
23
- * How much we have left to allocate for given allocation from the remaining total
24
- */
25
- __publicField(this, "remainingAllocationAmount");
26
- /**
27
- * How much we have left to allocate in total
28
- */
29
- __publicField(this, "remainingTotalAmount");
30
- __publicField(this, "currency");
31
- this.remainingAllocationAmount = getDinero(initialAllocateAmount, currency);
32
- this.remainingTotalAmount = getDinero(initialTotalAmount, currency);
33
- this.currency = getDineroCurrency(currency);
34
- }
35
- /**
36
- * We always allocate biggest share to first item
37
- */
38
- allocate(lineItemTotal, currency) {
39
- assert(this.currency.code === currency, `Currency mismatch, expected ${currency}, got ${this.currency.code}`);
40
- const lineItemTotalDinero = getDinero(lineItemTotal, currency);
41
- if (lineItemTotal === 0) {
42
- return lineItemTotalDinero;
43
- }
44
- const [allocationAmount, remainingAllocationAmount] = allocate(this.remainingAllocationAmount, [lineItemTotal, Math.max(amount(this.remainingTotalAmount) - lineItemTotal, 0)]);
45
- assert(!!allocationAmount, "Allocation amount is zero");
46
- assert(!!remainingAllocationAmount, "Remaining allocation remainder is zero");
47
- this.remainingAllocationAmount = remainingAllocationAmount;
48
- this.remainingTotalAmount = subtract(this.remainingTotalAmount, lineItemTotalDinero);
49
- return greaterThan(allocationAmount, lineItemTotalDinero) ? lineItemTotalDinero : allocationAmount;
50
- }
51
- }
52
- export { FixedAmountAllocator };
53
- //# sourceMappingURL=fixedAmount.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixedAmount.mjs","sources":["../../../../src/utils/money/allocators/fixedAmount.ts"],"sourcesContent":["import { allocate, greaterThan, subtract } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { amount, getDinero, getDineroCurrency } from \"../misc\";\nimport type { Cents, Dino, DinoCurrency } from \"../types\";\n\n/**\n * Helper class to distribute a fixed amount (e.g. discount) between multiple items.\n * For example when trying to apply 5$ discount to 3 items, we need to distribute it evenly as possible\n */\nexport class FixedAmountAllocator {\n /**\n * How much we have left to allocate for given allocation from the remaining total\n */\n public remainingAllocationAmount: Dino;\n /**\n * How much we have left to allocate in total\n */\n public remainingTotalAmount: Dino;\n public currency: DinoCurrency;\n\n constructor({\n initialAllocateAmount,\n initialTotalAmount,\n currency,\n }: {\n initialAllocateAmount: Cents;\n initialTotalAmount: Cents;\n currency: Currency;\n }) {\n this.remainingAllocationAmount = getDinero(initialAllocateAmount, currency);\n this.remainingTotalAmount = getDinero(initialTotalAmount, currency);\n this.currency = getDineroCurrency(currency);\n }\n\n /**\n * We always allocate biggest share to first item\n */\n allocate(lineItemTotal: Cents, currency: Currency): Dino {\n assert(\n this.currency.code === currency,\n `Currency mismatch, expected ${currency}, got ${this.currency.code}`,\n );\n const lineItemTotalDinero = getDinero(lineItemTotal, currency);\n /**\n * If total price of line items is zero, it means it's free, thus no discount\n * can be calculated (it's either 0 or infinity, but let's go with 0)\n */\n if (lineItemTotal === 0) {\n return lineItemTotalDinero;\n }\n\n const [allocationAmount, remainingAllocationAmount] = allocate(\n this.remainingAllocationAmount,\n [\n lineItemTotal,\n Math.max(amount(this.remainingTotalAmount) - lineItemTotal, 0),\n ],\n );\n\n assert(!!allocationAmount, \"Allocation amount is zero\");\n assert(\n !!remainingAllocationAmount,\n \"Remaining allocation remainder is zero\",\n );\n\n this.remainingAllocationAmount = remainingAllocationAmount;\n this.remainingTotalAmount = subtract(\n this.remainingTotalAmount,\n lineItemTotalDinero,\n );\n\n /**\n * The discount amount is evenly split but can still be higher than the line item total\n * Need to ceil the price to be not more than the line item total\n */\n return greaterThan(allocationAmount, lineItemTotalDinero)\n ? lineItemTotalDinero\n : allocationAmount;\n }\n}\n"],"names":["FixedAmountAllocator","constructor","initialAllocateAmount","initialTotalAmount","currency","__publicField","remainingAllocationAmount","getDinero","remainingTotalAmount","getDineroCurrency","allocate","lineItemTotal","assert","code","lineItemTotalDinero","allocationAmount","Math","max","amount","subtract","greaterThan"],"mappings":";;;;;;;;;;;;;;;AAWO,MAAMA,oBAAqB,CAAA;EAWhCC,WAAYA,CAAA;IACVC,qBAAA;IACAC,kBAAA;IACAC;EAAA,CAKC,EAAA;IAfH;AAAA;AAAA;IAAOC,aAAA,CAAA,IAAA,EAAA,2BAAA,CAAA;IAIP;AAAA;AAAA;IAAOA,aAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IAWA,IAAA,CAAAC,yBAAA,GAA4BC,SAAU,CAAAL,qBAAA,EAAuBE,QAAQ,CAAA;IACrE,IAAA,CAAAI,oBAAA,GAAuBD,SAAU,CAAAJ,kBAAA,EAAoBC,QAAQ,CAAA;IAC7D,IAAA,CAAAA,QAAA,GAAWK,kBAAkBL,QAAQ,CAAA;EAC5C;EAAA;AAAA;AAAA;EAKAM,QAAAA,CAASC,eAAsBP,QAA0B,EAAA;IACvDQ,MAAA,CACE,IAAA,CAAKR,SAASS,IAAS,KAAAT,QAAA,EACQ,+BAAAA,QAAiB,SAAA,IAAA,CAAKA,SAASS,IAAI,EAAA,CACpE;IACM,MAAAC,mBAAA,GAAsBP,SAAU,CAAAI,aAAA,EAAeP,QAAQ,CAAA;IAK7D,IAAIO,kBAAkB,CAAG,EAAA;MAChB,OAAAG,mBAAA;IACT;IAEM,MAAA,CAACC,gBAAkB,EAAAT,yBAAyB,CAAI,GAAAI,QAAA,CACpD,IAAK,CAAAJ,yBAAA,EACL,CACEK,aAAA,EACAK,KAAKC,GAAI,CAAAC,MAAA,CAAO,KAAKV,oBAAoB,CAAA,GAAIG,eAAe,CAAC,CAAA,CAC/D,CACF;IAEOC,MAAA,CAAA,CAAC,CAACG,gBAAA,EAAkB,2BAA2B,CAAA;IACtDH,MAAA,CACE,CAAC,CAACN,yBAAA,EACF,wCAAA,CACF;IAEA,IAAA,CAAKA,yBAA4B,GAAAA,yBAAA;IACjC,IAAA,CAAKE,oBAAuB,GAAAW,QAAA,CAC1B,IAAK,CAAAX,oBAAA,EACLM,mBAAA,CACF;IAMA,OAAOM,WAAY,CAAAL,gBAAA,EAAkBD,mBAAmB,CAAA,GACpDA,mBACA,GAAAC,gBAAA;EACN;AACF;"}
@@ -1,2 +0,0 @@
1
- export * from "./fixedAmount";
2
- export * from "./productAmount";
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var fixedAmount = require('./fixedAmount.js');
4
- var productAmount = require('./productAmount.js');
5
- "use strict";
6
- exports.FixedAmountAllocator = fixedAmount.FixedAmountAllocator;
7
- exports.ProductAmountAllocator = productAmount.ProductAmountAllocator;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,4 +0,0 @@
1
- export { FixedAmountAllocator } from './fixedAmount.mjs';
2
- export { ProductAmountAllocator } from './productAmount.mjs';
3
- "use strict";
4
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,13 +0,0 @@
1
- import type { FullLineItemSummary } from "../types";
2
- /**
3
- * Helper class to distribute a total amount for a product
4
- */
5
- export declare class ProductAmountAllocator {
6
- #private;
7
- /**
8
- * Remaining quantity to allocate
9
- */
10
- quantity: number;
11
- constructor(productSummary: FullLineItemSummary);
12
- allocateQty(quantity: number): FullLineItemSummary;
13
- }
@@ -1,110 +0,0 @@
1
- 'use strict';
2
-
3
- var misc = require('../misc.js');
4
- var fixedAmount = require('./fixedAmount.js');
5
- "use strict";
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
8
- enumerable: true,
9
- configurable: true,
10
- writable: true,
11
- value
12
- }) : obj[key] = value;
13
- var __publicField = (obj, key, value) => {
14
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
15
- return value;
16
- };
17
- var __accessCheck = (obj, member, msg) => {
18
- if (!member.has(obj)) throw TypeError("Cannot " + msg);
19
- };
20
- var __privateGet = (obj, member, getter) => {
21
- __accessCheck(obj, member, "read from private field");
22
- return getter ? getter.call(obj) : member.get(obj);
23
- };
24
- var __privateAdd = (obj, member, value) => {
25
- if (member.has(obj)) throw TypeError("Cannot add the same private member more than once");
26
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
27
- };
28
- var __privateSet = (obj, member, value, setter) => {
29
- __accessCheck(obj, member, "write to private field");
30
- setter ? setter.call(obj, value) : member.set(obj, value);
31
- return value;
32
- };
33
- var _itemPrice, _currency, _subtotal, _discountAmount, _taxableAmount, _tax, _total;
34
- class ProductAmountAllocator {
35
- constructor(productSummary) {
36
- // #############################################################################
37
- // Fixed values
38
- // #############################################################################
39
- __privateAdd(this, _itemPrice, void 0);
40
- __privateAdd(this, _currency, void 0);
41
- // #############################################################################
42
- /**
43
- * Remaining quantity to allocate
44
- */
45
- __publicField(this, "quantity");
46
- // #############################################################################
47
- // Specific amount allocators
48
- // #############################################################################
49
- __privateAdd(this, _subtotal, void 0);
50
- __privateAdd(this, _discountAmount, void 0);
51
- __privateAdd(this, _taxableAmount, void 0);
52
- __privateAdd(this, _tax, void 0);
53
- __privateAdd(this, _total, void 0);
54
- const currency = productSummary.currency;
55
- const priceForAllocation = productSummary.itemPrice * productSummary.quantity;
56
- __privateSet(this, _itemPrice, productSummary.itemPrice);
57
- __privateSet(this, _currency, currency);
58
- this.quantity = productSummary.quantity;
59
- __privateSet(this, _subtotal, new fixedAmount.FixedAmountAllocator({
60
- initialAllocateAmount: productSummary.subtotal,
61
- initialTotalAmount: priceForAllocation,
62
- currency
63
- }));
64
- __privateSet(this, _discountAmount, new fixedAmount.FixedAmountAllocator({
65
- initialAllocateAmount: productSummary.discountAmount,
66
- initialTotalAmount: priceForAllocation,
67
- currency
68
- }));
69
- __privateSet(this, _taxableAmount, new fixedAmount.FixedAmountAllocator({
70
- initialAllocateAmount: productSummary.taxableAmount,
71
- initialTotalAmount: priceForAllocation,
72
- currency
73
- }));
74
- __privateSet(this, _tax, new fixedAmount.FixedAmountAllocator({
75
- initialAllocateAmount: productSummary.tax,
76
- initialTotalAmount: priceForAllocation,
77
- currency
78
- }));
79
- __privateSet(this, _total, new fixedAmount.FixedAmountAllocator({
80
- initialAllocateAmount: productSummary.total,
81
- initialTotalAmount: priceForAllocation,
82
- currency
83
- }));
84
- }
85
- allocateQty(quantity) {
86
- let quantityNormalized = Math.max(quantity, 0);
87
- quantityNormalized = this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;
88
- this.quantity = Math.max(this.quantity - quantityNormalized, 0);
89
- const itemQuantityPrice = __privateGet(this, _itemPrice) * quantityNormalized;
90
- return {
91
- itemPrice: __privateGet(this, _itemPrice),
92
- currency: __privateGet(this, _currency),
93
- quantity: quantityNormalized,
94
- subtotal: misc.amount(__privateGet(this, _subtotal).allocate(itemQuantityPrice, __privateGet(this, _currency))),
95
- discountAmount: misc.amount(__privateGet(this, _discountAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
96
- taxableAmount: misc.amount(__privateGet(this, _taxableAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
97
- tax: misc.amount(__privateGet(this, _tax).allocate(itemQuantityPrice, __privateGet(this, _currency))),
98
- total: misc.amount(__privateGet(this, _total).allocate(itemQuantityPrice, __privateGet(this, _currency)))
99
- };
100
- }
101
- }
102
- _itemPrice = new WeakMap();
103
- _currency = new WeakMap();
104
- _subtotal = new WeakMap();
105
- _discountAmount = new WeakMap();
106
- _taxableAmount = new WeakMap();
107
- _tax = new WeakMap();
108
- _total = new WeakMap();
109
- exports.ProductAmountAllocator = ProductAmountAllocator;
110
- //# sourceMappingURL=productAmount.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productAmount.js","sources":["../../../../src/utils/money/allocators/productAmount.ts"],"sourcesContent":["import type { Currency } from \"../../../types\";\nimport { amount } from \"../misc\";\nimport type { Cents, FullLineItemSummary } from \"../types\";\nimport { FixedAmountAllocator } from \"./fixedAmount\";\n\n/**\n * Helper class to distribute a total amount for a product\n */\nexport class ProductAmountAllocator {\n // #############################################################################\n // Fixed values\n // #############################################################################\n readonly #itemPrice: Cents;\n readonly #currency: Currency;\n // #############################################################################\n /**\n * Remaining quantity to allocate\n */\n quantity: number;\n // #############################################################################\n // Specific amount allocators\n // #############################################################################\n #subtotal: FixedAmountAllocator;\n #discountAmount: FixedAmountAllocator;\n #taxableAmount: FixedAmountAllocator;\n #tax: FixedAmountAllocator;\n #total: FixedAmountAllocator;\n\n constructor(productSummary: FullLineItemSummary) {\n const currency = productSummary.currency;\n\n /**\n * Somewhat hackish, just need a stable price that can easily divide later by quantity\n */\n const priceForAllocation =\n productSummary.itemPrice * productSummary.quantity;\n\n this.#itemPrice = productSummary.itemPrice;\n this.#currency = currency;\n this.quantity = productSummary.quantity;\n this.#subtotal = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.subtotal,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#discountAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.discountAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#taxableAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.taxableAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#tax = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.tax,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#total = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.total,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n }\n\n allocateQty(quantity: number): FullLineItemSummary {\n // Calculate remaining allocatable quantity\n let quantityNormalized = Math.max(quantity, 0);\n quantityNormalized =\n this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;\n\n // Adjust remaining qty\n this.quantity = Math.max(this.quantity - quantityNormalized, 0);\n\n // How big of a slice of the total price we need to allocate\n const itemQuantityPrice = this.#itemPrice * quantityNormalized;\n\n return {\n itemPrice: this.#itemPrice,\n currency: this.#currency,\n quantity: quantityNormalized,\n subtotal: amount(\n this.#subtotal.allocate(itemQuantityPrice, this.#currency),\n ),\n discountAmount: amount(\n this.#discountAmount.allocate(itemQuantityPrice, this.#currency),\n ),\n taxableAmount: amount(\n this.#taxableAmount.allocate(itemQuantityPrice, this.#currency),\n ),\n tax: amount(this.#tax.allocate(itemQuantityPrice, this.#currency)),\n total: amount(this.#total.allocate(itemQuantityPrice, this.#currency)),\n } satisfies FullLineItemSummary;\n }\n}\n"],"names":["_itemPrice","_currency","_subtotal","_discountAmount","_taxableAmount","_tax","_total","ProductAmountAllocator","constructor","productSummary","__privateAdd","__publicField","currency","priceForAllocation","itemPrice","quantity","__privateSet","FixedAmountAllocator","initialAllocateAmount","subtotal","initialTotalAmount","discountAmount","taxableAmount","tax","total","allocateQty","quantityNormalized","Math","max","itemQuantityPrice","__privateGet","amount","allocate","WeakMap"],"mappings":"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"}
@@ -1,108 +0,0 @@
1
- import { amount } from '../misc.mjs';
2
- import { FixedAmountAllocator } from './fixedAmount.mjs';
3
- "use strict";
4
- var __defProp = Object.defineProperty;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
6
- enumerable: true,
7
- configurable: true,
8
- writable: true,
9
- value
10
- }) : obj[key] = value;
11
- var __publicField = (obj, key, value) => {
12
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
- return value;
14
- };
15
- var __accessCheck = (obj, member, msg) => {
16
- if (!member.has(obj)) throw TypeError("Cannot " + msg);
17
- };
18
- var __privateGet = (obj, member, getter) => {
19
- __accessCheck(obj, member, "read from private field");
20
- return getter ? getter.call(obj) : member.get(obj);
21
- };
22
- var __privateAdd = (obj, member, value) => {
23
- if (member.has(obj)) throw TypeError("Cannot add the same private member more than once");
24
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
25
- };
26
- var __privateSet = (obj, member, value, setter) => {
27
- __accessCheck(obj, member, "write to private field");
28
- setter ? setter.call(obj, value) : member.set(obj, value);
29
- return value;
30
- };
31
- var _itemPrice, _currency, _subtotal, _discountAmount, _taxableAmount, _tax, _total;
32
- class ProductAmountAllocator {
33
- constructor(productSummary) {
34
- // #############################################################################
35
- // Fixed values
36
- // #############################################################################
37
- __privateAdd(this, _itemPrice, void 0);
38
- __privateAdd(this, _currency, void 0);
39
- // #############################################################################
40
- /**
41
- * Remaining quantity to allocate
42
- */
43
- __publicField(this, "quantity");
44
- // #############################################################################
45
- // Specific amount allocators
46
- // #############################################################################
47
- __privateAdd(this, _subtotal, void 0);
48
- __privateAdd(this, _discountAmount, void 0);
49
- __privateAdd(this, _taxableAmount, void 0);
50
- __privateAdd(this, _tax, void 0);
51
- __privateAdd(this, _total, void 0);
52
- const currency = productSummary.currency;
53
- const priceForAllocation = productSummary.itemPrice * productSummary.quantity;
54
- __privateSet(this, _itemPrice, productSummary.itemPrice);
55
- __privateSet(this, _currency, currency);
56
- this.quantity = productSummary.quantity;
57
- __privateSet(this, _subtotal, new FixedAmountAllocator({
58
- initialAllocateAmount: productSummary.subtotal,
59
- initialTotalAmount: priceForAllocation,
60
- currency
61
- }));
62
- __privateSet(this, _discountAmount, new FixedAmountAllocator({
63
- initialAllocateAmount: productSummary.discountAmount,
64
- initialTotalAmount: priceForAllocation,
65
- currency
66
- }));
67
- __privateSet(this, _taxableAmount, new FixedAmountAllocator({
68
- initialAllocateAmount: productSummary.taxableAmount,
69
- initialTotalAmount: priceForAllocation,
70
- currency
71
- }));
72
- __privateSet(this, _tax, new FixedAmountAllocator({
73
- initialAllocateAmount: productSummary.tax,
74
- initialTotalAmount: priceForAllocation,
75
- currency
76
- }));
77
- __privateSet(this, _total, new FixedAmountAllocator({
78
- initialAllocateAmount: productSummary.total,
79
- initialTotalAmount: priceForAllocation,
80
- currency
81
- }));
82
- }
83
- allocateQty(quantity) {
84
- let quantityNormalized = Math.max(quantity, 0);
85
- quantityNormalized = this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;
86
- this.quantity = Math.max(this.quantity - quantityNormalized, 0);
87
- const itemQuantityPrice = __privateGet(this, _itemPrice) * quantityNormalized;
88
- return {
89
- itemPrice: __privateGet(this, _itemPrice),
90
- currency: __privateGet(this, _currency),
91
- quantity: quantityNormalized,
92
- subtotal: amount(__privateGet(this, _subtotal).allocate(itemQuantityPrice, __privateGet(this, _currency))),
93
- discountAmount: amount(__privateGet(this, _discountAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
94
- taxableAmount: amount(__privateGet(this, _taxableAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
95
- tax: amount(__privateGet(this, _tax).allocate(itemQuantityPrice, __privateGet(this, _currency))),
96
- total: amount(__privateGet(this, _total).allocate(itemQuantityPrice, __privateGet(this, _currency)))
97
- };
98
- }
99
- }
100
- _itemPrice = new WeakMap();
101
- _currency = new WeakMap();
102
- _subtotal = new WeakMap();
103
- _discountAmount = new WeakMap();
104
- _taxableAmount = new WeakMap();
105
- _tax = new WeakMap();
106
- _total = new WeakMap();
107
- export { ProductAmountAllocator };
108
- //# sourceMappingURL=productAmount.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productAmount.mjs","sources":["../../../../src/utils/money/allocators/productAmount.ts"],"sourcesContent":["import type { Currency } from \"../../../types\";\nimport { amount } from \"../misc\";\nimport type { Cents, FullLineItemSummary } from \"../types\";\nimport { FixedAmountAllocator } from \"./fixedAmount\";\n\n/**\n * Helper class to distribute a total amount for a product\n */\nexport class ProductAmountAllocator {\n // #############################################################################\n // Fixed values\n // #############################################################################\n readonly #itemPrice: Cents;\n readonly #currency: Currency;\n // #############################################################################\n /**\n * Remaining quantity to allocate\n */\n quantity: number;\n // #############################################################################\n // Specific amount allocators\n // #############################################################################\n #subtotal: FixedAmountAllocator;\n #discountAmount: FixedAmountAllocator;\n #taxableAmount: FixedAmountAllocator;\n #tax: FixedAmountAllocator;\n #total: FixedAmountAllocator;\n\n constructor(productSummary: FullLineItemSummary) {\n const currency = productSummary.currency;\n\n /**\n * Somewhat hackish, just need a stable price that can easily divide later by quantity\n */\n const priceForAllocation =\n productSummary.itemPrice * productSummary.quantity;\n\n this.#itemPrice = productSummary.itemPrice;\n this.#currency = currency;\n this.quantity = productSummary.quantity;\n this.#subtotal = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.subtotal,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#discountAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.discountAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#taxableAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.taxableAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#tax = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.tax,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.#total = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.total,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n }\n\n allocateQty(quantity: number): FullLineItemSummary {\n // Calculate remaining allocatable quantity\n let quantityNormalized = Math.max(quantity, 0);\n quantityNormalized =\n this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;\n\n // Adjust remaining qty\n this.quantity = Math.max(this.quantity - quantityNormalized, 0);\n\n // How big of a slice of the total price we need to allocate\n const itemQuantityPrice = this.#itemPrice * quantityNormalized;\n\n return {\n itemPrice: this.#itemPrice,\n currency: this.#currency,\n quantity: quantityNormalized,\n subtotal: amount(\n this.#subtotal.allocate(itemQuantityPrice, this.#currency),\n ),\n discountAmount: amount(\n this.#discountAmount.allocate(itemQuantityPrice, this.#currency),\n ),\n taxableAmount: amount(\n this.#taxableAmount.allocate(itemQuantityPrice, this.#currency),\n ),\n tax: amount(this.#tax.allocate(itemQuantityPrice, this.#currency)),\n total: amount(this.#total.allocate(itemQuantityPrice, this.#currency)),\n } satisfies FullLineItemSummary;\n }\n}\n"],"names":["_itemPrice","_currency","_subtotal","_discountAmount","_taxableAmount","_tax","_total","ProductAmountAllocator","constructor","productSummary","__privateAdd","__publicField","currency","priceForAllocation","itemPrice","quantity","__privateSet","FixedAmountAllocator","initialAllocateAmount","subtotal","initialTotalAmount","discountAmount","taxableAmount","tax","total","allocateQty","quantityNormalized","Math","max","itemQuantityPrice","__privateGet","amount","allocate","WeakMap"],"mappings":"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"}
@@ -1,31 +0,0 @@
1
- import type { Cents, TaxRate } from "./types";
2
- /**
3
- * Parse exchange rate to dinero friendly amount and scale.
4
- *
5
- * Used to prepare exchange rate for sending over API.
6
- *
7
- * @example
8
- * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}
9
- */
10
- export declare const toSnapshotExchangeRate: (exchangeRate: TaxRate) => {
11
- amount: Cents;
12
- scale: number;
13
- };
14
- /**
15
- * Converts an arbitrary exchange rate to a fixed decimal place number.
16
- *
17
- * Used to take in an input and convert it for storage in the database.
18
- *
19
- * @example
20
- * toFixedExchangeRate("0.123456789") // "0.123457"
21
- * toFixedExchangeRate("0.123456789", true) // 0.123457
22
- */
23
- export declare function toFixedExchangeRate(rate: string | number, asNumber?: boolean): string;
24
- export declare function toFixedExchangeRate(rate: string | number, asNumber: true): number;
25
- /**
26
- * Invert an exchange rate by doing 1 / rate
27
- * Used to fake a reverse exchange rate in case we don't have it
28
- * @example
29
- * invertExchangeRate("0.22") // "4.545455"
30
- */
31
- export declare function invertExchangeRate(rate: string | number): string;
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var errors = require('../errors.js');
4
- var number = require('../number.js');
5
- var constants = require('./constants.js');
6
- var misc_private = require('./misc.private.js');
7
- "use strict";
8
- const toSnapshotExchangeRate = exchangeRate => {
9
- number.isFloat(exchangeRate, "Exchange rate");
10
- errors.assert(exchangeRate > 0, "Exchange rate must be greater than 0");
11
- const rateInt = misc_private.floatToInt(exchangeRate, constants.EXCHANGE_RATE_DINERO_CURRENCY.base, constants.EXCHANGE_RATE_DINERO_CURRENCY.exponent);
12
- return {
13
- amount: rateInt,
14
- scale: constants.EXCHANGE_RATE_DINERO_CURRENCY.exponent
15
- };
16
- };
17
- function toFixedExchangeRate(rate, asNumber) {
18
- return number.toFixedRate(typeof rate === "string" ? +rate : rate, constants.EXCHANGE_RATE_DINERO_CURRENCY.exponent, asNumber);
19
- }
20
- function invertExchangeRate(rate) {
21
- const exchangeRate = toFixedExchangeRate(rate, true);
22
- return toFixedExchangeRate(1 / exchangeRate, false);
23
- }
24
- exports.invertExchangeRate = invertExchangeRate;
25
- exports.toFixedExchangeRate = toFixedExchangeRate;
26
- exports.toSnapshotExchangeRate = toSnapshotExchangeRate;
27
- //# sourceMappingURL=exchangeRate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exchangeRate.js","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,cAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAAA,CAAAA,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,YAAA,CAAAA,UAAA,CACdJ,YAAA,EACAK,SAAAA,CAAAA,6BAA8B,CAAAC,IAAA,EAC9BD,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,SAA8B,CAAAA,6BAAA,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,MAAA,CAAAA,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;;;"}
@@ -1,23 +0,0 @@
1
- import { assert } from '../errors.mjs';
2
- import { isFloat, toFixedRate } from '../number.mjs';
3
- import { EXCHANGE_RATE_DINERO_CURRENCY } from './constants.mjs';
4
- import { floatToInt } from './misc.private.mjs';
5
- "use strict";
6
- const toSnapshotExchangeRate = exchangeRate => {
7
- isFloat(exchangeRate, "Exchange rate");
8
- assert(exchangeRate > 0, "Exchange rate must be greater than 0");
9
- const rateInt = floatToInt(exchangeRate, EXCHANGE_RATE_DINERO_CURRENCY.base, EXCHANGE_RATE_DINERO_CURRENCY.exponent);
10
- return {
11
- amount: rateInt,
12
- scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent
13
- };
14
- };
15
- function toFixedExchangeRate(rate, asNumber) {
16
- return toFixedRate(typeof rate === "string" ? +rate : rate, EXCHANGE_RATE_DINERO_CURRENCY.exponent, asNumber);
17
- }
18
- function invertExchangeRate(rate) {
19
- const exchangeRate = toFixedExchangeRate(rate, true);
20
- return toFixedExchangeRate(1 / exchangeRate, false);
21
- }
22
- export { invertExchangeRate, toFixedExchangeRate, toSnapshotExchangeRate };
23
- //# sourceMappingURL=exchangeRate.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exchangeRate.mjs","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,OAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,UAAA,CACdJ,YAAA,EACAK,6BAA8B,CAAAC,IAAA,EAC9BD,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,6BAA8B,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;"}
@@ -1,23 +0,0 @@
1
- import * as currencies from "@dinero.js/currencies";
2
- import type { DinoCurrency } from "./types";
3
- /**
4
- * Fast lookup for our custom currency enum to check that given currency is valid
5
- */
6
- export declare const currencyLookup: Set<string>;
7
- /**
8
- * Dinero currency lookup to check that given currency is valid
9
- */
10
- export declare const dineroCurrenciesLookup: Map<string, currencies.Currency<number>>;
11
- /**
12
- * Private util to convert a float value into a int. Also applies financial rounding to the value if needed.
13
- * Inspired by https://v2.dinerojs.com/docs/faq/how-can-i-create-dinero-objects-from-floats
14
- * @example
15
- * floatToInt(69.10, 10, 2); // 6910
16
- * floatToInt(42, 10, 2); // 4200
17
- * floatToInt(0.22, 10, 6); // 220000
18
- */
19
- export declare const floatToInt: (floatAmount: number, base: number, exponent: number) => number;
20
- /**
21
- * FIXME: is it private tho?!
22
- */
23
- export declare const decimalToDinero: (decimalAmount: string | number, currency: DinoCurrency) => import("dinero.js").Dinero<number>;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- var currencies = require('@dinero.js/currencies');
4
- var dinero_js = require('dinero.js');
5
- require('../../types/index.js');
6
- var number = require('../number.js');
7
- var constants = require('./constants.js');
8
- var generated = require('../../types/generated.js');
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
21
- });
22
- }
23
- });
24
- }
25
- n["default"] = e;
26
- return Object.freeze(n);
27
- }
28
- var currencies__namespace = /*#__PURE__*/_interopNamespace(currencies);
29
- "use strict";
30
- const currencyLookup = new Set(Object.keys(generated.Currency).map(el => el.toString()));
31
- const dineroCurrenciesLookup = new Map(Object.values(currencies__namespace).map(currency => [currency.code, currency]));
32
- const floatToInt = (floatAmount, base, exponent) => constants.Round.Financial(floatAmount * Math.pow(base, exponent));
33
- const decimalToDinero = (decimalAmount, currency) => {
34
- const parsedNumber = typeof decimalAmount === "number" ? decimalAmount : Number.parseFloat(decimalAmount);
35
- number.isFloat(parsedNumber);
36
- const parsedNumberInt = Number.parseInt((parsedNumber * Math.pow(10, currency.exponent)).toFixed(0));
37
- return dinero_js.dinero({
38
- amount: parsedNumberInt,
39
- currency
40
- });
41
- };
42
- exports.currencyLookup = currencyLookup;
43
- exports.decimalToDinero = decimalToDinero;
44
- exports.dineroCurrenciesLookup = dineroCurrenciesLookup;
45
- exports.floatToInt = floatToInt;
46
- //# sourceMappingURL=misc.private.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.private.js","sources":["../../../src/utils/money/misc.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport * as currencies from \"@dinero.js/currencies\";\nimport { dinero } from \"dinero.js\";\n\nimport { Currency } from \"../../types\";\nimport { isFloat } from \"../number\";\nimport { Round } from \"./constants\";\nimport type { DinoCurrency } from \"./types\";\n\n/**\n * Fast lookup for our custom currency enum to check that given currency is valid\n */\nexport const currencyLookup = new Set(\n Object.keys(Currency).map((el) => el.toString()),\n);\n\n/**\n * Dinero currency lookup to check that given currency is valid\n */\nexport const dineroCurrenciesLookup = new Map(\n Object.values(currencies).map((currency) => [currency.code, currency]),\n);\n\n/**\n * Private util to convert a float value into a int. Also applies financial rounding to the value if needed.\n * Inspired by https://v2.dinerojs.com/docs/faq/how-can-i-create-dinero-objects-from-floats\n * @example\n * floatToInt(69.10, 10, 2); // 6910\n * floatToInt(42, 10, 2); // 4200\n * floatToInt(0.22, 10, 6); // 220000\n */\nexport const floatToInt = (\n floatAmount: number,\n base: number,\n exponent: number,\n // FIXME: pass in the rounding method and or use roundDinero\n): number => Round.Financial(floatAmount * Math.pow(base, exponent));\n\n/**\n * FIXME: is it private tho?!\n */\nexport const decimalToDinero = (\n decimalAmount: string | number,\n currency: DinoCurrency,\n // FIXME: rounding method?!\n) => {\n const parsedNumber =\n typeof decimalAmount === \"number\"\n ? decimalAmount\n : Number.parseFloat(decimalAmount);\n isFloat(parsedNumber);\n\n const parsedNumberInt = Number.parseInt(\n (parsedNumber * Math.pow(10, currency.exponent)).toFixed(0),\n );\n return dinero({\n amount: parsedNumberInt,\n currency,\n });\n};\n"],"names":["currencyLookup","Set","Object","keys","Currency","map","el","toString","dineroCurrenciesLookup","Map","values","currencies","currency","code","floatToInt","floatAmount","base","exponent","Round","Financial","Math","pow","decimalToDinero","decimalAmount","parsedNumber","Number","parseFloat","isFloat","parsedNumberInt","parseInt","toFixed","dinero","amount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAMA,iBAAiB,IAAIC,GAAA,CAChCC,MAAA,CAAOC,KAAKC,SAAAA,CAAAA,QAAQ,CAAA,CAAEC,IAAKC,EAAA,IAAOA,EAAG,CAAAC,QAAA,EAAU,CACjD,CAAA;AAKO,MAAMC,yBAAyB,IAAIC,GAAA,CACxCP,MAAA,CAAOQ,MAAO,CAAAC,qBAAU,CAAE,CAAAN,GAAA,CAAKO,QAAA,IAAa,CAACA,QAAA,CAASC,IAAM,EAAAD,QAAQ,CAAC,CACvE,CAAA;AAUO,MAAME,UAAa,GAAAA,CACxBC,WACA,EAAAC,IAAA,EACAC,QAEW,KAAAC,SAAA,CAAAA,KAAA,CAAMC,SAAU,CAAAJ,WAAA,GAAcK,IAAK,CAAAC,GAAA,CAAIL,IAAM,EAAAC,QAAQ,CAAC,CAAA;AAKtD,MAAAK,eAAA,GAAkBA,CAC7BC,aAAA,EACAX,QAEG,KAAA;EACH,MAAMY,eACJ,OAAOD,aAAA,KAAkB,WACrBA,aACA,GAAAE,MAAA,CAAOC,WAAWH,aAAa,CAAA;EACrCI,MAAA,CAAAA,OAAA,CAAQH,YAAY,CAAA;EAEpB,MAAMI,kBAAkBH,MAAO,CAAAI,QAAA,CAC5B,CAAAL,YAAA,GAAeJ,KAAKC,GAAI,CAAA,EAAA,EAAIT,SAASK,QAAQ,CAAA,EAAGa,QAAQ,CAAC,CAAA,CAC5D;EACA,OAAOC,gBAAO,CAAA;IACZC,MAAQ,EAAAJ,eAAA;IACRhB;EAAA,CACD,CAAA;AACH,CAAA;;;;"}
@@ -1,21 +0,0 @@
1
- import * as currencies from '@dinero.js/currencies';
2
- import { dinero } from 'dinero.js';
3
- import '../../types/index.mjs';
4
- import { isFloat } from '../number.mjs';
5
- import { Round } from './constants.mjs';
6
- import { Currency } from '../../types/generated.mjs';
7
- "use strict";
8
- const currencyLookup = new Set(Object.keys(Currency).map(el => el.toString()));
9
- const dineroCurrenciesLookup = new Map(Object.values(currencies).map(currency => [currency.code, currency]));
10
- const floatToInt = (floatAmount, base, exponent) => Round.Financial(floatAmount * Math.pow(base, exponent));
11
- const decimalToDinero = (decimalAmount, currency) => {
12
- const parsedNumber = typeof decimalAmount === "number" ? decimalAmount : Number.parseFloat(decimalAmount);
13
- isFloat(parsedNumber);
14
- const parsedNumberInt = Number.parseInt((parsedNumber * Math.pow(10, currency.exponent)).toFixed(0));
15
- return dinero({
16
- amount: parsedNumberInt,
17
- currency
18
- });
19
- };
20
- export { currencyLookup, decimalToDinero, dineroCurrenciesLookup, floatToInt };
21
- //# sourceMappingURL=misc.private.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.private.mjs","sources":["../../../src/utils/money/misc.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport * as currencies from \"@dinero.js/currencies\";\nimport { dinero } from \"dinero.js\";\n\nimport { Currency } from \"../../types\";\nimport { isFloat } from \"../number\";\nimport { Round } from \"./constants\";\nimport type { DinoCurrency } from \"./types\";\n\n/**\n * Fast lookup for our custom currency enum to check that given currency is valid\n */\nexport const currencyLookup = new Set(\n Object.keys(Currency).map((el) => el.toString()),\n);\n\n/**\n * Dinero currency lookup to check that given currency is valid\n */\nexport const dineroCurrenciesLookup = new Map(\n Object.values(currencies).map((currency) => [currency.code, currency]),\n);\n\n/**\n * Private util to convert a float value into a int. Also applies financial rounding to the value if needed.\n * Inspired by https://v2.dinerojs.com/docs/faq/how-can-i-create-dinero-objects-from-floats\n * @example\n * floatToInt(69.10, 10, 2); // 6910\n * floatToInt(42, 10, 2); // 4200\n * floatToInt(0.22, 10, 6); // 220000\n */\nexport const floatToInt = (\n floatAmount: number,\n base: number,\n exponent: number,\n // FIXME: pass in the rounding method and or use roundDinero\n): number => Round.Financial(floatAmount * Math.pow(base, exponent));\n\n/**\n * FIXME: is it private tho?!\n */\nexport const decimalToDinero = (\n decimalAmount: string | number,\n currency: DinoCurrency,\n // FIXME: rounding method?!\n) => {\n const parsedNumber =\n typeof decimalAmount === \"number\"\n ? decimalAmount\n : Number.parseFloat(decimalAmount);\n isFloat(parsedNumber);\n\n const parsedNumberInt = Number.parseInt(\n (parsedNumber * Math.pow(10, currency.exponent)).toFixed(0),\n );\n return dinero({\n amount: parsedNumberInt,\n currency,\n });\n};\n"],"names":["currencyLookup","Set","Object","keys","Currency","map","el","toString","dineroCurrenciesLookup","Map","values","currencies","currency","code","floatToInt","floatAmount","base","exponent","Round","Financial","Math","pow","decimalToDinero","decimalAmount","parsedNumber","Number","parseFloat","isFloat","parsedNumberInt","parseInt","toFixed","dinero","amount"],"mappings":";;;;;;;AAeO,MAAMA,iBAAiB,IAAIC,GAAA,CAChCC,MAAA,CAAOC,KAAKC,QAAQ,CAAA,CAAEC,IAAKC,EAAA,IAAOA,EAAG,CAAAC,QAAA,EAAU,CACjD,CAAA;AAKO,MAAMC,yBAAyB,IAAIC,GAAA,CACxCP,MAAA,CAAOQ,MAAO,CAAAC,UAAU,CAAE,CAAAN,GAAA,CAAKO,QAAA,IAAa,CAACA,QAAA,CAASC,IAAM,EAAAD,QAAQ,CAAC,CACvE,CAAA;AAUO,MAAME,UAAa,GAAAA,CACxBC,WACA,EAAAC,IAAA,EACAC,QAEW,KAAAC,KAAA,CAAMC,SAAU,CAAAJ,WAAA,GAAcK,IAAK,CAAAC,GAAA,CAAIL,IAAM,EAAAC,QAAQ,CAAC,CAAA;AAKtD,MAAAK,eAAA,GAAkBA,CAC7BC,aAAA,EACAX,QAEG,KAAA;EACH,MAAMY,eACJ,OAAOD,aAAA,KAAkB,WACrBA,aACA,GAAAE,MAAA,CAAOC,WAAWH,aAAa,CAAA;EACrCI,OAAA,CAAQH,YAAY,CAAA;EAEpB,MAAMI,kBAAkBH,MAAO,CAAAI,QAAA,CAC5B,CAAAL,YAAA,GAAeJ,KAAKC,GAAI,CAAA,EAAA,EAAIT,SAASK,QAAQ,CAAA,EAAGa,QAAQ,CAAC,CAAA,CAC5D;EACA,OAAOC,MAAO,CAAA;IACZC,MAAQ,EAAAJ,eAAA;IACRhB;EAAA,CACD,CAAA;AACH,CAAA;"}
@@ -1,5 +0,0 @@
1
- import type { Dino } from "./types";
2
- /**
3
- * Rounding for shipping price used only after applying
4
- */
5
- export declare const roundShippingPrice: (price: Dino) => Dino;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var constants = require('./constants.js');
4
- var misc = require('./misc.js');
5
- "use strict";
6
- const roundShippingPrice = price => misc.roundDinero(price, constants.Round.Shipping);
7
- exports.roundShippingPrice = roundShippingPrice;
8
- //# sourceMappingURL=shipping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping.js","sources":["../../../src/utils/money/shipping.ts"],"sourcesContent":["import { Round } from \"./constants\";\nimport { roundDinero } from \"./misc\";\nimport type { Dino } from \"./types\";\n\n/**\n * Rounding for shipping price used only after applying\n */\nexport const roundShippingPrice = (price: Dino) =>\n roundDinero(price, Round.Shipping);\n"],"names":["roundShippingPrice","price","roundDinero","Round","Shipping"],"mappings":";;;;;AAOO,MAAMA,qBAAsBC,KAAA,IACjCC,IAAY,CAAAA,WAAA,CAAAD,KAAA,EAAOE,gBAAMC,QAAQ,CAAA;"}
@@ -1,6 +0,0 @@
1
- import { Round } from './constants.mjs';
2
- import { roundDinero } from './misc.mjs';
3
- "use strict";
4
- const roundShippingPrice = price => roundDinero(price, Round.Shipping);
5
- export { roundShippingPrice };
6
- //# sourceMappingURL=shipping.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping.mjs","sources":["../../../src/utils/money/shipping.ts"],"sourcesContent":["import { Round } from \"./constants\";\nimport { roundDinero } from \"./misc\";\nimport type { Dino } from \"./types\";\n\n/**\n * Rounding for shipping price used only after applying\n */\nexport const roundShippingPrice = (price: Dino) =>\n roundDinero(price, Round.Shipping);\n"],"names":["roundShippingPrice","price","roundDinero","Round","Shipping"],"mappings":";;;AAOO,MAAMA,qBAAsBC,KAAA,IACjCC,WAAY,CAAAD,KAAA,EAAOE,MAAMC,QAAQ,CAAA;"}