@ubnt/store.core 9.17.0-alpha.5 → 9.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/CHANGELOG.md +2 -158
  2. package/lib/_virtual/_virtual_multi-entry.js +12 -27
  3. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  4. package/lib/_virtual/_virtual_multi-entry.mjs +10 -14
  5. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  6. package/lib/apis/smartcat.js +1 -4
  7. package/lib/apis/smartcat.js.map +1 -1
  8. package/lib/apis/smartcat.mjs +1 -4
  9. package/lib/apis/smartcat.mjs.map +1 -1
  10. package/lib/assets/attention.svg +5 -5
  11. package/lib/assets/attention2.svg +5 -5
  12. package/lib/{components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js → assets/icons/menu/icon-globe.svg.js} +6 -6
  13. package/lib/assets/icons/menu/icon-globe.svg.js.map +1 -0
  14. package/lib/assets/icons/menu/icon-globe.svg.mjs +3 -0
  15. package/lib/assets/icons/menu/icon-globe.svg.mjs.map +1 -0
  16. package/lib/assets/udmPro.jpg +0 -0
  17. package/lib/assets/udmPro2.jpg +0 -0
  18. package/lib/assets/udmProMax.jpg +0 -0
  19. package/lib/assets/udmProMax2.jpg +0 -0
  20. package/lib/assets/udmProSpecial.jpg +0 -0
  21. package/lib/assets/udmProSpecial2.jpg +0 -0
  22. package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +1 -1
  23. package/lib/components/CategoryTabs/CategoryTabs.types.d.ts +1 -1
  24. package/lib/components/CloserLookSection/CloserLookSection.js.map +1 -1
  25. package/lib/components/CloserLookSection/CloserLookSection.mjs.map +1 -1
  26. package/lib/components/Compare/Compare.styles.d.ts +5 -5
  27. package/lib/components/Container/Container.d.ts +1 -1
  28. package/lib/components/Container/Container.js +3 -4
  29. package/lib/components/Container/Container.js.map +1 -1
  30. package/lib/components/Container/Container.mjs +4 -5
  31. package/lib/components/Container/Container.mjs.map +1 -1
  32. package/lib/components/CustomImage/CustomImage.js.map +1 -1
  33. package/lib/components/CustomImage/CustomImage.mjs.map +1 -1
  34. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js.map +1 -1
  35. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs.map +1 -1
  36. package/lib/components/Footer/hooks/useFooterContent.d.ts +3 -1
  37. package/lib/components/Footer/hooks/useFooterContent.js +8 -1
  38. package/lib/components/Footer/hooks/useFooterContent.js.map +1 -1
  39. package/lib/components/Footer/hooks/useFooterContent.mjs +8 -1
  40. package/lib/components/Footer/hooks/useFooterContent.mjs.map +1 -1
  41. package/lib/components/Footer/translations/ar.json.js +1 -1
  42. package/lib/components/Footer/translations/ar.json.mjs +1 -1
  43. package/lib/components/Footer/translations/de.json.js +1 -1
  44. package/lib/components/Footer/translations/de.json.mjs +1 -1
  45. package/lib/components/Footer/translations/el.json.js +1 -1
  46. package/lib/components/Footer/translations/el.json.mjs +1 -1
  47. package/lib/components/Footer/translations/en.json.js +1 -0
  48. package/lib/components/Footer/translations/en.json.js.map +1 -1
  49. package/lib/components/Footer/translations/en.json.mjs +1 -0
  50. package/lib/components/Footer/translations/en.json.mjs.map +1 -1
  51. package/lib/components/Footer/translations/es.json.js +1 -1
  52. package/lib/components/Footer/translations/es.json.mjs +1 -1
  53. package/lib/components/Footer/translations/fr.json.js +4 -4
  54. package/lib/components/Footer/translations/fr.json.mjs +4 -4
  55. package/lib/components/Footer/translations/it.json.js +1 -1
  56. package/lib/components/Footer/translations/it.json.mjs +1 -1
  57. package/lib/components/Footer/translations/ja.json.js +2 -2
  58. package/lib/components/Footer/translations/ja.json.mjs +2 -2
  59. package/lib/components/Footer/translations/pt-BR.json.js +1 -1
  60. package/lib/components/Footer/translations/pt-BR.json.mjs +1 -1
  61. package/lib/components/Footer/translations/zh-Hans.json.js +4 -4
  62. package/lib/components/Footer/translations/zh-Hans.json.mjs +4 -4
  63. package/lib/components/Footer/translations/zh-Hant-TW.json.js +1 -1
  64. package/lib/components/Footer/translations/zh-Hant-TW.json.mjs +1 -1
  65. package/lib/components/GridGallery/GridGallery.js.map +1 -1
  66. package/lib/components/GridGallery/GridGallery.mjs.map +1 -1
  67. package/lib/components/Header/AccountMenu/AccountMenu.js +12 -20
  68. package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
  69. package/lib/components/Header/AccountMenu/AccountMenu.mjs +14 -22
  70. package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
  71. package/lib/components/Header/AccountMenu/megaphone.http.service.js +1 -4
  72. package/lib/components/Header/AccountMenu/megaphone.http.service.js.map +1 -1
  73. package/lib/components/Header/AccountMenu/megaphone.http.service.mjs +1 -4
  74. package/lib/components/Header/AccountMenu/megaphone.http.service.mjs.map +1 -1
  75. package/lib/components/Header/CartModalV2/CartModal.js.map +1 -1
  76. package/lib/components/Header/CartModalV2/CartModal.mjs.map +1 -1
  77. package/lib/components/Header/Header.js.map +1 -1
  78. package/lib/components/Header/Header.mjs.map +1 -1
  79. package/lib/components/Header/Header.styles.d.ts +2 -2
  80. package/lib/components/Header/Header.types.d.ts +4 -8
  81. package/lib/components/Header/Header.types.js +1 -2
  82. package/lib/components/Header/Header.types.js.map +1 -1
  83. package/lib/components/Header/Header.types.mjs +1 -2
  84. package/lib/components/Header/Header.types.mjs.map +1 -1
  85. package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
  86. package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
  87. package/lib/components/Header/LanguageFrame/Mobile/Mobile.js.map +1 -1
  88. package/lib/components/Header/LanguageFrame/Mobile/Mobile.mjs.map +1 -1
  89. package/lib/components/Header/MenuItem/MenuItem.styles.d.ts +1 -1
  90. package/lib/components/Header/MenuItem/MenuItem.styles.js +1 -1
  91. package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
  92. package/lib/components/Header/MenuItem/MenuItem.styles.mjs +1 -1
  93. package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
  94. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.d.ts +1 -1
  95. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +1 -1
  96. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
  97. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +63 -85
  98. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
  99. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +64 -86
  100. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
  101. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +0 -6
  102. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +1 -11
  103. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
  104. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +2 -10
  105. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
  106. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +1 -5
  107. package/lib/components/Header/Overlay/Overlay.js.map +1 -1
  108. package/lib/components/Header/Overlay/Overlay.mjs.map +1 -1
  109. package/lib/components/Header/ProHeader/ProHeader.d.ts +4 -2
  110. package/lib/components/Header/ProHeader/ProHeader.js +36 -148
  111. package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
  112. package/lib/components/Header/ProHeader/ProHeader.mjs +39 -149
  113. package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
  114. package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +1 -4
  115. package/lib/components/Header/ProHeader/ProHeader.styles.js +18 -20
  116. package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
  117. package/lib/components/Header/ProHeader/ProHeader.styles.mjs +19 -18
  118. package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
  119. package/lib/components/Header/translations/en.json.js +1 -4
  120. package/lib/components/Header/translations/en.json.js.map +1 -1
  121. package/lib/components/Header/translations/en.json.mjs +2 -4
  122. package/lib/components/Header/translations/en.json.mjs.map +1 -1
  123. package/lib/components/Hero/Hero.styles.d.ts +2 -2
  124. package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +1 -1
  125. package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +2 -2
  126. package/lib/components/ImageSequence/ImageSequence.js.map +1 -1
  127. package/lib/components/ImageSequence/ImageSequence.mjs.map +1 -1
  128. package/lib/components/LandingPage/Cards/Card/Card.js.map +1 -1
  129. package/lib/components/LandingPage/Cards/Card/Card.mjs.map +1 -1
  130. package/lib/components/LandingPage/Cards/Cards.js.map +1 -1
  131. package/lib/components/LandingPage/Cards/Cards.mjs.map +1 -1
  132. package/lib/components/LandingPagePro/LandingPagePro.d.ts +0 -3
  133. package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
  134. package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
  135. package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
  136. package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
  137. package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +1 -1
  138. package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +1 -1
  139. package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +3 -3
  140. package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +3 -3
  141. package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.js.map +1 -1
  142. package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.mjs.map +1 -1
  143. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js.map +1 -1
  144. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.mjs.map +1 -1
  145. package/lib/components/MicrositeProductGrid/MicrositeProductGrid.js.map +1 -1
  146. package/lib/components/MicrositeProductGrid/MicrositeProductGrid.mjs.map +1 -1
  147. package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +1 -1
  148. package/lib/components/Microsites/MicrositeProductPage.js +39 -0
  149. package/lib/components/Microsites/MicrositeProductPage.js.map +1 -1
  150. package/lib/components/Microsites/MicrositeProductPage.mjs +39 -0
  151. package/lib/components/Microsites/MicrositeProductPage.mjs.map +1 -1
  152. package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.js.map +1 -1
  153. package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.mjs.map +1 -1
  154. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  155. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  156. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  157. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  158. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  159. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  160. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  161. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  162. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  163. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  164. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  165. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  166. package/lib/components/ModelCompareV3/data/CloudGateways.js +9 -9
  167. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +6 -6
  168. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  169. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  170. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  171. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  172. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  173. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  174. package/lib/components/ProductCompare/ProductCompare.js.map +1 -1
  175. package/lib/components/ProductCompare/ProductCompare.mjs.map +1 -1
  176. package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +1 -1
  177. package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +1 -1
  178. package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +1 -1
  179. package/lib/components/QuantityControls/QuantityControls.js.map +1 -1
  180. package/lib/components/QuantityControls/QuantityControls.mjs.map +1 -1
  181. package/lib/components/RelatedProducts/RelatedProducts.js.map +1 -1
  182. package/lib/components/RelatedProducts/RelatedProducts.mjs.map +1 -1
  183. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +17 -313
  184. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
  185. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +17 -311
  186. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
  187. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -3
  188. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
  189. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
  190. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
  191. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
  192. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +34 -120
  193. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js.map +1 -1
  194. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs +34 -120
  195. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs.map +1 -1
  196. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.d.ts +2 -16
  197. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js +12 -54
  198. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js.map +1 -1
  199. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs +11 -50
  200. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs.map +1 -1
  201. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowLeftPrimary.svg.js +5 -5
  202. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowRightPrimary.svg.js +5 -5
  203. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +2 -2
  204. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
  205. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +2 -2
  206. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
  207. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +0 -2
  208. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
  209. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +0 -2
  210. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
  211. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  212. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  213. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  214. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  215. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  216. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  217. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
  218. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
  219. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
  220. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
  221. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  222. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
  223. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  224. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
  225. package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +2 -1
  226. package/lib/components/ResourceCalculatorV1/ResourceCalculator.js.map +1 -1
  227. package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs +2 -1
  228. package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs.map +1 -1
  229. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.d.ts +1 -1
  230. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.js +1 -3
  231. package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +1 -0
  232. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.mjs +1 -3
  233. package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +1 -0
  234. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.d.ts +0 -1
  235. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.js +7 -10
  236. package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +1 -0
  237. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.mjs +7 -10
  238. package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +1 -0
  239. package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.types.d.ts +0 -1
  240. package/lib/components/ResourceCalculatorV1/components/index.d.ts +1 -0
  241. package/lib/components/ResourceCalculatorV1/components/index.js +5 -0
  242. package/lib/components/{Header/Navigation/ProMenu → ResourceCalculatorV1/components}/index.js.map +1 -1
  243. package/lib/components/ResourceCalculatorV1/components/index.mjs +3 -0
  244. package/lib/components/ResourceCalculatorV1/translations/en.json.js +4 -6
  245. package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
  246. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +4 -6
  247. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
  248. package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
  249. package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.js.map +1 -1
  250. package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.mjs.map +1 -1
  251. package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
  252. package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
  253. package/lib/components/StorageSliders/Slider/Slider.js.map +1 -1
  254. package/lib/components/StorageSliders/Slider/Slider.mjs.map +1 -1
  255. package/lib/components/StorageSliders/StorageSliders.context.js.map +1 -1
  256. package/lib/components/StorageSliders/StorageSliders.context.mjs.map +1 -1
  257. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.js.map +1 -1
  258. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.mjs.map +1 -1
  259. package/lib/components/VariantSelector/Variant/Variant.js.map +1 -1
  260. package/lib/components/VariantSelector/Variant/Variant.mjs.map +1 -1
  261. package/lib/components/index.d.ts +0 -1
  262. package/lib/components/index.js +0 -2
  263. package/lib/components/index.js.map +1 -1
  264. package/lib/components/index.mjs +0 -2
  265. package/lib/components/index.mjs.map +1 -1
  266. package/lib/constants/icons/options/colors/black.svg.js +5 -5
  267. package/lib/constants/icons/options/colors/index.js +3 -3
  268. package/lib/constants/icons/options/styles/black.svg.js +5 -5
  269. package/lib/constants/icons/options/styles/index.js +3 -3
  270. package/lib/constants/optionIcons.js +6 -6
  271. package/lib/constants/optionIcons.mjs +4 -4
  272. package/lib/constants/proStoreCategories/mapping/index.d.ts +0 -1
  273. package/lib/constants/proStoreCategories/mapping/index.js +10 -15
  274. package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
  275. package/lib/constants/proStoreCategories/mapping/index.mjs +10 -15
  276. package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
  277. package/lib/constants/proStoreCategories/mapping/unifi.d.ts +1 -2
  278. package/lib/constants/proStoreCategories/mapping/unifi.js +0 -1
  279. package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
  280. package/lib/constants/proStoreCategories/mapping/unifi.mjs +0 -1
  281. package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
  282. package/lib/constants/proStoreCategories/translations/en.json.js +0 -3
  283. package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
  284. package/lib/constants/proStoreCategories/translations/en.json.mjs +1 -3
  285. package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
  286. package/lib/constants/proStoreCategories/translations/fr.json.js +1 -1
  287. package/lib/constants/proStoreCategories/translations/fr.json.mjs +1 -1
  288. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -1
  289. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +1 -1
  290. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -1
  291. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +1 -1
  292. package/lib/constants/url.d.ts +2 -1
  293. package/lib/constants/url.js +1 -0
  294. package/lib/constants/url.js.map +1 -1
  295. package/lib/constants/url.mjs +1 -0
  296. package/lib/constants/url.mjs.map +1 -1
  297. package/lib/contexts/MenuContext/context.js +1 -1
  298. package/lib/contexts/MenuContext/context.js.map +1 -1
  299. package/lib/contexts/MenuContext/context.mjs +1 -1
  300. package/lib/contexts/MenuContext/context.mjs.map +1 -1
  301. package/lib/contexts/MenuContext/utils.js +1 -0
  302. package/lib/contexts/MenuContext/utils.js.map +1 -1
  303. package/lib/contexts/MenuContext/utils.mjs +1 -0
  304. package/lib/contexts/MenuContext/utils.mjs.map +1 -1
  305. package/lib/helpers/index.d.ts +0 -1
  306. package/lib/helpers/index.js +0 -11
  307. package/lib/helpers/index.js.map +1 -1
  308. package/lib/helpers/index.mjs +0 -1
  309. package/lib/helpers/index.mjs.map +1 -1
  310. package/lib/helpers/ux.d.ts +1 -9
  311. package/lib/helpers/ux.js +0 -15
  312. package/lib/helpers/ux.js.map +1 -1
  313. package/lib/helpers/ux.mjs +1 -15
  314. package/lib/helpers/ux.mjs.map +1 -1
  315. package/lib/hooks/useHasTouch.js.map +1 -1
  316. package/lib/hooks/useHasTouch.mjs.map +1 -1
  317. package/lib/hooks/useHorizontalScroll.js.map +1 -1
  318. package/lib/hooks/useHorizontalScroll.mjs.map +1 -1
  319. package/lib/types/index.d.ts +0 -1
  320. package/lib/types/index.js +0 -2
  321. package/lib/types/index.js.map +1 -1
  322. package/lib/types/index.mjs +0 -1
  323. package/lib/types/index.mjs.map +1 -1
  324. package/lib/utils/array.d.ts +0 -4
  325. package/lib/utils/array.js +0 -10
  326. package/lib/utils/array.js.map +1 -1
  327. package/lib/utils/array.mjs +1 -10
  328. package/lib/utils/array.mjs.map +1 -1
  329. package/lib/utils/money/constants.d.ts +25 -56
  330. package/lib/utils/money/constants.js +7 -72
  331. package/lib/utils/money/constants.js.map +1 -1
  332. package/lib/utils/money/constants.mjs +7 -70
  333. package/lib/utils/money/constants.mjs.map +1 -1
  334. package/lib/utils/money/format.d.ts +5 -10
  335. package/lib/utils/money/format.js +14 -22
  336. package/lib/utils/money/format.js.map +1 -1
  337. package/lib/utils/money/format.mjs +16 -23
  338. package/lib/utils/money/format.mjs.map +1 -1
  339. package/lib/utils/money/index.d.ts +1 -4
  340. package/lib/utils/money/index.js +8 -26
  341. package/lib/utils/money/index.js.map +1 -1
  342. package/lib/utils/money/index.mjs +4 -8
  343. package/lib/utils/money/index.mjs.map +1 -1
  344. package/lib/utils/money/misc.d.ts +28 -68
  345. package/lib/utils/money/misc.js +64 -35
  346. package/lib/utils/money/misc.js.map +1 -1
  347. package/lib/utils/money/misc.mjs +43 -32
  348. package/lib/utils/money/misc.mjs.map +1 -1
  349. package/lib/utils/money/tax.d.ts +2 -38
  350. package/lib/utils/money/tax.js +10 -46
  351. package/lib/utils/money/tax.js.map +1 -1
  352. package/lib/utils/money/tax.mjs +11 -42
  353. package/lib/utils/money/tax.mjs.map +1 -1
  354. package/lib/utils/money/types.d.ts +3 -78
  355. package/lib/utils/number.d.ts +1 -1
  356. package/lib/utils/number.js +1 -1
  357. package/lib/utils/number.js.map +1 -1
  358. package/lib/utils/number.mjs +1 -1
  359. package/lib/utils/number.mjs.map +1 -1
  360. package/lib/utils/validations/postalCodeSuperRefinement.js +3 -0
  361. package/lib/utils/validations/postalCodeSuperRefinement.js.map +1 -1
  362. package/lib/utils/validations/postalCodeSuperRefinement.mjs +3 -0
  363. package/lib/utils/validations/postalCodeSuperRefinement.mjs.map +1 -1
  364. package/lib/utils/validations/stateRegistrationNumberSuperRefinement.js +2 -0
  365. package/lib/utils/validations/stateRegistrationNumberSuperRefinement.js.map +1 -1
  366. package/lib/utils/validations/stateRegistrationNumberSuperRefinement.mjs +2 -0
  367. package/lib/utils/validations/stateRegistrationNumberSuperRefinement.mjs.map +1 -1
  368. package/lib/utils/validations/taxIdSuperRefinement.js +2 -0
  369. package/lib/utils/validations/taxIdSuperRefinement.js.map +1 -1
  370. package/lib/utils/validations/taxIdSuperRefinement.mjs +2 -0
  371. package/lib/utils/validations/taxIdSuperRefinement.mjs.map +1 -1
  372. package/lib/utils/validations.d.ts +15 -0
  373. package/lib/utils/validations.js +23 -0
  374. package/lib/utils/validations.js.map +1 -0
  375. package/lib/utils/validations.mjs +21 -0
  376. package/lib/utils/validations.mjs.map +1 -0
  377. package/lib/utils/variant.js.map +1 -1
  378. package/lib/utils/variant.mjs.map +1 -1
  379. package/lib/utils/wattage.js.map +1 -1
  380. package/lib/utils/wattage.mjs.map +1 -1
  381. package/package.json +1 -1
  382. package/lib/assets/efg.png +0 -0
  383. package/lib/assets/icon-location-pin.svg +0 -5
  384. package/lib/assets/icons/menu/icon-location-pin.svg.js +0 -27
  385. package/lib/assets/icons/menu/icon-location-pin.svg.js.map +0 -1
  386. package/lib/assets/icons/menu/icon-location-pin.svg.mjs +0 -3
  387. package/lib/assets/icons/menu/icon-location-pin.svg.mjs.map +0 -1
  388. package/lib/assets/ucg-max.png +0 -0
  389. package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +0 -2
  390. package/lib/components/Header/Navigation/ProMenu/ProMenu.js +0 -109
  391. package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +0 -1
  392. package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +0 -87
  393. package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +0 -1
  394. package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +0 -24
  395. package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +0 -154
  396. package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +0 -1
  397. package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +0 -138
  398. package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +0 -1
  399. package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +0 -13
  400. package/lib/components/Header/Navigation/ProMenu/index.d.ts +0 -1
  401. package/lib/components/Header/Navigation/ProMenu/index.js +0 -6
  402. package/lib/components/Header/Navigation/ProMenu/index.mjs +0 -3
  403. package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +0 -1
  404. package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +0 -1
  405. package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +0 -1
  406. package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +0 -1
  407. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
  408. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
  409. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
  410. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
  411. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
  412. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
  413. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
  414. package/lib/helpers/product.d.ts +0 -87
  415. package/lib/helpers/product.js +0 -346
  416. package/lib/helpers/product.js.map +0 -1
  417. package/lib/helpers/product.mjs +0 -335
  418. package/lib/helpers/product.mjs.map +0 -1
  419. package/lib/types/product.d.ts +0 -87
  420. package/lib/types/product.js +0 -14
  421. package/lib/types/product.js.map +0 -1
  422. package/lib/types/product.mjs +0 -13
  423. package/lib/types/product.mjs.map +0 -1
  424. package/lib/utils/money/allocators/fixedAmount.d.ts +0 -26
  425. package/lib/utils/money/allocators/fixedAmount.js +0 -55
  426. package/lib/utils/money/allocators/fixedAmount.js.map +0 -1
  427. package/lib/utils/money/allocators/fixedAmount.mjs +0 -53
  428. package/lib/utils/money/allocators/fixedAmount.mjs.map +0 -1
  429. package/lib/utils/money/allocators/index.d.ts +0 -2
  430. package/lib/utils/money/allocators/index.js +0 -8
  431. package/lib/utils/money/allocators/index.js.map +0 -1
  432. package/lib/utils/money/allocators/index.mjs +0 -4
  433. package/lib/utils/money/allocators/index.mjs.map +0 -1
  434. package/lib/utils/money/allocators/productAmount.d.ts +0 -13
  435. package/lib/utils/money/allocators/productAmount.js +0 -110
  436. package/lib/utils/money/allocators/productAmount.js.map +0 -1
  437. package/lib/utils/money/allocators/productAmount.mjs +0 -108
  438. package/lib/utils/money/allocators/productAmount.mjs.map +0 -1
  439. package/lib/utils/money/exchangeRate.d.ts +0 -31
  440. package/lib/utils/money/exchangeRate.js +0 -27
  441. package/lib/utils/money/exchangeRate.js.map +0 -1
  442. package/lib/utils/money/exchangeRate.mjs +0 -23
  443. package/lib/utils/money/exchangeRate.mjs.map +0 -1
  444. package/lib/utils/money/misc.private.d.ts +0 -23
  445. package/lib/utils/money/misc.private.js +0 -46
  446. package/lib/utils/money/misc.private.js.map +0 -1
  447. package/lib/utils/money/misc.private.mjs +0 -21
  448. package/lib/utils/money/misc.private.mjs.map +0 -1
  449. package/lib/utils/money/shipping.d.ts +0 -5
  450. package/lib/utils/money/shipping.js +0 -8
  451. package/lib/utils/money/shipping.js.map +0 -1
  452. package/lib/utils/money/shipping.mjs +0 -6
  453. package/lib/utils/money/shipping.mjs.map +0 -1
  454. package/lib/utils/money/tax.private.d.ts +0 -17
  455. package/lib/utils/money/tax.private.js +0 -65
  456. package/lib/utils/money/tax.private.js.map +0 -1
  457. package/lib/utils/money/tax.private.mjs +0 -60
  458. package/lib/utils/money/tax.private.mjs.map +0 -1
  459. package/lib/utils/productSort.d.ts +0 -41
  460. package/lib/utils/productSort.js +0 -66
  461. package/lib/utils/productSort.js.map +0 -1
  462. package/lib/utils/productSort.mjs +0 -59
  463. package/lib/utils/productSort.mjs.map +0 -1
  464. /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.d.ts +0 -0
  465. /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.js +0 -0
  466. /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.js.map +0 -0
  467. /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.mjs +0 -0
  468. /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.mjs.map +0 -0
  469. /package/lib/components/{Header/Navigation/ProMenu → ResourceCalculatorV1/components}/index.mjs.map +0 -0
