@ubnt/store.core 10.15.0-beta.0 → 10.15.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.
- package/CHANGELOG.md +24 -321
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-3603.jpg +0 -0
- package/lib/assets/ai-dome.jpg +0 -0
- package/lib/assets/ai-dome2.jpg +0 -0
- package/lib/assets/ai-dome3.jpg +0 -0
- package/lib/assets/ai-dslr.jpg +0 -0
- package/lib/assets/ai-dslr2.jpg +0 -0
- package/lib/assets/ai-lpr.jpg +0 -0
- package/lib/assets/ai-lpr2.jpg +0 -0
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/building-bridge-xg.jpg +0 -0
- package/lib/assets/building-bridge-xg2.jpg +0 -0
- package/lib/assets/bullet.svg +1 -3
- package/lib/assets/bullet2.svg +3 -1
- package/lib/assets/compact.svg +2 -2
- package/lib/assets/compact3.svg +2 -2
- package/lib/assets/door-hub-mini.jpg +0 -0
- package/lib/assets/door-hub-mini2.jpg +0 -0
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/e7-audience.jpg +0 -0
- package/lib/assets/e7-audience2.jpg +0 -0
- package/lib/assets/e7.jpg +0 -0
- package/lib/assets/e72.jpg +0 -0
- package/lib/assets/express.jpg +0 -0
- package/lib/assets/express2.jpg +0 -0
- package/lib/assets/flex.jpg +0 -0
- package/lib/assets/flex2.jpg +0 -0
- package/lib/assets/g2-reader-pro.jpg +0 -0
- package/lib/assets/g2-reader-pro2.jpg +0 -0
- package/lib/assets/g3-reader-flex.jpg +0 -0
- package/lib/assets/g3-reader-flex2.jpg +0 -0
- package/lib/assets/g3-reader.jpg +0 -0
- package/lib/assets/g3-reader2.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit.jpg +0 -0
- package/lib/assets/g3-starter-kit2.jpg +0 -0
- package/lib/assets/g4-ptz2.jpg +0 -0
- package/lib/assets/g4-ptz3.jpg +0 -0
- package/lib/assets/g5-dome-ultra.jpg +0 -0
- package/lib/assets/g5-dome-ultra2.jpg +0 -0
- package/lib/assets/g5-dome-ultra3.jpg +0 -0
- package/lib/assets/g5-flex.jpg +0 -0
- package/lib/assets/g5-flex2.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz3.jpg +0 -0
- package/lib/assets/g5-turret-ultra.jpg +0 -0
- package/lib/assets/g5-turret-ultra2.jpg +0 -0
- package/lib/assets/g5-turret-ultra3.jpg +0 -0
- package/lib/assets/g6-ptz.jpg +0 -0
- package/lib/assets/g6-ptz2.jpg +0 -0
- package/lib/assets/g6-turret.jpg +0 -0
- package/lib/assets/g6-turret2.jpg +0 -0
- package/lib/assets/globe.svg +2 -9
- package/lib/assets/globe2.svg +9 -2
- package/lib/assets/intercom.jpg +0 -0
- package/lib/assets/intercom2.jpg +0 -0
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/plus4.svg +9 -9
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/power.svg +1 -4
- package/lib/assets/power2.svg +4 -1
- package/lib/assets/ptz.svg +2 -2
- package/lib/assets/ptz2.svg +2 -2
- package/lib/assets/rack.svg +1 -4
- package/lib/assets/rack2.svg +4 -1
- package/lib/assets/reader-lite.jpg +0 -0
- package/lib/assets/reader-lite2.jpg +0 -0
- package/lib/assets/u6-extender.jpg +0 -0
- package/lib/assets/u6-extender2.jpg +0 -0
- package/lib/assets/u7-pro-max.jpg +0 -0
- package/lib/assets/u7-pro-max2.jpg +0 -0
- package/lib/assets/u7-pro-wall.jpg +0 -0
- package/lib/assets/u7-pro-wall2.jpg +0 -0
- package/lib/assets/ucgFiber.jpg +0 -0
- package/lib/assets/ucgFiber2.jpg +0 -0
- package/lib/components/Footer/Footer.js +0 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mjs +0 -1
- package/lib/components/Footer/Footer.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.js +5 -18
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +5 -18
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/CartIcon/CartIcon.d.ts +1 -1
- package/lib/components/Header/CartIcon/CartIcon.js +1 -5
- package/lib/components/Header/CartIcon/CartIcon.js.map +1 -1
- package/lib/components/Header/CartIcon/CartIcon.mjs +1 -5
- package/lib/components/Header/CartIcon/CartIcon.mjs.map +1 -1
- package/lib/components/Header/CartIcon/CartIcon.types.d.ts +0 -2
- package/lib/components/Header/Header.js +5 -12
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +5 -12
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.stories.d.ts +0 -2
- package/lib/components/Header/Header.styles.d.ts +3 -6
- package/lib/components/Header/Header.styles.js +9 -22
- package/lib/components/Header/Header.styles.js.map +1 -1
- package/lib/components/Header/Header.styles.mjs +9 -22
- package/lib/components/Header/Header.styles.mjs.map +1 -1
- package/lib/components/Header/Header.types.d.ts +0 -7
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js +0 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs +0 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +0 -1
- package/lib/components/Header/ProHeader/ProHeader.js +30 -62
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +31 -63
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +0 -4
- package/lib/components/Header/ProHeader/ProHeader.styles.js +0 -50
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +1 -47
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +2 -607
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +2 -603
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +1 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -4
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -4
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +5 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs +6 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +0 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +0 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/constants/icons/header/globe.svg.js +5 -5
- package/lib/constants/icons/header/globe.svg.mjs +2 -2
- package/lib/constants/icons/header/index.js +3 -3
- package/lib/constants/icons/header/index.mjs +1 -1
- package/lib/constants/icons/menu/bullet.svg.js +5 -5
- package/lib/constants/icons/menu/bullet.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.js +12 -12
- package/lib/constants/icons/menu/index.mjs +4 -4
- package/lib/constants/icons/menu/power.svg.js +5 -5
- package/lib/constants/icons/menu/power.svg.mjs +2 -2
- package/lib/constants/icons/menu/ptz.svg.js +5 -5
- package/lib/constants/icons/menu/ptz.svg.mjs +2 -2
- package/lib/constants/icons/menu/rack.svg.js +5 -5
- package/lib/constants/icons/menu/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/BuildingBridge/building-bridge-xg.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/BuildingBridge/building-bridge-xg.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-360.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-dome.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g4-ptz.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-dome-ultra.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-ptz.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-turret-ultra.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g5-turret-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g6-ptz.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g6-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/g6-turret.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/g6-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Compact/g5-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Compact/g5-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgFiber.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgFiber.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/ucgFiber.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/ucgFiber.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-turret-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-turret-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g6-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g6-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/reader-lite.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/reader-lite.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Flagship/u7-pro-max.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Flagship/u7-pro-max.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g6-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g6-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Switching/flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Switching/flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Wall/u6-extender.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Wall/u6-extender.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Wall/u7-pro-wall.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Wall/u7-pro-wall.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/WiFi/e7-audience.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/WiFi/e7-audience.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/WiFi/e7.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/WiFi/e7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-dslr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-dslr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g5-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g5-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-turret-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-turret-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/reader-lite.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/reader-lite.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/switches/utility/flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/switches/utility/flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/building-bridge/building-bridge-xg.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/building-bridge/building-bridge-xg.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/e7-series/e7.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/e7-series/e7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/flagship/u7-pro-max.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/flagship/u7-pro-max.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/mega-capacity/e7-audience.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/mega-capacity/e7-audience.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/wall/u6-extender.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/wall/u6-extender.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/wall/u7-pro-wall.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/wifi/wall/u7-pro-wall.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/CameraSecurity.js +17 -17
- package/lib/constants/modelCompareData/data/CameraSecurity.mjs +9 -9
- package/lib/constants/modelCompareData/data/CloudGateways.js +3 -3
- package/lib/constants/modelCompareData/data/CloudGateways.mjs +2 -2
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +3 -3
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +2 -2
- package/lib/constants/modelCompareData/data/EnterpriseSwitching.js +2 -3
- package/lib/constants/modelCompareData/data/EnterpriseSwitching.js.map +1 -1
- package/lib/constants/modelCompareData/data/EnterpriseSwitching.mjs +2 -3
- package/lib/constants/modelCompareData/data/EnterpriseSwitching.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/ProfessionalMaxSwitching.js +2 -3
- package/lib/constants/modelCompareData/data/ProfessionalMaxSwitching.js.map +1 -1
- package/lib/constants/modelCompareData/data/ProfessionalMaxSwitching.mjs +2 -3
- package/lib/constants/modelCompareData/data/ProfessionalMaxSwitching.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/Switching.js +1 -2
- package/lib/constants/modelCompareData/data/Switching.js.map +1 -1
- package/lib/constants/modelCompareData/data/Switching.mjs +1 -2
- package/lib/constants/modelCompareData/data/Switching.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/aggregation.js +0 -7
- package/lib/constants/modelCompareData/data/products/aggregation.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/aggregation.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/aggregation.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiDslr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiDslr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/buildingBridgeXG.js +2 -2
- package/lib/constants/modelCompareData/data/products/buildingBridgeXG.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/e7.js +2 -2
- package/lib/constants/modelCompareData/data/products/e7.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/e7Campus.js +1 -1
- package/lib/constants/modelCompareData/data/products/e7Campus.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseAggregation.js +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseAggregation.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseAggregation.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseAggregation.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseCampus24PoE.js +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseCampus24PoE.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseCampus24PoE.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseCampus24PoE.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseCampus48PoE.js +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseCampus48PoE.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/enterpriseCampus48PoE.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/enterpriseCampus48PoE.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/express.js +1 -1
- package/lib/constants/modelCompareData/data/products/express.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/flex.js +2 -2
- package/lib/constants/modelCompareData/data/products/flex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Flex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Flex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/g5TurretUltra.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5TurretUltra.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g6Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/products/g6Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/g6Turret.js +1 -1
- package/lib/constants/modelCompareData/data/products/g6Turret.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/highCapacityAggregation.js +0 -7
- package/lib/constants/modelCompareData/data/products/highCapacityAggregation.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/highCapacityAggregation.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/highCapacityAggregation.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
- package/lib/constants/modelCompareData/data/products/intercom.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/missionCritical.js +0 -7
- package/lib/constants/modelCompareData/data/products/missionCritical.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/missionCritical.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/missionCritical.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax16.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax16.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax16.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax16.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax16PoE.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax16PoE.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax16PoE.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax16PoE.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax24.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax24.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax24.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax24.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax24PoE.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax24PoE.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax24PoE.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax24PoE.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax48.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax48.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax48.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax48.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax48PoE.js +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax48PoE.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/professionalMax48PoE.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/professionalMax48PoE.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/readerLite.js +2 -2
- package/lib/constants/modelCompareData/data/products/readerLite.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/shared-product-data/e7Audience.js +2 -2
- package/lib/constants/modelCompareData/data/products/shared-product-data/e7Audience.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/switchesEnterprise.js +0 -8
- package/lib/constants/modelCompareData/data/products/switchesEnterprise.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesEnterprise.mjs +0 -8
- package/lib/constants/modelCompareData/data/products/switchesEnterprise.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesProfessional.js +0 -7
- package/lib/constants/modelCompareData/data/products/switchesProfessional.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesProfessional.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/switchesProfessional.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesProfessionalMax.js +1 -10
- package/lib/constants/modelCompareData/data/products/switchesProfessionalMax.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesProfessionalMax.mjs +1 -10
- package/lib/constants/modelCompareData/data/products/switchesProfessionalMax.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesStandard.js +0 -7
- package/lib/constants/modelCompareData/data/products/switchesStandard.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/switchesStandard.mjs +0 -7
- package/lib/constants/modelCompareData/data/products/switchesStandard.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/u6Extender.js +2 -2
- package/lib/constants/modelCompareData/data/products/u6Extender.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/u7ProWall.js +2 -2
- package/lib/constants/modelCompareData/data/products/u7ProWall.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/u7proMax.js +2 -2
- package/lib/constants/modelCompareData/data/products/u7proMax.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/u7proOutdoor.js +12 -26
- package/lib/constants/modelCompareData/data/products/u7proOutdoor.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/u7proOutdoor.mjs +12 -26
- package/lib/constants/modelCompareData/data/products/u7proOutdoor.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/ucgFiber.js +1 -1
- package/lib/constants/modelCompareData/data/products/ucgFiber.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/wanSwitch.js +2 -2
- package/lib/constants/modelCompareData/data/products/wanSwitch.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/wanSwitch.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/wanSwitch.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/index.d.ts +0 -1
- package/lib/constants/modelCompareData/data/properties/index.js +0 -2
- package/lib/constants/modelCompareData/data/properties/index.js.map +1 -1
- package/lib/constants/modelCompareData/data/properties/index.mjs +0 -1
- package/lib/constants/modelCompareData/data/properties/index.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
- package/lib/constants/modelCompareData/translations/en.json.js +0 -3
- package/lib/constants/modelCompareData/translations/en.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/en.json.mjs +0 -3
- package/lib/constants/modelCompareData/translations/en.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.js +1 -2
- package/lib/constants/modelCompareData/translations/es.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.mjs +1 -2
- package/lib/constants/modelCompareData/translations/es.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/constants/modelCompareData/types.d.ts +0 -1
- package/lib/constants/modelCompareData/types.js +0 -1
- package/lib/constants/modelCompareData/types.js.map +1 -1
- package/lib/constants/modelCompareData/types.mjs +0 -1
- package/lib/constants/modelCompareData/types.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.d.ts +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.js +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.mjs +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +0 -2
- package/lib/constants/proStoreCategories/mapping/index.js +4 -14
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +4 -14
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +1 -3
- package/lib/constants/proStoreCategories/mapping/unifi.js +0 -2
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +0 -2
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/proStoreFilters/mapping.d.ts +1 -2
- package/lib/constants/proStoreFilters/mapping.js +6 -8
- package/lib/constants/proStoreFilters/mapping.js.map +1 -1
- package/lib/constants/proStoreFilters/mapping.mjs +6 -8
- package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +2 -30
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +3 -31
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/contexts/MenuContext/mapping.js +9 -9
- package/lib/contexts/MenuContext/mapping.mjs +6 -6
- package/lib/contexts/MenuContext/types.d.ts +0 -3
- package/lib/contexts/MenuContext/types.js +0 -1
- package/lib/contexts/MenuContext/types.js.map +1 -1
- package/lib/contexts/MenuContext/types.mjs +0 -1
- package/lib/contexts/MenuContext/types.mjs.map +1 -1
- package/lib/utils/money/constants.d.ts +0 -6
- package/lib/utils/money/constants.js +1 -23
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +2 -23
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/index.js +0 -1
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +1 -1
- package/package.json +41 -41
- package/lib/assets/crestron.svg +0 -3
- package/lib/assets/ucg-fiber.png +0 -0
- package/lib/assets/udr7.png +0 -0
- package/lib/assets/ux.png +0 -0
- package/lib/assets/ux7.png +0 -0
- package/lib/components/BodyPortal/BodyPortal.d.ts +0 -6
- package/lib/components/BodyPortal/BodyPortal.js +0 -18
- package/lib/components/BodyPortal/BodyPortal.js.map +0 -1
- package/lib/components/BodyPortal/BodyPortal.mjs +0 -16
- package/lib/components/BodyPortal/BodyPortal.mjs.map +0 -1
- package/lib/components/BodyPortal/index.d.ts +0 -1
- package/lib/components/BodyPortal/index.js +0 -6
- package/lib/components/BodyPortal/index.js.map +0 -1
- package/lib/components/BodyPortal/index.mjs +0 -3
- package/lib/components/BodyPortal/index.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.mjs.map +0 -1
- package/lib/constants/modelCompareData/assets/crestron.svg.js +0 -27
- package/lib/constants/modelCompareData/assets/crestron.svg.js.map +0 -1
- package/lib/constants/modelCompareData/assets/crestron.svg.mjs +0 -3
- package/lib/constants/modelCompareData/assets/crestron.svg.mjs.map +0 -1
- package/lib/constants/modelCompareData/data/properties/crestronNaxNvxCertified.d.ts +0 -2
- package/lib/constants/modelCompareData/data/properties/crestronNaxNvxCertified.js +0 -18
- package/lib/constants/modelCompareData/data/properties/crestronNaxNvxCertified.js.map +0 -1
- package/lib/constants/modelCompareData/data/properties/crestronNaxNvxCertified.mjs +0 -10
- package/lib/constants/modelCompareData/data/properties/crestronNaxNvxCertified.mjs.map +0 -1
- package/lib/hooks/useIsTouchDevice.d.ts +0 -1
- package/lib/hooks/useIsTouchDevice.js +0 -20
- package/lib/hooks/useIsTouchDevice.js.map +0 -1
- package/lib/hooks/useIsTouchDevice.mjs +0 -18
- package/lib/hooks/useIsTouchDevice.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/contexts/MenuContext/types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { StoreId } from \"../../types\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteId,\n SiteUrl,\n} from \"./mapping\";\nimport type { LanguageDirectionType } from \"./utils\";\n\nexport enum ModalId {\n Support = \"support\",\n Account = \"account\",\n Cart = \"cart\",\n
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/contexts/MenuContext/types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { StoreId } from \"../../types\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteId,\n SiteUrl,\n} from \"./mapping\";\nimport type { LanguageDirectionType } from \"./utils\";\n\nexport enum ModalId {\n Support = \"support\",\n Account = \"account\",\n Cart = \"cart\",\n Language = \"language\",\n MobileMenu = \"mobileMenu\",\n ProMobileMenu = \"proMobileMenu\",\n Search = \"search\",\n}\n\nexport type ParsedNavigationSubSubItem = Omit<NavigationSubSubItem, \"url\"> & {\n url: string;\n active: boolean;\n possible: boolean;\n items: ParsedNavigationSubSubItem[];\n};\n\nexport type ParsedNavigationSubItem = Omit<\n NavigationSubItem,\n \"url\" | \"storePath\"\n> & {\n url: string;\n active: boolean;\n possible: boolean;\n /**\n * Sub-sub-items which will always be present\n * But can be empty in either cases e.g. no valid paths given\n */\n items: ParsedNavigationSubSubItem[];\n};\n\nexport type ParsedNavigationItem = Omit<NavigationItem, \"url\" | \"items\"> & {\n url: string;\n active: boolean;\n possible: boolean;\n items: ParsedNavigationSubItem[];\n};\n\nexport type ParsedNavigationSection = {\n type: NavigationSectionType;\n label: string;\n url: string;\n possible: boolean;\n active: boolean;\n items: ParsedNavigationItem[];\n};\n\nexport type ParsedNavigation = Record<\n NavigationSectionType,\n ParsedNavigationSection\n>;\n\n// #############################################################################\n// Global site config types\n// #############################################################################\nexport enum SiteConfigType {\n // Basic site config\n Basic = \"basic\",\n // Regional site config\n Regional = \"regional\",\n}\n\ninterface BaseSiteConfig {\n type: SiteConfigType;\n}\n\nexport interface BasicSiteConfig extends BaseSiteConfig {\n type: SiteConfigType.Basic;\n baseUrl: string;\n /** If `defaultLanguage` or `languages` are undefined, it means region does not have languages */\n defaultLanguage?: Language;\n languages?: DeployedLanguages;\n}\n\nexport interface RegionalSite extends BaseSiteConfig {\n type: SiteConfigType.Regional;\n defaultRegion: BasicSiteConfig;\n regions: Record<StoreId, BasicSiteConfig | null>;\n}\n\ntype SiteConfig = RegionalSite | BasicSiteConfig;\n\n/**\n * Static global site config type for known sites\n */\nexport type StaticGlobalSiteConfig = Record<\n // Excludes generic as it allows custom injecting in runtime\n Exclude<SiteId, SiteId.Generic>,\n SiteConfig\n>;\n\n/**\n * Explicit global site config type for known sites\n * (used for store where `satisfies` is not working)\n */\nexport interface StaticGlobalSiteConfigExplicit extends StaticGlobalSiteConfig {\n [SiteId.Store]: RegionalSite;\n [SiteId.Ui]: RegionalSite;\n [SiteId.Uisp]: RegionalSite;\n [SiteId.Amplifi]: BasicSiteConfig;\n [SiteId.TechSpecs]: BasicSiteConfig;\n [SiteId.ExpertsUi]: BasicSiteConfig;\n [SiteId.ExpertsUisp]: BasicSiteConfig;\n [SiteId.Uwc]: BasicSiteConfig;\n [SiteId.Blog]: BasicSiteConfig;\n [SiteId.CaseStudies]: BasicSiteConfig;\n}\n\n/**\n * Global site config type for known sites + generic site where\n * custom site config can be injected in the target project\n */\nexport type GlobalSiteConfig = StaticGlobalSiteConfig & {\n [SiteId.Generic]?: SiteConfig;\n};\n\n// #############################################################################\n// Microsite context value\n// #############################################################################\nexport type MenuContextValue = {\n /**\n * Indicates if app is doing SSR\n */\n isSsr: boolean;\n storeId: StoreId;\n\n // Menu motif\n motif: Motif;\n setMotif: (motif: Motif) => void;\n\n // Nav context\n context: SiteId;\n isMicrositeContext: boolean;\n\n // Modals\n activeModal: ModalId | null;\n prevActiveModal: ModalId | null;\n setActiveModal: (id: ModalId | null) => void;\n\n // Languages\n language: `${Language}`;\n isMultiLanguage: boolean;\n deployedLanguages: Array<`${Language}`>;\n languageDirection: LanguageDirectionType;\n isLongLanguage: boolean;\n\n // Menu sections and items\n navigation: ParsedNavigation;\n activeNavigationSection: ParsedNavigationSection;\n inactiveNavigationSection: ParsedNavigationSection;\n isPathnameActive: (pathname: string) => boolean;\n\n // For DOM animations\n navigationOutOfView: boolean;\n setNavigationOutOfView: (navigationOutOfView: boolean) => void;\n\n // Utils\n createSiteUrl: (siteUrl: SiteUrl) => string;\n};\n"],"names":["ModalId","SiteConfigType"],"mappings":";;;AAeY,IAAAA,OAAA,GAAA,gBAAAA,QAAL,IAAA;EACLA,SAAA,SAAU,CAAA,GAAA,SAAA;EACVA,SAAA,SAAU,CAAA,GAAA,SAAA;EACVA,SAAA,MAAO,CAAA,GAAA,MAAA;EACPA,SAAA,UAAW,CAAA,GAAA,UAAA;EACXA,SAAA,YAAa,CAAA,GAAA,YAAA;EACbA,SAAA,eAAgB,CAAA,GAAA,eAAA;EAChBA,SAAA,QAAS,CAAA,GAAA,QAAA;EAPCA,OAAAA,QAAAA;AAAA,CAAA,EAAAA,OAAA,IAAA,CAAA,CAAA,CAAA;AAuDA,IAAAC,cAAA,GAAA,gBAAAA,eAAL,IAAA;EAELA,gBAAA,OAAQ,CAAA,GAAA,OAAA;EAERA,gBAAA,UAAW,CAAA,GAAA,UAAA;EAJDA,OAAAA,eAAAA;AAAA,CAAA,EAAAA,cAAA,IAAA,CAAA,CAAA,CAAA;;"}
|
|
@@ -4,7 +4,6 @@ var ModalId = /* @__PURE__ */(ModalId2 => {
|
|
|
4
4
|
ModalId2["Support"] = "support";
|
|
5
5
|
ModalId2["Account"] = "account";
|
|
6
6
|
ModalId2["Cart"] = "cart";
|
|
7
|
-
ModalId2["CartPreview"] = "cartPreview";
|
|
8
7
|
ModalId2["Language"] = "language";
|
|
9
8
|
ModalId2["MobileMenu"] = "mobileMenu";
|
|
10
9
|
ModalId2["ProMobileMenu"] = "proMobileMenu";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../src/contexts/MenuContext/types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { StoreId } from \"../../types\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteId,\n SiteUrl,\n} from \"./mapping\";\nimport type { LanguageDirectionType } from \"./utils\";\n\nexport enum ModalId {\n Support = \"support\",\n Account = \"account\",\n Cart = \"cart\",\n
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../src/contexts/MenuContext/types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { StoreId } from \"../../types\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteId,\n SiteUrl,\n} from \"./mapping\";\nimport type { LanguageDirectionType } from \"./utils\";\n\nexport enum ModalId {\n Support = \"support\",\n Account = \"account\",\n Cart = \"cart\",\n Language = \"language\",\n MobileMenu = \"mobileMenu\",\n ProMobileMenu = \"proMobileMenu\",\n Search = \"search\",\n}\n\nexport type ParsedNavigationSubSubItem = Omit<NavigationSubSubItem, \"url\"> & {\n url: string;\n active: boolean;\n possible: boolean;\n items: ParsedNavigationSubSubItem[];\n};\n\nexport type ParsedNavigationSubItem = Omit<\n NavigationSubItem,\n \"url\" | \"storePath\"\n> & {\n url: string;\n active: boolean;\n possible: boolean;\n /**\n * Sub-sub-items which will always be present\n * But can be empty in either cases e.g. no valid paths given\n */\n items: ParsedNavigationSubSubItem[];\n};\n\nexport type ParsedNavigationItem = Omit<NavigationItem, \"url\" | \"items\"> & {\n url: string;\n active: boolean;\n possible: boolean;\n items: ParsedNavigationSubItem[];\n};\n\nexport type ParsedNavigationSection = {\n type: NavigationSectionType;\n label: string;\n url: string;\n possible: boolean;\n active: boolean;\n items: ParsedNavigationItem[];\n};\n\nexport type ParsedNavigation = Record<\n NavigationSectionType,\n ParsedNavigationSection\n>;\n\n// #############################################################################\n// Global site config types\n// #############################################################################\nexport enum SiteConfigType {\n // Basic site config\n Basic = \"basic\",\n // Regional site config\n Regional = \"regional\",\n}\n\ninterface BaseSiteConfig {\n type: SiteConfigType;\n}\n\nexport interface BasicSiteConfig extends BaseSiteConfig {\n type: SiteConfigType.Basic;\n baseUrl: string;\n /** If `defaultLanguage` or `languages` are undefined, it means region does not have languages */\n defaultLanguage?: Language;\n languages?: DeployedLanguages;\n}\n\nexport interface RegionalSite extends BaseSiteConfig {\n type: SiteConfigType.Regional;\n defaultRegion: BasicSiteConfig;\n regions: Record<StoreId, BasicSiteConfig | null>;\n}\n\ntype SiteConfig = RegionalSite | BasicSiteConfig;\n\n/**\n * Static global site config type for known sites\n */\nexport type StaticGlobalSiteConfig = Record<\n // Excludes generic as it allows custom injecting in runtime\n Exclude<SiteId, SiteId.Generic>,\n SiteConfig\n>;\n\n/**\n * Explicit global site config type for known sites\n * (used for store where `satisfies` is not working)\n */\nexport interface StaticGlobalSiteConfigExplicit extends StaticGlobalSiteConfig {\n [SiteId.Store]: RegionalSite;\n [SiteId.Ui]: RegionalSite;\n [SiteId.Uisp]: RegionalSite;\n [SiteId.Amplifi]: BasicSiteConfig;\n [SiteId.TechSpecs]: BasicSiteConfig;\n [SiteId.ExpertsUi]: BasicSiteConfig;\n [SiteId.ExpertsUisp]: BasicSiteConfig;\n [SiteId.Uwc]: BasicSiteConfig;\n [SiteId.Blog]: BasicSiteConfig;\n [SiteId.CaseStudies]: BasicSiteConfig;\n}\n\n/**\n * Global site config type for known sites + generic site where\n * custom site config can be injected in the target project\n */\nexport type GlobalSiteConfig = StaticGlobalSiteConfig & {\n [SiteId.Generic]?: SiteConfig;\n};\n\n// #############################################################################\n// Microsite context value\n// #############################################################################\nexport type MenuContextValue = {\n /**\n * Indicates if app is doing SSR\n */\n isSsr: boolean;\n storeId: StoreId;\n\n // Menu motif\n motif: Motif;\n setMotif: (motif: Motif) => void;\n\n // Nav context\n context: SiteId;\n isMicrositeContext: boolean;\n\n // Modals\n activeModal: ModalId | null;\n prevActiveModal: ModalId | null;\n setActiveModal: (id: ModalId | null) => void;\n\n // Languages\n language: `${Language}`;\n isMultiLanguage: boolean;\n deployedLanguages: Array<`${Language}`>;\n languageDirection: LanguageDirectionType;\n isLongLanguage: boolean;\n\n // Menu sections and items\n navigation: ParsedNavigation;\n activeNavigationSection: ParsedNavigationSection;\n inactiveNavigationSection: ParsedNavigationSection;\n isPathnameActive: (pathname: string) => boolean;\n\n // For DOM animations\n navigationOutOfView: boolean;\n setNavigationOutOfView: (navigationOutOfView: boolean) => void;\n\n // Utils\n createSiteUrl: (siteUrl: SiteUrl) => string;\n};\n"],"names":["ModalId","SiteConfigType"],"mappings":";;AAeY,IAAAA,OAAA,GAAA,gBAAAA,QAAL,IAAA;EACLA,SAAA,SAAU,CAAA,GAAA,SAAA;EACVA,SAAA,SAAU,CAAA,GAAA,SAAA;EACVA,SAAA,MAAO,CAAA,GAAA,MAAA;EACPA,SAAA,UAAW,CAAA,GAAA,UAAA;EACXA,SAAA,YAAa,CAAA,GAAA,YAAA;EACbA,SAAA,eAAgB,CAAA,GAAA,eAAA;EAChBA,SAAA,QAAS,CAAA,GAAA,QAAA;EAPCA,OAAAA,QAAAA;AAAA,CAAA,EAAAA,OAAA,IAAA,CAAA,CAAA,CAAA;AAuDA,IAAAC,cAAA,GAAA,gBAAAA,eAAL,IAAA;EAELA,gBAAA,OAAQ,CAAA,GAAA,OAAA;EAERA,gBAAA,UAAW,CAAA,GAAA,UAAA;EAJDA,OAAAA,eAAAA;AAAA,CAAA,EAAAA,cAAA,IAAA,CAAA,CAAA,CAAA;"}
|
|
@@ -8,7 +8,6 @@ import type { LocalizedCurrency, RoundingFn } from "./types";
|
|
|
8
8
|
* @see: https://ubiquiti.atlassian.net/browse/NEP-3846
|
|
9
9
|
*/
|
|
10
10
|
export declare const roundToNearestFull059: RoundingFn;
|
|
11
|
-
export declare const roundToNearestValidUiCarePrice: RoundingFn;
|
|
12
11
|
/**
|
|
13
12
|
* Custom rounding method to be used with dinero.js
|
|
14
13
|
* This rounding method will round to
|
|
@@ -67,11 +66,6 @@ export declare const Round: {
|
|
|
67
66
|
*/
|
|
68
67
|
PrettifyHalfUnitCents: RoundingFn;
|
|
69
68
|
Subunit: import("@dinero.js/core").RoundingMode;
|
|
70
|
-
/**
|
|
71
|
-
* ! Disclaimer may not work for "weird" currencies as expected
|
|
72
|
-
* ! For correct rounding UI Care prices, used for auto managed UI Care products.
|
|
73
|
-
*/
|
|
74
|
-
ValidUiCarePrice: RoundingFn;
|
|
75
69
|
};
|
|
76
70
|
/**
|
|
77
71
|
* Mapping of how prices should be rounded down to "whole numbers" after certain threshold
|
|
@@ -22,22 +22,6 @@ const roundToNearestFull059 = input => {
|
|
|
22
22
|
return roundedNumber - remainder + 9;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const roundToNearestValidUiCarePrice = input => {
|
|
26
|
-
if (input === 0) {
|
|
27
|
-
return 0;
|
|
28
|
-
}
|
|
29
|
-
if (input <= 5) {
|
|
30
|
-
return 5;
|
|
31
|
-
}
|
|
32
|
-
const remainder = input % 10;
|
|
33
|
-
if (remainder <= 2) {
|
|
34
|
-
return input - remainder - 1;
|
|
35
|
-
} else if (remainder <= 5) {
|
|
36
|
-
return input - remainder + 5;
|
|
37
|
-
} else {
|
|
38
|
-
return input - remainder + 9;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
25
|
const roundToNearestDecimalCent = input => {
|
|
42
26
|
if (input === 0) {
|
|
43
27
|
return 0;
|
|
@@ -102,12 +86,7 @@ const Round = {
|
|
|
102
86
|
* ! Disclaimer may not work for "weird" currencies as expected
|
|
103
87
|
*/
|
|
104
88
|
PrettifyHalfUnitCents: roundToNearestHalfUnitCent,
|
|
105
|
-
Subunit: dinero_js.halfUp
|
|
106
|
-
/**
|
|
107
|
-
* ! Disclaimer may not work for "weird" currencies as expected
|
|
108
|
-
* ! For correct rounding UI Care prices, used for auto managed UI Care products.
|
|
109
|
-
*/
|
|
110
|
-
ValidUiCarePrice: roundToNearestValidUiCarePrice
|
|
89
|
+
Subunit: dinero_js.halfUp
|
|
111
90
|
};
|
|
112
91
|
const prettifyPriceLookup = /* @__PURE__ */new Map([[currencies.USD.code, 20], [currencies.AED.code, 50],
|
|
113
92
|
// Approximately every price above ~1.1 usd will be rounded in ZAR
|
|
@@ -239,7 +218,6 @@ exports.prettifyPriceLookup = prettifyPriceLookup;
|
|
|
239
218
|
exports.roundToNearestDecimalCent = roundToNearestDecimalCent;
|
|
240
219
|
exports.roundToNearestFull059 = roundToNearestFull059;
|
|
241
220
|
exports.roundToNearestHalfUnitCent = roundToNearestHalfUnitCent;
|
|
242
|
-
exports.roundToNearestValidUiCarePrice = roundToNearestValidUiCarePrice;
|
|
243
221
|
exports.smallestSubunitLookup = smallestSubunitLookup;
|
|
244
222
|
exports.storesWithPerItemTaxRate = storesWithPerItemTaxRate;
|
|
245
223
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CNY,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PHP,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\nexport const roundToNearestValidUiCarePrice: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n // Determine nearest rounding value\n const remainder = input % 10;\n if (remainder <= 2) {\n // Round down to nearest 9\n return input - remainder - 1;\n } else if (remainder <= 5) {\n // Round to nearest 5\n return input - remainder + 5;\n } else {\n // Round up to nearest 9\n return input - remainder + 9;\n }\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest decimal cent. e.g. 1.53 = 1.50 / 1.57 = 1.60\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestDecimalCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.09\n if (input <= 0.1) {\n return 0.1;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n */\n return parseFloat((Math.round(input * 10) / 10).toFixed(1));\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest .50 or .00. e.g. 11.22 = 11 / 11.55 = 11.50 / 11.90 = 12\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestHalfUnitCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.5\n if (input <= 0.5) {\n return 0.5;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n *\n * Multiply by 2, round to the nearest integer, then divide by 2 to get the nearest .5 or .0\n * Return with fixed precision to avoid floating-point artifacts\n */\n return parseFloat((Math.round(input * 2) / 2).toFixed(2));\n};\n\nexport const Round = {\n /**\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n *\n * OLD: halfEven docs\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalize the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/v2.0.0-alpha.8/packages/core/src/round/halfEven.ts\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behavior\n * based on if the rounded number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding\n * (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: roundToNearestDecimalCent,\n Prettify: down,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyFull059: roundToNearestFull059,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyDecimalCents: roundToNearestDecimalCent,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyHalfUnitCents: roundToNearestHalfUnitCent,\n Subunit: halfUp,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n * ! For correct rounding UI Care prices, used for auto managed UI Care products.\n */\n ValidUiCarePrice: roundToNearestValidUiCarePrice,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n [MXN.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n [Currency.Php, { currency: PHP, locale: \"en-PH\" }],\n [Currency.Cny, { currency: CNY, locale: \"zh-CN\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059","input","roundedNumber","Math","round","remainder","roundToNearestValidUiCarePrice","roundToNearestDecimalCent","parseFloat","toFixed","roundToNearestHalfUnitCent","Round","Financial","halfAwayFromZero","Shipping","Prettify","down","PrettifyFull059","PrettifyDecimalCents","PrettifyHalfUnitCents","Subunit","halfUp","ValidUiCarePrice","prettifyPriceLookup","Map","USD","code","AED","ZAR","MXN","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","CAD","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","EUR","Gbp","GBP","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","Php","PHP","Cny","CNY","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;;;AA+Ca,MAAAA,qBAAA,GAAqCC,KAAkB,IAAA;EAClE,IAAIA,UAAU,CAAG,EAAA;IACR,OAAA,CAAA;EAAA;EAIT,IAAIA,SAAS,CAAG,EAAA;IACP,OAAA,CAAA;EAAA;EAOH,MAAAC,aAAA,GAAgBC,IAAK,CAAAC,KAAA,CAAMH,KAAK,CAAA;EAGtC,MAAMI,YAAYH,aAAgB,GAAA,EAAA;EAClC,IAAIG,aAAa,CAAG,EAAA;IAElB,OAAOH,aAAgB,GAAAG,SAAA;EAAA,CACzB,MAAA,IAAWA,aAAa,CAAG,EAAA;IAEzB,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EAAA,CAC9B,MAAA;IAEL,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EAAA;AAEvC,CAAA;AAEa,MAAAC,8BAAA,GAA8CL,KAAkB,IAAA;EAC3E,IAAIA,UAAU,CAAG,EAAA;IACR,OAAA,CAAA;EAAA;EAIT,IAAIA,SAAS,CAAG,E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AMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAM0D,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CNY,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PHP,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest decimal cent. e.g. 1.53 = 1.50 / 1.57 = 1.60\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestDecimalCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.09\n if (input <= 0.1) {\n return 0.1;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n */\n return parseFloat((Math.round(input * 10) / 10).toFixed(1));\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest .50 or .00. e.g. 11.22 = 11 / 11.55 = 11.50 / 11.90 = 12\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestHalfUnitCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.5\n if (input <= 0.5) {\n return 0.5;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n *\n * Multiply by 2, round to the nearest integer, then divide by 2 to get the nearest .5 or .0\n * Return with fixed precision to avoid floating-point artifacts\n */\n return parseFloat((Math.round(input * 2) / 2).toFixed(2));\n};\n\nexport const Round = {\n /**\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n *\n * OLD: halfEven docs\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalize the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/v2.0.0-alpha.8/packages/core/src/round/halfEven.ts\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behavior\n * based on if the rounded number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding\n * (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: roundToNearestDecimalCent,\n Prettify: down,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyFull059: roundToNearestFull059,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyDecimalCents: roundToNearestDecimalCent,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyHalfUnitCents: roundToNearestHalfUnitCent,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n [MXN.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n [Currency.Php, { currency: PHP, locale: \"en-PH\" }],\n [Currency.Cny, { currency: CNY, locale: \"zh-CN\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059","input","roundedNumber","Math","round","remainder","roundToNearestDecimalCent","parseFloat","toFixed","roundToNearestHalfUnitCent","Round","Financial","halfAwayFromZero","Shipping","Prettify","down","PrettifyFull059","PrettifyDecimalCents","PrettifyHalfUnitCents","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","AED","ZAR","MXN","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","CAD","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","EUR","Gbp","GBP","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","Php","PHP","Cny","CNY","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_D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CAAA,CAAA,CAClD,CAAA;AAeY,MAAA2C,wBAAA,GAAA,mBAA+BC,GAAI,CAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,CAWlC,CAAA;AAKP,MAAMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAM0D,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;;;;;;;;;;"}
|
|
@@ -20,22 +20,6 @@ const roundToNearestFull059 = input => {
|
|
|
20
20
|
return roundedNumber - remainder + 9;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
const roundToNearestValidUiCarePrice = input => {
|
|
24
|
-
if (input === 0) {
|
|
25
|
-
return 0;
|
|
26
|
-
}
|
|
27
|
-
if (input <= 5) {
|
|
28
|
-
return 5;
|
|
29
|
-
}
|
|
30
|
-
const remainder = input % 10;
|
|
31
|
-
if (remainder <= 2) {
|
|
32
|
-
return input - remainder - 1;
|
|
33
|
-
} else if (remainder <= 5) {
|
|
34
|
-
return input - remainder + 5;
|
|
35
|
-
} else {
|
|
36
|
-
return input - remainder + 9;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
23
|
const roundToNearestDecimalCent = input => {
|
|
40
24
|
if (input === 0) {
|
|
41
25
|
return 0;
|
|
@@ -100,12 +84,7 @@ const Round = {
|
|
|
100
84
|
* ! Disclaimer may not work for "weird" currencies as expected
|
|
101
85
|
*/
|
|
102
86
|
PrettifyHalfUnitCents: roundToNearestHalfUnitCent,
|
|
103
|
-
Subunit: halfUp
|
|
104
|
-
/**
|
|
105
|
-
* ! Disclaimer may not work for "weird" currencies as expected
|
|
106
|
-
* ! For correct rounding UI Care prices, used for auto managed UI Care products.
|
|
107
|
-
*/
|
|
108
|
-
ValidUiCarePrice: roundToNearestValidUiCarePrice
|
|
87
|
+
Subunit: halfUp
|
|
109
88
|
};
|
|
110
89
|
const prettifyPriceLookup = /* @__PURE__ */new Map([[USD.code, 20], [AED.code, 50],
|
|
111
90
|
// Approximately every price above ~1.1 usd will be rounded in ZAR
|
|
@@ -229,5 +208,5 @@ const EXCHANGE_RATE_DINERO_CURRENCY = {
|
|
|
229
208
|
code: ""
|
|
230
209
|
// Not important
|
|
231
210
|
};
|
|
232
|
-
export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, roundToNearestDecimalCent, roundToNearestFull059, roundToNearestHalfUnitCent,
|
|
211
|
+
export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, roundToNearestDecimalCent, roundToNearestFull059, roundToNearestHalfUnitCent, smallestSubunitLookup, storesWithPerItemTaxRate };
|
|
233
212
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CNY,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PHP,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\nexport const roundToNearestValidUiCarePrice: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n // Determine nearest rounding value\n const remainder = input % 10;\n if (remainder <= 2) {\n // Round down to nearest 9\n return input - remainder - 1;\n } else if (remainder <= 5) {\n // Round to nearest 5\n return input - remainder + 5;\n } else {\n // Round up to nearest 9\n return input - remainder + 9;\n }\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest decimal cent. e.g. 1.53 = 1.50 / 1.57 = 1.60\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestDecimalCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.09\n if (input <= 0.1) {\n return 0.1;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n */\n return parseFloat((Math.round(input * 10) / 10).toFixed(1));\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest .50 or .00. e.g. 11.22 = 11 / 11.55 = 11.50 / 11.90 = 12\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestHalfUnitCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.5\n if (input <= 0.5) {\n return 0.5;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n *\n * Multiply by 2, round to the nearest integer, then divide by 2 to get the nearest .5 or .0\n * Return with fixed precision to avoid floating-point artifacts\n */\n return parseFloat((Math.round(input * 2) / 2).toFixed(2));\n};\n\nexport const Round = {\n /**\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n *\n * OLD: halfEven docs\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalize the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/v2.0.0-alpha.8/packages/core/src/round/halfEven.ts\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behavior\n * based on if the rounded number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding\n * (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: roundToNearestDecimalCent,\n Prettify: down,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyFull059: roundToNearestFull059,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyDecimalCents: roundToNearestDecimalCent,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyHalfUnitCents: roundToNearestHalfUnitCent,\n Subunit: halfUp,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n * ! For correct rounding UI Care prices, used for auto managed UI Care products.\n */\n ValidUiCarePrice: roundToNearestValidUiCarePrice,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n [MXN.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n [Currency.Php, { currency: PHP, locale: \"en-PH\" }],\n [Currency.Cny, { currency: CNY, locale: \"zh-CN\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059","input","roundedNumber","Math","round","remainder","roundToNearestValidUiCarePrice","roundToNearestDecimalCent","parseFloat","toFixed","roundToNearestHalfUnitCent","Round","Financial","halfAwayFromZero","Shipping","Prettify","down","PrettifyFull059","PrettifyDecimalCents","PrettifyHalfUnitCents","Subunit","halfUp","ValidUiCarePrice","prettifyPriceLookup","Map","USD","code","AED","ZAR","MXN","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","CAD","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","EUR","Gbp","GBP","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","Php","PHP","Cny","CNY","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;AA+Ca,MAAAA,qBAAA,GAAqCC,KAAkB,IAAA;EAClE,IAAIA,UAAU,CAAG,EAAA;IACR,OAAA,CAAA;EAAA;EAIT,IAAIA,SAAS,CAAG,EAAA;IACP,OAAA,CAAA;EAAA;EAOH,MAAAC,aAAA,GAAgBC,IAAK,CAAAC,KAAA,CAAMH,KAAK,CAAA;EAGtC,MAAMI,YAAYH,aAAgB,GAAA,EAAA;EAClC,IAAIG,aAAa,CAAG,EAAA;IAElB,OAAOH,aAAgB,GAAAG,SAAA;EAAA,CACzB,MAAA,IAAWA,aAAa,C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jD,CAACH,SAASoC,GAAK,EAAA;EAAElC,UAAUmC,GAAK;EAAAlC,MAAA,EAAQ;CAAS,CAAA;AAAA;AAEjD,CAACH,SAASsC,GAAK,EAAA;EAAEpC,UAAUqC,GAAK;EAAApC,MAAA,EAAQ;CAAS,CAAA;AAAA;AAEjD,CAACH,SAASwC,GAAK,EAAA;EAAEtC,UAAUJ,GAAK;EAAAK,MAAA,EAAQ;CAAS,CAAA,EACjD,CAACH,SAASyC,GAAK,EAAA;EAAEvC,UAAUN,GAAK;EAAAO,MAAA,EAAQ;CAAS,CAAA,EACjD,CAACH,SAAS0C,GAAK,EAAA;EAAExC,UAAUyC,GAAK;EAAAxC,MAAA,EAAQ;CAAS,CAAA,EACjD,CAACH,SAAS4C,GAAK,EAAA;EAAE1C,UAAU2C,GAAK;EAAA1C,MAAA,EAAQ;AAAS,CAAA,CAAA,CAClD,CAAA;AAeY,MAAA2C,wBAAA,GAAA,mBAA+BC,GAAI,CAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,CAWlC,CAAA;AAKP,MAAMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAM0D,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;"}
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../src/utils/money/constants.ts"],"sourcesContent":["import {\n AED,\n BGN,\n BRL,\n CAD,\n CHF,\n CNY,\n CZK,\n DKK,\n EUR,\n GBP,\n HRK,\n HUF,\n INR,\n JPY,\n MXN,\n NOK,\n PHP,\n PLN,\n RON,\n SEK,\n SGD,\n TWD,\n USD,\n ZAR,\n} from \"@dinero.js/currencies\";\nimport { down, halfAwayFromZero, halfUp } from \"dinero.js\";\n\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\nimport type {\n Cents,\n DinoCurrency,\n LocalizedCurrency,\n RoundingFn,\n} from \"./types\";\n\n// #############################################################################\n// Constants\n// #############################################################################\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to nearest FULL 0/5/9 (and strip cents)\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestFull059: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-5.00\n if (input <= 5) {\n return 5;\n }\n\n /**\n * Input comes as float, for this rounding we don't need cents, so round\n * to nearest full number\n */\n const roundedNumber = Math.round(input);\n\n // Determine nearest rounding value\n const remainder = roundedNumber % 10;\n if (remainder <= 2) {\n // Round down to nearest 0\n return roundedNumber - remainder;\n } else if (remainder <= 7) {\n // Round to nearest 5\n return roundedNumber - remainder + 5;\n } else {\n // Round up to nearest 9\n return roundedNumber - remainder + 9;\n }\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest decimal cent. e.g. 1.53 = 1.50 / 1.57 = 1.60\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestDecimalCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.09\n if (input <= 0.1) {\n return 0.1;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n */\n return parseFloat((Math.round(input * 10) / 10).toFixed(1));\n};\n\n/**\n * Custom rounding method to be used with dinero.js\n * This rounding method will round to\n * nearest .50 or .00. e.g. 11.22 = 11 / 11.55 = 11.50 / 11.90 = 12\n *\n * @see: https://ubiquiti.atlassian.net/browse/NEP-3846\n */\nexport const roundToNearestHalfUnitCent: RoundingFn = (input: number) => {\n if (input === 0) {\n return 0;\n }\n\n // Special handling of 0.01-0.5\n if (input <= 0.5) {\n return 0.5;\n }\n\n /**\n * Input comes as float, just to be on the safe side use toFixed to mitigate\n * risk of running to floating point precision issues\n *\n * Multiply by 2, round to the nearest integer, then divide by 2 to get the nearest .5 or .0\n * Return with fixed precision to avoid floating-point artifacts\n */\n return parseFloat((Math.round(input * 2) / 2).toFixed(2));\n};\n\nexport const Round = {\n /**\n * !!!!!!!!!!!!!!\n * ! Update 2024\n * ! We ar changing from `halfEven` (bankers rounding) to `halfAwayFromZero` (symmetric rounding) to match Avalara tax\n * @see https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Change_how_AvaTax_rounds_the_tax_amount.html\n * @see https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n * !!!!!!!!!!!!!!\n *\n * OLD: halfEven docs\n * ⚠️ Instead of using Math.round, we HAVE to use this method to round the financial numbers everywhere where we CAN'T\n * deal with dinero.js (Dinero.js should be the priority). But often for converting from API requests we have to\n * normalize the values so we use this method.\n *\n * It just a re-export of the dinero.js halfEven (a.k.a bankers rounding) method which is the default rounding method.\n * @see https://github.com/dinerojs/dinero.js/blob/v2.0.0-alpha.8/packages/core/src/round/halfEven.ts\n *\n * Compared to Math.round (arithmetic rounding) it differentiates that it changes the `.5` round up or down behavior\n * based on if the rounded number would be an even number. So 1.5 would round to 2 while 2.5 would round to 2.\n * See the youtube link below for a brief exclamation on why it's important to use this method over regular rounding\n * (half-up):\n * https://youtu.be/yuRdYlZvs1E\n *\n * If you really want to get knee-deep in the rounding subject, you can read the following:\n * https://en.wikipedia.org/wiki/Rounding#Round_half_toward_zero\n */\n Financial: halfAwayFromZero,\n // https://ui.slack.com/archives/C07P7L7S3CP/p1728313196140639\n // TODO: maybe we should have separate rounding functions depending on the input value?\n // Reading from wiki \"Round half toward zero\" is better if the value is already \"normalized to cents\"\n // But the \"Round half to even\" seems better for when working with float like values\n // financialRound = Math.round;\n Shipping: roundToNearestDecimalCent,\n Prettify: down,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyFull059: roundToNearestFull059,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyDecimalCents: roundToNearestDecimalCent,\n /**\n * ! Disclaimer may not work for \"weird\" currencies as expected\n */\n PrettifyHalfUnitCents: roundToNearestHalfUnitCent,\n Subunit: halfUp,\n} satisfies Record<string, RoundingFn>;\n\n/**\n * Mapping of how prices should be rounded down to \"whole numbers\" after certain threshold\n */\nexport const prettifyPriceLookup = new Map([\n [USD.code, 20],\n [AED.code, 50],\n // Approximately every price above ~1.1 usd will be rounded in ZAR\n [ZAR.code, 20],\n [MXN.code, 20],\n]);\n\n/**\n * Map of dinero code to subunit digit count.\n */\nexport const smallestSubunitLookup = new Map<string, [Cents, RoundingFn]>([\n /**\n * TWD does not use subunits at all in day to day transactions.\n */\n [TWD.code, [0, Round.Subunit]],\n]);\n\n/**\n * Precompiled list for faster currency and locale lookups\n */\nexport const localizedCurrencyLookup = new Map<Currency, LocalizedCurrency>([\n [Currency.Aed, { currency: AED, locale: \"ar-AE\" }],\n [Currency.Bgn, { currency: BGN, locale: \"bg-BG\" }],\n [Currency.Cad, { currency: CAD, locale: \"en-CA\" }],\n [Currency.Chf, { currency: CHF, locale: \"it-CH\" }],\n [Currency.Czk, { currency: CZK, locale: \"cs-CZ\" }],\n [Currency.Dkk, { currency: DKK, locale: \"da-DK\" }],\n [Currency.Eur, { currency: EUR, locale: \"de-DE\" }],\n [Currency.Gbp, { currency: GBP, locale: \"en-GB\" }],\n [Currency.Hrk, { currency: HRK, locale: \"hr-HR\" }],\n [Currency.Huf, { currency: HUF, locale: \"hu-HU\" }],\n [Currency.Nok, { currency: NOK, locale: \"no-NO\" }],\n [Currency.Pln, { currency: PLN, locale: \"pl-PL\" }],\n [Currency.Ron, { currency: RON, locale: \"ro-RO\" }],\n [Currency.Sek, { currency: SEK, locale: \"sv-SE\" }],\n [Currency.Usd, { currency: USD, locale: \"en-US\" }],\n [Currency.Zar, { currency: ZAR, locale: \"en-ZA\" }],\n [Currency.Inr, { currency: INR, locale: \"en-IN\" }],\n [Currency.Sgd, { currency: SGD, locale: \"en-SG\" }],\n [Currency.Brl, { currency: BRL, locale: \"pt-BR\" }],\n // NOTE: en-JP Doesn't exist\n [Currency.Jpy, { currency: JPY, locale: \"en-JP\" }],\n // NOTE: en-TW Doesn't exist\n [Currency.Twd, { currency: TWD, locale: \"en-TW\" }],\n [Currency.Mxn, { currency: MXN, locale: \"es-MX\" }],\n [Currency.Php, { currency: PHP, locale: \"en-PH\" }],\n [Currency.Cny, { currency: CNY, locale: \"zh-CN\" }],\n]);\n\n// #############################################################################\n// Tax Rate\n// #############################################################################\n/**\n * List of stores that require calculating per single item qty and then combining them to get the total tax amount for a\n * single line. Rest of the stores inherit default behavior that tax calculated on whole line item\n *\n * ! IMPORTANT: When changing need to sync that store.backend `AVATAX_CUSTOM_COMPANY_CODES` is updated to reflect the change\n *\n * FIXME: as PR for the change as unfinished currently disabled to enable the functionality that calculates tax per single item as requires\n * specific testing both for our custom tax and Avalara stores that use custom company codes. So the groundwork for\n * different tax calculations is there just need to enable on the share side and test if it works\n */\nexport const storesWithPerItemTaxRate = new Set([\n // #############################################################################\n // Stores with custom tax rates\n // #############################################################################\n // StoreId.Br,\n // StoreId.Tw,\n // #############################################################################\n // Stores with Avalara, but will have custom company codes to handle per-item tax rate\n // #############################################################################\n // StoreId.Jp,\n // StoreId.Sg,\n] as StoreId[]);\n\n/**\n * Dinero currency option block for working with tax rates within dinero\n */\nexport const TAX_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We expect the tax rate to be in the range of 0..1\n * 0 --> 0%\n * 1 --> 100%\n * 0.21 --> 21%\n * 0.2169 --> 21.69%\n * 0.12345678 --> 12.345678%\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 8,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n\n// #############################################################################\n// Exchange Rate\n// #############################################################################\n\nexport const EXCHANGE_RATE_DINERO_CURRENCY = {\n base: 10,\n /**\n * We support having certain decimal places for exchange rates\n * !!! Don't change as this value is tied to store.backend DB schema !!!\n */\n exponent: 6,\n code: \"\", // Not important\n} satisfies DinoCurrency;\n"],"names":["roundToNearestFull059","input","roundedNumber","Math","round","remainder","roundToNearestDecimalCent","parseFloat","toFixed","roundToNearestHalfUnitCent","Round","Financial","halfAwayFromZero","Shipping","Prettify","down","PrettifyFull059","PrettifyDecimalCents","PrettifyHalfUnitCents","Subunit","halfUp","prettifyPriceLookup","Map","USD","code","AED","ZAR","MXN","smallestSubunitLookup","TWD","localizedCurrencyLookup","Currency","Aed","currency","locale","Bgn","BGN","Cad","CAD","Chf","CHF","Czk","CZK","Dkk","DKK","Eur","EUR","Gbp","GBP","Hrk","HRK","Huf","HUF","Nok","NOK","Pln","PLN","Ron","RON","Sek","SEK","Usd","Zar","Inr","INR","Sgd","SGD","Brl","BRL","Jpy","JPY","Twd","Mxn","Php","PHP","Cny","CNY","storesWithPerItemTaxRate","Set","TAX_RATE_DINERO_CURRENCY","base","exponent","EXCHANGE_RATE_DINERO_CURRENCY"],"mappings":";;;;;AA+Ca,MAAAA,qBAAA,GAAqCC,KAAkB,IAAA;EAClE,IAAIA,UAAU,CAAG,EAAA;IACR,OAAA,CAAA;EAAA;EAIT,IAAIA,SAAS,CAAG,EAAA;IACP,OAAA,CAAA;EAAA;EAOH,MAAAC,aAAA,GAAgBC,IAAK,CAAAC,KAAA,CAAMH,KAAK,CAAA;EAGtC,MAAMI,YAAYH,aAAgB,GAAA,EAAA;EAClC,IAAIG,aAAa,CAAG,EAAA;IAElB,OAAOH,aAAgB,GAAAG,SAAA;EAAA,CACzB,MAAA,IAAWA,aAAa,CAAG,EAAA;IAEzB,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EAAA,CAC9B,MAAA;IAEL,OAAOH,gBAAgBG,SAAY,GAAA,CAAA;EAAA;AAEvC,CAAA;AASa,MAAAC,yBAAA,GAAyCL,KAAkB,I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AAA;EAAA;AAAA,CAWlC,CAAA;AAKP,MAAMC,wBAA2B,GAAA;EACtCC,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;AAMO,MAAM0D,6BAAgC,GAAA;EAC3CF,IAAM,EAAA,EAAA;EAAA;AAAA;AAAA;AAAA;EAKNC,QAAU,EAAA,CAAA;EACVzD,IAAM,EAAA;EAAA;AACR,CAAA;"}
|
package/lib/utils/money/index.js
CHANGED
|
@@ -20,7 +20,6 @@ exports.prettifyPriceLookup = constants.prettifyPriceLookup;
|
|
|
20
20
|
exports.roundToNearestDecimalCent = constants.roundToNearestDecimalCent;
|
|
21
21
|
exports.roundToNearestFull059 = constants.roundToNearestFull059;
|
|
22
22
|
exports.roundToNearestHalfUnitCent = constants.roundToNearestHalfUnitCent;
|
|
23
|
-
exports.roundToNearestValidUiCarePrice = constants.roundToNearestValidUiCarePrice;
|
|
24
23
|
exports.smallestSubunitLookup = constants.smallestSubunitLookup;
|
|
25
24
|
exports.storesWithPerItemTaxRate = constants.storesWithPerItemTaxRate;
|
|
26
25
|
exports.invertExchangeRate = exchangeRate.invertExchangeRate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FixedAmountAllocator } from './allocators/fixedAmount.mjs';
|
|
2
2
|
export { ProductAmountAllocator } from './allocators/productAmount.mjs';
|
|
3
|
-
export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, roundToNearestDecimalCent, roundToNearestFull059, roundToNearestHalfUnitCent,
|
|
3
|
+
export { EXCHANGE_RATE_DINERO_CURRENCY, Round, TAX_RATE_DINERO_CURRENCY, localizedCurrencyLookup, prettifyPriceLookup, roundToNearestDecimalCent, roundToNearestFull059, roundToNearestHalfUnitCent, smallestSubunitLookup, storesWithPerItemTaxRate } from './constants.mjs';
|
|
4
4
|
export { invertExchangeRate, toFixedExchangeRate, toSnapshotExchangeRate } from './exchangeRate.mjs';
|
|
5
5
|
export { formatPrice, formatPriceRaw, getLocalizedCurrency, prettifyTotal } from './format.mjs';
|
|
6
6
|
export { addMany, amount, centsToCurrencyUnit, currency, dineroToCurrencyUnit, getDinero, getDineroCurrency, money, multiplyByFullPercent, parseCurrencyCode, parseFloatToDinero, parseFloatToDineroRaw, roundDinero, stringAmountToDinero, subtractMany, toSmallestSubunit } from './misc.mjs';
|
package/package.json
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@ubnt/store.core",
|
|
3
|
+
"version": "10.15.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rollup -c && tsc --emitDeclarationOnly",
|
|
8
|
+
"build:watch": "nodemon --config ./nodemon.json",
|
|
9
|
+
"lint:tsc": "tsc --project ./tsconfig.json",
|
|
10
|
+
"prepublishOnly": "npm run build",
|
|
11
|
+
"test": "echo 'Hi from @ubnt/store.core 👋'"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"CHANGELOG.md"
|
|
17
|
+
],
|
|
2
18
|
"dependencies": {
|
|
3
19
|
"adm-zip": "0.5.16",
|
|
4
20
|
"axios": "1.8.2",
|
|
@@ -6,37 +22,6 @@
|
|
|
6
22
|
"terser": "5.39.0",
|
|
7
23
|
"tldts": "6.1.84"
|
|
8
24
|
},
|
|
9
|
-
"description": "",
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@babel/types": "7.26.9",
|
|
12
|
-
"@rollup/plugin-commonjs": "28.0.3",
|
|
13
|
-
"@rollup/plugin-json": "6.1.0",
|
|
14
|
-
"@rollup/plugin-multi-entry": "6.0.1",
|
|
15
|
-
"@rollup/plugin-node-resolve": "16.0.0",
|
|
16
|
-
"@types/adm-zip": "0.5.7",
|
|
17
|
-
"@types/big.js": "6.2.2",
|
|
18
|
-
"@types/react": "^17.0.0 || ^18.3.18 || ^19.0.8",
|
|
19
|
-
"@types/url-join": "^4.0.3",
|
|
20
|
-
"babel-plugin-styled-components": "2.1.4",
|
|
21
|
-
"css-loader": "7.1.2",
|
|
22
|
-
"nodemon": "2.0.22",
|
|
23
|
-
"react-hook-form": "7.54.2",
|
|
24
|
-
"rollup": "4.35.0",
|
|
25
|
-
"rollup-plugin-copy": "3.5.0",
|
|
26
|
-
"rollup-plugin-delete": "3.0.0",
|
|
27
|
-
"rollup-plugin-esbuild": "6.2.1",
|
|
28
|
-
"rollup-plugin-external-assets": "4.1.1",
|
|
29
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
30
|
-
"sass": "1.85.1",
|
|
31
|
-
"sass-loader": "16.0.5",
|
|
32
|
-
"style-loader": "4.0.0"
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"lib",
|
|
36
|
-
"CHANGELOG.md"
|
|
37
|
-
],
|
|
38
|
-
"keywords": [],
|
|
39
|
-
"name": "@ubnt/store.core",
|
|
40
25
|
"peerDependencies": {
|
|
41
26
|
"@babel/core": "7.26.9",
|
|
42
27
|
"@dinero.js/currencies": "2.0.0-alpha.8",
|
|
@@ -55,10 +40,10 @@
|
|
|
55
40
|
"libphonenumber-js": "^1.12.4",
|
|
56
41
|
"lodash-es": "^4.17.21",
|
|
57
42
|
"next": "^14.2.23 || ^15.1.0",
|
|
58
|
-
"react": "^17.0.0 || ^18.3.1 || ^19.0.0",
|
|
59
43
|
"react-countup": "6.5.3",
|
|
60
44
|
"react-dom": "^17.0.0 || ^18.3.1 || ^19.0.0",
|
|
61
45
|
"react-use": "^17.5.1",
|
|
46
|
+
"react": "^17.0.0 || ^18.3.1 || ^19.0.0",
|
|
62
47
|
"slugify": "^1.6.6",
|
|
63
48
|
"styled-components": "^6.1.13",
|
|
64
49
|
"url-join": "^4.0.1",
|
|
@@ -87,13 +72,28 @@
|
|
|
87
72
|
"optional": true
|
|
88
73
|
}
|
|
89
74
|
},
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@babel/types": "7.26.9",
|
|
77
|
+
"@rollup/plugin-commonjs": "28.0.3",
|
|
78
|
+
"@rollup/plugin-json": "6.1.0",
|
|
79
|
+
"@rollup/plugin-multi-entry": "6.0.1",
|
|
80
|
+
"@rollup/plugin-node-resolve": "16.0.0",
|
|
81
|
+
"@types/adm-zip": "0.5.7",
|
|
82
|
+
"@types/big.js": "6.2.2",
|
|
83
|
+
"@types/react": "^17.0.0 || ^18.3.18 || ^19.0.8",
|
|
84
|
+
"@types/url-join": "^4.0.3",
|
|
85
|
+
"babel-plugin-styled-components": "2.1.4",
|
|
86
|
+
"css-loader": "7.1.2",
|
|
87
|
+
"nodemon": "2.0.22",
|
|
88
|
+
"react-hook-form": "7.54.2",
|
|
89
|
+
"rollup-plugin-copy": "3.5.0",
|
|
90
|
+
"rollup-plugin-delete": "3.0.0",
|
|
91
|
+
"rollup-plugin-esbuild": "6.2.1",
|
|
92
|
+
"rollup-plugin-external-assets": "4.1.1",
|
|
93
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
94
|
+
"rollup": "4.35.0",
|
|
95
|
+
"sass-loader": "16.0.5",
|
|
96
|
+
"sass": "1.85.1",
|
|
97
|
+
"style-loader": "4.0.0"
|
|
98
|
+
}
|
|
99
99
|
}
|
package/lib/assets/crestron.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.5934 11.5633C19.4108 10.4229 17.5851 9.44735 13.9717 8.42955H13.9722C13.8487 8.39472 13.8566 8.23964 13.9833 8.21735C14.0147 8.21191 14.0487 8.20558 14.0855 8.19871C14.2595 8.16626 14.4982 8.12174 14.84 8.1022C27.9265 7.34953 25.5408 17.5489 17.3014 17.5684C15.7747 17.5716 14.0534 17.4616 12.9242 16.187C12.8286 16.0788 12.9725 15.9372 13.0788 16.0343C14.9812 17.7625 20.1667 17.1171 21.3368 15.2964C22.2901 13.8115 21.6999 12.6312 20.5934 11.5633ZM25.8905 11.2872C26 11.3406 26.1236 11.4084 26.2508 11.4975L26.2512 11.4989C30.2602 14.3285 27.6438 16.6915 23.7773 17.8834V17.8852C23.7195 17.9014 23.6615 17.9186 23.6032 17.9358L23.6022 17.9361C23.589 17.94 23.5759 17.9439 23.5627 17.9478L23.5419 17.9539C19.9141 19.014 15.0503 19.1761 12.6284 17.8894C12.6284 17.8894 12.1121 17.5802 11.9059 17.3968C11.1217 16.6993 10.4066 15.7999 12.0104 14.6247C12.127 14.5393 12.2551 14.6981 12.1469 14.7947C10.8723 15.9272 12.3535 17.3745 14.7221 17.8829C15.5063 18.051 16.5283 18.1169 17.5428 18.0087C17.8776 17.9735 18.1971 17.9307 18.5012 17.882H18.5137C20.9839 17.4827 22.473 16.6729 23.5642 15.7577C24.8736 14.6586 25.5724 13.3701 25.467 11.27C25.4624 11.1799 25.5394 11.1279 25.6212 11.1655C25.647 11.1774 25.6757 11.19 25.7071 11.2038C25.7614 11.2276 25.8233 11.2548 25.8905 11.2872ZM3.34008 12.1588C6.84248 11.0453 9.39209 10.7087 11.9143 10.7482C14.2749 10.7849 16.636 11.1192 18.7004 12.3273C21.0025 13.6743 19.8041 16.2992 15.8128 16.289C15.6665 16.289 15.6609 16.4993 15.8072 16.5067C18.4422 16.6335 19.4976 15.9291 20.2777 15.221C22.3862 13.3057 19.2594 10.783 15.3614 9.58689C11.3631 8.35969 6.16085 8.34808 3.45663 11.5482C3.36701 11.6545 3.31315 11.7479 3.27647 11.8296C3.25423 11.8786 3.23919 11.9223 3.2261 11.9603C3.21923 11.9802 3.2129 11.9985 3.20636 12.0153C3.16875 12.1114 3.24304 12.1899 3.34055 12.1588H3.34008ZM12.2203 11.9816C9.15574 12.3071 7.4266 13.2028 6.19892 14.2331V14.2322C5.07294 15.1762 4.39874 16.2608 4.29844 17.8799L4.29241 17.8836H4.29844C4.28219 18.1451 4.28126 18.4237 4.29612 18.7199C4.30077 18.8095 4.23205 18.8648 4.13593 18.8397C4.07789 18.8246 4.0121 18.7916 3.93645 18.7536L3.93643 18.7536L3.93636 18.7536C3.914 18.7424 3.89077 18.7307 3.86662 18.719C3.75974 18.6667 3.64629 18.5863 3.52328 18.4992L3.51234 18.4914C3.22167 18.2867 2.96583 18.0842 2.74296 17.8841C-0.173466 15.2709 2.51172 13.1211 6.22121 12.0373C10.2594 10.857 15.8281 10.7902 17.8572 12.5945C18.6414 13.2919 19.357 14.1909 17.7527 15.3661C17.6362 15.4511 17.508 15.2932 17.6162 15.1971C19.3328 13.6713 16.1629 11.5633 12.2203 11.9816ZM26.4221 17.8312C26.3738 17.846 26.326 17.8618 26.2782 17.8795H26.267C22.8445 18.9544 20.333 19.2799 17.8479 19.2418C15.6396 19.207 13.4303 18.9117 11.4634 17.8841H11.4616C11.3274 17.8135 11.1941 17.7402 11.0623 17.6631C8.76014 16.3161 9.95856 13.6913 13.9499 13.7005C14.0962 13.7015 14.1017 13.4902 13.9555 13.4832C11.3204 13.356 10.265 14.0604 9.48495 14.769C8.42211 15.7348 8.68956 16.8547 9.71618 17.8841H9.71943C10.7298 18.8926 12.471 19.8101 14.4017 20.4031C18.4 21.6307 23.6023 21.6414 26.307 18.4413C26.3966 18.3354 26.4504 18.2416 26.4871 18.1604C26.509 18.1116 26.5241 18.0681 26.5372 18.0302L26.5372 18.0302C26.5442 18.0101 26.5506 17.9916 26.5572 17.9747C26.5702 17.9412 26.5698 17.9096 26.5591 17.8846C26.5396 17.8372 26.4862 17.8117 26.4226 17.8316L26.4221 17.8312ZM9.16923 18.4263C10.3514 19.5671 12.1776 20.5422 15.791 21.5605L15.7905 21.56C15.914 21.5948 15.9061 21.7494 15.7794 21.7717C15.7478 21.7772 15.7136 21.7836 15.6765 21.7905C15.5026 21.8229 15.2641 21.8674 14.9227 21.8873C8.7713 22.2412 6.03829 20.1749 5.72534 17.8835C5.37245 15.3004 8.09478 12.4309 12.4613 12.4207C13.988 12.4174 15.7092 12.5279 16.8385 13.8021C16.9346 13.9098 16.7907 14.0519 16.6839 13.9548C14.7815 12.2271 9.59594 12.8725 8.42585 14.6931C7.63092 15.9305 7.90859 16.9571 8.66405 17.8825V17.8839C8.81449 18.0678 8.98489 18.2484 9.16923 18.4263Z" fill="#212124"/>
|
|
3
|
-
</svg>
|
package/lib/assets/ucg-fiber.png
DELETED
|
Binary file
|
package/lib/assets/udr7.png
DELETED
|
Binary file
|
package/lib/assets/ux.png
DELETED
|
Binary file
|
package/lib/assets/ux7.png
DELETED
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var reactDom = require('react-dom');
|
|
5
|
-
"use strict";
|
|
6
|
-
const BodyPortal = ({
|
|
7
|
-
isOpen,
|
|
8
|
-
children
|
|
9
|
-
}) => {
|
|
10
|
-
if (!isOpen) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return reactDom.createPortal(/* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
14
|
-
children
|
|
15
|
-
}), document.body);
|
|
16
|
-
};
|
|
17
|
-
exports.BodyPortal = BodyPortal;
|
|
18
|
-
//# sourceMappingURL=BodyPortal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BodyPortal.js","sources":["../../../src/components/BodyPortal/BodyPortal.tsx"],"sourcesContent":["import { createPortal } from \"react-dom\";\n\ninterface BodyPortalProps {\n isOpen: boolean;\n children: React.ReactNode;\n}\n\nexport const BodyPortal = ({\n isOpen,\n children,\n}: BodyPortalProps): JSX.Element | null => {\n if (!isOpen) {\n return null;\n }\n\n return createPortal(<>{children}</>, document.body);\n};\n"],"names":["BodyPortal","isOpen","children","createPortal","jsx","Fragment","document","body"],"mappings":";;;;;AAOO,MAAMA,aAAaA,CAAC;EACzBC,MAAA;EACAC;AACF,CAA2C,KAAA;EACzC,IAAI,CAACD,MAAQ,EAAA;IACJ,OAAA,IAAA;EAAA;EAGT,OAAOE,QAAAA,CAAAA,YAAa,CAAAC,eAAAA,UAAAA,CAAAA,GAAA,CAAAC,UAAA,CAAAA,QAAA,EAAA;IAAGH;GAAS,CAAA,EAAKI,SAASC,IAAI,CAAA;AACpD,CAAA;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { createPortal } from 'react-dom';
|
|
3
|
-
"use strict";
|
|
4
|
-
const BodyPortal = ({
|
|
5
|
-
isOpen,
|
|
6
|
-
children
|
|
7
|
-
}) => {
|
|
8
|
-
if (!isOpen) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return createPortal(/* @__PURE__ */jsx(Fragment, {
|
|
12
|
-
children
|
|
13
|
-
}), document.body);
|
|
14
|
-
};
|
|
15
|
-
export { BodyPortal };
|
|
16
|
-
//# sourceMappingURL=BodyPortal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BodyPortal.mjs","sources":["../../../src/components/BodyPortal/BodyPortal.tsx"],"sourcesContent":["import { createPortal } from \"react-dom\";\n\ninterface BodyPortalProps {\n isOpen: boolean;\n children: React.ReactNode;\n}\n\nexport const BodyPortal = ({\n isOpen,\n children,\n}: BodyPortalProps): JSX.Element | null => {\n if (!isOpen) {\n return null;\n }\n\n return createPortal(<>{children}</>, document.body);\n};\n"],"names":["BodyPortal","isOpen","children","createPortal","jsx","Fragment","document","body"],"mappings":";;;AAOO,MAAMA,aAAaA,CAAC;EACzBC,MAAA;EACAC;AACF,CAA2C,KAAA;EACzC,IAAI,CAACD,MAAQ,EAAA;IACJ,OAAA,IAAA;EAAA;EAGT,OAAOE,YAAa,CAAA,eAAAC,GAAA,CAAAC,QAAA,EAAA;IAAGH;GAAS,CAAA,EAAKI,SAASC,IAAI,CAAA;AACpD,CAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./BodyPortal";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var ucgFiber = require("../../../../assets/ucg-fiber.png");
|
|
7
|
-
function _interopDefault(e) {
|
|
8
|
-
return e && e.__esModule ? e : {
|
|
9
|
-
default: e
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
var ucgFiber__default = /*#__PURE__*/_interopDefault(ucgFiber);
|
|
13
|
-
Object.defineProperty(exports, "default", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return ucgFiber__default["default"];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.keys(ucgFiber).forEach(function (k) {
|
|
20
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return ucgFiber[k];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=ucg-fiber.png.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ucg-fiber.png.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|