@ubnt/store.core 9.30.0-beta.12 → 9.30.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/CHANGELOG.md +0 -53
  2. package/lib/assets/attention.svg +5 -5
  3. package/lib/assets/attention2.svg +5 -5
  4. package/lib/assets/close2.svg +2 -3
  5. package/lib/assets/close3.svg +3 -2
  6. package/lib/assets/icons/wizard/plus.svg.js +1 -1
  7. package/lib/assets/icons/wizard/plus.svg.mjs +2 -2
  8. package/lib/assets/plus.svg +22 -4
  9. package/lib/assets/plus2.svg +1 -22
  10. package/lib/assets/plus3.svg +4 -1
  11. package/lib/assets/ucgUltra.jpg +0 -0
  12. package/lib/assets/ucgUltra2.jpg +0 -0
  13. package/lib/assets/udmPro.jpg +0 -0
  14. package/lib/assets/udmPro2.jpg +0 -0
  15. package/lib/assets/udmProMax.jpg +0 -0
  16. package/lib/assets/udmProMax2.jpg +0 -0
  17. package/lib/assets/udmProSpecial.jpg +0 -0
  18. package/lib/assets/udmProSpecial2.jpg +0 -0
  19. package/lib/components/BackInStock/BackInStock.types.d.ts +0 -1
  20. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.d.ts +1 -1
  21. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js +4 -16
  22. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js.map +1 -1
  23. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs +5 -17
  24. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs.map +1 -1
  25. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +1 -5
  26. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js +17 -82
  27. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js.map +1 -1
  28. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs +17 -82
  29. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs.map +1 -1
  30. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.types.d.ts +0 -4
  31. package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.js +1 -1
  32. package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.mjs +1 -1
  33. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
  34. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
  35. package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
  36. package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
  37. package/lib/components/FeaturesSection_deprecated/assets/plus.svg.js +1 -1
  38. package/lib/components/FeaturesSection_deprecated/assets/plus.svg.mjs +2 -2
  39. package/lib/components/Header/CartModalV2/Item/Item.js +3 -3
  40. package/lib/components/Header/CartModalV2/Item/Item.mjs +2 -2
  41. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +2 -7
  42. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  43. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  44. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  45. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  46. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  47. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  48. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  49. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  50. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  51. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  52. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  53. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  54. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  55. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  56. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  57. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  58. package/lib/components/ModelCompareV3/data/CloudGateways.js +12 -12
  59. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +8 -8
  60. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js +4 -16
  61. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js.map +1 -1
  62. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs +4 -16
  63. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs.map +1 -1
  64. package/lib/components/ModelCompareV3/data/products/aggregation.js +1 -1
  65. package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
  66. package/lib/components/ModelCompareV3/data/products/aggregation.mjs +1 -1
  67. package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
  68. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js +1 -1
  69. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js.map +1 -1
  70. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs +1 -1
  71. package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs.map +1 -1
  72. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js +1 -1
  73. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js.map +1 -1
  74. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs +1 -1
  75. package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs.map +1 -1
  76. package/lib/components/ModelCompareV3/data/products/enterprise8PoE.js +1 -1
  77. package/lib/components/ModelCompareV3/data/products/enterprise8PoE.js.map +1 -1
  78. package/lib/components/ModelCompareV3/data/products/enterprise8PoE.mjs +1 -1
  79. package/lib/components/ModelCompareV3/data/products/enterprise8PoE.mjs.map +1 -1
  80. package/lib/components/ModelCompareV3/data/products/enterpriseAccessHub.js +1 -1
  81. package/lib/components/ModelCompareV3/data/products/enterpriseAccessHub.js.map +1 -1
  82. package/lib/components/ModelCompareV3/data/products/enterpriseAccessHub.mjs +1 -1
  83. package/lib/components/ModelCompareV3/data/products/enterpriseAccessHub.mjs.map +1 -1
  84. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js +1 -1
  85. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js.map +1 -1
  86. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs +1 -1
  87. package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs.map +1 -1
  88. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +1 -1
  89. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
  90. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +1 -1
  91. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
  92. package/lib/components/ModelCompareV3/data/products/industrial.js +1 -1
  93. package/lib/components/ModelCompareV3/data/products/industrial.js.map +1 -1
  94. package/lib/components/ModelCompareV3/data/products/industrial.mjs +1 -1
  95. package/lib/components/ModelCompareV3/data/products/industrial.mjs.map +1 -1
  96. package/lib/components/ModelCompareV3/data/products/lite16PoE.js +1 -1
  97. package/lib/components/ModelCompareV3/data/products/lite16PoE.js.map +1 -1
  98. package/lib/components/ModelCompareV3/data/products/lite16PoE.mjs +1 -1
  99. package/lib/components/ModelCompareV3/data/products/lite16PoE.mjs.map +1 -1
  100. package/lib/components/ModelCompareV3/data/products/lite8PoE.js +1 -1
  101. package/lib/components/ModelCompareV3/data/products/lite8PoE.js.map +1 -1
  102. package/lib/components/ModelCompareV3/data/products/lite8PoE.mjs +1 -1
  103. package/lib/components/ModelCompareV3/data/products/lite8PoE.mjs.map +1 -1
  104. package/lib/components/ModelCompareV3/data/products/missionCritical.js +1 -1
  105. package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
  106. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +1 -1
  107. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
  108. package/lib/components/ModelCompareV3/data/products/professional24.js +1 -1
  109. package/lib/components/ModelCompareV3/data/products/professional24.js.map +1 -1
  110. package/lib/components/ModelCompareV3/data/products/professional24.mjs +1 -1
  111. package/lib/components/ModelCompareV3/data/products/professional24.mjs.map +1 -1
  112. package/lib/components/ModelCompareV3/data/products/professional24PoE.js +1 -1
  113. package/lib/components/ModelCompareV3/data/products/professional24PoE.js.map +1 -1
  114. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs +1 -1
  115. package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs.map +1 -1
  116. package/lib/components/ModelCompareV3/data/products/professional48.js +1 -1
  117. package/lib/components/ModelCompareV3/data/products/professional48.js.map +1 -1
  118. package/lib/components/ModelCompareV3/data/products/professional48.mjs +1 -1
  119. package/lib/components/ModelCompareV3/data/products/professional48.mjs.map +1 -1
  120. package/lib/components/ModelCompareV3/data/products/professional48PoE.js +1 -1
  121. package/lib/components/ModelCompareV3/data/products/professional48PoE.js.map +1 -1
  122. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs +1 -1
  123. package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs.map +1 -1
  124. package/lib/components/ModelCompareV3/data/products/professional8PoE.js +1 -1
  125. package/lib/components/ModelCompareV3/data/products/professional8PoE.js.map +1 -1
  126. package/lib/components/ModelCompareV3/data/products/professional8PoE.mjs +1 -1
  127. package/lib/components/ModelCompareV3/data/products/professional8PoE.mjs.map +1 -1
  128. package/lib/components/ModelCompareV3/data/products/standard16PoE.js +1 -1
  129. package/lib/components/ModelCompareV3/data/products/standard16PoE.js.map +1 -1
  130. package/lib/components/ModelCompareV3/data/products/standard16PoE.mjs +1 -1
  131. package/lib/components/ModelCompareV3/data/products/standard16PoE.mjs.map +1 -1
  132. package/lib/components/ModelCompareV3/data/products/standard24.js +1 -1
  133. package/lib/components/ModelCompareV3/data/products/standard24.js.map +1 -1
  134. package/lib/components/ModelCompareV3/data/products/standard24.mjs +1 -1
  135. package/lib/components/ModelCompareV3/data/products/standard24.mjs.map +1 -1
  136. package/lib/components/ModelCompareV3/data/products/standard24PoE.js +1 -1
  137. package/lib/components/ModelCompareV3/data/products/standard24PoE.js.map +1 -1
  138. package/lib/components/ModelCompareV3/data/products/standard24PoE.mjs +1 -1
  139. package/lib/components/ModelCompareV3/data/products/standard24PoE.mjs.map +1 -1
  140. package/lib/components/ModelCompareV3/data/products/standard48.js +1 -1
  141. package/lib/components/ModelCompareV3/data/products/standard48.js.map +1 -1
  142. package/lib/components/ModelCompareV3/data/products/standard48.mjs +1 -1
  143. package/lib/components/ModelCompareV3/data/products/standard48.mjs.map +1 -1
  144. package/lib/components/ModelCompareV3/data/products/standard48PoE.js +1 -1
  145. package/lib/components/ModelCompareV3/data/products/standard48PoE.js.map +1 -1
  146. package/lib/components/ModelCompareV3/data/products/standard48PoE.mjs +1 -1
  147. package/lib/components/ModelCompareV3/data/products/standard48PoE.mjs.map +1 -1
  148. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +3 -5
  149. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
  150. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +3 -5
  151. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
  152. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +1 -1
  153. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
  154. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +1 -1
  155. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
  156. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +1 -1
  157. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
  158. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +1 -1
  159. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
  160. package/lib/components/ModelCompareV3/data/products/switchesStandard.js +1 -1
  161. package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
  162. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +1 -1
  163. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
  164. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  165. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  166. package/lib/components/ModelCompareV3/data/products/udb.js +1 -1
  167. package/lib/components/ModelCompareV3/data/products/udb.js.map +1 -1
  168. package/lib/components/ModelCompareV3/data/products/udb.mjs +1 -1
  169. package/lib/components/ModelCompareV3/data/products/udb.mjs.map +1 -1
  170. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  171. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  172. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  173. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  174. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  175. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  176. package/lib/components/ModelCompareV3/translations/en.json.js +37 -16
  177. package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
  178. package/lib/components/ModelCompareV3/translations/en.json.mjs +37 -16
  179. package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
  180. package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
  181. package/lib/components/ProductWizard/ProductWizard.js +1 -1
  182. package/lib/components/ProductWizard/ProductWizard.mjs +1 -1
  183. package/lib/components/QuantityInput/QuantityInput.js +1 -1
  184. package/lib/components/QuantityInput/QuantityInput.mjs +1 -1
  185. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  186. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  187. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  188. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  189. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  190. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  191. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  192. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  193. package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
  194. package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
  195. package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
  196. package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
  197. package/lib/constants/icons/generic/index.js +3 -3
  198. package/lib/constants/icons/generic/index.mjs +1 -1
  199. package/lib/constants/icons/generic/plus.svg.js +5 -5
  200. package/lib/constants/icons/generic/plus.svg.mjs +2 -2
  201. package/lib/constants/proStoreCategories/mapping/filters.d.ts +4 -0
  202. package/lib/constants/proStoreCategories/mapping/filters.js +4 -0
  203. package/lib/constants/proStoreCategories/mapping/filters.js.map +1 -1
  204. package/lib/constants/proStoreCategories/mapping/filters.mjs +4 -0
  205. package/lib/constants/proStoreCategories/mapping/filters.mjs.map +1 -1
  206. package/lib/constants/proStoreCategories/mapping/index.js +2 -17
  207. package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
  208. package/lib/constants/proStoreCategories/mapping/index.mjs +2 -17
  209. package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
  210. package/lib/constants/proStoreCategories/mapping/mapping.d.ts +1 -7
  211. package/lib/constants/proStoreCategories/mapping/redirects.js +7 -7
  212. package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
  213. package/lib/constants/proStoreCategories/mapping/redirects.mjs +7 -7
  214. package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
  215. package/lib/constants/proStoreFilters/mapping.d.ts +19 -20
  216. package/lib/constants/proStoreFilters/mapping.js +35 -18
  217. package/lib/constants/proStoreFilters/mapping.js.map +1 -1
  218. package/lib/constants/proStoreFilters/mapping.mjs +35 -18
  219. package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
  220. package/lib/contexts/MenuContext/mapping.js +0 -1
  221. package/lib/contexts/MenuContext/mapping.js.map +1 -1
  222. package/lib/contexts/MenuContext/mapping.mjs +0 -1
  223. package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
  224. package/lib/utils/money/constants.d.ts +0 -9
  225. package/lib/utils/money/constants.js +1 -14
  226. package/lib/utils/money/constants.js.map +1 -1
  227. package/lib/utils/money/constants.mjs +2 -14
  228. package/lib/utils/money/constants.mjs.map +1 -1
  229. package/lib/utils/money/format.js +4 -17
  230. package/lib/utils/money/format.js.map +1 -1
  231. package/lib/utils/money/format.mjs +5 -18
  232. package/lib/utils/money/format.mjs.map +1 -1
  233. package/lib/utils/money/index.js +0 -1
  234. package/lib/utils/money/index.js.map +1 -1
  235. package/lib/utils/money/index.mjs +1 -1
  236. package/package.json +1 -1
  237. package/lib/assets/enterpriseCampus24.jpg +0 -0
  238. package/lib/assets/enterpriseCampus48.jpg +0 -0
  239. package/lib/assets/enterpriseCampusAggregation.jpg +0 -0
  240. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus24.jpg.js +0 -27
  241. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus24.jpg.js.map +0 -1
  242. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus24.jpg.mjs +0 -3
  243. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus24.jpg.mjs.map +0 -1
  244. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus48.jpg.js +0 -27
  245. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus48.jpg.js.map +0 -1
  246. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus48.jpg.mjs +0 -3
  247. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampus48.jpg.mjs.map +0 -1
  248. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampusAggregation.jpg.js +0 -27
  249. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampusAggregation.jpg.js.map +0 -1
  250. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampusAggregation.jpg.mjs +0 -3
  251. package/lib/components/ModelCompareV3/assets/Switching/enterpriseCampusAggregation.jpg.mjs.map +0 -1
  252. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.d.ts +0 -2
  253. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js +0 -91
  254. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js.map +0 -1
  255. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs +0 -83
  256. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs.map +0 -1
  257. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24.d.ts +0 -6
  258. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.d.ts +0 -2
  259. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js +0 -93
  260. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js.map +0 -1
  261. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs +0 -85
  262. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs.map +0 -1
  263. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48.d.ts +0 -6
  264. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.d.ts +0 -2
  265. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js +0 -93
  266. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js.map +0 -1
  267. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs +0 -85
  268. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mapping.mjs","sources":["../../../src/contexts/MenuContext/mapping.ts"],"sourcesContent":["/* eslint-disable sonarjs/no-duplicate-string */\nimport type { StaticImageData } from \"next/image\";\n\nimport { menu as menuIcons } from \"../../constants/icons\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { Language } from \"../../types/constants\";\n\n// #############################################################################\n// Enums\n// #############################################################################\n/**\n * Enum containing \"id's\" for different microsites used in navigation\n */\nexport enum SiteId {\n // ui.com\n Ui = \"ui\",\n // uisp.com\n Uisp = \"uisp\",\n // either new store or shopify\n Store = \"store\",\n // amplifi.com\n Amplifi = \"amplifi\",\n // Similar to ui.com but escapes route matching for use in techspecs.ui.com etc\n Generic = \"generic\",\n // techspecs.ui.com\n TechSpecs = \"techSpecs\",\n // experts.ui.com\n ExpertsUi = \"expertsUi\",\n // experts.uisp.com\n ExpertsUisp = \"expertsUisp\",\n // uwc.ui.com\n Uwc = \"uwc\",\n}\n\n// #############################################################################\n// Mapping related types\n// #############################################################################\n/**\n * Just a re-export of moved type to reduce breaking changes\n * @deprecated Use `import {Language} from '@ubnt/store.core/lib/types';` instead\n */\nexport { Language } from \"../../types\";\n\nexport const DEFAULT_LANGUAGE = Language.En;\n\nexport const LONG_LANGUAGES = [Language.De];\n\nexport const AvailableLanguages: { [key in Language]: string } = {\n [Language.En]: \"English\",\n [Language.Ar]: \"Arabic\",\n [Language.De]: \"German\",\n [Language.El]: \"Greek\",\n [Language.Es]: \"Spanish\",\n [Language.Fr]: \"French\",\n [Language.It]: \"Italian\",\n [Language.Ja]: \"Japanese\",\n [Language.Pt]: \"Portuguese\",\n [Language.Zh]: \"Chinese\",\n [Language.Tw]: \"Taiwanese\",\n};\n\n/**\n * Deployed languages list\n * Rules:\n * - First language in the list is default;\n * - Array should have an English language always;\n * - Rest of the languages are optional\n */\nexport type DeployedLanguages = [Language, ...Language[]];\n\n/**\n * Deployed languages for each store ID\n *\n * If null, then this store is not on the new platform/does not have a language in URL\n */\nexport type DeployedLanguagesMapping = Record<\n StoreId,\n DeployedLanguages | null\n>;\n\n/**\n * Mapping to store base urls\n *\n * WARNING: In case of new platform the url will include `/${storeId}/${language}` part, so we need to be careful when\n * combining path names!\n */\nexport type StoreRootUrlMapping = {\n [key in GlobalStoreId]: string;\n};\n\n/**\n * Mapping to microsite base urls\n * As of right no urls include a pathname\n */\nexport type MicrositeRootUrlMapping = {\n [SiteId.Ui]: string;\n [SiteId.Uisp]: string;\n [SiteId.Amplifi]: string;\n [SiteId.TechSpecs]: string;\n [SiteId.ExpertsUi]: string;\n [SiteId.ExpertsUisp]: string;\n [SiteId.Uwc]: string;\n};\n\n/**\n * Type for defining external microsite url, as the base domain can change depending on environment we can only define\n * it by:\n * 1. which microsite/store to lookup\n * 2. what pathname should we append it with\n */\nexport type SiteUrl = [\n // Don't allow to make sites for generic site id\n siteId: Exclude<SiteId, SiteId.Generic>,\n pathname: string,\n searchParams?: Record<string, string | number | boolean>,\n fragment?: string | number,\n];\n\nexport type NavigationUrl = {\n /**\n * (Optional) External URL to ui.com or uisp.com\n * Will override path usage, however, both will be used for active state check\n */\n url: SiteUrl;\n};\n\nexport type NavigationItemIcon = {\n src: string | StaticImageData;\n width: number;\n height: number;\n useRawHeight?: boolean;\n};\n\ninterface NavigationItemCore {\n /**\n * Slugified label for use as a key\n * Needs to be unique only between the same level children\n */\n id: string;\n label: string;\n icon?: NavigationItemIcon;\n mobileIcon?: NavigationItemIcon;\n /**\n * (Optional) Marks the navigation item with an additional blue \"New\" below the label\n */\n isNew?: boolean;\n}\n\nexport type NavigationInvisibleItem = {\n /**\n * (Optional) Use it to keep hidden from rendering in navigations, but preserve itself in categories.\n */\n invisible?: boolean;\n};\n\nexport type NavigationSubSubItem = NavigationItemCore &\n NavigationInvisibleItem &\n /**\n * The item either has a single path\n */ (\n | NavigationUrl\n /**\n * Or multi-item sub-sub-items\n */\n | {\n url?: never;\n items: NavigationSubSubItem[];\n }\n | {\n /**\n * External URL to ui.com or uisp.com\n */\n url: SiteUrl;\n fallbackUrl?: never;\n items?: NavigationSubSubItem[];\n }\n );\n\nexport type NavigationSubItem = NavigationItemCore &\n NavigationInvisibleItem & {\n /**\n * (Optional) Additional label that shows below the main label\n * ! For now, replaces \"New\" label if both are present\n */\n subLabel?: string;\n /**\n * (Optional) Color Style subLabel\n * @default 'grey'\n */\n subLabelTheme?: \"blue\" | \"grey\";\n /**\n * (Optional) Position of subLabel in collapsed mode\n * @default 'vertical'\n */\n subLabelCollapseMode?: \"vertical\" | \"horizontal\";\n\n icon: NavigationItemIcon;\n } & /**\n * The item either has a single path\n */ (\n | NavigationUrl\n /**\n * Or multi-item sub-sub-items\n */\n | {\n url?: SiteUrl;\n items: NavigationSubSubItem[];\n }\n );\n\nexport type NavigationItem = NavigationItemCore &\n NavigationInvisibleItem &\n (\n | {\n /**\n * External URL to ui.com or uisp.com\n */\n fallbackUrl?: never;\n items: NavigationSubItem[];\n key?: string;\n url: SiteUrl;\n }\n | {\n /**\n * Path to a collection, just like on sub-items\n * Leave null to inherit first available items path\n */\n fallbackUrl?: SiteUrl;\n items: NavigationSubItem[];\n key?: string;\n url?: never;\n }\n );\n\nexport type NavigationSection =\n | NavigationSectionFlat\n | NavigationSectionNested\n | NavigationSectionNestedWithFallback;\n\n/**\n * Goes directly to a specific url, no fuss\n */\ntype NavigationSectionFlat = Pick<NavigationItemCore, \"label\"> & {\n items?: never;\n key?: string;\n url: SiteUrl;\n};\n\n/**\n * Might go directly to an url or path (depends on context store or microsite), but if not specified fallback to first available item, and if no items show, the\n * fallback to `fallbackUrl`\n */\ntype NavigationSectionNested = Pick<NavigationItemCore, \"label\"> & {\n /**\n * Fallback url if no `url` provided and items are not available in the current store\n */\n fallbackUrl?: never;\n key?: string;\n items: NavigationItem[];\n url: SiteUrl;\n};\n\ntype NavigationSectionNestedWithFallback = Pick<NavigationItemCore, \"label\"> & {\n /**\n * Fallback url if no `url` provided and items are not available in the current store\n */\n fallbackUrl: SiteUrl;\n items: NavigationItem[];\n key?: string;\n url?: never;\n};\n\nexport type NavigationSectionType = \"primary\" | \"secondary\";\n\nexport type NavigationMapping = Record<\n NavigationSectionType,\n NavigationSection\n>;\n\n// #############################################################################\n// Defaults\n// #############################################################################\n\n/**\n * Fallback store in case we are not able to detect current store\n */\nexport const DEFAULT_STORE_ID = GlobalStoreId.Us;\n\n/**\n * Generic Site IDs that shouldn't be used for URL matching\n */\nexport const GENERIC_SITE_IDS = [SiteId.Generic, SiteId.TechSpecs, SiteId.Uwc];\n\n// #############################################################################\n// Main navigation mapping\n// #############################################################################\n\n/**\n * Sections' top-level item ids\n *\n * Using const over enum to preserve string type\n */\nexport const NavigationItemId = {\n CloudGateways: \"cloud-gateways\",\n WiFi: \"wifi\",\n Switching: \"switching\",\n CameraSecurity: \"camera-security\",\n DoorAccess: \"door-access\",\n NewIntegrations: \"new-integrations\",\n Accessories: \"accessories\",\n UnifiIdentity: \"unifi-identity\",\n SixtyGhzWireless: \"60ghz-wireless\",\n Wireless: \"wireless\",\n Fiber: \"fiber\",\n Wired: \"wired\",\n UispAccessoryTech: \"uisp-accessory-tech\",\n UispSoftware: \"uisp-software\",\n LargeDeploymentAssistance: \"large-deployment-assistance\",\n};\n\n/**\n * Master mapping of all navigation links in the app\n * @see https://docs.google.com/spreadsheets/d/1X2HxC54SrrryUy0MtQs7F95rNkh70XFhXnOBH3-fazw/edit?pli=1#gid=183343023\n * @see https://www.figma.com/file/WQBiTOpN41gTcnQ6FqIyDX/UI-Navigations?node-id=1%3A6520&t=I7dumjOsJAX5ZMYX-0\n */\nexport const NAVIGATION_MAPPING: NavigationMapping = {\n primary: {\n label: \"UniFi\",\n // fallbackUrl: [SiteId.Ui, \"/\"],\n url: [SiteId.Ui, \"/\"],\n items: [\n {\n id: NavigationItemId.CloudGateways,\n label: \"Cloud Gateways\",\n key: \"cloud-gateways\",\n url: [SiteId.Ui, \"/cloud-gateways\"],\n items: [\n {\n id: \"enterprise-scale\",\n label: \"Enterprise Scale\",\n icon: {\n src: menuIcons.efgStacked,\n width: 114,\n height: 25,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/enterprise-scale\"],\n },\n {\n id: \"large-scale\",\n label: \"Large Scale\",\n icon: {\n src: menuIcons.dreamMachineProMax,\n width: 113,\n height: 14,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/large-scale\"],\n },\n {\n id: \"gateways-compact\",\n label: \"Compact\",\n icon: {\n src: menuIcons.cloudGatewayUltra,\n width: 55.86,\n height: 14,\n },\n mobileIcon: {\n src: menuIcons.cloudGatewayUltra,\n width: 30,\n height: 7,\n useRawHeight: true,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/compact\"],\n },\n {\n id: \"wifi-integrated\",\n label: \"WiFi Integrated\",\n icon: {\n src: menuIcons.wifiIntegrated,\n width: 38,\n height: 38,\n },\n items: [\n {\n id: \"express\",\n label: \"Express\",\n icon: {\n src: menuIcons.express,\n width: 36,\n height: 14,\n },\n url: [SiteId.Ui, \"/cloud-gateways/wifi-integrated/express\"],\n },\n {\n id: \"dream-router\",\n label: \"Dream Router\",\n icon: {\n src: menuIcons.dreamRouter,\n width: 22,\n height: 38,\n },\n url: [\n SiteId.Ui,\n \"/cloud-gateways/wifi-integrated/dream-router\",\n ],\n },\n {\n id: \"dream-wall\",\n label: \"Dream Wall\",\n icon: {\n src: menuIcons.dreamWall,\n width: 27,\n height: 36,\n },\n url: [SiteId.Ui, \"/cloud-gateways/wifi-integrated/dream-wall\"],\n },\n ],\n },\n ],\n },\n {\n id: NavigationItemId.Switching,\n label: \"Switching\",\n url: [SiteId.Ui, \"/switching\"],\n items: [\n {\n id: \"switching-enterprise\",\n label: \"Enterprise\",\n icon: {\n src: menuIcons.swEnterprise,\n width: 114,\n height: 36,\n },\n isNew: true,\n url: [SiteId.Ui, \"/switching/enterprise\"],\n },\n {\n id: \"switching-pro-max\",\n label: \"Professional Max\",\n icon: {\n src: menuIcons.swProMax,\n width: 113,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/professional-max\"],\n subLabelCollapseMode: \"horizontal\",\n },\n {\n id: \"switching-pro\",\n label: \"Professional\",\n icon: {\n src: menuIcons.swPro,\n width: 115,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/professional\"],\n },\n {\n id: \"switching-standard\",\n label: \"Standard\",\n icon: {\n src: menuIcons.swStandard,\n width: 115,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/standard\"],\n },\n {\n id: \"switching-utility\",\n label: \"Utility\",\n icon: {\n src: menuIcons.swCompact,\n width: 73,\n height: 35,\n },\n url: [SiteId.Ui, \"/switching/utility\"],\n isNew: true,\n },\n ],\n },\n {\n id: NavigationItemId.WiFi,\n label: \"WiFi\",\n url: [SiteId.Ui, \"/wifi\"],\n items: [\n {\n id: \"flagship\",\n label: \"Flagship\",\n icon: {\n src: menuIcons.flagship,\n width: 38,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/flagship\"],\n },\n {\n id: \"wall\",\n label: \"Wall\",\n icon: {\n src: menuIcons.inWall,\n width: 24,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/wall\"],\n },\n {\n id: \"outdoor\",\n label: \"Outdoor\",\n icon: {\n src: menuIcons.flexibleOutdoor,\n width: 34,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/outdoor\"],\n },\n {\n id: \"mega-capacity\",\n label: \"Mega Capacity\",\n icon: {\n src: menuIcons.stadium,\n width: 69,\n height: 38,\n },\n url: [SiteId.Ui, \"/wifi/mega-capacity\"],\n },\n {\n id: \"bridging\",\n label: \"Bridging\",\n icon: {\n src: menuIcons.bridging,\n width: 82,\n height: 38,\n },\n isNew: true,\n items: [\n {\n id: \"bridging-building-bridge\",\n label: \"Building Bridge\",\n icon: {\n src: menuIcons.buildingBridge,\n width: 75,\n height: 38,\n },\n url: [SiteId.Ui, \"/wifi/bridging/building-bridge\"],\n },\n {\n id: \"bridging-device-bridge\",\n label: \"Device Bridge\",\n icon: {\n src: menuIcons.deviceBridge,\n width: 44,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/bridging/device-bridge\"],\n },\n ],\n },\n ],\n },\n\n {\n id: NavigationItemId.CameraSecurity,\n label: \"Camera Security\",\n url: [SiteId.Ui, \"/camera-security\"],\n items: [\n {\n id: \"dome\",\n label: \"Dome & Turret\",\n icon: {\n src: menuIcons.domeTurret,\n width: 72,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/camera-security/dome-turret\"],\n },\n {\n id: \"bullet\",\n label: \"Bullet\",\n icon: {\n src: menuIcons.bullet,\n width: 49,\n height: 26,\n },\n url: [SiteId.Ui, \"/camera-security/bullet\"],\n },\n\n {\n id: \"compact\",\n label: \"Compact\",\n icon: {\n src: menuIcons.flexAndInstant,\n width: 31,\n height: 39,\n },\n url: [SiteId.Ui, \"/camera-security/compact\"],\n },\n {\n id: \"theta\",\n label: \"Interior Design\",\n icon: {\n src: menuIcons.interiorDesign,\n width: 62,\n height: 29,\n },\n url: [SiteId.Ui, \"/camera-security/interior-design\"],\n },\n {\n id: \"ptz\",\n label: \"PTZ\",\n icon: {\n src: menuIcons.ptz,\n width: 27,\n height: 38,\n },\n url: [SiteId.Ui, \"/camera-security/ptz\"],\n isNew: true,\n },\n {\n id: \"special\",\n label: \"Special Devices\",\n icon: {\n src: menuIcons.specialDevices,\n width: 32,\n height: 38,\n },\n url: [SiteId.Ui, \"/camera-security/special-devices\"],\n },\n {\n id: \"nvr\",\n label: \"Video Recorders\",\n icon: {\n src: menuIcons.nvr,\n width: 114,\n height: 36,\n },\n isNew: true,\n url: [SiteId.Ui, \"/camera-security/video-recorders\"],\n },\n ],\n },\n {\n id: NavigationItemId.DoorAccess,\n label: \"Door Access\",\n url: [SiteId.Ui, \"/door-access\"],\n items: [\n {\n id: \"door-access-control-hubs\",\n label: \"Control Hubs\",\n url: [SiteId.Ui, \"/door-access/control-hubs\"],\n icon: {\n src: menuIcons.controlHubs,\n width: 53,\n height: 38,\n },\n isNew: true,\n },\n {\n id: \"door-access-readers\",\n label: \"Readers\",\n url: [SiteId.Ui, \"/door-access/readers\"],\n icon: {\n src: menuIcons.readers,\n width: 21.9,\n height: 38,\n },\n },\n {\n id: \"door-access-intercoms-viewers\",\n label: \"Intercoms\",\n url: [SiteId.Ui, \"/door-access/intercoms\"],\n icon: {\n src: menuIcons.intercomsViewers,\n width: 25.5,\n height: 38,\n },\n isNew: true,\n },\n {\n id: \"door-access-accessories\",\n label: \"Locks & Accessories\",\n url: [SiteId.Ui, \"/door-access/locks-accessories\"],\n icon: {\n src: menuIcons.locksAccessories,\n width: 32,\n height: 38,\n },\n },\n ],\n },\n {\n id: NavigationItemId.NewIntegrations,\n label: \"New Integrations\",\n url: [SiteId.Ui, \"/new-integrations\"],\n items: [\n {\n id: \"phone\",\n label: \"Managed VoIP\",\n icon: {\n src: menuIcons.phones,\n width: 56,\n height: 38,\n },\n url: [SiteId.Ui, \"/new-integrations/managed-voip\"],\n },\n {\n id: \"mobile-routing\",\n label: \"Mobile Routing\",\n icon: {\n src: menuIcons.mobileRouting,\n width: 34,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/mobile-routing\"],\n },\n {\n id: \"ev-charging\",\n label: \"EV Charging\",\n icon: {\n src: menuIcons.evCharging,\n width: 55,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/ev-charging\"],\n },\n {\n id: \"digital-signage\",\n label: \"Digital Signage\",\n icon: {\n src: menuIcons.poeDisplayTop,\n width: 38,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/digital-signage\"],\n },\n {\n id: \"premium-audio\",\n label: \"Premium Audio\",\n icon: {\n src: menuIcons.powerAmp,\n width: 49,\n height: 17,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/premium-audio\"],\n },\n {\n id: \"network-storage\",\n label: \"Network Storage\",\n icon: {\n src: menuIcons.unasDrive,\n width: 114,\n height: 24,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/network-storage\"],\n },\n ],\n },\n {\n id: NavigationItemId.Accessories,\n label: \"Accessory Tech\",\n url: [SiteId.Ui, \"/accessory-tech\"],\n items: [\n {\n id: \"power-systems\",\n label: \"Power Tech\",\n icon: {\n src: menuIcons.powerTech,\n width: 32,\n height: 36,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"power-tech\"],\n },\n {\n id: \"cables\",\n label: \"Cables\",\n icon: {\n src: menuIcons.cabling,\n width: 26,\n height: 29,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"cables\"],\n },\n {\n id: \"installations\",\n label: \"Installations\",\n icon: {\n src: menuIcons.rack,\n width: 41,\n height: 38,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"installations\"],\n },\n {\n id: \"storage\",\n label: \"Storage\",\n icon: {\n src: menuIcons.storage,\n width: 24,\n height: 33,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"storage\"],\n },\n {\n id: \"internet-solutions\",\n label: \"Internet Solutions\",\n icon: {\n src: menuIcons.internetSolutions,\n width: 113,\n height: 38,\n },\n url: [SiteId.Ui, \"/accessory-tech/internet-solutions\"],\n },\n {\n id: \"accessory-unifi-hosting-and-gateways\",\n label: \"CloudKeys & Gateways\",\n icon: {\n src: menuIcons.hostingAndGateway2,\n width: 114,\n height: 25,\n },\n url: [SiteId.Ui, \"/accessory-tech/cloud-keys-gateways\"],\n },\n ],\n },\n {\n id: NavigationItemId.UnifiIdentity,\n label: \"Identity\",\n url: [SiteId.Ui, \"/identity\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n ],\n },\n secondary: {\n label: \"UISP\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item, for now it's undefined\n fallbackUrl: [SiteId.Uisp, \"/\"],\n items: [\n {\n id: NavigationItemId.UispSoftware,\n label: \"UISP Overview\",\n url: [SiteId.Uisp, \"/uisp-overview\"],\n items: [],\n },\n {\n id: NavigationItemId.SixtyGhzWireless,\n label: \"60 GHz Wireless\",\n url: [SiteId.Uisp, \"/60ghz-wireless\"],\n items: [],\n },\n {\n id: NavigationItemId.Wireless,\n label: \"Wireless\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item\n url: [SiteId.Uisp, \"/wireless\"],\n items: [\n {\n id: \"wiress-wave-mlo\",\n label: \"Wave MLO\",\n subLabel: \"5 & 6 GHz\",\n isNew: true,\n icon: {\n src: menuIcons.waveMlo,\n width: 23,\n height: 31,\n },\n url: [SiteId.Uisp, \"/wireless/wave-mlo\"],\n },\n {\n id: \"ltu-5-ghz-wireless\",\n label: \"LTU\",\n subLabel: \"5 GHz\",\n icon: {\n src: menuIcons.ltu5ghz,\n width: 41,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/ltu\"],\n },\n {\n id: \"airmax-5-ghz-wireless\",\n label: \"airMAX\",\n subLabel: \"5 GHz\",\n icon: {\n src: menuIcons.airMax5ghz,\n width: 45,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airmax5ghz\"],\n },\n {\n id: \"airmax-2-4-ghz-wireless\",\n label: \"airMAX\",\n subLabel: \"2.4 GHz\",\n icon: {\n src: menuIcons.airMax24ghz,\n width: 35,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airmax2-4ghz\"],\n },\n {\n id: \"airfiber-ptp-wireless\",\n label: \"airFiber\",\n subLabel: \"PtP\",\n icon: {\n src: menuIcons.airFiberPtP,\n width: 44,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airfiber\"],\n },\n {\n id: \"antennas\",\n label: \"Antennas\",\n icon: {\n src: menuIcons.antennasWireless,\n width: 33,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/antennas\"],\n },\n ],\n },\n {\n id: NavigationItemId.Fiber,\n label: \"Fiber\",\n url: [SiteId.Uisp, \"/fiber\"],\n items: [\n {\n id: \"xgs-pon-fiber\",\n label: \"XGS-PON\",\n icon: {\n src: menuIcons.xgsPon,\n width: 113,\n height: 20,\n },\n url: [SiteId.Uisp, \"/fiber/xgs-pon\"],\n },\n {\n id: \"gpon-fiber\",\n label: \"GPON\",\n icon: {\n src: menuIcons.gpon,\n width: 113,\n height: 20,\n },\n url: [SiteId.Uisp, \"/fiber/gpon\"],\n },\n ],\n },\n {\n id: NavigationItemId.Wired,\n label: \"Wired\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item\n url: [SiteId.Uisp, \"/wired\"],\n items: [\n {\n id: \"wired-routing-switching\",\n label: \"UISP Routing / Switching\",\n subLabel: \"Simple\",\n icon: {\n src: menuIcons.uispRouter,\n width: 114,\n height: 23,\n },\n url: [SiteId.Uisp, \"/wired/uisp-routing\"],\n },\n {\n id: \"wired-advanced-routing-switching\",\n label: \"EdgeMAX Routing / Switching\",\n subLabel: \"Advanced\",\n icon: {\n src: menuIcons.uispAdvancedRouter,\n width: 114,\n height: 31,\n },\n url: [SiteId.Uisp, \"/wired/edgemax\"],\n items: [],\n },\n ],\n },\n {\n id: NavigationItemId.UispAccessoryTech,\n label: \"Accessory Tech\",\n url: [SiteId.TechSpecs, \"/uisp/accessory-tech\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n {\n id: NavigationItemId.LargeDeploymentAssistance,\n label: \"Large Deployment Assistance\",\n url: [SiteId.ExpertsUisp, \"/\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n ],\n },\n};\n"],"names":["SiteId","DEFAULT_LANGUAGE","Language","En","LONG_LANGUAGES","De","AvailableLanguages","Ar","El","Es","Fr","It","Ja","Pt","Zh","Tw","DEFAULT_STORE_ID","GlobalStoreId","Us","GENERIC_SITE_IDS","NavigationItemId","CloudGateways","WiFi","Switching","CameraSecurity","DoorAccess","NewIntegrations","Accessories","UnifiIdentity","SixtyGhzWireless","Wireless","Fiber","Wired","UispAccessoryTech","UispSoftware","LargeDeploymentAssistance","NAVIGATION_MAPPING","primary","label","url","items","id","key","icon","src","menuIcons.efgStacked","width","height","isNew","menuIcons.dreamMachineProMax","menuIcons.cloudGatewayUltra","mobileIcon","useRawHeight","menuIcons.wifiIntegrated","menuIcons.express","menuIcons.dreamRouter","menuIcons.dreamWall","menuIcons.swEnterprise","menuIcons.swProMax","subLabelCollapseMode","menuIcons.swPro","menuIcons.swStandard","menuIcons.swCompact","menuIcons.flagship","menuIcons.inWall","menuIcons.flexibleOutdoor","menuIcons.stadium","menuIcons.bridging","menuIcons.buildingBridge","menuIcons.deviceBridge","menuIcons.domeTurret","menuIcons.bullet","menuIcons.flexAndInstant","menuIcons.interiorDesign","menuIcons.ptz","menuIcons.specialDevices","menuIcons.nvr","menuIcons.controlHubs","menuIcons.readers","menuIcons.intercomsViewers","menuIcons.locksAccessories","menuIcons.phones","menuIcons.mobileRouting","menuIcons.evCharging","menuIcons.poeDisplayTop","menuIcons.powerAmp","menuIcons.unasDrive","menuIcons.powerTech","menuIcons.cabling","menuIcons.rack","menuIcons.storage","menuIcons.internetSolutions","menuIcons.hostingAndGateway2","secondary","fallbackUrl","subLabel","menuIcons.waveMlo","menuIcons.ltu5ghz","menuIcons.airMax5ghz","menuIcons.airMax24ghz","menuIcons.airFiberPtP","menuIcons.antennasWireless","menuIcons.xgsPon","menuIcons.gpon","menuIcons.uispRouter","menuIcons.uispAdvancedRouter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcY,IAAAA,MAAA,GAAA,gBA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,CAAA,mBAAoB,GAAG,CAAA;MAAA;MAE7BC,OAAO;IACT,CAAA;EAEJ;AACF,CAAA;"}