package/CHANGELOG.md CHANGED
@@ -6,46 +6,14 @@
6
6
 
7
7
  ## Releases
8
8
 
9
- ### 9.17.0-alpha.5
9
+ ### 9.17.0
10
10
 
11
- - [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) add data-test-ids
12
-
13
- ### 9.17.0-alpha.4
14
-
15
- - [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) add loading state to account menu
16
-
17
- ### 9.17.0-alpha.3
18
-
19
- - [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) improve header max width handler
20
-
21
- ### 9.17.0-alpha.2
22
-
23
- - [Fix] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) fix pro mobile menu label
24
-
25
- ### 9.17.0-alpha.1
26
-
27
- - [Fix] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) fix pro header inline rendering
28
-
29
- ### 9.17.0-alpha.0
30
-
31
- - [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) pro header inline categories variant
11
+ - [Feat] [MIC-412](https://ubiquiti.atlassian.net/browse/MIC-387) Add "Compliance" footer link
32
12
 
33
13
  ### 9.16.0
34
14
 
35
15
  - [Chore] Remove coming soon from PowerAmp
36
16
 
37
- ### 9.15.0-alpha.3
38
-
39
- - [Feat] [NEP-3479](https://ubiquiti.atlassian.net/browse/NEP-3479)
40
- - Add scroll helper buttons for device select
41
- - Force enable network for UCG-Max
42
- - Remove 0 tb option for UCG-Max
43
-
44
- ### 9.15.0-alpha.2
45
-
46
- - [Chore] [MIC-389](https://ubiquiti.atlassian.net/browse/MIC-389) Performance improvements:
47
- - Remove unused data from Menu mapping
48
-
49
17
  ### 9.15.0
50
18
 
51
19
  - [Chore] [MIC-389](https://ubiquiti.atlassian.net/browse/MIC-389) Performance improvements:
@@ -59,15 +27,6 @@
59
27
 
60
28
  - [Fix] [NEP-3518](https://ubiquiti.atlassian.net/browse/NEP-3518) Add horizontal padding to input card footer note
61
29
 
62
- ### 9.15.0-alpha.1
63
-
64
- - [Fix] [NEP-3518](https://ubiquiti.atlassian.net/browse/NEP-3518) Resource calc add padding to input card footer note
65
-
66
- ### 9.15.0-alpha.0
67
-
68
- - Upstream master branch
69
- - [Feat] [NEP-3641](https://ubiquiti.atlassian.net/browse/NEP-3641) Enable Door Access > Intercoms subcategory in TW store
70
-
71
30
  ### 9.14.0
72
31
 
73
32
  - [Feat] [NEP-3518](https://ubiquiti.atlassian.net/browse/NEP-3518) Resource calculator - Add configurable options for hdd size on device level and configure CloudKey+ to only have 1TB option
@@ -76,26 +35,6 @@
76
35
 
77
36
  - [Fix] [MIC-387](https://ubiquiti.atlassian.net/browse/MIC-387) Use help.uisp.com support link in UISP menu context
78
37
 
79
- ### 9.13.0-alpha.4
80
-
81
- - [Fix] [MIC-387](https://ubiquiti.atlassian.net/browse/MIC-387) Use help.uisp.com support link in UISP menu context
82
-
83
- ### 9.13.0-alpha.3
84
-
85
- - [Feat] [NEP-3478](https://ubiquiti.atlassian.net/browse/NEP-3478) Add HorizontalOptionSelect
86
-
87
- ### 9.13.0-alpha.2
88
-
89
- - [Fix] [NEP-3623](https://ubiquiti.atlassian.net/browse/NEP-3623) Disable "RJ45 & Copper" category in BR store
90
-
91
- ### 9.13.0-alpha.1
92
-
93
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) Add coming soon message to PowerAmp
94
-
95
- ### 9.13.0-alpha.0
96
-
97
- - Upstream master
98
-
99
38
  ### 9.13.0
100
39
 
101
40
  - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) `PowerAmp` release changes:
@@ -114,64 +53,15 @@
114
53
  - [Fix] [NEP-3402](https://ubiquiti.atlassian.net/browse/NEP-3402) Add forced features for consoles in resource calculator
115
54
  - [Feat] [NEP-3419](https://ubiquiti.atlassian.net/browse/NEP-3419) Update cart icon logic
116
55
 
117
- ### 9.12.0.alpha.9
118
-
119
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) Add translations, update content
120
-
121
- ### 9.12.0.alpha.8
122
-
123
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) Update pro store mapping with the new "Premium Audio" category and rename "Professional A/V" to "Digital Signage"
124
-
125
- ### 9.12.0.alpha.7
126
-
127
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) Update Power Amp stuff
128
-
129
- ### 9.12.0.alpha.6
130
-
131
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) Add "Pro A/V Support" property to switching Compare tables
132
-
133
- ### 9.12.0.alpha.5
134
-
135
- - [Feat] Add global site config for uwc.ui.com, remove SiteId.Experts as it is deprecated
136
-
137
- ### 9.12.0.alpha.4
138
-
139
- - Upstream master branch
140
-
141
56
  ### 9.11.1
142
57
 
143
58
  - [Bug] [NEP-3606](https://ubiquiti.atlassian.net/browse/NEP-3606) Disable "Max" menu items in unavailable stores
144
59
 
145
- ### 9.12.0-alpha.3
146
-
147
- - [Feat] [NEP-3479](https://ubiquiti.atlassian.net/browse/NEP-3479) Enable EFG and update its data values
148
-
149
- ### 9.12.0-alpha.2
150
-
151
- - [Feat] [NEP-3479](https://ubiquiti.atlassian.net/browse/NEP-3479)
152
- - Add UCG Max to the Resource Calculator
153
- - Add options for device specific storage drive sizes.
154
-
155
- ### 9.12.0-alpha.1
156
-
157
- - [Feat] [MIC-378](https://ubiquiti.atlassian.net/browse/MIC-378) Move product helpers from SF to SH
158
-
159
- ### 9.12.0-alpha.0
160
-
161
- - [Feat] [MIC-383](https://ubiquiti.atlassian.net/browse/MIC-383) `PowerAmp` release changes:
162
- - Update menu mapping
163
- - Add `PowerAmp` to ExploreProduct component
164
- - Remove unused stuff from ExploreProduct and do a small refactor
165
-
166
60
  ### 9.11.0
167
61
 
168
62
  - [Feat] [NEP-3494](https://ubiquiti.atlassian.net/browse/NEP-3494) Split "Cables & Modules" category into two categories -> "RJ45 & Copper" and "SFP & Fiber"
169
63
  - [Feat] [NEP-3353](https://ubiquiti.atlassian.net/browse/NEP-3353) Hide menu items that are not available in India
170
64
 
171
- ### 9.11.0-alpha.0
172
-
173
- - Upstream master branch
174
-
175
65
  ### 9.10.1
176
66
 
177
67
  - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix X icon and "Cookie Settings" color in dark motif
@@ -180,57 +70,11 @@
180
70
 
181
71
  - [Feat] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Revive Footer component for shared usage between projects
182
72
 
183
- ### 9.9.0-alpha.13
184
-
185
- - [Feat] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix layouting issues on different projects, add Downloads link at the top
186
-
187
- ### 9.9.0-alpha.12
188
-
189
- - [Feat] [NEP-3494](https://ubiquiti.atlassian.net/browse/NEP-3494) Update cables item order
190
-
191
- ### 9.9.0-alpha.11
192
-
193
- - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix font-size and line-height issues on microsites
194
-
195
- ### 9.9.0-alpha.10
196
-
197
- - [Feat] [MIC-315](https://ubiquiti.atlassian.net/browse/MIC-315) Fix links
198
-
199
- ### 9.9.0-alpha.9
200
-
201
- - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix font-family for email placeholder
202
-
203
- ### 9.9.0-alpha.8
204
-
205
- - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix cookie button styling
206
-
207
- ### 9.9.0-alpha.7
208
-
209
- - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Fix footer styling
210
-
211
- ### 9.9.0-alpha.6
212
-
213
- - [Fix] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Open Mailchimp screen in new tab
214
-
215
- ### 9.9.0-alpha.5
216
-
217
- - [Feat] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Revive Footer component for shared usage between projects (don't use Store BE for subscribing)
218
-
219
73
  ### 9.9.1
220
74
 
221
75
  - [Fix] [MIC-315](https://ubiquiti.atlassian.net/browse/MIC-315) Fix product links for UISP compare tables and update property icons
222
76
  - [Fix] [NEP-3353](https://ubiquiti.atlassian.net/browse/NEP-3353) Hide menu items that are not available in India
223
77
 
224
- ### 9.9.0-alpha.4
225
-
226
- - [Feat] [NEP-3494](https://ubiquiti.atlassian.net/browse/NEP-3494) Split "Cables & Modules" category into two categories -> "RJ45 & Copper" and "SFP & Fiber"
227
- - [Fix] [NEP-3149](https://ubiquiti.atlassian.net/browse/NEP-3149) Fix Resource Calculator overlay and remove footer note if no content
228
- - [Feat] [NEP-3419](https://ubiquiti.atlassian.net/browse/NEP-3419) Update cart icon logic
229
- - [Fix] [NEP-3402](https://ubiquiti.atlassian.net/browse/NEP-3402) Add forced features for consoles in resource calculator
230
- - [Feat] [MIC-167](https://ubiquiti.atlassian.net/browse/MIC-167) Revive Footer component for shared usage between projects
231
- - [NEP-3300](https://ubiquiti.atlassian.net/browse/NEP-3300) Add NAS category in pro store
232
- - [Feat] [NEP-3353](https://ubiquiti.atlassian.net/browse/NEP-3353) Hide menu items that are not available in India
233
-
234
78
  ### 9.9.0
235
79
 
236
80
  - [Feat] [MIC-315](https://ubiquiti.atlassian.net/browse/MIC-315) Updates for UISP.com:
@@ -62,25 +62,23 @@ var index$O = require('../components/VideoPlayerNew/index.js');
62
62
  var index$P = require('../components/ResourceCalculatorV1/index.js');
63
63
  var index$Q = require('../components/CartIcon/index.js');
64
64
  var index$R = require('../components/Header/AccountMenu/index.js');
65
- var index$S = require('../components/QuantityInput/index.js');
66
- var index$T = require('../contexts/MenuContext/index.js');
65
+ var index$S = require('../contexts/MenuContext/index.js');
67
66
  var useLockBodyScrollCustom = require('../hooks/useLockBodyScrollCustom.js');
68
67
  var useTestMediaElementVolumeSetter = require('../hooks/useTestMediaElementVolumeSetter.js');
69
68
  var useTranslation = require('../hooks/useTranslation.js');
70
69
  var useScrollToY = require('../hooks/useScrollToY.js');
71
70
  var constants = require('../types/constants.js');
72
71
  var generated = require('../types/generated.js');
73
- var product = require('../types/product.js');
74
72
  var url = require('../utils/url.js');
75
73
  var misc = require('../utils/money/misc.js');
76
74
  var number = require('../utils/number.js');
77
75
  var string = require('../utils/string.js');
78
76
  var array = require('../utils/array.js');
79
- var index$U = require('../utils/nextjs/index.js');
77
+ var index$T = require('../utils/nextjs/index.js');
80
78
  var country = require('../utils/country.js');
81
79
  var countriesAndZones = require('../utils/countriesAndZones.js');
82
80
  var address = require('../utils/address.js');
83
- var index$V = require('../utils/tax/index.js');
81
+ var index$U = require('../utils/tax/index.js');
84
82
  var zod = require('../utils/zod.js');
85
83
  var collectionSlug = require('../utils/collectionSlug.js');
86
84
  var shipping = require('../utils/shipping.js');
@@ -88,15 +86,14 @@ var measures = require('../utils/measures.js');
88
86
  var errors = require('../utils/errors.js');
89
87
  var tags = require('../utils/tags.js');
90
88
  var wattage = require('../utils/wattage.js');
91
- var product$1 = require('../utils/product.js');
89
+ var product = require('../utils/product.js');
92
90
  var asset = require('../utils/asset.js');
93
91
  var imageOptimizer = require('../utils/imageOptimizer.js');
94
92
  var styles = require('../utils/styles.js');
95
93
  var storeId = require('../utils/storeId.js');
96
- var index$W = require('../constants/proStoreCategories/index.js');
97
- var index$X = require('../constants/proStoreFilters/index.js');
94
+ var index$V = require('../constants/proStoreCategories/index.js');
95
+ var index$W = require('../constants/proStoreFilters/index.js');
98
96
  var proStoreCategories = require('../helpers/proStoreCategories.js');
99
- var product$2 = require('../helpers/product.js');
100
97
  var smartcat = require('../apis/smartcat.js');
101
98
  exports.Avatar = index;
102
99
  exports.Button = index$1;
@@ -152,8 +149,7 @@ exports.VideoPlayer = index$O;
152
149
  exports.ResourceCalculatorV1 = index$P;
153
150
  exports.CartIcon = index$Q;
154
151
  exports.AccountMenu = index$R;
155
- exports.QuantityInput = index$S;
156
- exports.MenuContext = index$T;
152
+ exports.MenuContext = index$S;
157
153
  exports.useLockBodyScrollCustom = useLockBodyScrollCustom.useLockBodyScrollCustom;
158
154
  exports.useTestMediaElementVolumeSetter = useTestMediaElementVolumeSetter.useTestMediaElementVolumeSetter;
159
155
  exports.useTranslation = useTranslation.useTranslation;
@@ -171,17 +167,16 @@ exports.Unit = generated.Unit;
171
167
  exports.UnitSystem = generated.UnitSystem;
172
168
  exports.UserAssignedCountryCode = generated.UserAssignedCountryCode;
173
169
  exports.ValidateTaxStatus = generated.ValidateTaxStatus;
174
- exports.DisplayProductStatus = product.DisplayProductStatus;
175
170
  exports.url = url;
176
171
  exports.money = misc;
177
172
  exports.number = number;
178
173
  exports.string = string;
179
174
  exports.array = array;
180
- exports.nextjs = index$U;
175
+ exports.nextjs = index$T;
181
176
  exports.country = country;
182
177
  exports.countryAndZones = countriesAndZones;
183
178
  exports.address = address;
184
- exports.tax = index$V;
179
+ exports.tax = index$U;
185
180
  exports.zod = zod;
186
181
  exports.collectionSlug = collectionSlug;
187
182
  exports.shipping = shipping;
@@ -189,13 +184,13 @@ exports.measures = measures;
189
184
  exports.errors = errors;
190
185
  exports.tags = tags;
191
186
  exports.wattage = wattage;
192
- exports.product = product$1;
187
+ exports.product = product;
193
188
  exports.asset = asset;
194
189
  exports.imageOptimizer = imageOptimizer;
195
190
  exports.styles = styles;
196
191
  exports.storeId = storeId;
197
- exports.proStoreCategories = index$W;
198
- exports.proStoreFilters = index$X;
192
+ exports.proStoreCategories = index$V;
193
+ exports.proStoreFilters = index$W;
199
194
  exports.getCategoriesBySubcategory = proStoreCategories.getCategoriesBySubcategory;
200
195
  exports.getLocalizedCategories = proStoreCategories.getLocalizedCategories;
201
196
  exports.getProductLineByCategory = proStoreCategories.getProductLineByCategory;
@@ -204,15 +199,5 @@ exports.getSubCategoryIdByCollectionSlug = proStoreCategories.getSubCategoryIdBy
204
199
  exports.isValidSubCategory = proStoreCategories.isValidSubCategory;
205
200
  exports.parseCategories = proStoreCategories.parseCategories;
206
201
  exports.useTranslatedCategories = proStoreCategories.useTranslatedCategories;
207
- exports.COLLECTION_SECTION_OTHER_ID = product$2.COLLECTION_SECTION_OTHER_ID;
208
- exports.HDDProductSlugs = product$2.HDDProductSlugs;
209
- exports.MagicCollectionTags = product$2.MagicCollectionTags;
210
- exports.ProductOptions = product$2.ProductOptions;
211
- exports.createSectionHierarchy = product$2.createSectionHierarchy;
212
- exports.getProStoreCategory = product$2.getProStoreCategory;
213
- exports.getProductGroups = product$2.getProductGroups;
214
- exports.getStoreProducts = product$2.getStoreProducts;
215
- exports.isNonNullish = product$2.isNonNullish;
216
- exports.removeExcludedProducts = product$2.removeExcludedProducts;
217
202
  exports.smartcat = smartcat;
218
203
  //# sourceMappingURL=_virtual_multi-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_virtual_multi-entry.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_virtual_multi-entry.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -114,17 +114,14 @@ import * as index$Q from '../components/CartIcon/index.mjs';
114
114
  export { index$Q as CartIcon };
115
115
  import * as index$R from '../components/Header/AccountMenu/index.mjs';
116
116
  export { index$R as AccountMenu };
117
- import * as index$S from '../components/QuantityInput/index.mjs';
118
- export { index$S as QuantityInput };
119
- import * as index$T from '../contexts/MenuContext/index.mjs';
120
- export { index$T as MenuContext };
117
+ import * as index$S from '../contexts/MenuContext/index.mjs';
118
+ export { index$S as MenuContext };
121
119
  export { useLockBodyScrollCustom } from '../hooks/useLockBodyScrollCustom.mjs';
122
120
  export { useTestMediaElementVolumeSetter } from '../hooks/useTestMediaElementVolumeSetter.mjs';
123
121
  export { useTranslation, useTranslationRaw } from '../hooks/useTranslation.mjs';
124
122
  export { useScrollToY } from '../hooks/useScrollToY.mjs';
125
123
  export { AddressUsageType, Language } from '../types/constants.mjs';
126
124
  export { AddressType, CountryCode, Currency, GlobalStoreId, ProductLine, StoreId, Unit, UnitSystem, UserAssignedCountryCode, ValidateTaxStatus } from '../types/generated.mjs';
127
- export { DisplayProductStatus } from '../types/product.mjs';
128
125
  import * as url from '../utils/url.mjs';
129
126
  export { url };
130
127
  import * as misc from '../utils/money/misc.mjs';
@@ -135,16 +132,16 @@ import * as string from '../utils/string.mjs';
135
132
  export { string };
136
133
  import * as array from '../utils/array.mjs';
137
134
  export { array };
138
- import * as index$U from '../utils/nextjs/index.mjs';
139
- export { index$U as nextjs };
135
+ import * as index$T from '../utils/nextjs/index.mjs';
136
+ export { index$T as nextjs };
140
137
  import * as country from '../utils/country.mjs';
141
138
  export { country };
142
139
  import * as countriesAndZones from '../utils/countriesAndZones.mjs';
143
140
  export { countriesAndZones as countryAndZones };
144
141
  import * as address from '../utils/address.mjs';
145
142
  export { address };
146
- import * as index$V from '../utils/tax/index.mjs';
147
- export { index$V as tax };
143
+ import * as index$U from '../utils/tax/index.mjs';
144
+ export { index$U as tax };
148
145
  import * as zod from '../utils/zod.mjs';
149
146
  export { zod };
150
147
  import * as collectionSlug from '../utils/collectionSlug.mjs';
@@ -169,12 +166,11 @@ import * as styles from '../utils/styles.mjs';
169
166
  export { styles };
170
167
  import * as storeId from '../utils/storeId.mjs';
171
168
  export { storeId };
172
- import * as index$W from '../constants/proStoreCategories/index.mjs';
173
- export { index$W as proStoreCategories };
174
- import * as index$X from '../constants/proStoreFilters/index.mjs';
175
- export { index$X as proStoreFilters };
169
+ import * as index$V from '../constants/proStoreCategories/index.mjs';
170
+ export { index$V as proStoreCategories };
171
+ import * as index$W from '../constants/proStoreFilters/index.mjs';
172
+ export { index$W as proStoreFilters };
176
173
  export { getCategoriesBySubcategory, getLocalizedCategories, getProductLineByCategory, getProductLineBySubcategory, getSubCategoryIdByCollectionSlug, isValidSubCategory, parseCategories, useTranslatedCategories } from '../helpers/proStoreCategories.mjs';
177
- export { COLLECTION_SECTION_OTHER_ID, HDDProductSlugs, MagicCollectionTags, ProductOptions, createSectionHierarchy, getProStoreCategory, getProductGroups, getStoreProducts, isNonNullish, removeExcludedProducts } from '../helpers/product.mjs';
178
174
  import * as smartcat from '../apis/smartcat.mjs';
179
175
  export { smartcat };
180
176
  //# sourceMappingURL=_virtual_multi-entry.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_virtual_multi-entry.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_virtual_multi-entry.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -26,10 +26,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
26
26
  writable: true,
27
27
  value
28
28
  }) : obj[key] = value;
29
- var __publicField = (obj, key, value) => {
30
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
31
- return value;
32
- };
29
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
33
30
  const isDigitsOnlyRegex = /^\d+$/;
34
31
  const languageToSmartcatLocaleMapping = {
35
32
  [constants.Language.Ar]: "ar",
@@ -1 +1 @@
1
- {"version":3,"file":"smartcat.js","sources":["../../src/apis/smartcat.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\nimport AdmZip from \"adm-zip\";\nimport type { AxiosInstance } from \"axios\";\nimport axios from \"axios\";\nimport { createHash } from \"crypto\";\nimport stableStringify from \"json-stable-stringify\";\nimport invert from \"lodash/invert\";\nimport type { Agent as HttpsAgent } from \"node:https\";\nimport { setTimeout as setTimeoutAsync } from \"node:timers/promises\";\n\nimport type { Nullish } from \"../types\";\nimport { Language } from \"../types\";\nimport { assert } from \"../utils/errors\";\n\ntype SmartcatCredentials = {\n apiSecret: string;\n accountId: string;\n projectId: string;\n collectionName: string;\n};\n\ntype SmartcatProject = {\n // Workflow type and id mapping for project\n workflowStages: Array<{\n id: string;\n stageType: \"translation\" | \"postediting\";\n }>;\n documents: Array<{\n // Collection name the document belongs to\n name: string;\n // Flag for if auto translations are complete on smartcat side\n pretranslateCompleted: boolean;\n // Workflow progress of a document\n workflowStages: Array<{\n id: string;\n progress: number;\n }>;\n // Target language of the document\n targetLanguage: string;\n }>;\n};\n\ntype TranslationObject = Record<string, string>;\n\ntype TranslationUploadObject = {\n translations: TranslationObject;\n /**\n * (Optional) Labels that will be appended to all segments in the upload. Existing labels in SC remains untouched.\n */\n appendLabels?: string[];\n};\n\n/**\n * Basic check if given string only consists of digits\n * ! Doesn't support decimal and thousand separated numbers as it's not a relevant practical use case right now\n */\nconst isDigitsOnlyRegex = /^\\d+$/;\n\nexport type SmartcatApiConfig = {\n auth: SmartcatCredentials;\n enableLogs?: boolean;\n /**\n * (optional) Parse single brackets variable delimiters before\n * upstream to Smartcat, from \"{x}\" to \"{{x}}\".\n */\n escapeBracketDelimiters?: boolean;\n /**\n * (optional) Pass https agent to try to keep connections open.\n */\n httpsAgent?: HttpsAgent;\n /**\n * Languages that will be downloaded from Smartcat.\n * When omitted, all languages will be downloaded.\n */\n targetLanguages?: Language[];\n // #############################################################################\n // Suffix options\n // #############################################################################\n} & (\n | {\n /**\n * No suffix to be used in translation keys\n * @example 'commons.button.buyNow'\n */\n suffixMode: \"none\";\n }\n | {\n /**\n * Custom suffix to use in translation keys\n * @example `commons.button.buyNow.${suffix}`\n */\n suffixMode: \"custom\";\n /**\n * * ! Must be a non-empty string which doesn't contain the key delimiter \".\" character otherwise will fail\n */\n suffix: string;\n }\n | {\n /**\n * Auto generate (7-character) hash-suffix from the default (english) value\n * @example 'commons.button.buyNow.nk31jnb'\n */\n suffixMode: \"auto\";\n }\n);\n\nconst languageToSmartcatLocaleMapping: Record<Language, string> = {\n [Language.Ar]: \"ar\",\n [Language.De]: \"de\",\n [Language.En]: \"en\",\n [Language.Es]: \"es\",\n [Language.Fr]: \"fr\",\n [Language.El]: \"el\",\n [Language.It]: \"it\",\n [Language.Ja]: \"ja\",\n [Language.Pt]: \"pt-BR\",\n [Language.Zh]: \"zh-Hans\",\n [Language.Tw]: \"zh-Hant-TW\",\n};\n\n/**\n * ####################################################################################\n * # Description:\n * - Uploading a local source of truth (English) locale file to a Smartcat project.\n * Before uploading locale file, a hash is created from the value of the text entry and added as suffix to the key of the text entry.\n *\n * - Downloading translated locale files and only keep translation entries where the \"key.{hash of value}\"\n * matches exactly to the source of truth \"key.{hash of value}\"\n *\n * # Script usage:\n * - Running `runFullSync` will first upload a source of truth locale file to Smartcat,\n * then we poll the smartcat severs until the new locales are full translated by Smartcat AI.\n * When translations are done, we download and process the translated files.\n *\n * - Each of these actions can be run separately as well.\n * ####################################################################################\n */\nexport class SmartcatApi {\n private projectId: string;\n private collectionName: string;\n private axios: AxiosInstance;\n private enableLogs: boolean = false;\n private escapeBracketDelimiters: boolean = false;\n private suffix: string | null;\n private targetLanguages: Language[] | undefined;\n /**\n * Depending on input we might need or not need suffixes.\n */\n private hasSuffix: boolean;\n\n /**\n * Delimiter used to separate translation key \"parts\"\n */\n public keyDelimiter = \".\";\n\n constructor(config: SmartcatApiConfig) {\n this.enableLogs = !!config.enableLogs;\n this.escapeBracketDelimiters = !!config.escapeBracketDelimiters;\n this.projectId = config.auth.projectId;\n this.collectionName = config.auth.collectionName;\n this.targetLanguages = config.targetLanguages;\n\n switch (config.suffixMode) {\n case \"none\": {\n this.suffix = null;\n this.hasSuffix = false;\n break;\n }\n case \"custom\": {\n const suffixRegex = /^[a-zA-Z0-9-]+$/;\n\n if (\n // Empty string\n !config.suffix ||\n // Contains invalid characters\n !suffixRegex.test(config.suffix) ||\n // Contains key delimiter\n config.suffix.indexOf(this.keyDelimiter) > -1\n ) {\n throw new Error(\n \"Invalid custom suffix provided for SmartcatApi.suffix. Can only contain alphanumeric characters and hyphens.\",\n );\n }\n this.suffix = config.suffix;\n this.hasSuffix = true;\n break;\n }\n case \"auto\": {\n this.suffix = null;\n this.hasSuffix = true;\n break;\n }\n default:\n throw new Error(`Unsupported or missing value for SmartcatApi.suffix`);\n }\n\n const authBase64 = Buffer.from(\n `${config.auth.accountId}:${config.auth.apiSecret}`,\n ).toString(\"base64\");\n\n this.axios = axios.create({\n httpsAgent: config.httpsAgent,\n baseURL: \"https://us.smartcat.ai/api/\",\n headers: {\n Authorization: `Basic ${authBase64}`,\n },\n });\n }\n\n // #############################################################################\n // Internal helpers\n // #############################################################################\n /**\n * Smartcat locale --> enum Language mapping for filenames\n */\n private smartcatLocaleToLanguageMap = invert(languageToSmartcatLocaleMapping);\n\n // #############################################################################\n // Key/Suffix/Hash helpers\n // #############################################################################\n\n /**\n * Hash the text value from translation entry value from reference language\n */\n private generateHashSuffixFromValue(value: string): string {\n // Using same amount of chars (7) as GIT uses for shorthand hash.\n const shorthandHashCharCount = 7;\n\n return createHash(\"sha256\")\n .update(value)\n .digest(\"hex\")\n .substring(0, shorthandHashCharCount);\n }\n\n /**\n * Create suffix for given value depending on configuration\n */\n public createSuffix(value: string): string {\n assert(\n this.hasSuffix,\n \"Can't call `createSuffix` for instance without a suffix\",\n );\n\n return this.suffix || this.generateHashSuffixFromValue(value);\n }\n\n /**\n * Util to create translation key.\n * ! Recommended to be used to create key on consumer side of Smartcat class for a consistent experience\n *\n * @example smartcatApi.createTranslationKey(['a', 'b', 'c']) // 'a.b.c'\n */\n public createTranslationKey(parts: string[]): string {\n return parts.join(this.keyDelimiter);\n }\n\n /**\n * Util to parse a translation key\n * ! Recommended to be used to create key on consumer side of Smartcat class for a consistent experience\n *\n * @example smartcatApi.parseTranslationKey('a.b.c'); // ['a', 'b', 'c'];\n */\n public parseTranslationKey(key: string): string[] {\n return key.split(this.keyDelimiter);\n }\n\n /**\n * Returns the key with suffix created by hashing the value.\n */\n public addSuffixToKey(key: string, value: string): string {\n return this.hasSuffix\n ? this.createTranslationKey([key, this.createSuffix(value)])\n : key;\n }\n\n /**\n * Takes a SmartCat text entry key (with hash) and returns the key without it\n */\n public removeSuffixFromKey(key: string): string {\n return this.hasSuffix\n ? this.createTranslationKey(this.parseTranslationKey(key).slice(0, -1))\n : key;\n }\n\n // #############################################################################\n // Transform data helpers\n // #############################################################################\n\n /**\n * Filter out entries that are not included in source of truth\n * translations and remove suffix from keys.\n */\n public processSmartcatTranslations(\n sourceOfTruthTranslations: TranslationObject,\n smartcatTranslations: TranslationObject,\n ): TranslationObject {\n // Append suffix to source of truth translations.\n const sourceOfTruthKeysWithSuffix = new Set(\n Object.entries(sourceOfTruthTranslations).map(([key, value]) =>\n this.addSuffixToKey(key, value),\n ),\n );\n\n // Normalise translated entry keys by removing the hash from key name.\n const result: TranslationObject = {};\n for (const key in smartcatTranslations) {\n // Ignore key from smartcat if not in source-of-truth\n if (!sourceOfTruthKeysWithSuffix.has(key)) {\n continue;\n }\n\n const normalisedKey = this.removeSuffixFromKey(key);\n const value = smartcatTranslations[key];\n\n if (value !== undefined) {\n result[normalisedKey] = value;\n }\n }\n\n return result;\n }\n\n /**\n * Parse string variable delimiters between smartcat and local delimiters.\n * Only top level delimiter pairs that don't have child delimiters or child curly brackets should be transformed.\n */\n private parseVariableDelimiters(\n input: string,\n mode: \"toSmartcatDelimiters\" | \"toLocalDelimiters\",\n ): string {\n /**\n * Constant icu string delimiters that we avoid to transform,\n * can conflict with the variable delimiters without error.\n */\n const icuStringDelimiters = {\n open: \"{\",\n close: \"}\",\n };\n\n /**\n * Evaluate what delimiters to transform from and to\n */\n const delimiterOptions = {\n local: {\n open: \"{\",\n close: \"}\",\n },\n smartcat: {\n open: \"{{\",\n close: \"}}\",\n },\n };\n const delimiters =\n mode === \"toSmartcatDelimiters\"\n ? {\n from: delimiterOptions.local,\n to: delimiterOptions.smartcat,\n }\n : {\n from: delimiterOptions.smartcat,\n to: delimiterOptions.local,\n };\n\n // Cheap check - return unmodified if input does not contain any opening or any closing variable delimiters\n if (\n !input.includes(delimiters.from.open) ||\n !input.includes(delimiters.from.close)\n ) {\n return input;\n }\n\n let result = \"\"; // Final result\n let lastPosition = 0; // This helps in building the result string\n let icuStringDepth = 0;\n /**\n * When finding an opening delimiter, closing delimiter index is already\n * evaluated and therefor we store it until it's reached.\n * Gets reset to `null` when this index in the iteration is reached.\n */\n let nextValidClosingVariableDelimiterIndex: null | number = null;\n\n for (let i = 0; i < input.length; i++) {\n // Hold current char\n const currentChar = input[i];\n\n // If currently inside ICU string, track the depth and continue to next char\n if (icuStringDepth > 0) {\n if (currentChar === icuStringDelimiters.open) {\n icuStringDepth++;\n } else if (currentChar === icuStringDelimiters.close) {\n icuStringDepth--;\n }\n\n continue;\n }\n\n /**\n * Encounter of a closing delimiter\n */\n if (i === nextValidClosingVariableDelimiterIndex) {\n // Get inner content between variable delimiters\n const variableInnerContent = input.slice(\n lastPosition + delimiters.from.open.length,\n i,\n );\n // Transform delimiters\n result += `${delimiters.to.open}${variableInnerContent}${delimiters.to.close}`;\n // Move the last position past this closing brace\n lastPosition = i + delimiters.from.close.length;\n // Reset closing delimiter index\n nextValidClosingVariableDelimiterIndex = null;\n // Go next after closing variable\n continue;\n } else if (nextValidClosingVariableDelimiterIndex !== null) {\n // Go next until reaching closing variable delimiter\n continue;\n }\n\n /**\n * Evaluate if current position is index of an opening delimiter\n */\n const isVariableOpeningBracketPattern =\n input.substring(i, i + delimiters.from.open.length) ===\n delimiters.from.open;\n if (isVariableOpeningBracketPattern) {\n // Evaluate start and end indexes of variable brackets.\n const innerContentStartIndex = i + delimiters.from.open.length;\n const closingVariableDelimiterIndex = input.indexOf(\n delimiters.from.close,\n innerContentStartIndex,\n );\n\n // Check if we can find the closing delimiter, else the opening delimiter can not be valid\n if (closingVariableDelimiterIndex !== -1) {\n // Variable delimiters inner content, excluding the delimiters\n const variableInnerContent = input.substring(\n innerContentStartIndex,\n closingVariableDelimiterIndex,\n );\n // Characters not allowed for variable inner content - helps to avoid transforming ICU string delimiters\n const illegalVariableCharacterRegex = /{|}|,|#/;\n // If delimiters inner content contains illegal characters, the opening bracket is not a valid variable.\n const isValidVariableOpeningDelimiters =\n !illegalVariableCharacterRegex.test(variableInnerContent);\n\n if (isValidVariableOpeningDelimiters) {\n // Append everything up to this delimiter to the result\n result += input.substring(lastPosition, i);\n // Update the last position to the current index\n lastPosition = i;\n // Store the closing delimiter index\n nextValidClosingVariableDelimiterIndex =\n closingVariableDelimiterIndex;\n } else if (currentChar === icuStringDelimiters.open) {\n // When reached - ICU string begins here\n icuStringDepth++;\n }\n }\n } else if (currentChar === icuStringDelimiters.open) {\n icuStringDepth++;\n }\n }\n\n // Append any remaining part of the input string to result\n result += input.slice(lastPosition);\n return result;\n }\n\n /**\n * Helper to parse variable placeholders for a translation file\n */\n public parseTranslationVariableDelimiters(\n translations: TranslationObject,\n mode: \"toSmartcatDelimiters\" | \"toLocalDelimiters\",\n ): TranslationObject {\n return Object.fromEntries(\n Object.entries(translations).map(([key, value]) => [\n key,\n this.parseVariableDelimiters(value, mode),\n ]),\n );\n }\n\n /**\n * Check if SmartCat has translated all target languages.\n */\n private async checkProjectTranslationStatus(): Promise<boolean> {\n try {\n // Fetch project data\n const res = await this.axios.get(\n `/integration/v1/project/${this.projectId}`,\n );\n const project = res.data as SmartcatProject;\n\n // Find the auto translation workflow id\n const autoTranslationWorkflowId = project.workflowStages.find(\n (workflow) => workflow.stageType === \"translation\",\n )?.id;\n if (!autoTranslationWorkflowId) {\n throw new Error(\n \"Could not find auto translation workflow id in SmartCat project.\",\n );\n }\n\n // Get relevant documents\n const documents = project.documents.filter((doc) => {\n const isInCollection = doc.name === this.collectionName;\n const isRequestedTargetLanguage = Boolean(\n !this.targetLanguages ||\n this.targetLanguages\n ?.map((lang) => languageToSmartcatLocaleMapping[lang])\n .includes(doc.targetLanguage),\n );\n\n return isInCollection && isRequestedTargetLanguage;\n });\n\n // Check if all documents have 100% progress in auto translation workflow\n return documents.every((doc) => {\n const autoTranslationWorkflow = doc.workflowStages.find(\n (workflow) => workflow.id === autoTranslationWorkflowId,\n );\n return autoTranslationWorkflow?.progress === 100;\n });\n } catch (error) {\n if (this.enableLogs) {\n console.error(\"❌ Failed to get project\", error);\n }\n throw error;\n }\n }\n\n // #############################################################################\n // Api methods\n // #############################################################################\n\n /**\n * Download translations from Smartcat.\n */\n public async downloadSmartcatTranslations(\n defaultTranslations: TranslationObject,\n ): Promise<Record<Language, TranslationObject>> {\n const url = `integration/v2/project/${this.projectId}/export`;\n const params = {\n \"completion-state\": \"draft\",\n \"output-file-path-template\": \"{LANGUAGE}.json\",\n collections: this.collectionName,\n zip: \"true\",\n languages: this.targetLanguages\n ?.map((lang) => languageToSmartcatLocaleMapping[lang])\n .join(\",\"),\n };\n\n try {\n const exportResponse = await this.axios.post(\n url,\n {},\n {\n params,\n headers: {\n \"Content-Type\": \"application/json-patch+json\",\n },\n },\n );\n const taskID = exportResponse.data;\n\n const pollRunLimit = 10;\n const pollInterval = 5000;\n\n const translations: Record<string, TranslationObject> = {};\n let pollRunCount = 0;\n let exportSuccessful = false;\n\n // Polling loop to check if the export is successful\n while (!exportSuccessful && pollRunCount < pollRunLimit) {\n pollRunCount += 1;\n\n const checkUrl = `integration/v1/document/export/${taskID}/`;\n const checkResponse = await this.axios.get(checkUrl, {\n responseType: \"arraybuffer\", // Set response type to arraybuffer\n });\n\n if (checkResponse.status === 200) {\n // Unzip and discard the zip file, rename.\n const zip = new AdmZip(checkResponse.data);\n const zipEntries = zip.getEntries();\n\n for (const zipEntry of zipEntries) {\n if (!zipEntry.isDirectory) {\n // Extract the content of the file\n const data = zip.readFile(zipEntry);\n\n if (!data) {\n throw new Error(\n \"Exported smarcat document does not include any data\",\n );\n }\n\n const locale = zipEntry.entryName.replace(\".json\", \"\");\n const mappedLocale = this.smartcatLocaleToLanguageMap[locale];\n\n if (!mappedLocale) {\n this.enableLogs &&\n console.log(\n `Couldnt find map for SmartCat locale ${locale}, skipping file.`,\n );\n continue;\n }\n\n const parsedTranslations = JSON.parse(data.toString());\n\n // Process downloaded translations.\n let result = this.processSmartcatTranslations(\n defaultTranslations,\n parsedTranslations,\n );\n\n // Escape content variable delimiters.\n if (this.escapeBracketDelimiters) {\n result = this.parseTranslationVariableDelimiters(\n result,\n \"toLocalDelimiters\",\n );\n }\n\n translations[mappedLocale] = result;\n }\n }\n\n // Exit loop.\n exportSuccessful = true;\n } else if (checkResponse.status === 204) {\n // Wait for one second before checking again.\n await setTimeoutAsync(pollInterval);\n } else {\n // Unknown status response.\n throw new Error(\n `Failed to download smartcat translations, endpoint returned unknown status code ${checkResponse.status}`,\n );\n }\n }\n\n if (!exportSuccessful) {\n throw new Error(\n \"Max retries reached when trying to export files from SmartCat.\",\n );\n }\n\n if (this.enableLogs) {\n console.log(\"✅ Download target language locale documents complete.\");\n }\n\n return translations;\n } catch (error) {\n if (this.enableLogs) {\n console.error(\n \"❌ Failed downloading locale files from SmartCat\\n\",\n error,\n );\n }\n\n throw error;\n }\n }\n\n /**\n * Exposed method for uploading source translations to Smartcat.\n */\n public async uploadSourceTranslations(\n // Source translations that will be uploaded to SmartCat.\n sourceTranslations: TranslationUploadObject | TranslationUploadObject[],\n options?: {\n // When true, deleting all keys in the smartcat collection that does not exist in sourceTranslations.\n deleteMissingKeys?: boolean;\n },\n ): Promise<void> {\n try {\n const rawTranslationUploads = Array.isArray(sourceTranslations)\n ? sourceTranslations\n : [sourceTranslations];\n\n /**\n * Prepare translations for upload by:\n * 1. Ignore non-translatable values.\n * 2. Add suffix to key based on settings.\n * 3. Escape variable delimiters based on settings.\n */\n const preparedTranslationUploads = rawTranslationUploads.map(\n (translationUpload) => {\n let translations: TranslationObject = {};\n\n for (const [key, value] of Object.entries(\n translationUpload.translations,\n )) {\n if (!SmartcatApi.isTranslatableValue(value)) {\n continue;\n }\n const suffixedKey = this.addSuffixToKey(key, value);\n translations[suffixedKey] = value;\n }\n\n // Prepare variable delimiters.\n if (this.escapeBracketDelimiters) {\n translations = this.parseTranslationVariableDelimiters(\n translations,\n \"toSmartcatDelimiters\",\n );\n }\n\n return {\n ...translationUpload,\n translations,\n };\n },\n );\n\n /**\n * Upload all translations together and make the data purge in SC.\n */\n if (options?.deleteMissingKeys) {\n // Merge all prepared translations into one object.\n const combinedTranslations: TranslationObject =\n preparedTranslationUploads.reduce((acc, current) => {\n return { ...acc, ...current.translations };\n }, {});\n\n await this.smartcatUploadRequest(combinedTranslations, {\n deleteMissingKeys: true,\n });\n\n if (this.enableLogs) {\n console.log(\"🧹 Deleted unused translations from Smartcat.\");\n }\n }\n\n /**\n * Upload each translation object separately to apply labels.\n */\n for (const translationUpload of preparedTranslationUploads) {\n await this.smartcatUploadRequest(translationUpload.translations, {\n labels: translationUpload.appendLabels,\n });\n }\n\n if (this.enableLogs) {\n console.log(\"✅ Upload source translations to SmartCat complete.\");\n }\n } catch (error) {\n if (this.enableLogs) {\n console.error(\n \"❌ Failed uploading source translations to SmartCat.\",\n error,\n );\n }\n throw error;\n }\n }\n\n /**\n * Internal helper method for uploading source translations to Smartcat.\n */\n private async smartcatUploadRequest(\n sourceTranslations: TranslationObject,\n options?: {\n labels?: string[];\n deleteMissingKeys?: boolean;\n },\n ) {\n const labels =\n options?.labels\n ?.map((label) => label.trim())\n .filter(Boolean)\n .join(\",\") || \"\";\n\n const queryParams = {\n format: \"json\",\n language: \"en\",\n collection: this.collectionName,\n \"delete-missing-keys\": !!options?.deleteMissingKeys,\n labels,\n };\n\n const url = `integration/v2/project/${this.projectId}/import`;\n\n const smartCatSourceLanguageBuffer = Buffer.from(\n JSON.stringify(sourceTranslations),\n );\n\n const fileBlob = new Blob([smartCatSourceLanguageBuffer], {\n type: \"application/octet-stream\",\n });\n\n const formData = new FormData();\n formData.append(\"file\", fileBlob);\n\n await this.axios.post(url, formData, {\n params: queryParams,\n headers: { \"Content-Type\": \"multipart/form-data\" },\n });\n }\n\n /**\n * Wait for SmartCat to fully translate all target languages.\n */\n public pollAndWaitForCompletedTranslations = async (\n pollRunLimit = 20,\n pollIntervalMs = 10000,\n ): Promise<boolean> => {\n let pollRunCount = 0;\n let translationCompleted = false;\n\n while (!translationCompleted && pollRunCount < pollRunLimit) {\n if (this.enableLogs) {\n console.log(`⌛ SmartCat translations in progress.`);\n }\n\n translationCompleted = await this.checkProjectTranslationStatus();\n pollRunCount += 1;\n\n if (!translationCompleted) {\n await setTimeoutAsync(pollIntervalMs);\n }\n }\n\n /**\n * HACK\n * Since there is a bug with smartcat returning true for `pretranslateCompleted`\n * before they are updated in smartcat. We implement an artificial sleep to let\n * smartcat update the target translations before we download them.\n */\n if (translationCompleted) {\n await setTimeoutAsync(60000);\n }\n\n if (this.enableLogs) {\n const msg = translationCompleted\n ? \"✅ SmartCat translations completed.\"\n : \"❌ Max retries reached when waiting for SmartCat translations to complete.\";\n console.log(msg);\n }\n\n return translationCompleted;\n };\n\n /**\n * Static util to prettify translation for writing to file-system\n */\n static prettifyTranslation = (translation: TranslationObject): string => {\n return (\n stableStringify(translation, { space: 2 }) +\n // Add EOF newline\n `\\n`\n );\n };\n\n /**\n * Checks if given value is translatable a.k.a if it's worth sending over to smartcat to translate\n */\n static isTranslatableValue = (value: Nullish<string>): boolean => {\n // Trim to check if given string isn't just spaces which is not worth translating\n const parsedValue = value?.trim();\n\n // Ignore empty values\n if (!parsedValue) {\n return false;\n }\n\n // Don't translate values that are digits only\n return !isDigitsOnlyRegex.test(parsedValue);\n };\n\n /**\n * Centralized method to get Smartcat label based on environment.\n */\n static getSmartcatLabel = (env: \"qa\" | \"prod\"): string => {\n switch (env) {\n case \"qa\":\n return \"STG\";\n case \"prod\":\n return \"MAIN\";\n default:\n throw new Error(\n `Failed to get smartcat label - Unknown environment ${env}`,\n );\n }\n };\n}\n"],"names":["isDigitsOnlyRegex","languageToSmartcatLocaleMapping","Language","Ar","De","En","Es","Fr","El","It","Ja","Pt","Zh","Tw","_SmartcatApi","constructor","config","__publicField","invert","pollRunLimit","pollIntervalMs","pollRunCount","translationCompleted","enableLogs","console","log","checkProjectTranslationStatus","setTimeoutAsync","msg","escapeBracketDelimiters","projectId","auth","collectionName","targetLanguages","suffixMode","suffix","hasSuffix","suffixRegex","test","indexOf","keyDelimiter","Error","authBase64","Buffer","from","accountId","apiSecret","toString","axios","create","httpsAgent","baseURL","headers","Authorization","generateHashSuffixFromValue","value","shorthandHashCharCount","createHash","update","digest","substring","createSuffix","assert","createTranslationKey","parts","join","parseTranslationKey","key","split","addSuffixToKey","removeSuffixFromKey","slice","processSmartcatTranslations","sourceOfTruthTranslations","smartcatTranslations","sourceOfTruthKeysWithSuffix","Set","Object","entries","map","result","has","normalisedKey","parseVariableDelimiters","input","mode","icuStringDelimiters","open","close","delimiterOptions","local","smartcat","delimiters","to","includes","lastPosition","icuStringDepth","nextValidClosingVariableDelimiterIndex","i","length","currentChar","variableInnerContent","isVariableOpeningBracketPattern","innerContentStartIndex","closingVariableDelimiterIndex","illegalVariableCharacterRegex","isValidVariableOpeningDelimiters","parseTranslationVariableDelimiters","translations","fromEntries","res","get","project","data","autoTranslationWorkflowId","workflowStages","find","workflow","stageType","id","documents","filter","doc","isInCollection","name","isRequestedTargetLanguage","Boolean","lang","targetLanguage","every","autoTranslationWorkflow","progress","error","downloadSmartcatTranslations","defaultTranslations","url","params","collections","zip","languages","exportResponse","post","taskID","pollInterval","exportSuccessful","checkUrl","checkResponse","responseType","status","AdmZip","zipEntries","getEntries","zipEntry","isDirectory","readFile","locale","entryName","replace","mappedLocale","smartcatLocaleToLanguageMap","parsedTranslations","JSON","parse","uploadSourceTranslations","sourceTranslations","options","rawTranslationUploads","Array","isArray","preparedTranslationUploads","translationUpload","isTranslatableValue","suffixedKey","deleteMissingKeys","combinedTranslations","reduce","acc","current","smartcatUploadRequest","labels","appendLabels","label","trim","queryParams","format","language","collection","smartCatSourceLanguageBuffer","stringify","fileBlob","Blob","type","formData","FormData","append","translation","stableStringify","space","parsedValue","env","SmartcatApi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAMA,iBAAoB,GAAA,OAAA;AAkD1B,MAAMC,+BAA4D,GAAA;EAChE,CAACC,SAAAA,CAAAA,QAAS,CAAAC,EAAE,GAAG,IAAA;EACf,CAACD,SAAAA,CAAAA,QAAS,CAAAE,EAAE,GAAG,IAAA;EACf,CAACF,SAAAA,CAAAA,QAAS,CAAAG,EAAE,GAAG,IAAA;EACf,CAACH,SAAAA,CAAAA,QAAS,CAAAI,EAAE,GAAG,IAAA;EACf,CAACJ,SAAAA,CAAAA,QAAS,CAAAK,EAAE,GAAG,IAAA;EACf,CAACL,SAAAA,CAAAA,QAAS,CAAAM,EAAE,GAAG,IAAA;EACf,CAACN,SAAAA,CAAAA,QAAS,CAAAO,EAAE,GAAG,IAAA;EACf,CAACP,SAAAA,CAAAA,QAAS,CAAAQ,EAAE,GAAG,IAAA;EACf,CAACR,SAAAA,CAAAA,QAAS,CAAAS,EAAE,GAAG,OAAA;EACf,CAACT,SAAAA,CAAAA,QAAS,CAAAU,EAAE,GAAG,SAAA;EACf,CAACV,SAAAA,CAAAA,QAAS,CAAAW,EAAE,GAAG;AACjB,CAAA;AAmBO,MAAMC,YAAA,GAAN,MAAMA,YAAY,CAAA;EAkBvBC,YAAYC,MAA2B,EAAA;IA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IAAMC,WAAN,GAAA1L,YAAA;"}
1
+ {"version":3,"file":"smartcat.js","sources":["../../src/apis/smartcat.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\nimport AdmZip from \"adm-zip\";\nimport type { AxiosInstance } from \"axios\";\nimport axios from \"axios\";\nimport { createHash } from \"crypto\";\nimport stableStringify from \"json-stable-stringify\";\nimport invert from \"lodash/invert\";\nimport type { Agent as HttpsAgent } from \"node:https\";\nimport { setTimeout as setTimeoutAsync } from \"node:timers/promises\";\n\nimport type { Nullish } from \"../types\";\nimport { Language } from \"../types\";\nimport { assert } from \"../utils/errors\";\n\ntype SmartcatCredentials = {\n apiSecret: string;\n accountId: string;\n projectId: string;\n collectionName: string;\n};\n\ntype SmartcatProject = {\n // Workflow type and id mapping for project\n workflowStages: Array<{\n id: string;\n stageType: \"translation\" | \"postediting\";\n }>;\n documents: Array<{\n // Collection name the document belongs to\n name: string;\n // Flag for if auto translations are complete on smartcat side\n pretranslateCompleted: boolean;\n // Workflow progress of a document\n workflowStages: Array<{\n id: string;\n progress: number;\n }>;\n // Target language of the document\n targetLanguage: string;\n }>;\n};\n\ntype TranslationObject = Record<string, string>;\n\ntype TranslationUploadObject = {\n translations: TranslationObject;\n /**\n * (Optional) Labels that will be appended to all segments in the upload. Existing labels in SC remains untouched.\n */\n appendLabels?: string[];\n};\n\n/**\n * Basic check if given string only consists of digits\n * ! Doesn't support decimal and thousand separated numbers as it's not a relevant practical use case right now\n */\nconst isDigitsOnlyRegex = /^\\d+$/;\n\nexport type SmartcatApiConfig = {\n auth: SmartcatCredentials;\n enableLogs?: boolean;\n /**\n * (optional) Parse single brackets variable delimiters before\n * upstream to Smartcat, from \"{x}\" to \"{{x}}\".\n */\n escapeBracketDelimiters?: boolean;\n /**\n * (optional) Pass https agent to try to keep connections open.\n */\n httpsAgent?: HttpsAgent;\n /**\n * Languages that will be downloaded from Smartcat.\n * When omitted, all languages will be downloaded.\n */\n targetLanguages?: Language[];\n // #############################################################################\n // Suffix options\n // #############################################################################\n} & (\n | {\n /**\n * No suffix to be used in translation keys\n * @example 'commons.button.buyNow'\n */\n suffixMode: \"none\";\n }\n | {\n /**\n * Custom suffix to use in translation keys\n * @example `commons.button.buyNow.${suffix}`\n */\n suffixMode: \"custom\";\n /**\n * * ! Must be a non-empty string which doesn't contain the key delimiter \".\" character otherwise will fail\n */\n suffix: string;\n }\n | {\n /**\n * Auto generate (7-character) hash-suffix from the default (english) value\n * @example 'commons.button.buyNow.nk31jnb'\n */\n suffixMode: \"auto\";\n }\n);\n\nconst languageToSmartcatLocaleMapping: Record<Language, string> = {\n [Language.Ar]: \"ar\",\n [Language.De]: \"de\",\n [Language.En]: \"en\",\n [Language.Es]: \"es\",\n [Language.Fr]: \"fr\",\n [Language.El]: \"el\",\n [Language.It]: \"it\",\n [Language.Ja]: \"ja\",\n [Language.Pt]: \"pt-BR\",\n [Language.Zh]: \"zh-Hans\",\n [Language.Tw]: \"zh-Hant-TW\",\n};\n\n/**\n * ####################################################################################\n * # Description:\n * - Uploading a local source of truth (English) locale file to a Smartcat project.\n * Before uploading locale file, a hash is created from the value of the text entry and added as suffix to the key of the text entry.\n *\n * - Downloading translated locale files and only keep translation entries where the \"key.{hash of value}\"\n * matches exactly to the source of truth \"key.{hash of value}\"\n *\n * # Script usage:\n * - Running `runFullSync` will first upload a source of truth locale file to Smartcat,\n * then we poll the smartcat severs until the new locales are full translated by Smartcat AI.\n * When translations are done, we download and process the translated files.\n *\n * - Each of these actions can be run separately as well.\n * ####################################################################################\n */\nexport class SmartcatApi {\n private projectId: string;\n private collectionName: string;\n private axios: AxiosInstance;\n private enableLogs: boolean = false;\n private escapeBracketDelimiters: boolean = false;\n private suffix: string | null;\n private targetLanguages: Language[] | undefined;\n /**\n * Depending on input we might need or not need suffixes.\n */\n private hasSuffix: boolean;\n\n /**\n * Delimiter used to separate translation key \"parts\"\n */\n public keyDelimiter = \".\";\n\n constructor(config: SmartcatApiConfig) {\n this.enableLogs = !!config.enableLogs;\n this.escapeBracketDelimiters = !!config.escapeBracketDelimiters;\n this.projectId = config.auth.projectId;\n this.collectionName = config.auth.collectionName;\n this.targetLanguages = config.targetLanguages;\n\n switch (config.suffixMode) {\n case \"none\": {\n this.suffix = null;\n this.hasSuffix = false;\n break;\n }\n case \"custom\": {\n const suffixRegex = /^[a-zA-Z0-9-]+$/;\n\n if (\n // Empty string\n !config.suffix ||\n // Contains invalid characters\n !suffixRegex.test(config.suffix) ||\n // Contains key delimiter\n config.suffix.indexOf(this.keyDelimiter) > -1\n ) {\n throw new Error(\n \"Invalid custom suffix provided for SmartcatApi.suffix. Can only contain alphanumeric characters and hyphens.\",\n );\n }\n this.suffix = config.suffix;\n this.hasSuffix = true;\n break;\n }\n case \"auto\": {\n this.suffix = null;\n this.hasSuffix = true;\n break;\n }\n default:\n throw new Error(`Unsupported or missing value for SmartcatApi.suffix`);\n }\n\n const authBase64 = Buffer.from(\n `${config.auth.accountId}:${config.auth.apiSecret}`,\n ).toString(\"base64\");\n\n this.axios = axios.create({\n httpsAgent: config.httpsAgent,\n baseURL: \"https://us.smartcat.ai/api/\",\n headers: {\n Authorization: `Basic ${authBase64}`,\n },\n });\n }\n\n // #############################################################################\n // Internal helpers\n // #############################################################################\n /**\n * Smartcat locale --> enum Language mapping for filenames\n */\n private smartcatLocaleToLanguageMap = invert(languageToSmartcatLocaleMapping);\n\n // #############################################################################\n // Key/Suffix/Hash helpers\n // #############################################################################\n\n /**\n * Hash the text value from translation entry value from reference language\n */\n private generateHashSuffixFromValue(value: string): string {\n // Using same amount of chars (7) as GIT uses for shorthand hash.\n const shorthandHashCharCount = 7;\n\n return createHash(\"sha256\")\n .update(value)\n .digest(\"hex\")\n .substring(0, shorthandHashCharCount);\n }\n\n /**\n * Create suffix for given value depending on configuration\n */\n public createSuffix(value: string): string {\n assert(\n this.hasSuffix,\n \"Can't call `createSuffix` for instance without a suffix\",\n );\n\n return this.suffix || this.generateHashSuffixFromValue(value);\n }\n\n /**\n * Util to create translation key.\n * ! Recommended to be used to create key on consumer side of Smartcat class for a consistent experience\n *\n * @example smartcatApi.createTranslationKey(['a', 'b', 'c']) // 'a.b.c'\n */\n public createTranslationKey(parts: string[]): string {\n return parts.join(this.keyDelimiter);\n }\n\n /**\n * Util to parse a translation key\n * ! Recommended to be used to create key on consumer side of Smartcat class for a consistent experience\n *\n * @example smartcatApi.parseTranslationKey('a.b.c'); // ['a', 'b', 'c'];\n */\n public parseTranslationKey(key: string): string[] {\n return key.split(this.keyDelimiter);\n }\n\n /**\n * Returns the key with suffix created by hashing the value.\n */\n public addSuffixToKey(key: string, value: string): string {\n return this.hasSuffix\n ? this.createTranslationKey([key, this.createSuffix(value)])\n : key;\n }\n\n /**\n * Takes a SmartCat text entry key (with hash) and returns the key without it\n */\n public removeSuffixFromKey(key: string): string {\n return this.hasSuffix\n ? this.createTranslationKey(this.parseTranslationKey(key).slice(0, -1))\n : key;\n }\n\n // #############################################################################\n // Transform data helpers\n // #############################################################################\n\n /**\n * Filter out entries that are not included in source of truth\n * translations and remove suffix from keys.\n */\n public processSmartcatTranslations(\n sourceOfTruthTranslations: TranslationObject,\n smartcatTranslations: TranslationObject,\n ): TranslationObject {\n // Append suffix to source of truth translations.\n const sourceOfTruthKeysWithSuffix = new Set(\n Object.entries(sourceOfTruthTranslations).map(([key, value]) =>\n this.addSuffixToKey(key, value),\n ),\n );\n\n // Normalise translated entry keys by removing the hash from key name.\n const result: TranslationObject = {};\n for (const key in smartcatTranslations) {\n // Ignore key from smartcat if not in source-of-truth\n if (!sourceOfTruthKeysWithSuffix.has(key)) {\n continue;\n }\n\n const normalisedKey = this.removeSuffixFromKey(key);\n const value = smartcatTranslations[key];\n\n if (value !== undefined) {\n result[normalisedKey] = value;\n }\n }\n\n return result;\n }\n\n /**\n * Parse string variable delimiters between smartcat and local delimiters.\n * Only top level delimiter pairs that don't have child delimiters or child curly brackets should be transformed.\n */\n private parseVariableDelimiters(\n input: string,\n mode: \"toSmartcatDelimiters\" | \"toLocalDelimiters\",\n ): string {\n /**\n * Constant icu string delimiters that we avoid to transform,\n * can conflict with the variable delimiters without error.\n */\n const icuStringDelimiters = {\n open: \"{\",\n close: \"}\",\n };\n\n /**\n * Evaluate what delimiters to transform from and to\n */\n const delimiterOptions = {\n local: {\n open: \"{\",\n close: \"}\",\n },\n smartcat: {\n open: \"{{\",\n close: \"}}\",\n },\n };\n const delimiters =\n mode === \"toSmartcatDelimiters\"\n ? {\n from: delimiterOptions.local,\n to: delimiterOptions.smartcat,\n }\n : {\n from: delimiterOptions.smartcat,\n to: delimiterOptions.local,\n };\n\n // Cheap check - return unmodified if input does not contain any opening or any closing variable delimiters\n if (\n !input.includes(delimiters.from.open) ||\n !input.includes(delimiters.from.close)\n ) {\n return input;\n }\n\n let result = \"\"; // Final result\n let lastPosition = 0; // This helps in building the result string\n let icuStringDepth = 0;\n /**\n * When finding an opening delimiter, closing delimiter index is already\n * evaluated and therefor we store it until it's reached.\n * Gets reset to `null` when this index in the iteration is reached.\n */\n let nextValidClosingVariableDelimiterIndex: null | number = null;\n\n for (let i = 0; i < input.length; i++) {\n // Hold current char\n const currentChar = input[i];\n\n // If currently inside ICU string, track the depth and continue to next char\n if (icuStringDepth > 0) {\n if (currentChar === icuStringDelimiters.open) {\n icuStringDepth++;\n } else if (currentChar === icuStringDelimiters.close) {\n icuStringDepth--;\n }\n\n continue;\n }\n\n /**\n * Encounter of a closing delimiter\n */\n if (i === nextValidClosingVariableDelimiterIndex) {\n // Get inner content between variable delimiters\n const variableInnerContent = input.slice(\n lastPosition + delimiters.from.open.length,\n i,\n );\n // Transform delimiters\n result += `${delimiters.to.open}${variableInnerContent}${delimiters.to.close}`;\n // Move the last position past this closing brace\n lastPosition = i + delimiters.from.close.length;\n // Reset closing delimiter index\n nextValidClosingVariableDelimiterIndex = null;\n // Go next after closing variable\n continue;\n } else if (nextValidClosingVariableDelimiterIndex !== null) {\n // Go next until reaching closing variable delimiter\n continue;\n }\n\n /**\n * Evaluate if current position is index of an opening delimiter\n */\n const isVariableOpeningBracketPattern =\n input.substring(i, i + delimiters.from.open.length) ===\n delimiters.from.open;\n if (isVariableOpeningBracketPattern) {\n // Evaluate start and end indexes of variable brackets.\n const innerContentStartIndex = i + delimiters.from.open.length;\n const closingVariableDelimiterIndex = input.indexOf(\n delimiters.from.close,\n innerContentStartIndex,\n );\n\n // Check if we can find the closing delimiter, else the opening delimiter can not be valid\n if (closingVariableDelimiterIndex !== -1) {\n // Variable delimiters inner content, excluding the delimiters\n const variableInnerContent = input.substring(\n innerContentStartIndex,\n closingVariableDelimiterIndex,\n );\n // Characters not allowed for variable inner content - helps to avoid transforming ICU string delimiters\n const illegalVariableCharacterRegex = /{|}|,|#/;\n // If delimiters inner content contains illegal characters, the opening bracket is not a valid variable.\n const isValidVariableOpeningDelimiters =\n !illegalVariableCharacterRegex.test(variableInnerContent);\n\n if (isValidVariableOpeningDelimiters) {\n // Append everything up to this delimiter to the result\n result += input.substring(lastPosition, i);\n // Update the last position to the current index\n lastPosition = i;\n // Store the closing delimiter index\n nextValidClosingVariableDelimiterIndex =\n closingVariableDelimiterIndex;\n } else if (currentChar === icuStringDelimiters.open) {\n // When reached - ICU string begins here\n icuStringDepth++;\n }\n }\n } else if (currentChar === icuStringDelimiters.open) {\n icuStringDepth++;\n }\n }\n\n // Append any remaining part of the input string to result\n result += input.slice(lastPosition);\n return result;\n }\n\n /**\n * Helper to parse variable placeholders for a translation file\n */\n public parseTranslationVariableDelimiters(\n translations: TranslationObject,\n mode: \"toSmartcatDelimiters\" | \"toLocalDelimiters\",\n ): TranslationObject {\n return Object.fromEntries(\n Object.entries(translations).map(([key, value]) => [\n key,\n this.parseVariableDelimiters(value, mode),\n ]),\n );\n }\n\n /**\n * Check if SmartCat has translated all target languages.\n */\n private async checkProjectTranslationStatus(): Promise<boolean> {\n try {\n // Fetch project data\n const res = await this.axios.get(\n `/integration/v1/project/${this.projectId}`,\n );\n const project = res.data as SmartcatProject;\n\n // Find the auto translation workflow id\n const autoTranslationWorkflowId = project.workflowStages.find(\n (workflow) => workflow.stageType === \"translation\",\n )?.id;\n if (!autoTranslationWorkflowId) {\n throw new Error(\n \"Could not find auto translation workflow id in SmartCat project.\",\n );\n }\n\n // Get relevant documents\n const documents = project.documents.filter((doc) => {\n const isInCollection = doc.name === this.collectionName;\n const isRequestedTargetLanguage = Boolean(\n !this.targetLanguages ||\n this.targetLanguages\n ?.map((lang) => languageToSmartcatLocaleMapping[lang])\n .includes(doc.targetLanguage),\n );\n\n return isInCollection && isRequestedTargetLanguage;\n });\n\n // Check if all documents have 100% progress in auto translation workflow\n return documents.every((doc) => {\n const autoTranslationWorkflow = doc.workflowStages.find(\n (workflow) => workflow.id === autoTranslationWorkflowId,\n );\n return autoTranslationWorkflow?.progress === 100;\n });\n } catch (error) {\n if (this.enableLogs) {\n console.error(\"❌ Failed to get project\", error);\n }\n throw error;\n }\n }\n\n // #############################################################################\n // Api methods\n // #############################################################################\n\n /**\n * Download translations from Smartcat.\n */\n public async downloadSmartcatTranslations(\n defaultTranslations: TranslationObject,\n ): Promise<Record<Language, TranslationObject>> {\n const url = `integration/v2/project/${this.projectId}/export`;\n const params = {\n \"completion-state\": \"draft\",\n \"output-file-path-template\": \"{LANGUAGE}.json\",\n collections: this.collectionName,\n zip: \"true\",\n languages: this.targetLanguages\n ?.map((lang) => languageToSmartcatLocaleMapping[lang])\n .join(\",\"),\n };\n\n try {\n const exportResponse = await this.axios.post(\n url,\n {},\n {\n params,\n headers: {\n \"Content-Type\": \"application/json-patch+json\",\n },\n },\n );\n const taskID = exportResponse.data;\n\n const pollRunLimit = 10;\n const pollInterval = 5000;\n\n const translations: Record<string, TranslationObject> = {};\n let pollRunCount = 0;\n let exportSuccessful = false;\n\n // Polling loop to check if the export is successful\n while (!exportSuccessful && pollRunCount < pollRunLimit) {\n pollRunCount += 1;\n\n const checkUrl = `integration/v1/document/export/${taskID}/`;\n const checkResponse = await this.axios.get(checkUrl, {\n responseType: \"arraybuffer\", // Set response type to arraybuffer\n });\n\n if (checkResponse.status === 200) {\n // Unzip and discard the zip file, rename.\n const zip = new AdmZip(checkResponse.data);\n const zipEntries = zip.getEntries();\n\n for (const zipEntry of zipEntries) {\n if (!zipEntry.isDirectory) {\n // Extract the content of the file\n const data = zip.readFile(zipEntry);\n\n if (!data) {\n throw new Error(\n \"Exported smarcat document does not include any data\",\n );\n }\n\n const locale = zipEntry.entryName.replace(\".json\", \"\");\n const mappedLocale = this.smartcatLocaleToLanguageMap[locale];\n\n if (!mappedLocale) {\n this.enableLogs &&\n console.log(\n `Couldnt find map for SmartCat locale ${locale}, skipping file.`,\n );\n continue;\n }\n\n const parsedTranslations = JSON.parse(data.toString());\n\n // Process downloaded translations.\n let result = this.processSmartcatTranslations(\n defaultTranslations,\n parsedTranslations,\n );\n\n // Escape content variable delimiters.\n if (this.escapeBracketDelimiters) {\n result = this.parseTranslationVariableDelimiters(\n result,\n \"toLocalDelimiters\",\n );\n }\n\n translations[mappedLocale] = result;\n }\n }\n\n // Exit loop.\n exportSuccessful = true;\n } else if (checkResponse.status === 204) {\n // Wait for one second before checking again.\n await setTimeoutAsync(pollInterval);\n } else {\n // Unknown status response.\n throw new Error(\n `Failed to download smartcat translations, endpoint returned unknown status code ${checkResponse.status}`,\n );\n }\n }\n\n if (!exportSuccessful) {\n throw new Error(\n \"Max retries reached when trying to export files from SmartCat.\",\n );\n }\n\n if (this.enableLogs) {\n console.log(\"✅ Download target language locale documents complete.\");\n }\n\n return translations;\n } catch (error) {\n if (this.enableLogs) {\n console.error(\n \"❌ Failed downloading locale files from SmartCat\\n\",\n error,\n );\n }\n\n throw error;\n }\n }\n\n /**\n * Exposed method for uploading source translations to Smartcat.\n */\n public async uploadSourceTranslations(\n // Source translations that will be uploaded to SmartCat.\n sourceTranslations: TranslationUploadObject | TranslationUploadObject[],\n options?: {\n // When true, deleting all keys in the smartcat collection that does not exist in sourceTranslations.\n deleteMissingKeys?: boolean;\n },\n ): Promise<void> {\n try {\n const rawTranslationUploads = Array.isArray(sourceTranslations)\n ? sourceTranslations\n : [sourceTranslations];\n\n /**\n * Prepare translations for upload by:\n * 1. Ignore non-translatable values.\n * 2. Add suffix to key based on settings.\n * 3. Escape variable delimiters based on settings.\n */\n const preparedTranslationUploads = rawTranslationUploads.map(\n (translationUpload) => {\n let translations: TranslationObject = {};\n\n for (const [key, value] of Object.entries(\n translationUpload.translations,\n )) {\n if (!SmartcatApi.isTranslatableValue(value)) {\n continue;\n }\n const suffixedKey = this.addSuffixToKey(key, value);\n translations[suffixedKey] = value;\n }\n\n // Prepare variable delimiters.\n if (this.escapeBracketDelimiters) {\n translations = this.parseTranslationVariableDelimiters(\n translations,\n \"toSmartcatDelimiters\",\n );\n }\n\n return {\n ...translationUpload,\n translations,\n };\n },\n );\n\n /**\n * Upload all translations together and make the data purge in SC.\n */\n if (options?.deleteMissingKeys) {\n // Merge all prepared translations into one object.\n const combinedTranslations: TranslationObject =\n preparedTranslationUploads.reduce((acc, current) => {\n return { ...acc, ...current.translations };\n }, {});\n\n await this.smartcatUploadRequest(combinedTranslations, {\n deleteMissingKeys: true,\n });\n\n if (this.enableLogs) {\n console.log(\"🧹 Deleted unused translations from Smartcat.\");\n }\n }\n\n /**\n * Upload each translation object separately to apply labels.\n */\n for (const translationUpload of preparedTranslationUploads) {\n await this.smartcatUploadRequest(translationUpload.translations, {\n labels: translationUpload.appendLabels,\n });\n }\n\n if (this.enableLogs) {\n console.log(\"✅ Upload source translations to SmartCat complete.\");\n }\n } catch (error) {\n if (this.enableLogs) {\n console.error(\n \"❌ Failed uploading source translations to SmartCat.\",\n error,\n );\n }\n throw error;\n }\n }\n\n /**\n * Internal helper method for uploading source translations to Smartcat.\n */\n private async smartcatUploadRequest(\n sourceTranslations: TranslationObject,\n options?: {\n labels?: string[];\n deleteMissingKeys?: boolean;\n },\n ) {\n const labels =\n options?.labels\n ?.map((label) => label.trim())\n .filter(Boolean)\n .join(\",\") || \"\";\n\n const queryParams = {\n format: \"json\",\n language: \"en\",\n collection: this.collectionName,\n \"delete-missing-keys\": !!options?.deleteMissingKeys,\n labels,\n };\n\n const url = `integration/v2/project/${this.projectId}/import`;\n\n const smartCatSourceLanguageBuffer = Buffer.from(\n JSON.stringify(sourceTranslations),\n );\n\n const fileBlob = new Blob([smartCatSourceLanguageBuffer], {\n type: \"application/octet-stream\",\n });\n\n const formData = new FormData();\n formData.append(\"file\", fileBlob);\n\n await this.axios.post(url, formData, {\n params: queryParams,\n headers: { \"Content-Type\": \"multipart/form-data\" },\n });\n }\n\n /**\n * Wait for SmartCat to fully translate all target languages.\n */\n public pollAndWaitForCompletedTranslations = async (\n pollRunLimit = 20,\n pollIntervalMs = 10000,\n ): Promise<boolean> => {\n let pollRunCount = 0;\n let translationCompleted = false;\n\n while (!translationCompleted && pollRunCount < pollRunLimit) {\n if (this.enableLogs) {\n console.log(`⌛ SmartCat translations in progress.`);\n }\n\n translationCompleted = await this.checkProjectTranslationStatus();\n pollRunCount += 1;\n\n if (!translationCompleted) {\n await setTimeoutAsync(pollIntervalMs);\n }\n }\n\n /**\n * HACK\n * Since there is a bug with smartcat returning true for `pretranslateCompleted`\n * before they are updated in smartcat. We implement an artificial sleep to let\n * smartcat update the target translations before we download them.\n */\n if (translationCompleted) {\n await setTimeoutAsync(60000);\n }\n\n if (this.enableLogs) {\n const msg = translationCompleted\n ? \"✅ SmartCat translations completed.\"\n : \"❌ Max retries reached when waiting for SmartCat translations to complete.\";\n console.log(msg);\n }\n\n return translationCompleted;\n };\n\n /**\n * Static util to prettify translation for writing to file-system\n */\n static prettifyTranslation = (translation: TranslationObject): string => {\n return (\n stableStringify(translation, { space: 2 }) +\n // Add EOF newline\n `\\n`\n );\n };\n\n /**\n * Checks if given value is translatable a.k.a if it's worth sending over to smartcat to translate\n */\n static isTranslatableValue = (value: Nullish<string>): boolean => {\n // Trim to check if given string isn't just spaces which is not worth translating\n const parsedValue = value?.trim();\n\n // Ignore empty values\n if (!parsedValue) {\n return false;\n }\n\n // Don't translate values that are digits only\n return !isDigitsOnlyRegex.test(parsedValue);\n };\n\n /**\n * Centralized method to get Smartcat label based on environment.\n */\n static getSmartcatLabel = (env: \"qa\" | \"prod\"): string => {\n switch (env) {\n case \"qa\":\n return \"STG\";\n case \"prod\":\n return \"MAIN\";\n default:\n throw new Error(\n `Failed to get smartcat label - Unknown environment ${env}`,\n );\n }\n };\n}\n"],"names":["isDigitsOnlyRegex","languageToSmartcatLocaleMapping","Language","Ar","De","En","Es","Fr","El","It","Ja","Pt","Zh","Tw","_SmartcatApi","constructor","config","__publicField","invert","pollRunLimit","pollIntervalMs","pollRunCount","translationCompleted","enableLogs","console","log","checkProjectTranslationStatus","setTimeoutAsync","msg","escapeBracketDelimiters","projectId","auth","collectionName","targetLanguages","suffixMode","suffix","hasSuffix","suffixRegex","test","indexOf","keyDelimiter","Error","authBase64","Buffer","from","accountId","apiSecret","toString","axios","create","httpsAgent","baseURL","headers","Authorization","generateHashSuffixFromValue","value","shorthandHashCharCount","createHash","update","digest","substring","createSuffix","assert","createTranslationKey","parts","join","parseTranslationKey","key","split","addSuffixToKey","removeSuffixFromKey","slice","processSmartcatTranslations","sourceOfTruthTranslations","smartcatTranslations","sourceOfTruthKeysWithSuffix","Set","Object","entries","map","result","has","normalisedKey","parseVariableDelimiters","input","mode","icuStringDelimiters","open","close","delimiterOptions","local","smartcat","delimiters","to","includes","lastPosition","icuStringDepth","nextValidClosingVariableDelimiterIndex","i","length","currentChar","variableInnerContent","isVariableOpeningBracketPattern","innerContentStartIndex","closingVariableDelimiterIndex","illegalVariableCharacterRegex","isValidVariableOpeningDelimiters","parseTranslationVariableDelimiters","translations","fromEntries","res","get","project","data","autoTranslationWorkflowId","workflowStages","find","workflow","stageType","id","documents","filter","doc","isInCollection","name","isRequestedTargetLanguage","Boolean","lang","targetLanguage","every","autoTranslationWorkflow","progress","error","downloadSmartcatTranslations","defaultTranslations","url","params","collections","zip","languages","exportResponse","post","taskID","pollInterval","exportSuccessful","checkUrl","checkResponse","responseType","status","AdmZip","zipEntries","getEntries","zipEntry","isDirectory","readFile","locale","entryName","replace","mappedLocale","smartcatLocaleToLanguageMap","parsedTranslations","JSON","parse","uploadSourceTranslations","sourceTranslations","options","rawTranslationUploads","Array","isArray","preparedTranslationUploads","translationUpload","isTranslatableValue","suffixedKey","deleteMissingKeys","combinedTranslations","reduce","acc","current","smartcatUploadRequest","labels","appendLabels","label","trim","queryParams","format","language","collection","smartCatSourceLanguageBuffer","stringify","fileBlob","Blob","type","formData","FormData","append","translation","stableStringify","space","parsedValue","env","SmartcatApi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAMA,iBAAoB,GAAA,OAAA;AAkD1B,MAAMC,+BAA4D,GAAA;EAChE,CAACC,SAAAA,CAAAA,QAAS,CAAAC,EAAE,GAAG,IAAA;EACf,CAACD,SAAAA,CAAAA,QAAS,CAAAE,EAAE,GAAG,IAAA;EACf,CAACF,SAAAA,CAAAA,QAAS,CAAAG,EAAE,GAAG,IAAA;EACf,CAACH,SAAAA,CAAAA,QAAS,CAAAI,EAAE,GAAG,IAAA;EACf,CAACJ,SAAAA,CAAAA,QAAS,CAAAK,EAAE,GAAG,IAAA;EACf,CAACL,SAAAA,CAAAA,QAAS,CAAAM,EAAE,GAAG,IAAA;EACf,CAACN,SAAAA,CAAAA,QAAS,CAAAO,EAAE,GAAG,IAAA;EACf,CAACP,SAAAA,CAAAA,QAAS,CAAAQ,EAAE,GAAG,IAAA;EACf,CAACR,SAAAA,CAAAA,QAAS,CAAAS,EAAE,GAAG,OAAA;EACf,CAACT,SAAAA,CAAAA,QAAS,CAAAU,EAAE,GAAG,SAAA;EACf,CAACV,SAAAA,CAAAA,QAAS,CAAAW,EAAE,GAAG;AACjB,CAAA;AAmBO,MAAMC,YAAA,GAAN,MAAMA,YAAY,CAAA;EAkBvBC,YAAYC,MAA2B,EAAA;IAjB/BC,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,gBAAA,CAAA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