1
+ {"version":3,"file":"mapping.mjs","sources":["../../../src/contexts/MenuContext/mapping.ts"],"sourcesContent":["/* eslint-disable sonarjs/no-duplicate-string */\nimport type { StaticImageData } from \"next/image\";\n\nimport { menu as menuIcons } from \"../../constants/icons\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { Language } from \"../../types/constants\";\n\n// #############################################################################\n// Enums\n// #############################################################################\n/**\n * Enum containing \"id's\" for different microsites used in navigation\n */\nexport enum SiteId {\n // ui.com\n Ui = \"ui\",\n // uisp.com\n Uisp = \"uisp\",\n // either new store or shopify\n Store = \"store\",\n // amplifi.com\n Amplifi = \"amplifi\",\n // Similar to ui.com but escapes route matching for use in techspecs.ui.com etc\n Generic = \"generic\",\n // techspecs.ui.com\n TechSpecs = \"techSpecs\",\n // experts.ui.com\n ExpertsUi = \"expertsUi\",\n // experts.uisp.com\n ExpertsUisp = \"expertsUisp\",\n // uwc.ui.com\n Uwc = \"uwc\",\n}\n\n// #############################################################################\n// Mapping related types\n// #############################################################################\n/**\n * Just a re-export of moved type to reduce breaking changes\n * @deprecated Use `import {Language} from '@ubnt/store.core/lib/types';` instead\n */\nexport { Language } from \"../../types\";\n\nexport const DEFAULT_LANGUAGE = Language.En;\n\nexport const LONG_LANGUAGES = [Language.De];\n\nexport const AvailableLanguages: { [key in Language]: string } = {\n [Language.En]: \"English\",\n [Language.Ar]: \"Arabic\",\n [Language.De]: \"German\",\n [Language.El]: \"Greek\",\n [Language.Es]: \"Spanish\",\n [Language.Fr]: \"French\",\n [Language.It]: \"Italian\",\n [Language.Ja]: \"Japanese\",\n [Language.Pt]: \"Portuguese\",\n [Language.Zh]: \"Chinese\",\n [Language.Tw]: \"Taiwanese\",\n};\n\n/**\n * Deployed languages list\n * Rules:\n * - First language in the list is default;\n * - Array should have an English language always;\n * - Rest of the languages are optional\n */\nexport type DeployedLanguages = [Language, ...Language[]];\n\n/**\n * Deployed languages for each store ID\n *\n * If null, then this store is not on the new platform/does not have a language in URL\n */\nexport type DeployedLanguagesMapping = Record<\n StoreId,\n DeployedLanguages | null\n>;\n\n/**\n * Mapping to store base urls\n *\n * WARNING: In case of new platform the url will include `/${storeId}/${language}` part, so we need to be careful when\n * combining path names!\n */\nexport type StoreRootUrlMapping = {\n [key in GlobalStoreId]: string;\n};\n\n/**\n * Mapping to microsite base urls\n * As of right no urls include a pathname\n */\nexport type MicrositeRootUrlMapping = {\n [SiteId.Ui]: string;\n [SiteId.Uisp]: string;\n [SiteId.Amplifi]: string;\n [SiteId.TechSpecs]: string;\n [SiteId.ExpertsUi]: string;\n [SiteId.ExpertsUisp]: string;\n [SiteId.Uwc]: string;\n};\n\n/**\n * Type for defining external microsite url, as the base domain can change depending on environment we can only define\n * it by:\n * 1. which microsite/store to lookup\n * 2. what pathname should we append it with\n */\nexport type SiteUrl = [\n // Don't allow to make sites for generic site id\n siteId: Exclude<SiteId, SiteId.Generic>,\n pathname: string,\n searchParams?: Record<string, string | number | boolean>,\n fragment?: string | number,\n];\n\nexport type NavigationUrl = {\n /**\n * (Optional) External URL to ui.com or uisp.com\n * Will override path usage, however, both will be used for active state check\n */\n url: SiteUrl;\n};\n\nexport type NavigationItemIcon = {\n src: string | StaticImageData;\n width: number;\n height: number;\n useRawHeight?: boolean;\n};\n\ninterface NavigationItemCore {\n /**\n * Slugified label for use as a key\n * Needs to be unique only between the same level children\n */\n id: string;\n label: string;\n icon?: NavigationItemIcon;\n mobileIcon?: NavigationItemIcon;\n /**\n * (Optional) Marks the navigation item with an additional blue \"New\" below the label\n */\n isNew?: boolean;\n}\n\nexport type NavigationInvisibleItem = {\n /**\n * (Optional) Use it to keep hidden from rendering in navigations, but preserve itself in categories.\n */\n invisible?: boolean;\n};\n\nexport type NavigationSubSubItem = NavigationItemCore &\n NavigationInvisibleItem &\n /**\n * The item either has a single path\n */ (\n | NavigationUrl\n /**\n * Or multi-item sub-sub-items\n */\n | {\n url?: never;\n items: NavigationSubSubItem[];\n }\n | {\n /**\n * External URL to ui.com or uisp.com\n */\n url: SiteUrl;\n fallbackUrl?: never;\n items?: NavigationSubSubItem[];\n }\n );\n\nexport type NavigationSubItem = NavigationItemCore &\n NavigationInvisibleItem & {\n /**\n * (Optional) Additional label that shows below the main label\n * ! For now, replaces \"New\" label if both are present\n */\n subLabel?: string;\n /**\n * (Optional) Color Style subLabel\n * @default 'grey'\n */\n subLabelTheme?: \"blue\" | \"grey\";\n /**\n * (Optional) Position of subLabel in collapsed mode\n * @default 'vertical'\n */\n subLabelCollapseMode?: \"vertical\" | \"horizontal\";\n\n icon: NavigationItemIcon;\n } & /**\n * The item either has a single path\n */ (\n | NavigationUrl\n /**\n * Or multi-item sub-sub-items\n */\n | {\n url?: SiteUrl;\n items: NavigationSubSubItem[];\n }\n );\n\nexport type NavigationItem = NavigationItemCore &\n NavigationInvisibleItem &\n (\n | {\n /**\n * External URL to ui.com or uisp.com\n */\n fallbackUrl?: never;\n items: NavigationSubItem[];\n key?: string;\n url: SiteUrl;\n }\n | {\n /**\n * Path to a collection, just like on sub-items\n * Leave null to inherit first available items path\n */\n fallbackUrl?: SiteUrl;\n items: NavigationSubItem[];\n key?: string;\n url?: never;\n }\n );\n\nexport type NavigationSection =\n | NavigationSectionFlat\n | NavigationSectionNested\n | NavigationSectionNestedWithFallback;\n\n/**\n * Goes directly to a specific url, no fuss\n */\ntype NavigationSectionFlat = Pick<NavigationItemCore, \"label\"> & {\n items?: never;\n key?: string;\n url: SiteUrl;\n};\n\n/**\n * Might go directly to an url or path (depends on context store or microsite), but if not specified fallback to first available item, and if no items show, the\n * fallback to `fallbackUrl`\n */\ntype NavigationSectionNested = Pick<NavigationItemCore, \"label\"> & {\n /**\n * Fallback url if no `url` provided and items are not available in the current store\n */\n fallbackUrl?: never;\n key?: string;\n items: NavigationItem[];\n url: SiteUrl;\n};\n\ntype NavigationSectionNestedWithFallback = Pick<NavigationItemCore, \"label\"> & {\n /**\n * Fallback url if no `url` provided and items are not available in the current store\n */\n fallbackUrl: SiteUrl;\n items: NavigationItem[];\n key?: string;\n url?: never;\n};\n\nexport type NavigationSectionType = \"primary\" | \"secondary\";\n\nexport type NavigationMapping = Record<\n NavigationSectionType,\n NavigationSection\n>;\n\n// #############################################################################\n// Defaults\n// #############################################################################\n\n/**\n * Fallback store in case we are not able to detect current store\n */\nexport const DEFAULT_STORE_ID = GlobalStoreId.Us;\n\n/**\n * Generic Site IDs that shouldn't be used for URL matching\n */\nexport const GENERIC_SITE_IDS = [SiteId.Generic, SiteId.TechSpecs, SiteId.Uwc];\n\n// #############################################################################\n// Main navigation mapping\n// #############################################################################\n\n/**\n * Sections' top-level item ids\n *\n * Using const over enum to preserve string type\n */\nexport const NavigationItemId = {\n CloudGateways: \"cloud-gateways\",\n WiFi: \"wifi\",\n Switching: \"switching\",\n CameraSecurity: \"camera-security\",\n DoorAccess: \"door-access\",\n NewIntegrations: \"new-integrations\",\n Accessories: \"accessories\",\n UnifiIdentity: \"unifi-identity\",\n SixtyGhzWireless: \"60ghz-wireless\",\n Wireless: \"wireless\",\n Fiber: \"fiber\",\n Wired: \"wired\",\n UispAccessoryTech: \"uisp-accessory-tech\",\n UispSoftware: \"uisp-software\",\n LargeDeploymentAssistance: \"large-deployment-assistance\",\n};\n\n/**\n * Master mapping of all navigation links in the app\n * @see https://docs.google.com/spreadsheets/d/1X2HxC54SrrryUy0MtQs7F95rNkh70XFhXnOBH3-fazw/edit?pli=1#gid=183343023\n * @see https://www.figma.com/file/WQBiTOpN41gTcnQ6FqIyDX/UI-Navigations?node-id=1%3A6520&t=I7dumjOsJAX5ZMYX-0\n */\nexport const NAVIGATION_MAPPING: NavigationMapping = {\n primary: {\n label: \"UniFi\",\n // fallbackUrl: [SiteId.Ui, \"/\"],\n url: [SiteId.Ui, \"/\"],\n items: [\n {\n id: NavigationItemId.CloudGateways,\n label: \"Cloud Gateways\",\n key: \"cloud-gateways\",\n url: [SiteId.Ui, \"/cloud-gateways\"],\n items: [\n {\n id: \"enterprise-scale\",\n label: \"Enterprise Scale\",\n icon: {\n src: menuIcons.efgStacked,\n width: 114,\n height: 25,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/enterprise-scale\"],\n },\n {\n id: \"large-scale\",\n label: \"Large Scale\",\n icon: {\n src: menuIcons.dreamMachineProMax,\n width: 113,\n height: 14,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/large-scale\"],\n },\n {\n id: \"gateways-compact\",\n label: \"Compact\",\n icon: {\n src: menuIcons.cloudGatewayUltra,\n width: 55.86,\n height: 14,\n },\n mobileIcon: {\n src: menuIcons.cloudGatewayUltra,\n width: 30,\n height: 7,\n useRawHeight: true,\n },\n isNew: true,\n url: [SiteId.Ui, \"/cloud-gateways/compact\"],\n },\n {\n id: \"wifi-integrated\",\n label: \"WiFi Integrated\",\n icon: {\n src: menuIcons.wifiIntegrated,\n width: 38,\n height: 38,\n },\n items: [\n {\n id: \"express\",\n label: \"Express\",\n icon: {\n src: menuIcons.express,\n width: 36,\n height: 14,\n },\n url: [SiteId.Ui, \"/cloud-gateways/wifi-integrated/express\"],\n },\n {\n id: \"dream-router\",\n label: \"Dream Router\",\n icon: {\n src: menuIcons.dreamRouter,\n width: 22,\n height: 38,\n },\n url: [\n SiteId.Ui,\n \"/cloud-gateways/wifi-integrated/dream-router\",\n ],\n },\n {\n id: \"dream-wall\",\n label: \"Dream Wall\",\n icon: {\n src: menuIcons.dreamWall,\n width: 27,\n height: 36,\n },\n url: [SiteId.Ui, \"/cloud-gateways/wifi-integrated/dream-wall\"],\n },\n ],\n },\n ],\n },\n {\n id: NavigationItemId.Switching,\n label: \"Switching\",\n url: [SiteId.Ui, \"/switching\"],\n items: [\n {\n id: \"switching-enterprise\",\n label: \"Enterprise\",\n icon: {\n src: menuIcons.swEnterprise,\n width: 114,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/enterprise\"],\n },\n {\n id: \"switching-pro-max\",\n label: \"Professional Max\",\n icon: {\n src: menuIcons.swProMax,\n width: 113,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/professional-max\"],\n subLabelCollapseMode: \"horizontal\",\n },\n {\n id: \"switching-pro\",\n label: \"Professional\",\n icon: {\n src: menuIcons.swPro,\n width: 115,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/professional\"],\n },\n {\n id: \"switching-standard\",\n label: \"Standard\",\n icon: {\n src: menuIcons.swStandard,\n width: 115,\n height: 36,\n },\n url: [SiteId.Ui, \"/switching/standard\"],\n },\n {\n id: \"switching-utility\",\n label: \"Utility\",\n icon: {\n src: menuIcons.swCompact,\n width: 73,\n height: 35,\n },\n url: [SiteId.Ui, \"/switching/utility\"],\n isNew: true,\n },\n ],\n },\n {\n id: NavigationItemId.WiFi,\n label: \"WiFi\",\n url: [SiteId.Ui, \"/wifi\"],\n items: [\n {\n id: \"flagship\",\n label: \"Flagship\",\n icon: {\n src: menuIcons.flagship,\n width: 38,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/flagship\"],\n },\n {\n id: \"wall\",\n label: \"Wall\",\n icon: {\n src: menuIcons.inWall,\n width: 24,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/wall\"],\n },\n {\n id: \"outdoor\",\n label: \"Outdoor\",\n icon: {\n src: menuIcons.flexibleOutdoor,\n width: 34,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/outdoor\"],\n },\n {\n id: \"mega-capacity\",\n label: \"Mega Capacity\",\n icon: {\n src: menuIcons.stadium,\n width: 69,\n height: 38,\n },\n url: [SiteId.Ui, \"/wifi/mega-capacity\"],\n },\n {\n id: \"bridging\",\n label: \"Bridging\",\n icon: {\n src: menuIcons.bridging,\n width: 82,\n height: 38,\n },\n isNew: true,\n items: [\n {\n id: \"bridging-building-bridge\",\n label: \"Building Bridge\",\n icon: {\n src: menuIcons.buildingBridge,\n width: 75,\n height: 38,\n },\n url: [SiteId.Ui, \"/wifi/bridging/building-bridge\"],\n },\n {\n id: \"bridging-device-bridge\",\n label: \"Device Bridge\",\n icon: {\n src: menuIcons.deviceBridge,\n width: 44,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/wifi/bridging/device-bridge\"],\n },\n ],\n },\n ],\n },\n\n {\n id: NavigationItemId.CameraSecurity,\n label: \"Camera Security\",\n url: [SiteId.Ui, \"/camera-security\"],\n items: [\n {\n id: \"dome\",\n label: \"Dome & Turret\",\n icon: {\n src: menuIcons.domeTurret,\n width: 72,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/camera-security/dome-turret\"],\n },\n {\n id: \"bullet\",\n label: \"Bullet\",\n icon: {\n src: menuIcons.bullet,\n width: 49,\n height: 26,\n },\n url: [SiteId.Ui, \"/camera-security/bullet\"],\n },\n\n {\n id: \"compact\",\n label: \"Compact\",\n icon: {\n src: menuIcons.flexAndInstant,\n width: 31,\n height: 39,\n },\n url: [SiteId.Ui, \"/camera-security/compact\"],\n },\n {\n id: \"theta\",\n label: \"Interior Design\",\n icon: {\n src: menuIcons.interiorDesign,\n width: 62,\n height: 29,\n },\n url: [SiteId.Ui, \"/camera-security/interior-design\"],\n },\n {\n id: \"ptz\",\n label: \"PTZ\",\n icon: {\n src: menuIcons.ptz,\n width: 27,\n height: 38,\n },\n url: [SiteId.Ui, \"/camera-security/ptz\"],\n isNew: true,\n },\n {\n id: \"special\",\n label: \"Special Devices\",\n icon: {\n src: menuIcons.specialDevices,\n width: 32,\n height: 38,\n },\n url: [SiteId.Ui, \"/camera-security/special-devices\"],\n },\n {\n id: \"nvr\",\n label: \"Video Recorders\",\n icon: {\n src: menuIcons.nvr,\n width: 114,\n height: 36,\n },\n isNew: true,\n url: [SiteId.Ui, \"/camera-security/video-recorders\"],\n },\n ],\n },\n {\n id: NavigationItemId.DoorAccess,\n label: \"Door Access\",\n url: [SiteId.Ui, \"/door-access\"],\n items: [\n {\n id: \"door-access-control-hubs\",\n label: \"Control Hubs\",\n url: [SiteId.Ui, \"/door-access/control-hubs\"],\n icon: {\n src: menuIcons.controlHubs,\n width: 53,\n height: 38,\n },\n isNew: true,\n },\n {\n id: \"door-access-readers\",\n label: \"Readers\",\n url: [SiteId.Ui, \"/door-access/readers\"],\n icon: {\n src: menuIcons.readers,\n width: 21.9,\n height: 38,\n },\n },\n {\n id: \"door-access-intercoms-viewers\",\n label: \"Intercoms\",\n url: [SiteId.Ui, \"/door-access/intercoms\"],\n icon: {\n src: menuIcons.intercomsViewers,\n width: 25.5,\n height: 38,\n },\n isNew: true,\n },\n {\n id: \"door-access-accessories\",\n label: \"Locks & Accessories\",\n url: [SiteId.Ui, \"/door-access/locks-accessories\"],\n icon: {\n src: menuIcons.locksAccessories,\n width: 32,\n height: 38,\n },\n },\n ],\n },\n {\n id: NavigationItemId.NewIntegrations,\n label: \"New Integrations\",\n url: [SiteId.Ui, \"/new-integrations\"],\n items: [\n {\n id: \"phone\",\n label: \"Managed VoIP\",\n icon: {\n src: menuIcons.phones,\n width: 56,\n height: 38,\n },\n url: [SiteId.Ui, \"/new-integrations/managed-voip\"],\n },\n {\n id: \"mobile-routing\",\n label: \"Mobile Routing\",\n icon: {\n src: menuIcons.mobileRouting,\n width: 34,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/mobile-routing\"],\n },\n {\n id: \"ev-charging\",\n label: \"EV Charging\",\n icon: {\n src: menuIcons.evCharging,\n width: 55,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/ev-charging\"],\n },\n {\n id: \"digital-signage\",\n label: \"Digital Signage\",\n icon: {\n src: menuIcons.poeDisplayTop,\n width: 38,\n height: 38,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/digital-signage\"],\n },\n {\n id: \"premium-audio\",\n label: \"Premium Audio\",\n icon: {\n src: menuIcons.powerAmp,\n width: 49,\n height: 17,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/premium-audio\"],\n },\n {\n id: \"network-storage\",\n label: \"Network Storage\",\n icon: {\n src: menuIcons.unasDrive,\n width: 114,\n height: 24,\n },\n isNew: true,\n url: [SiteId.Ui, \"/new-integrations/network-storage\"],\n },\n ],\n },\n {\n id: NavigationItemId.Accessories,\n label: \"Accessory Tech\",\n url: [SiteId.Ui, \"/accessory-tech\"],\n items: [\n {\n id: \"power-systems\",\n label: \"Power Tech\",\n icon: {\n src: menuIcons.powerTech,\n width: 32,\n height: 36,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"power-tech\"],\n },\n {\n id: \"cables\",\n label: \"Cables\",\n icon: {\n src: menuIcons.cabling,\n width: 26,\n height: 29,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"cables\"],\n },\n {\n id: \"installations\",\n label: \"Installations\",\n icon: {\n src: menuIcons.rack,\n width: 41,\n height: 38,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"installations\"],\n },\n {\n id: \"storage\",\n label: \"Storage\",\n icon: {\n src: menuIcons.storage,\n width: 24,\n height: 33,\n },\n url: [SiteId.Ui, \"/accessory-tech\", undefined, \"storage\"],\n },\n {\n id: \"internet-solutions\",\n label: \"Internet Solutions\",\n icon: {\n src: menuIcons.internetSolutions,\n width: 113,\n height: 38,\n },\n url: [SiteId.Ui, \"/accessory-tech/internet-solutions\"],\n },\n {\n id: \"accessory-unifi-hosting-and-gateways\",\n label: \"CloudKeys & Gateways\",\n icon: {\n src: menuIcons.hostingAndGateway2,\n width: 114,\n height: 25,\n },\n url: [SiteId.Ui, \"/accessory-tech/cloud-keys-gateways\"],\n },\n ],\n },\n {\n id: NavigationItemId.UnifiIdentity,\n label: \"Identity\",\n url: [SiteId.Ui, \"/identity\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n ],\n },\n secondary: {\n label: \"UISP\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item, for now it's undefined\n fallbackUrl: [SiteId.Uisp, \"/\"],\n items: [\n {\n id: NavigationItemId.UispSoftware,\n label: \"UISP Overview\",\n url: [SiteId.Uisp, \"/uisp-overview\"],\n items: [],\n },\n {\n id: NavigationItemId.SixtyGhzWireless,\n label: \"60 GHz Wireless\",\n url: [SiteId.Uisp, \"/60ghz-wireless\"],\n items: [],\n },\n {\n id: NavigationItemId.Wireless,\n label: \"Wireless\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item\n url: [SiteId.Uisp, \"/wireless\"],\n items: [\n {\n id: \"wiress-wave-mlo\",\n label: \"Wave MLO\",\n subLabel: \"5 & 6 GHz\",\n isNew: true,\n icon: {\n src: menuIcons.waveMlo,\n width: 23,\n height: 31,\n },\n url: [SiteId.Uisp, \"/wireless/wave-mlo\"],\n },\n {\n id: \"ltu-5-ghz-wireless\",\n label: \"LTU\",\n subLabel: \"5 GHz\",\n icon: {\n src: menuIcons.ltu5ghz,\n width: 41,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/ltu\"],\n },\n {\n id: \"airmax-5-ghz-wireless\",\n label: \"airMAX\",\n subLabel: \"5 GHz\",\n icon: {\n src: menuIcons.airMax5ghz,\n width: 45,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airmax5ghz\"],\n },\n {\n id: \"airmax-2-4-ghz-wireless\",\n label: \"airMAX\",\n subLabel: \"2.4 GHz\",\n icon: {\n src: menuIcons.airMax24ghz,\n width: 35,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airmax2-4ghz\"],\n },\n {\n id: \"airfiber-ptp-wireless\",\n label: \"airFiber\",\n subLabel: \"PtP\",\n icon: {\n src: menuIcons.airFiberPtP,\n width: 44,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/airfiber\"],\n },\n {\n id: \"antennas\",\n label: \"Antennas\",\n icon: {\n src: menuIcons.antennasWireless,\n width: 33,\n height: 38,\n },\n url: [SiteId.Uisp, \"/wireless/antennas\"],\n },\n ],\n },\n {\n id: NavigationItemId.Fiber,\n label: \"Fiber\",\n url: [SiteId.Uisp, \"/fiber\"],\n items: [\n {\n id: \"xgs-pon-fiber\",\n label: \"XGS-PON\",\n icon: {\n src: menuIcons.xgsPon,\n width: 113,\n height: 20,\n },\n url: [SiteId.Uisp, \"/fiber/xgs-pon\"],\n },\n {\n id: \"gpon-fiber\",\n label: \"GPON\",\n icon: {\n src: menuIcons.gpon,\n width: 113,\n height: 20,\n },\n url: [SiteId.Uisp, \"/fiber/gpon\"],\n },\n ],\n },\n {\n id: NavigationItemId.Wired,\n label: \"Wired\",\n // NOTE: for initial launch don't go to uisp microsite instead to the first nested item\n url: [SiteId.Uisp, \"/wired\"],\n items: [\n {\n id: \"wired-routing-switching\",\n label: \"UISP Routing / Switching\",\n subLabel: \"Simple\",\n icon: {\n src: menuIcons.uispRouter,\n width: 114,\n height: 23,\n },\n url: [SiteId.Uisp, \"/wired/uisp-routing\"],\n },\n {\n id: \"wired-advanced-routing-switching\",\n label: \"EdgeMAX Routing / Switching\",\n subLabel: \"Advanced\",\n icon: {\n src: menuIcons.uispAdvancedRouter,\n width: 114,\n height: 31,\n },\n url: [SiteId.Uisp, \"/wired/edgemax\"],\n items: [],\n },\n ],\n },\n {\n id: NavigationItemId.UispAccessoryTech,\n label: \"Accessory Tech\",\n url: [SiteId.TechSpecs, \"/uisp/accessory-tech\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n {\n id: NavigationItemId.LargeDeploymentAssistance,\n label: \"Large Deployment Assistance\",\n url: [SiteId.ExpertsUisp, \"/\"],\n // TODO: possible refactor type so we don't have to define empty items\n items: [],\n },\n ],\n },\n};\n"],"names":["SiteId","DEFAULT_LANGUAGE","Language","En","LONG_LANGUAGES","De","AvailableLanguages","Ar","El","Es","Fr","It","Ja","Pt","Zh","Tw","DEFAULT_STORE_ID","GlobalStoreId","Us","GENERIC_SITE_IDS","NavigationItemId","CloudGateways","WiFi","Switching","CameraSecurity","DoorAccess","NewIntegrations","Accessories","UnifiIdentity","SixtyGhzWireless","Wireless","Fiber","Wired","UispAccessoryTech","UispSoftware","LargeDeploymentAssistance","NAVIGATION_MAPPING","primary","label","url","items","id","key","icon","src","menuIcons.efgStacked","width","height","isNew","menuIcons.dreamMachineProMax","menuIcons.cloudGatewayUltra","mobileIcon","useRawHeight","menuIcons.wifiIntegrated","menuIcons.express","menuIcons.dreamRouter","menuIcons.dreamWall","menuIcons.swEnterprise","menuIcons.swProMax","subLabelCollapseMode","menuIcons.swPro","menuIcons.swStandard","menuIcons.swCompact","menuIcons.flagship","menuIcons.inWall","menuIcons.flexibleOutdoor","menuIcons.stadium","menuIcons.bridging","menuIcons.buildingBridge","menuIcons.deviceBridge","menuIcons.domeTurret","menuIcons.bullet","menuIcons.flexAndInstant","menuIcons.interiorDesign","menuIcons.ptz","menuIcons.specialDevices","menuIcons.nvr","menuIcons.controlHubs","menuIcons.readers","menuIcons.intercomsViewers","menuIcons.locksAccessories","menuIcons.phones","menuIcons.mobileRouting","menuIcons.evCharging","menuIcons.poeDisplayTop","menuIcons.powerAmp","menuIcons.unasDrive","menuIcons.powerTech","menuIcons.cabling","menuIcons.rack","menuIcons.storage","menuIcons.internetSolutions","menuIcons.hostingAndGateway2","secondary","fallbackUrl","subLabel","menuIcons.waveMlo","menuIcons.ltu5ghz","menuIcons.airMax5ghz","menuIcons.airMax24ghz","menuIcons.airFiberPtP","menuIcons.antennasWireless","menuIcons.xgsPon","menuIcons.gpon","menuIcons.uispRouter","menuIcons.uispAdvancedRouter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcY,IAAAA,MAAA,GAAA,gBAAAA,OAAL,IAAA;EAELA,QAAA,IAAK,CAAA,GAAA,IAAA;EAELA,QAAA,MAAO,CAAA,GAAA,MAAA;EAEPA,QAAA,OAAQ,CAAA,GAAA,OAAA;EAERA,QAAA,SAAU,CAAA,GAAA,SAAA;EAEVA,QAAA,SAAU,CAAA,GAAA,SAAA;EAEV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;QACV,CAAA;QACAR,GAAA,EAAK,CAAC,MAAA,CAAA,YAAa,aAAa;MAClC,CAAA;IAEJ,CAAA,EACA;MACEE,IAAIrB,gBAAiB,CAAAY,KAAA;MACrBM,KAAO,EAAA,OAAA;MAAA;MAEPC,GAAA,EAAK,CAAC,MAAA,CAAA,YAAa,QAAQ,CAAA;MAC3BC,KAAO,EAAA,CACL;QACEC,EAAI,EAAA,yBAAA;QACJH,KAAO,EAAA,0BAAA;QACPyD,QAAU,EAAA,QAAA;QACVpD,IAAM,EAAA;UACJC,KAAK4D,iCAAU;UACf1D,KAAO,EAAA,GAAA;UACPC,MAAQ,EAAA;QACV,CAAA;QACAR,GAAA,EAAK,CAAC,MAAA,CAAA,YAAa,qBAAqB;MAC1C,CAAA,EACA;QACEE,EAAI,EAAA,kCAAA;QACJH,KAAO,EAAA,6BAAA;QACPyD,QAAU,EAAA,UAAA;QACVpD,IAAM,EAAA;UACJC,KAAK6D,iCAAU;UACf3D,KAAO,EAAA,GAAA;UACPC,MAAQ,EAAA;QACV,CAAA;QACAR,GAAA,EAAK,CAAC,MAAA,CAAA,YAAa,gBAAgB,CAAA;QACnCC,OAAO;MACT,CAAA;IAEJ,CAAA,EACA;MACEC,IAAIrB,gBAAiB,CAAAa,iBAAA;MACrBK,KAAO,EAAA,gBAAA;MACPC,GAAA,EAAK,CAAC,WAAA,CAAA,iBAAkB,sBAAsB,CAAA;MAAA;MAE9CC,OAAO;IACT,CAAA,EACA;MACEC,IAAIrB,gBAAiB,CAAAe,yBAAA;MACrBG,KAAO,EAAA,6BAAA;MACPC,GAAA,EAAK,CAAC,aAAA,CAAA,mBAAoB,GAAG,CAAA;MAAA;MAE7BC,OAAO;IACT,CAAA;EAEJ;AACF,CAAA;"}
@@ -1,14 +1,6 @@
1
1
  import type { StoreId } from "../../types";
2
2
  import { Currency } from "../../types";
3
3
  import type { LocalizedCurrency, RoundingFn } from "./types";
4
- /**
5
- * Custom rounding method to be used with dinero.js
6
- * This rounding method will round to nearest FULL 0/5/9 (and strip cents)
7
- * (moved here to mitigate ReferenceError: Cannot access 'roundToNearestFull059Fn' before initialization)
8
- *
9
- * @see: https://ubiquiti.atlassian.net/browse/NEP-3846
10
- */
11
- export declare const roundToNearestFull059Fn: RoundingFn;
12
4
  export declare const Round: {
13
5
  /**
14
6
  * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
@@ -37,7 +29,6 @@ export declare const Round: {
37
29
  Financial: import("@dinero.js/core").RoundingMode;
38
30
  Shipping: import("@dinero.js/core").RoundingMode;
39
31
  Prettify: import("@dinero.js/core").RoundingMode;
40
- PrettifyFull059: RoundingFn;
41
32
  Subunit: import("@dinero.js/core").RoundingMode;
42
33
  };
43
34
  /**
@@ -5,17 +5,6 @@ var dinero_js = require('dinero.js');
5
5
  require('../../types/index.js');
6
6
  var generated = require('../../types/generated.js');
7
7
  "use strict";
8
- const roundToNearestFull059Fn = input => {
9
- const roundedNumber = Math.round(input);
10
- const remainder = roundedNumber % 10;
11
- if (remainder <= 2) {
12
- return roundedNumber - remainder;
13
- } else if (remainder <= 7) {
14
- return roundedNumber - remainder + 5;
15
- } else {
16
- return roundedNumber - remainder + 9;
17
- }
18
- };
19
8
  const Round = {
20
9
  /**
21
10
  * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
@@ -49,10 +38,9 @@ const Round = {
49
38
  // financialRound = Math.round;
50
39
  Shipping: dinero_js.down,
51
40
  Prettify: dinero_js.down,
52
- PrettifyFull059: roundToNearestFull059Fn,
53
41
  Subunit: dinero_js.halfUp
54
42
  };
55
- const prettifyPriceLookup = /* @__PURE__ */new Map([[currencies.USD.code, 20], [currencies.CAD.code, 50], [currencies.EUR.code, 50], [currencies.GBP.code, 50], [currencies.AED.code, 50],
43
+ const prettifyPriceLookup = /* @__PURE__ */new Map([[currencies.USD.code, 20], [currencies.CAD.code, 20], [currencies.EUR.code, 20], [currencies.GBP.code, 20], [currencies.AED.code, 50],
56
44
  // Approximately every price above ~1.1 usd will be rounded in ZAR
57
45
  [currencies.ZAR.code, 20]]);
58
46
  const smallestSubunitLookup = /* @__PURE__ */new Map([
@@ -173,7 +161,6 @@ exports.Round = Round;
173
161
  exports.TAX_RATE_DINERO_CURRENCY = TAX_RATE_DINERO_CURRENCY;
174
162
  exports.localizedCurrencyLookup = localizedCurrencyLookup;
175
163
  exports.prettifyPriceLookup = prettifyPriceLookup;
176
- exports.roundToNearestFull059Fn = roundToNearestFull059Fn;
177
164
  exports.smallestSubunitLookup = smallestSubunitLookup;
178
165
  exports.storesWithPerItemTaxRate = storesWithPerItemTaxRate;
179
166
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n * (moved here to mitigate ReferenceError: Cannot access 'roundToNearestFull059Fn' before initialization)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059Fn: RoundingFn = (input: number) => {\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\nexport const Round = {\n /**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n *\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: down,\n Prettify: down,\n PrettifyFull059: roundToNearestFull059Fn,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 50],\n [EUR.code, 50],\n [GBP.code, 50],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059Fn","input","roundedNumber","Math","round","remainder","Round","Financial","halfAwayFromZero","Shipping","down","Prettify","PrettifyFull059","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","Gbp","Hrk","HRK","Huf","HUF","Nok","NOK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EACjD,CAACH,SAAAA,CAAAA,SAASiC,GAAK,EAAA;EAAE/B,UAAUgC,UAAAA,CAAAA,GAAK;EAAA/B,MAAA,EAAQ;CAAS,CAAA;AAAA;AAEjD,CAACH,SAAAA,CAAAA,SAASmC,GAAK,EAAA;EAAEjC,UAAUkC,UAAAA,CAAAA,GAAK;EAAAjC,MAAA,EAAQ;CAAS,CAAA;AAAA;AAEjD,CAACH,SAAAA,CAAAA,SAASqC,GAAK,EAAA;EAAEnC,UAAUJ,UAAAA,CAAAA,GAAK;EAAAK,MAAA,EAAQ;CAAS,CAAA,EACjD,CAACH,SAAAA,CAAAA,SAASsC,GAAK,EAAA;EAAEpC,UAAUqC,UAAAA,CAAAA,GAAK;EAAApC,MAAA,EAAQ;CAAS,CAAA,CAClD,CAAA;AAeY,MAAAqC,wBAAA,GAAA,mBAA+BC,GAAI,CAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,CAWlC,CAAA;AAKP,MAAMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAMsD,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\nexport const Round = {\n /**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n *\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: down,\n Prettify: down,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 20],\n [EUR.code, 20],\n [GBP.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["Round","Financial","halfAwayFromZero","Shipping","down","Prettify","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","Gbp","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","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GAAK;EAAApC,MAAA,EAAQ;CAAS,CAAA,CAClD,CAAA;AAeY,MAAAqC,wBAAA,GAAA,mBAA+BC,GAAI,CAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,CAWlC,CAAA;AAKP,MAAMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAMsD,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;;;;;;;"}
@@ -3,17 +3,6 @@ import { halfAwayFromZero, down, halfUp } from 'dinero.js';
3
3
  import '../../types/index.mjs';
4
4
  import { Currency } from '../../types/generated.mjs';
5
5
  "use strict";
6
- const roundToNearestFull059Fn = input => {
7
- const roundedNumber = Math.round(input);
8
- const remainder = roundedNumber % 10;
9
- if (remainder <= 2) {
10
- return roundedNumber - remainder;
11
- } else if (remainder <= 7) {
12
- return roundedNumber - remainder + 5;
13
- } else {
14
- return roundedNumber - remainder + 9;
15
- }
16
- };
17
6
  const Round = {
18
7
  /**
19
8
  * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T
@@ -47,10 +36,9 @@ const Round = {
47
36
  // financialRound = Math.round;
48
37
  Shipping: down,
49
38
  Prettify: down,
50
- PrettifyFull059: roundToNearestFull059Fn,
51
39
  Subunit: halfUp
52
40
  };
53
- const prettifyPriceLookup = /* @__PURE__ */new Map([[USD.code, 20], [CAD.code, 50], [EUR.code, 50], [GBP.code, 50], [AED.code, 50],
41
+ const prettifyPriceLookup = /* @__PURE__ */new Map([[USD.code, 20], [CAD.code, 20], [EUR.code, 20], [GBP.code, 20], [AED.code, 50],
54
42
  // Approximately every price above ~1.1 usd will be rounded in ZAR
55
43
  [ZAR.code, 20]]);
56
44
  const smallestSubunitLookup = /* @__PURE__ */new Map([
@@ -166,5 +154,5 @@ const EXCHANGE_RATE_DINERO_CURRENCY = {
166
154
  code: ""
167
155
  // Not important
168
156
  };
169
- export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, roundToNearestFull059Fn, smallestSubunitLookup, storesWithPerItemTaxRate };
157
+ export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, smallestSubunitLookup, storesWithPerItemTaxRate };
170
158
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n * (moved here to mitigate ReferenceError: Cannot access 'roundToNearestFull059Fn' before initialization)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059Fn: RoundingFn = (input: number) => {\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\nexport const Round = {\n /**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n *\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: down,\n Prettify: down,\n PrettifyFull059: roundToNearestFull059Fn,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 50],\n [EUR.code, 50],\n [GBP.code, 50],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059Fn","input","roundedNumber","Math","round","remainder","Round","Financial","halfAwayFromZero","Shipping","down","Prettify","PrettifyFull059","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","Gbp","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","MXN","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;AA8Ca,MAAAA,uBAAA,GAAuCC,KAAkB,IAAA;EAK9D,MAAAC,aAAA,GAAgBC,IAAK,CAAAC,KAAA,CAAMH,KAAK,CAAA;EAGtC,MAAMI,YAAYH,aAAgB,GAAA,EAAA;EAClC,IAAIG,aAAa,CAAG,EAAA;IAElB,OAAOH,aAAgB,GAAAG,SAAA;EAAA,CACzB,MAAA,IAAWA,aAAa,CAAG,EAAA;IAEzB,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EAAA,CAC9B,MAAA;IAEL,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EACrC;AACF,CAAA;AAEO,MAAMC,KAAQ,GAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAyBnBC,SAAW,EAAAC,gBAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAMXC,QAAU,EAAAC,IAAA;EACVC,QAAU,EAAAD,IAAA;EACVE,eAAiB,EAAAZ,uBAAA;EACjBa,OAAS,EAAAC;AACX,CAAA;AAKa,MAAAC,mBAAA,GAAA,mBAA0BC,GAAI,CAAA,CACzC,CAACC,GAAI,CAAAC,IAAA,EAAM,EAAE,CAAA,EACb,CAACC,GAAI,CAAAD,IAAA,EAAM,EAAE,CAAA,EACb,CAACE,GAAI,CAAAF,IAAA,EAAM,EAAE,CAAA,EACb,CAACG,GAAI,CAAAH,IAAA,EAAM,EAAE,CAAA,EACb,CAACI,GAAI,CAAAJ,IAAA,EAAM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AAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAMsD,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;"}
1
+ {"version":3,"file":"constants.mjs","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\nexport const Round = {\n /**\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalise the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/main/packages/core/src/round/halfEven.ts\n * @see\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behaviour based on if the rounded\n * number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n *\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: down,\n Prettify: down,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [CAD.code, 20],\n [EUR.code, 20],\n [GBP.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["Round","Financial","halfAwayFromZero","Shipping","down","Prettify","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","CAD","EUR","GBP","AED","ZAR","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","Gbp","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","MXN","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;AAuCO,MAAMA,KAAQ,GAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAyBnBC,SAAW,EAAAC,gBAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAMXC,QAAU,EAAAC,IAAA;EACVC,QAAU,EAAAD,IAAA;EACVE,OAAS,EAAAC;AACX,CAAA;AAKa,MAAAC,mBAAA,GAAA,mBAA0BC,GAAI,CAAA,CACzC,CAACC,GAAI,CAAAC,IAAA,EAAM,EAAE,CAAA,EACb,CAACC,GAAI,CAAAD,IAAA,EAAM,EAAE,CAAA,EACb,CAACE,GAAI,CAAAF,IAAA,EAAM,EAAE,CAAA,EACb,CAACG,GAAI,CAAAH,IAAA,EAAM,EAAE,CAAA,EACb,CAACI,GAAI,CAAAJ,IAAA,EA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EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAMsD,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVrD,IAAM,EAAA;EAAA;AACR,CAAA;"}
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var currencies = require('@dinero.js/currencies');
4
3
  var dinero_js = require('dinero.js');
5
4
  var errors = require('../errors.js');
6
5
  var constants = require('./constants.js');
@@ -59,27 +58,15 @@ const formatPrice = (money, options) => {
59
58
  return formatPriceRaw(misc.getDinero(money.amount, money.currency), localizedCurrency.locale, options);
60
59
  };
61
60
  const prettifyTotal = total => {
61
+ if (!dinero_js.hasSubUnits(total)) {
62
+ return total;
63
+ }
62
64
  const totalJson = total.toJSON();
63
65
  const minValueInclusiveToRoundDownFrom = constants.prettifyPriceLookup.get(totalJson.currency.code);
64
66
  if (minValueInclusiveToRoundDownFrom == null || dinero_js.toUnit(total) < minValueInclusiveToRoundDownFrom) {
65
67
  return total;
66
68
  }
67
- switch (totalJson.currency.code) {
68
- // @see: https://ubiquiti.atlassian.net/browse/NEP-3846
69
- case currencies.EUR.code:
70
- case currencies.GBP.code:
71
- case currencies.CAD.code:
72
- {
73
- return misc.roundDinero(total, constants.Round.PrettifyFull059);
74
- }
75
- default:
76
- {
77
- if (!dinero_js.hasSubUnits(total)) {
78
- return total;
79
- }
80
- return misc.roundDinero(total, constants.Round.Prettify);
81
- }
82
- }
69
+ return misc.roundDinero(total, constants.Round.Prettify);
83
70
  };
84
71
  exports.formatPrice = formatPrice;
85
72
  exports.formatPriceRaw = formatPriceRaw;
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sources":["../../../src/utils/money/format.ts"],"sourcesContent":["import { CAD, EUR, GBP } from \"@dinero.js/currencies\";\nimport { hasSubUnits, toFormat, toUnit } from \"dinero.js\";\n\nimport type { Currency, Nullish } from \"../../types\";\nimport { assert } from \"../errors\";\nimport {\n localizedCurrencyLookup,\n prettifyPriceLookup,\n Round,\n} from \"./constants\";\nimport { getDinero, roundDinero } from \"./misc\";\nimport type { Dino, LocalizedCurrency, Money } from \"./types\";\n\nexport const getLocalizedCurrency = (\n currencyCode: Nullish<Currency>,\n): LocalizedCurrency | undefined => {\n return currencyCode ? localizedCurrencyLookup.get(currencyCode) : undefined;\n};\n\n// #############################################################################\n// Formatter\n// #############################################################################\nconst currencyFormatterCache = new Map<string, Intl.NumberFormat>();\n/**\n * Function to get a Int.NumberFormat instance that can be reused to format currency over using\n * `Number.toLocaleString(...)` function, which makes more sense to use as we usually just display 1 or 2 currencies\n * MAX, so reusing the formatted makes a lot of sense\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#performance\n */\nconst getCurrencyFormatter = (\n locale: string,\n currencyCode: string,\n): Intl.NumberFormat => {\n const cacheKey = `${locale}_${currencyCode}`;\n\n let formatter = currencyFormatterCache.get(cacheKey);\n if (formatter) {\n return formatter;\n }\n\n formatter = new Intl.NumberFormat(locale, {\n style: \"currency\",\n currency: currencyCode,\n /**\n * Explicitly define default behavior - just in case some runtime overrides it\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay\n */\n currencySign: \"standard\",\n currencyDisplay: \"symbol\",\n });\n currencyFormatterCache.set(cacheKey, formatter);\n\n return formatter;\n};\n\nexport type FormatPriceOptions = {\n /**\n * Optionally remove trailing zeroes (only if all of them are 0)\n * @default false\n * @example\n * \"420,66 €\" => \"420,66 €\"\n * \"420,60 €\" => \"420,60 €\"\n * \"420,00 €\" => \"420 €\"\n */\n removeTrailingZeros?: boolean;\n /**\n * Optionally return currency rounded down to the nearest dollar-equivalent of a the given currency. Doesn't apply any\n * rounding just \"trims\" end decimal values\n *\n * ! Only use for display purposes where monetary precision is not required!\n *\n * @default false\n * @example\n * \"420,66 €\" => \"420 €\"\n * \"420,60 €\" => \"420 €\"\n * \"420,00 €\" => \"420 €\"\n */\n removeFractions?: boolean;\n};\n\n/**\n * Currency formatter based on dinero currency types and browser internationalizing functions\n *\n * Based on:\n * @see https://v2.dinerojs.com/docs/guides/formatting-in-a-multilingual-site#building-a-custom-internationalization-formatter\n * @protected\n * @deprecated Use `formatPrice` instead as this functions is for INTERNAL USE ONLY! (function not actual deprecated,\n * just marked so it discourages usage of it)\n */\nexport function formatPriceRaw(\n dinero: Dino,\n locale: string,\n options?: FormatPriceOptions,\n): string {\n return toFormat(dinero, ({ amount, currency }) => {\n const formatter = getCurrencyFormatter(locale, currency.code);\n const formatted = formatter.format(amount);\n\n return options?.removeFractions || options?.removeTrailingZeros\n ? /**\n * Regex to handle complex removing trailing zeros from currency\n * - Dynamically create regex based on currency as their exponent changes\n * - Also handles some currencies (e.g. EUR) having trailing currency symbol\n *\n * TODO: improve how we detect \"decimal separator\" for formatted currency, at least right now we have tests for it and doesn't seem like an issue\n */\n formatted.replace(\n // For some reason `\\.` need to be double-escaped `\\\\` when creating the regex from template string\n new RegExp(\n `(\\\\.|,)${\n // Depending options remove all trailing digits or just zeros, this way we don't need to do any rounding\n options?.removeFractions ? \"\\\\d\" : 0\n }{0,${currency.exponent}}(\\\\s\\\\D)?$`,\n ),\n // In the replaced using \"last capture group\" (if-exists) so we restore the trailing currency sign\n \"$2\",\n )\n : formatted;\n });\n}\n\n/**\n * Currency formatter based on dinero currency types and browser internationalizing functions\n *\n * In reality just a wrapper around `formatPriceRaw` that does the real formatting\n */\nexport const formatPrice = (\n money: Money,\n options?: FormatPriceOptions,\n): string => {\n const localizedCurrency = getLocalizedCurrency(money.currency);\n assert(!!localizedCurrency, `Currency ${money.currency} not supported`);\n\n return formatPriceRaw(\n getDinero(money.amount, money.currency),\n localizedCurrency.locale,\n options,\n );\n};\n\n/**\n * Prettify numbers depending on the currency using rounding down.\n * ! Should only be used to prettify storefront product prices after currency conversion but nothing else !\n */\nexport const prettifyTotal = (total: Dino): Dino => {\n const totalJson = total.toJSON();\n const minValueInclusiveToRoundDownFrom = prettifyPriceLookup.get(\n totalJson.currency.code,\n );\n\n // Don't round if currency unsupported or value is below min threshold\n if (\n minValueInclusiveToRoundDownFrom == null ||\n toUnit(total) < minValueInclusiveToRoundDownFrom\n ) {\n return total;\n }\n\n switch (totalJson.currency.code) {\n // @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n case EUR.code:\n case GBP.code:\n case CAD.code: {\n return roundDinero(total, Round.PrettifyFull059);\n }\n default: {\n // Nothing to round\n if (!hasSubUnits(total)) {\n return total;\n }\n\n return roundDinero(total, Round.Prettify);\n }\n }\n};\n"],"names":["getLocalizedCurrency","currencyCode","localizedCurrencyLookup","get","currencyFormatterCache","Map","getCurrencyFormatter","locale","cacheKey","formatter","Intl","NumberFormat","style","currency","currencySign","currencyDisplay","set","formatPriceRaw","dinero","options","toFormat","amount","code","formatted","format","removeFractions","removeTrailingZeros","replace","RegExp","exponent","formatPrice","money","localizedCurrency","assert","getDinero","prettifyTotal","total","totalJson","toJSON","minValueInclusiveToRoundDownFrom","prettifyPriceLookup","toUnit","EUR","GBP","CAD","roundDinero","Round","PrettifyFull059","hasSubUnits","Prettify"],"mappings":";;;;;;;;AAaa,MAAAA,oBAAA,GACXC,YACkC,IAAA;EAClC,OAAOA,YAAe,GAAAC,SAAAA,CAAAA,uBAAA,CAAwBC,GAAI,CAAAF,YAAY,CAAI,GAAA,KAAA,CAAA;AACpE,CAAA;AAKA,MAAMG,sBAAA,GAAA,mBAA6BC,GAA+B,EAAA;AAOlE,MAAMC,oBAAA,GAAuBA,CAC3BC,MAAA,EACAN,YACsB,KAAA;EACtB,MAAMO,QAAW,GAAA,GAAGD,MAAM,IAAIN,YAAY,EAAA;EAEtC,IAAAQ,SAAA,GAAYL,sBAAuB,CAAAD,GAAA,CAAIK,QAAQ,CAAA;EACn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CAAMlB,QAAQ,CAAA,EACtCmB,iBAAkB,CAAAzB,MAAA,EAClBY,OAAA,CACF;AACF,CAAA;AAMa,MAAAgB,aAAA,GAAiBC,KAAsB,IAAA;EAC5C,MAAAC,SAAA,GAAYD,MAAME,MAAO,EAAA;EAC/B,MAAMC,mCAAmCC,SAAAA,CAAAA,mBAAoB,CAAArC,GAAA,CAC3DkC,UAAUxB,QAAS,CAAAS,IAAA,CACrB;EAGA,IACEiB,gCAAoC,IAAA,IAAA,IACpCE,SAAO,CAAAA,MAAA,CAAAL,KAAK,IAAIG,gCAChB,EAAA;IACO,OAAAH,KAAA;EACT;EAEQ,QAAAC,SAAA,CAAUxB,SAASS,IAAM;IAAA;IAE/B,KAAKoB,UAAAA,CAAAA,GAAI,CAAApB,IAAA;IACT,KAAKqB,UAAAA,CAAAA,GAAI,CAAArB,IAAA;IACT,KAAKsB,UAAAA,CAAAA,IAAItB,IAAM;MAAA;QACN,OAAAuB,gBAAA,CAAYT,KAAO,EAAAU,SAAA,CAAAA,KAAA,CAAMC,eAAe,CAAA;MACjD;IACA;MAAS;QAEH,IAAA,CAACC,SAAAA,CAAAA,WAAY,CAAAZ,KAAK,CAAG,EAAA;UAChB,OAAAA,KAAA;QACT;QAEO,OAAAS,gBAAA,CAAYT,KAAO,EAAAU,SAAA,CAAAA,KAAA,CAAMG,QAAQ,CAAA;MAC1C;EACF;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"format.js","sources":["../../../src/utils/money/format.ts"],"sourcesContent":["import { hasSubUnits, toFormat, toUnit } from \"dinero.js\";\n\nimport type { Currency, Nullish } from \"../../types\";\nimport { assert } from \"../errors\";\nimport {\n localizedCurrencyLookup,\n prettifyPriceLookup,\n Round,\n} from \"./constants\";\nimport { getDinero, roundDinero } from \"./misc\";\nimport type { Dino, LocalizedCurrency, Money } from \"./types\";\n\nexport const getLocalizedCurrency = (\n currencyCode: Nullish<Currency>,\n): LocalizedCurrency | undefined => {\n return currencyCode ? localizedCurrencyLookup.get(currencyCode) : undefined;\n};\n\n// #############################################################################\n// Formatter\n// #############################################################################\nconst currencyFormatterCache = new Map<string, Intl.NumberFormat>();\n/**\n * Function to get a Int.NumberFormat instance that can be reused to format currency over using\n * `Number.toLocaleString(...)` function, which makes more sense to use as we usually just display 1 or 2 currencies\n * MAX, so reusing the formatted makes a lot of sense\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#performance\n */\nconst getCurrencyFormatter = (\n locale: string,\n currencyCode: string,\n): Intl.NumberFormat => {\n const cacheKey = `${locale}_${currencyCode}`;\n\n let formatter = currencyFormatterCache.get(cacheKey);\n if (formatter) {\n return formatter;\n }\n\n formatter = new Intl.NumberFormat(locale, {\n style: \"currency\",\n currency: currencyCode,\n /**\n * Explicitly define default behavior - just in case some runtime overrides it\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay\n */\n currencySign: \"standard\",\n currencyDisplay: \"symbol\",\n });\n currencyFormatterCache.set(cacheKey, formatter);\n\n return formatter;\n};\n\nexport type FormatPriceOptions = {\n /**\n * Optionally remove trailing zeroes (only if all of them are 0)\n * @default false\n * @example\n * \"420,66 €\" => \"420,66 €\"\n * \"420,60 €\" => \"420,60 €\"\n * \"420,00 €\" => \"420 €\"\n */\n removeTrailingZeros?: boolean;\n /**\n * Optionally return currency rounded down to the nearest dollar-equivalent of a the given currency. Doesn't apply any\n * rounding just \"trims\" end decimal values\n *\n * ! Only use for display purposes where monetary precision is not required!\n *\n * @default false\n * @example\n * \"420,66 €\" => \"420 €\"\n * \"420,60 €\" => \"420 €\"\n * \"420,00 €\" => \"420 €\"\n */\n removeFractions?: boolean;\n};\n\n/**\n * Currency formatter based on dinero currency types and browser internationalizing functions\n *\n * Based on:\n * @see https://v2.dinerojs.com/docs/guides/formatting-in-a-multilingual-site#building-a-custom-internationalization-formatter\n * @protected\n * @deprecated Use `formatPrice` instead as this functions is for INTERNAL USE ONLY! (function not actual deprecated,\n * just marked so it discourages usage of it)\n */\nexport function formatPriceRaw(\n dinero: Dino,\n locale: string,\n options?: FormatPriceOptions,\n): string {\n return toFormat(dinero, ({ amount, currency }) => {\n const formatter = getCurrencyFormatter(locale, currency.code);\n const formatted = formatter.format(amount);\n\n return options?.removeFractions || options?.removeTrailingZeros\n ? /**\n * Regex to handle complex removing trailing zeros from currency\n * - Dynamically create regex based on currency as their exponent changes\n * - Also handles some currencies (e.g. EUR) having trailing currency symbol\n *\n * TODO: improve how we detect \"decimal separator\" for formatted currency, at least right now we have tests for it and doesn't seem like an issue\n */\n formatted.replace(\n // For some reason `\\.` need to be double-escaped `\\\\` when creating the regex from template string\n new RegExp(\n `(\\\\.|,)${\n // Depending options remove all trailing digits or just zeros, this way we don't need to do any rounding\n options?.removeFractions ? \"\\\\d\" : 0\n }{0,${currency.exponent}}(\\\\s\\\\D)?$`,\n ),\n // In the replaced using \"last capture group\" (if-exists) so we restore the trailing currency sign\n \"$2\",\n )\n : formatted;\n });\n}\n\n/**\n * Currency formatter based on dinero currency types and browser internationalizing functions\n *\n * In reality just a wrapper around `formatPriceRaw` that does the real formatting\n */\nexport const formatPrice = (\n money: Money,\n options?: FormatPriceOptions,\n): string => {\n const localizedCurrency = getLocalizedCurrency(money.currency);\n assert(!!localizedCurrency, `Currency ${money.currency} not supported`);\n\n return formatPriceRaw(\n getDinero(money.amount, money.currency),\n localizedCurrency.locale,\n options,\n );\n};\n\n/**\n * Prettify numbers depending on the currency using rounding down.\n * ! Should only be used to prettify storefront product prices after currency conversion but nothing else !\n */\nexport const prettifyTotal = (total: Dino): Dino => {\n // Nothing to round\n if (!hasSubUnits(total)) {\n return total;\n }\n\n const totalJson = total.toJSON();\n\n const minValueInclusiveToRoundDownFrom = prettifyPriceLookup.get(\n totalJson.currency.code,\n );\n\n // Don't round if currency unsupported or value is below min threshold\n if (\n minValueInclusiveToRoundDownFrom == null ||\n toUnit(total) < minValueInclusiveToRoundDownFrom\n ) {\n return total;\n }\n\n return roundDinero(total, Round.Prettify);\n};\n"],"names":["getLocalizedCurrency","currencyCode","localizedCurrencyLookup","get","currencyFormatterCache","Map","getCurrencyFormatter","locale","cacheKey","formatter","Intl","NumberFormat","style","currency","currencySign","currencyDisplay","set","formatPriceRaw","dinero","options","toFormat","amount","code","formatted","format","removeFractions","removeTrailingZeros","replace","RegExp","exponent","formatPrice","money","localizedCurrency","assert","getDinero","prettifyTotal","total","hasSubUnits","totalJson","toJSON","minValueInclusiveToRoundDownFrom","prettifyPriceLookup","toUnit","roundDinero","Round","Prettify"],"mappings":";;;;;;;AAYa,MAAAA,oBAAA,GACXC,YACkC,IAAA;EAClC,OAAOA,YAAe,GAAAC,SAAAA,CAAAA,uBAAA,CAAwBC,GAAI,CAAAF,YAAY,CAAI,GAAA,KAAA,CAAA;AACpE,CAAA;AAKA,MAAMG,sBAAA,GAAA,mBAA6BC,GAA+B,EAAA;AAOlE,MAAMC,oBAAA,GAAuBA,CAC3BC,MAAA,EACAN,YACsB,KAAA;EACtB,MAAMO,QAAW,GAAA,GAAGD,MAAM,IAAIN,YAAY,EAAA;EAEtC,IAAAQ,SAAA,GAAYL,sBAAuB,CAAAD,GAAA,CAAIK,QAAQ,CAAA;EACnD,IAAIC,SAAW,EAAA;IACN,OAAAA,SAAA;EACT;EAEYA,SAAA,GAAA,IAAIC,IAAK,CAAAC,YAAA,CAAaJ,MAAQ,EAAA;IACxCK,KAAO,EAAA,UAAA;IACPC,QAAU,EAAAZ,YAAA;IAAA;AAAA;AAAA;AAAA;AAAA;IAMVa,YAAc,EAAA,UAAA;IACdC,eAAiB,EAAA;EAAA,CAClB,CAAA;EACsBX,sBAAA,CAAAY,GAAA,CAAIR,UAAUC,SAAS,CAAA;EAEvC,OAAAA,SAAA;AACT,CAAA;AAoCgB,SAAAQ,cAAAA,CACdC,MACA,E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CAAoC,IAAA,IAAA,IACpCE,SAAO,CAAAA,MAAA,CAAAN,KAAK,IAAII,gCAChB,EAAA;IACO,OAAAJ,KAAA;EACT;EAEO,OAAAO,gBAAA,CAAYP,KAAO,EAAAQ,SAAA,CAAAA,KAAA,CAAMC,QAAQ,CAAA;AAC1C,CAAA;;;;"}
@@ -1,5 +1,4 @@
1
- import { CAD, GBP, EUR } from '@dinero.js/currencies';
2
- import { toFormat, toUnit, hasSubUnits } from 'dinero.js';
1
+ import { toFormat, hasSubUnits, toUnit } from 'dinero.js';
3
2
  import { assert } from '../errors.mjs';
4
3
  import { localizedCurrencyLookup, prettifyPriceLookup, Round } from './constants.mjs';
5
4
  import { getDinero, roundDinero } from './misc.mjs';
@@ -57,27 +56,15 @@ const formatPrice = (money, options) => {
57
56
  return formatPriceRaw(getDinero(money.amount, money.currency), localizedCurrency.locale, options);
58
57
  };
59
58
  const prettifyTotal = total => {
59
+ if (!hasSubUnits(total)) {
60
+ return total;
61
+ }
60
62
  const totalJson = total.toJSON();
61
63
  const minValueInclusiveToRoundDownFrom = prettifyPriceLookup.get(totalJson.currency.code);
62
64
  if (minValueInclusiveToRoundDownFrom == null || toUnit(total) < minValueInclusiveToRoundDownFrom) {
63
65
  return total;
64
66
  }
65
- switch (totalJson.currency.code) {
66
- // @see: https://ubiquiti.atlassian.net/browse/NEP-3846
67
- case EUR.code:
68
- case GBP.code:
69
- case CAD.code:
70
- {
71
- return roundDinero(total, Round.PrettifyFull059);
72
- }
73
- default:
74
- {
75
- if (!hasSubUnits(total)) {
76
- return total;
77
- }
78
- return roundDinero(total, Round.Prettify);
79
- }
80
- }
67
+ return roundDinero(total, Round.Prettify);
81
68
  };
82
69
  export { formatPrice, formatPriceRaw, getLocalizedCurrency, prettifyTotal };
83
70
  //# sourceMappingURL=format.mjs.map