@ubnt/store.core 9.56.0-beta.4 → 9.56.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 +5 -545
- package/lib/_virtual/_virtual_multi-entry.js +2 -15
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +0 -2
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/close2.svg +2 -3
- package/lib/assets/close3.svg +3 -2
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/phoneTouch.jpg +0 -0
- package/lib/assets/phoneTouchMax.jpg +0 -0
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- package/lib/assets/poe2.svg +2 -3
- package/lib/assets/poe3.svg +3 -2
- package/lib/assets/port.svg +2 -4
- package/lib/assets/port2.svg +4 -2
- package/lib/assets/ucgMax.jpg +0 -0
- package/lib/assets/ucgMax2.jpg +0 -0
- package/lib/assets/ucgUltra.jpg +0 -0
- package/lib/assets/ucgUltra2.jpg +0 -0
- package/lib/components/BackInStock/BackInStock.types.d.ts +0 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.d.ts +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js +4 -16
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs +5 -17
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +1 -5
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js +17 -82
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs +17 -82
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.types.d.ts +0 -4
- package/lib/components/Explore/ExploreData.js +12 -12
- package/lib/components/Explore/ExploreData.js.map +1 -1
- package/lib/components/Explore/ExploreData.mjs +12 -12
- package/lib/components/Explore/ExploreData.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +3 -3
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/ImageCarousel/ImageCarousel.js +0 -4
- package/lib/components/ImageCarousel/ImageCarousel.js.map +1 -1
- package/lib/components/ImageCarousel/ImageCarousel.mjs +0 -4
- package/lib/components/ImageCarousel/ImageCarousel.mjs.map +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +1 -3
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/{crestron.svg.js → PhoneSystem/phoneTouch.jpg.js} +6 -6
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouch.jpg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouch.jpg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouch.jpg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouchMax.jpg.js +27 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouchMax.jpg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouchMax.jpg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/PhoneSystem/phoneTouchMax.jpg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/poe.svg.js +1 -1
- package/lib/components/ModelCompareV3/assets/poe.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/port.svg.js +1 -1
- package/lib/components/ModelCompareV3/assets/port.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js +2 -3
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs +2 -3
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/PhoneSystem.js +6 -3
- package/lib/components/ModelCompareV3/data/PhoneSystem.js.map +1 -1
- package/lib/components/ModelCompareV3/data/PhoneSystem.mjs +6 -3
- package/lib/components/ModelCompareV3/data/PhoneSystem.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js +3 -10
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs +3 -10
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.js +2 -3
- package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.mjs +2 -3
- package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aiLpr.js +7 -1
- package/lib/components/ModelCompareV3/data/products/aiLpr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aiLpr.mjs +7 -1
- package/lib/components/ModelCompareV3/data/products/aiLpr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js +2 -4
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.js +3 -3
- package/lib/components/ModelCompareV3/data/products/express.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/express.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchEnterprise.js +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchEnterprise.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchPro.js +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchPro.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchWall.js +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchWall.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g3TouchWall.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/g3TouchWall.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.js +0 -7
- package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js +1 -3
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs +1 -3
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/phoneTouch.js +104 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouch.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs +96 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js +104 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs +96 -0
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/professionalHd24.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +1 -10
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +1 -10
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.js +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +41 -5
- package/lib/components/ModelCompareV3/data/products/udr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +21 -5
- package/lib/components/ModelCompareV3/data/products/udr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/properties/index.js +0 -4
- package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs +0 -2
- package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/powerMethodPoe.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/powerMethodPoe.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/readerPowerMethod.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/readerPowerMethod.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs +1 -1
- package/lib/components/ModelCompareV3/data/property-sets/phoneSystem.js +3 -2
- package/lib/components/ModelCompareV3/data/property-sets/phoneSystem.js.map +1 -1
- package/lib/components/ModelCompareV3/data/property-sets/phoneSystem.mjs +3 -2
- package/lib/components/ModelCompareV3/data/property-sets/phoneSystem.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.js +44 -46
- package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.mjs +44 -46
- package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.js +30 -32
- package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.mjs +30 -32
- package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.js +23 -25
- package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.mjs +23 -25
- package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.js +19 -21
- package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.mjs +19 -21
- package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.js +18 -20
- package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.mjs +18 -20
- package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.js +17 -19
- package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.mjs +17 -19
- package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.js +29 -31
- package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.mjs +29 -31
- package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js +17 -19
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +17 -19
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +30 -32
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +30 -32
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +43 -45
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +43 -45
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.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/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/poe.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/poe.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/proStoreCategories/mapping/index.d.ts +2 -2
- package/lib/constants/proStoreCategories/mapping/index.js +46 -31
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +44 -30
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.js +3 -18
- package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.mjs +3 -18
- package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +9 -7
- package/lib/constants/proStoreCategories/mapping/unifi.js +9 -7
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +9 -7
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +2 -2
- package/lib/constants/proStoreCategories/translations/en.json.mjs +2 -2
- package/lib/constants/proStoreCategories/translations/es.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +2 -2
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +2 -2
- package/lib/constants/proStoreCategories/translations/it.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +2 -5
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +3 -5
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +2 -2
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +2 -2
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +2 -2
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +2 -2
- package/lib/constants/proStoreFilters/mapping.d.ts +1 -17
- package/lib/constants/proStoreFilters/mapping.js +0 -16
- package/lib/constants/proStoreFilters/mapping.js.map +1 -1
- package/lib/constants/proStoreFilters/mapping.mjs +0 -16
- package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/presets.d.ts +1 -1
- package/lib/contexts/MenuContext/presets.js +2 -4
- package/lib/contexts/MenuContext/presets.js.map +1 -1
- package/lib/contexts/MenuContext/presets.mjs +2 -4
- package/lib/contexts/MenuContext/presets.mjs.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/helpers/index.js +0 -11
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +0 -1
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/types/generated.d.ts +1 -1
- package/lib/types/generated.js.map +1 -1
- package/lib/types/generated.mjs.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +0 -1
- package/lib/types/index.mjs.map +1 -1
- package/lib/utils/address.d.ts +62 -278
- package/lib/utils/address.js +8 -11
- package/lib/utils/address.js.map +1 -1
- package/lib/utils/address.mjs +8 -11
- package/lib/utils/address.mjs.map +1 -1
- package/lib/utils/array.d.ts +0 -4
- package/lib/utils/array.js +0 -10
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +1 -10
- package/lib/utils/array.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/assets/crestron.svg +0 -3
- package/lib/components/ModelCompareV3/assets/crestron.svg.js.map +0 -1
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs +0 -3
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js +0 -18
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs +0 -10
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/highPerformanceSpeaker.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/properties/highPerformanceSpeaker.js +0 -18
- package/lib/components/ModelCompareV3/data/properties/highPerformanceSpeaker.js.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/highPerformanceSpeaker.mjs +0 -10
- package/lib/components/ModelCompareV3/data/properties/highPerformanceSpeaker.mjs.map +0 -1
- package/lib/helpers/product.d.ts +0 -87
- package/lib/helpers/product.js +0 -346
- package/lib/helpers/product.js.map +0 -1
- package/lib/helpers/product.mjs +0 -335
- package/lib/helpers/product.mjs.map +0 -1
- package/lib/helpers/product.test.d.ts +0 -1
- package/lib/types/product.d.ts +0 -87
- package/lib/types/product.js +0 -14
- package/lib/types/product.js.map +0 -1
- package/lib/types/product.mjs +0 -13
- package/lib/types/product.mjs.map +0 -1
- package/lib/utils/productSort.d.ts +0 -41
- package/lib/utils/productSort.js +0 -67
- package/lib/utils/productSort.js.map +0 -1
- package/lib/utils/productSort.mjs +0 -60
- package/lib/utils/productSort.mjs.map +0 -1
- package/lib/utils/validations/lastNameSuperRefinement.d.ts +0 -11
- package/lib/utils/validations/lastNameSuperRefinement.js +0 -25
- package/lib/utils/validations/lastNameSuperRefinement.js.map +0 -1
- package/lib/utils/validations/lastNameSuperRefinement.mjs +0 -21
- package/lib/utils/validations/lastNameSuperRefinement.mjs.map +0 -1
package/lib/utils/productSort.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('../types/index.js');
|
|
4
|
-
var array = require('./array.js');
|
|
5
|
-
var product$1 = require('./product.js');
|
|
6
|
-
var product = require('../types/product.js');
|
|
7
|
-
"use strict";
|
|
8
|
-
var Sort = /* @__PURE__ */(Sort2 => {
|
|
9
|
-
Sort2["HighestPrice"] = "highest-price";
|
|
10
|
-
Sort2["LowestPrice"] = "lowest-price";
|
|
11
|
-
Sort2["Availability"] = "availability";
|
|
12
|
-
return Sort2;
|
|
13
|
-
})(Sort || {});
|
|
14
|
-
var SortOrder = /* @__PURE__ */(SortOrder2 => {
|
|
15
|
-
SortOrder2["Asc"] = "Asc";
|
|
16
|
-
SortOrder2["Desc"] = "Desc";
|
|
17
|
-
return SortOrder2;
|
|
18
|
-
})(SortOrder || {});
|
|
19
|
-
const sortedStatusesByPriorityAsc = [product.DisplayProductStatus.Unavailable, product.DisplayProductStatus.ComingSoon, product.DisplayProductStatus.SoldOut, product.DisplayProductStatus.RegionNotAvailable, product.DisplayProductStatus.Backorder, product.DisplayProductStatus.Available];
|
|
20
|
-
const getProductStatusPriority = product$1 => {
|
|
21
|
-
let sortStatus = product$1.status;
|
|
22
|
-
if (product$1.variants.some(variant => variant.availableInOtherStores.length) || product$1.linkedProducts && product$1.linkedProducts.some(linkedProduct => linkedProduct.status === product.DisplayProductStatus.Available)) {
|
|
23
|
-
sortStatus = product.DisplayProductStatus.Available;
|
|
24
|
-
}
|
|
25
|
-
return sortedStatusesByPriorityAsc.indexOf(sortStatus);
|
|
26
|
-
};
|
|
27
|
-
const sortByAvailabilityDesc = (current, next) => {
|
|
28
|
-
return array.normalizeSortResult(getProductStatusPriority(next) - getProductStatusPriority(current));
|
|
29
|
-
};
|
|
30
|
-
const sortByPrice = order => (current, next) => {
|
|
31
|
-
const currentProductPrice = current.minDisplayPrice.amount;
|
|
32
|
-
const nextProductPrice = next.minDisplayPrice.amount;
|
|
33
|
-
if (order === "Desc" /* Desc */) {
|
|
34
|
-
return nextProductPrice - currentProductPrice;
|
|
35
|
-
} else {
|
|
36
|
-
return currentProductPrice - nextProductPrice;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const sortProducts = (currentSort, storeId, sortByWeightTag = true) => (current, next) => {
|
|
40
|
-
switch (currentSort) {
|
|
41
|
-
// Sort by price
|
|
42
|
-
case "highest-price" /* HighestPrice */:
|
|
43
|
-
case "lowest-price" /* LowestPrice */:
|
|
44
|
-
{
|
|
45
|
-
return sortByPrice(currentSort === "highest-price" /* HighestPrice */ ? "Desc" /* Desc */ : "Asc" /* Asc */)(current, next);
|
|
46
|
-
}
|
|
47
|
-
case "availability" /* Availability */:
|
|
48
|
-
{
|
|
49
|
-
return sortByAvailabilityDesc(current, next);
|
|
50
|
-
}
|
|
51
|
-
default:
|
|
52
|
-
{
|
|
53
|
-
const sorts = [sortByAvailabilityDesc];
|
|
54
|
-
if (sortByWeightTag) {
|
|
55
|
-
sorts.push(product$1.sortByTagWeight(product$1.SortSiteId.Store, storeId));
|
|
56
|
-
}
|
|
57
|
-
return array.combineSorts(sorts)(current, next);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.Sort = Sort;
|
|
62
|
-
exports.SortOrder = SortOrder;
|
|
63
|
-
exports.sortByAvailabilityDesc = sortByAvailabilityDesc;
|
|
64
|
-
exports.sortByPrice = sortByPrice;
|
|
65
|
-
exports.sortProducts = sortProducts;
|
|
66
|
-
exports.sortedStatusesByPriorityAsc = sortedStatusesByPriorityAsc;
|
|
67
|
-
//# sourceMappingURL=productSort.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"productSort.js","sources":["../../src/utils/productSort.ts"],"sourcesContent":["import type {\n Nullish,\n StorefrontProduct,\n StoreId,\n UnionToAllPossibleTuples,\n} from \"../types\";\nimport { DisplayProductStatus } from \"../types\";\nimport { combineSorts, normalizeSortResult } from \"./array\";\nimport { sortByTagWeight, SortSiteId } from \"./product\";\n\n/**\n * Narrow MinimalProProductFragment type even more to the union of fields that are needed to sort product\n */\ntype ProductMinFieldsForSorting = Pick<\n StorefrontProduct,\n \"status\" | \"tags\" | \"minDisplayPrice\"\n> & {\n variants: {\n // We only need bare minimum from array to compare array length\n // FIXME: move it to backend as a boolean field so we don't need to fetch entire array to reduce it to a boolean ourselves\n availableInOtherStores: Array<{ __typename: string }>;\n }[];\n linkedProducts?: {\n status: StorefrontProduct[\"status\"];\n }[];\n};\n\nexport enum Sort {\n HighestPrice = \"highest-price\",\n LowestPrice = \"lowest-price\",\n Availability = \"availability\",\n}\n\nexport enum SortOrder {\n Asc = \"Asc\",\n Desc = \"Desc\",\n}\n\n/**\n * Variants statuses sorted in ascending order from least preferable to most, so if some new status comes in, then the\n * lookup for `.indexOf()` would return `-1`, thus being \"worse\" then DisplayProductStatus.SoldOut and moved to the very\n * back of list\n */\nexport const sortedStatusesByPriorityAsc: UnionToAllPossibleTuples<DisplayProductStatus> =\n [\n DisplayProductStatus.Unavailable,\n DisplayProductStatus.ComingSoon,\n DisplayProductStatus.SoldOut,\n DisplayProductStatus.RegionNotAvailable,\n DisplayProductStatus.Backorder,\n DisplayProductStatus.Available,\n ];\n/**\n * Due to currently variant status being nullable for historical reasons we need to have a fallback state\n * TODO: remove once display status is StorefrontProductVariant.status is non-nullable\n */\nconst getProductStatusPriority = (\n product: ProductMinFieldsForSorting,\n): number => {\n let sortStatus = product.status;\n\n // Virtually set sort status as available if it has alternative stores\n if (\n product.variants.some((variant) => variant.availableInOtherStores.length) ||\n (product.linkedProducts &&\n product.linkedProducts.some(\n (linkedProduct) =>\n linkedProduct.status === DisplayProductStatus.Available,\n ))\n ) {\n sortStatus = DisplayProductStatus.Available;\n }\n\n return sortedStatusesByPriorityAsc.indexOf(sortStatus);\n};\n\nexport const sortByAvailabilityDesc = (\n current: ProductMinFieldsForSorting,\n next: ProductMinFieldsForSorting,\n): number => {\n return normalizeSortResult(\n getProductStatusPriority(next) - getProductStatusPriority(current),\n );\n};\n\nexport const sortByPrice =\n (order: SortOrder) =>\n (\n current: ProductMinFieldsForSorting,\n next: ProductMinFieldsForSorting,\n ): number => {\n const currentProductPrice = current.minDisplayPrice.amount;\n\n const nextProductPrice = next.minDisplayPrice.amount;\n\n if (order === SortOrder.Desc) {\n return nextProductPrice - currentProductPrice;\n } else {\n return currentProductPrice - nextProductPrice;\n }\n };\n\n/**\n * Sorts products based on the given sort type.\n * @param currentSort - sort type\n * @param sortByWeightTag - if false, then sort by weight tag is\n * ignored (e.g. for `Related Add-ons` where\n * we don't want to sort by weight tag)\n */\nexport const sortProducts =\n (\n currentSort: Nullish<string | Sort>,\n storeId?: StoreId,\n sortByWeightTag = true,\n ) =>\n (current: ProductMinFieldsForSorting, next: ProductMinFieldsForSorting) => {\n switch (currentSort) {\n // Sort by price\n case Sort.HighestPrice:\n case Sort.LowestPrice: {\n return sortByPrice(\n currentSort === Sort.HighestPrice ? SortOrder.Desc : SortOrder.Asc,\n )(current, next);\n }\n\n case Sort.Availability: {\n return sortByAvailabilityDesc(current, next);\n }\n\n default: {\n const sorts = [sortByAvailabilityDesc];\n\n // Add sorting by tag weight\n if (sortByWeightTag) {\n sorts.push(sortByTagWeight(SortSiteId.Store, storeId));\n }\n\n // Do additional sorting by tag weight only after initial sorting resulting in \"same group\"\n return combineSorts(sorts)(current, next);\n }\n }\n };\n"],"names":["Sort","SortOrder","sortedStatusesByPriorityAsc","DisplayProductStatus","Unavailable","ComingSoon","SoldOut","RegionNotAvailable","Backorder","Available","getProductStatusPriority","product","sortStatus","status","variants","some","variant","availableInOtherStores","length","linkedProducts","linkedProduct","indexOf","sortByAvailabilityDesc","current","next","normalizeSortResult","sortByPrice","order","currentProductPrice","minDisplayPrice","amount","nextProductPrice","sortProducts","currentSort","storeId","sortByWeightTag","sorts","push","sortByTagWeight","SortSiteId","Store","combineSorts"],"mappings":";;;;;;;AA2BY,IAAAA,IAAA,GAAA,gBAAAA,KAAL,IAAA;EACLA,MAAA,cAAe,CAAA,GAAA,eAAA;EACfA,MAAA,aAAc,CAAA,GAAA,cAAA;EACdA,MAAA,cAAe,CAAA,GAAA,cAAA;EAHLA,OAAAA,KAAAA;AAAA,CAAA,EAAAA,IAAA,IAAA,CAAA,CAAA,CAAA;AAMA,IAAAC,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,KAAM,CAAA,GAAA,KAAA;EACNA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;AAUL,MAAMC,2BACX,GAAA,CACEC,OAAAA,CAAAA,oBAAqB,CAAAC,WAAA,EACrBD,OAAAA,CAAAA,oBAAqB,CAAAE,UAAA,EACrBF,OAAAA,CAAAA,oBAAqB,CAAAG,OAAA,EACrBH,OAAAA,CAAAA,oBAAqB,CAAAI,kBAAA,EACrBJ,OAAAA,CAAAA,oBAAqB,CAAAK,SAAA,EACrBL,OAAAA,CAAAA,oBAAqB,CAAAM,SAAA,CACvB;AAKF,MAAMC,wBAAA,GACJC,SACW,IAAA;EACX,IAAIC,aAAaD,SAAQ,CAAAE,MAAA;EAGzB,IACEF,SAAQ,CAAAG,QAAA,CAASC,IAAK,CAACC,OAAY,IAAAA,OAAA,CAAQC,sBAAuB,CAAAC,MAAM,CACvE,IAAAP,SAAA,CAAQQ,cACP,IAAAR,SAAA,CAAQQ,cAAe,CAAAJ,IAAA,CACpBK,aAAA,IACCA,aAAc,CAAAP,MAAA,KAAWV,OAAqB,CAAAA,oBAAA,CAAAM,SAAA,CAEpD,EAAA;IACAG,UAAA,GAAaT,OAAqB,CAAAA,oBAAA,CAAAM,SAAA;EACpC;EAEO,OAAAP,2BAAA,CAA4BmB,QAAQT,UAAU,CAAA;AACvD,CAAA;AAEa,MAAAU,sBAAA,GAAyBA,CACpCC,OAAA,EACAC,IACW,KAAA;EACJ,OAAAC,KAAA,CAAAA,mBAAA,CACLf,wBAAyB,CAAAc,IAAI,CAAI,GAAAd,wBAAA,CAAyBa,OAAO,CAAA,CACnE;AACF,CAAA;AAEO,MAAMG,WACX,GAACC,KACD,IAAA,CACEJ,SACAC,IACW,KAAA;EACL,MAAAI,mBAAA,GAAsBL,QAAQM,eAAgB,CAAAC,MAAA;EAE9C,MAAAC,gBAAA,GAAmBP,KAAKK,eAAgB,CAAAC,MAAA;EAE9C,IAAIH,UAAU,MAAgB,CAAA,YAAA;IAC5B,OAAOI,gBAAmB,GAAAH,mBAAA;EAAA,CACrB,MAAA;IACL,OAAOA,mBAAsB,GAAAG,gBAAA;EAC/B;AACF,CAAA;AASW,MAAAC,YAAA,GACXA,CACEC,WACA,EAAAC,OAAA,EACAC,kBAAkB,IAEpB,KAAA,CAACZ,SAAqCC,IAAqC,KAAA;EACzE,QAAQS,WAAa;IAAA;IAEnB,KAAK,eAAA,CAAA;IACL,KAAK,cAAkB,CAAA;MAAA;QACd,OAAAP,WAAA,CACLO,WAAA,KAAgB,gBAAoB,qBAAA,MAAiB,cAAA,KAAA,CAAA,SAAA,CACvD,CAAEV,SAASC,IAAI,CAAA;MACjB;IAEA,KAAK,cAAmB,CAAA;MAAA;QACf,OAAAF,sBAAA,CAAuBC,SAASC,IAAI,CAAA;MAC7C;IAEA;MAAS;QACD,MAAAY,KAAA,GAAQ,CAACd,sBAAsB,CAAA;QAGrC,IAAIa,eAAiB,EAAA;UACnBC,KAAA,CAAMC,IAAK,CAAAC,SAAA,CAAAA,eAAA,CAAgBC,SAAW,CAAAA,UAAA,CAAAC,KAAA,EAAON,OAAO,CAAC,CAAA;QACvD;QAGA,OAAOO,KAAa,CAAAA,YAAA,CAAAL,KAAK,CAAE,CAAAb,OAAA,EAASC,IAAI,CAAA;MAC1C;EACF;AACF,CAAA;;;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import '../types/index.mjs';
|
|
2
|
-
import { normalizeSortResult, combineSorts } from './array.mjs';
|
|
3
|
-
import { sortByTagWeight, SortSiteId } from './product.mjs';
|
|
4
|
-
import { DisplayProductStatus } from '../types/product.mjs';
|
|
5
|
-
"use strict";
|
|
6
|
-
var Sort = /* @__PURE__ */(Sort2 => {
|
|
7
|
-
Sort2["HighestPrice"] = "highest-price";
|
|
8
|
-
Sort2["LowestPrice"] = "lowest-price";
|
|
9
|
-
Sort2["Availability"] = "availability";
|
|
10
|
-
return Sort2;
|
|
11
|
-
})(Sort || {});
|
|
12
|
-
var SortOrder = /* @__PURE__ */(SortOrder2 => {
|
|
13
|
-
SortOrder2["Asc"] = "Asc";
|
|
14
|
-
SortOrder2["Desc"] = "Desc";
|
|
15
|
-
return SortOrder2;
|
|
16
|
-
})(SortOrder || {});
|
|
17
|
-
const sortedStatusesByPriorityAsc = [DisplayProductStatus.Unavailable, DisplayProductStatus.ComingSoon, DisplayProductStatus.SoldOut, DisplayProductStatus.RegionNotAvailable, DisplayProductStatus.Backorder, DisplayProductStatus.Available];
|
|
18
|
-
const getProductStatusPriority = product => {
|
|
19
|
-
let sortStatus = product.status;
|
|
20
|
-
if (product.variants.some(variant => variant.availableInOtherStores.length) || product.linkedProducts && product.linkedProducts.some(linkedProduct => linkedProduct.status === DisplayProductStatus.Available)) {
|
|
21
|
-
sortStatus = DisplayProductStatus.Available;
|
|
22
|
-
}
|
|
23
|
-
return sortedStatusesByPriorityAsc.indexOf(sortStatus);
|
|
24
|
-
};
|
|
25
|
-
const sortByAvailabilityDesc = (current, next) => {
|
|
26
|
-
return normalizeSortResult(getProductStatusPriority(next) - getProductStatusPriority(current));
|
|
27
|
-
};
|
|
28
|
-
const sortByPrice = order => (current, next) => {
|
|
29
|
-
const currentProductPrice = current.minDisplayPrice.amount;
|
|
30
|
-
const nextProductPrice = next.minDisplayPrice.amount;
|
|
31
|
-
if (order === "Desc" /* Desc */) {
|
|
32
|
-
return nextProductPrice - currentProductPrice;
|
|
33
|
-
} else {
|
|
34
|
-
return currentProductPrice - nextProductPrice;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const sortProducts = (currentSort, storeId, sortByWeightTag = true) => (current, next) => {
|
|
38
|
-
switch (currentSort) {
|
|
39
|
-
// Sort by price
|
|
40
|
-
case "highest-price" /* HighestPrice */:
|
|
41
|
-
case "lowest-price" /* LowestPrice */:
|
|
42
|
-
{
|
|
43
|
-
return sortByPrice(currentSort === "highest-price" /* HighestPrice */ ? "Desc" /* Desc */ : "Asc" /* Asc */)(current, next);
|
|
44
|
-
}
|
|
45
|
-
case "availability" /* Availability */:
|
|
46
|
-
{
|
|
47
|
-
return sortByAvailabilityDesc(current, next);
|
|
48
|
-
}
|
|
49
|
-
default:
|
|
50
|
-
{
|
|
51
|
-
const sorts = [sortByAvailabilityDesc];
|
|
52
|
-
if (sortByWeightTag) {
|
|
53
|
-
sorts.push(sortByTagWeight(SortSiteId.Store, storeId));
|
|
54
|
-
}
|
|
55
|
-
return combineSorts(sorts)(current, next);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export { Sort, SortOrder, sortByAvailabilityDesc, sortByPrice, sortProducts, sortedStatusesByPriorityAsc };
|
|
60
|
-
//# sourceMappingURL=productSort.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"productSort.mjs","sources":["../../src/utils/productSort.ts"],"sourcesContent":["import type {\n Nullish,\n StorefrontProduct,\n StoreId,\n UnionToAllPossibleTuples,\n} from \"../types\";\nimport { DisplayProductStatus } from \"../types\";\nimport { combineSorts, normalizeSortResult } from \"./array\";\nimport { sortByTagWeight, SortSiteId } from \"./product\";\n\n/**\n * Narrow MinimalProProductFragment type even more to the union of fields that are needed to sort product\n */\ntype ProductMinFieldsForSorting = Pick<\n StorefrontProduct,\n \"status\" | \"tags\" | \"minDisplayPrice\"\n> & {\n variants: {\n // We only need bare minimum from array to compare array length\n // FIXME: move it to backend as a boolean field so we don't need to fetch entire array to reduce it to a boolean ourselves\n availableInOtherStores: Array<{ __typename: string }>;\n }[];\n linkedProducts?: {\n status: StorefrontProduct[\"status\"];\n }[];\n};\n\nexport enum Sort {\n HighestPrice = \"highest-price\",\n LowestPrice = \"lowest-price\",\n Availability = \"availability\",\n}\n\nexport enum SortOrder {\n Asc = \"Asc\",\n Desc = \"Desc\",\n}\n\n/**\n * Variants statuses sorted in ascending order from least preferable to most, so if some new status comes in, then the\n * lookup for `.indexOf()` would return `-1`, thus being \"worse\" then DisplayProductStatus.SoldOut and moved to the very\n * back of list\n */\nexport const sortedStatusesByPriorityAsc: UnionToAllPossibleTuples<DisplayProductStatus> =\n [\n DisplayProductStatus.Unavailable,\n DisplayProductStatus.ComingSoon,\n DisplayProductStatus.SoldOut,\n DisplayProductStatus.RegionNotAvailable,\n DisplayProductStatus.Backorder,\n DisplayProductStatus.Available,\n ];\n/**\n * Due to currently variant status being nullable for historical reasons we need to have a fallback state\n * TODO: remove once display status is StorefrontProductVariant.status is non-nullable\n */\nconst getProductStatusPriority = (\n product: ProductMinFieldsForSorting,\n): number => {\n let sortStatus = product.status;\n\n // Virtually set sort status as available if it has alternative stores\n if (\n product.variants.some((variant) => variant.availableInOtherStores.length) ||\n (product.linkedProducts &&\n product.linkedProducts.some(\n (linkedProduct) =>\n linkedProduct.status === DisplayProductStatus.Available,\n ))\n ) {\n sortStatus = DisplayProductStatus.Available;\n }\n\n return sortedStatusesByPriorityAsc.indexOf(sortStatus);\n};\n\nexport const sortByAvailabilityDesc = (\n current: ProductMinFieldsForSorting,\n next: ProductMinFieldsForSorting,\n): number => {\n return normalizeSortResult(\n getProductStatusPriority(next) - getProductStatusPriority(current),\n );\n};\n\nexport const sortByPrice =\n (order: SortOrder) =>\n (\n current: ProductMinFieldsForSorting,\n next: ProductMinFieldsForSorting,\n ): number => {\n const currentProductPrice = current.minDisplayPrice.amount;\n\n const nextProductPrice = next.minDisplayPrice.amount;\n\n if (order === SortOrder.Desc) {\n return nextProductPrice - currentProductPrice;\n } else {\n return currentProductPrice - nextProductPrice;\n }\n };\n\n/**\n * Sorts products based on the given sort type.\n * @param currentSort - sort type\n * @param sortByWeightTag - if false, then sort by weight tag is\n * ignored (e.g. for `Related Add-ons` where\n * we don't want to sort by weight tag)\n */\nexport const sortProducts =\n (\n currentSort: Nullish<string | Sort>,\n storeId?: StoreId,\n sortByWeightTag = true,\n ) =>\n (current: ProductMinFieldsForSorting, next: ProductMinFieldsForSorting) => {\n switch (currentSort) {\n // Sort by price\n case Sort.HighestPrice:\n case Sort.LowestPrice: {\n return sortByPrice(\n currentSort === Sort.HighestPrice ? SortOrder.Desc : SortOrder.Asc,\n )(current, next);\n }\n\n case Sort.Availability: {\n return sortByAvailabilityDesc(current, next);\n }\n\n default: {\n const sorts = [sortByAvailabilityDesc];\n\n // Add sorting by tag weight\n if (sortByWeightTag) {\n sorts.push(sortByTagWeight(SortSiteId.Store, storeId));\n }\n\n // Do additional sorting by tag weight only after initial sorting resulting in \"same group\"\n return combineSorts(sorts)(current, next);\n }\n }\n };\n"],"names":["Sort","SortOrder","sortedStatusesByPriorityAsc","DisplayProductStatus","Unavailable","ComingSoon","SoldOut","RegionNotAvailable","Backorder","Available","getProductStatusPriority","product","sortStatus","status","variants","some","variant","availableInOtherStores","length","linkedProducts","linkedProduct","indexOf","sortByAvailabilityDesc","current","next","normalizeSortResult","sortByPrice","order","currentProductPrice","minDisplayPrice","amount","nextProductPrice","sortProducts","currentSort","storeId","sortByWeightTag","sorts","push","sortByTagWeight","SortSiteId","Store","combineSorts"],"mappings":";;;;;AA2BY,IAAAA,IAAA,GAAA,gBAAAA,KAAL,IAAA;EACLA,MAAA,cAAe,CAAA,GAAA,eAAA;EACfA,MAAA,aAAc,CAAA,GAAA,cAAA;EACdA,MAAA,cAAe,CAAA,GAAA,cAAA;EAHLA,OAAAA,KAAAA;AAAA,CAAA,EAAAA,IAAA,IAAA,CAAA,CAAA,CAAA;AAMA,IAAAC,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,KAAM,CAAA,GAAA,KAAA;EACNA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;AAUL,MAAMC,2BACX,GAAA,CACEC,oBAAqB,CAAAC,WAAA,EACrBD,oBAAqB,CAAAE,UAAA,EACrBF,oBAAqB,CAAAG,OAAA,EACrBH,oBAAqB,CAAAI,kBAAA,EACrBJ,oBAAqB,CAAAK,SAAA,EACrBL,oBAAqB,CAAAM,SAAA,CACvB;AAKF,MAAMC,wBAAA,GACJC,OACW,IAAA;EACX,IAAIC,aAAaD,OAAQ,CAAAE,MAAA;EAGzB,IACEF,OAAQ,CAAAG,QAAA,CAASC,IAAK,CAACC,OAAY,IAAAA,OAAA,CAAQC,sBAAuB,CAAAC,MAAM,CACvE,IAAAP,OAAA,CAAQQ,cACP,IAAAR,OAAA,CAAQQ,cAAe,CAAAJ,IAAA,CACpBK,aAAA,IACCA,aAAc,CAAAP,MAAA,KAAWV,oBAAqB,CAAAM,SAAA,CAEpD,EAAA;IACAG,UAAA,GAAaT,oBAAqB,CAAAM,SAAA;EACpC;EAEO,OAAAP,2BAAA,CAA4BmB,QAAQT,UAAU,CAAA;AACvD,CAAA;AAEa,MAAAU,sBAAA,GAAyBA,CACpCC,OAAA,EACAC,IACW,KAAA;EACJ,OAAAC,mBAAA,CACLf,wBAAyB,CAAAc,IAAI,CAAI,GAAAd,wBAAA,CAAyBa,OAAO,CAAA,CACnE;AACF,CAAA;AAEO,MAAMG,WACX,GAACC,KACD,IAAA,CACEJ,SACAC,IACW,KAAA;EACL,MAAAI,mBAAA,GAAsBL,QAAQM,eAAgB,CAAAC,MAAA;EAE9C,MAAAC,gBAAA,GAAmBP,KAAKK,eAAgB,CAAAC,MAAA;EAE9C,IAAIH,UAAU,MAAgB,CAAA,YAAA;IAC5B,OAAOI,gBAAmB,GAAAH,mBAAA;EAAA,CACrB,MAAA;IACL,OAAOA,mBAAsB,GAAAG,gBAAA;EAC/B;AACF,CAAA;AASW,MAAAC,YAAA,GACXA,CACEC,WACA,EAAAC,OAAA,EACAC,kBAAkB,IAEpB,KAAA,CAACZ,SAAqCC,IAAqC,KAAA;EACzE,QAAQS,WAAa;IAAA;IAEnB,KAAK,eAAA,CAAA;IACL,KAAK,cAAkB,CAAA;MAAA;QACd,OAAAP,WAAA,CACLO,WAAA,KAAgB,gBAAoB,qBAAA,MAAiB,cAAA,KAAA,CAAA,SAAA,CACvD,CAAEV,SAASC,IAAI,CAAA;MACjB;IAEA,KAAK,cAAmB,CAAA;MAAA;QACf,OAAAF,sBAAA,CAAuBC,SAASC,IAAI,CAAA;MAC7C;IAEA;MAAS;QACD,MAAAY,KAAA,GAAQ,CAACd,sBAAsB,CAAA;QAGrC,IAAIa,eAAiB,EAAA;UACnBC,KAAA,CAAMC,IAAK,CAAAC,eAAA,CAAgBC,UAAW,CAAAC,KAAA,EAAON,OAAO,CAAC,CAAA;QACvD;QAGA,OAAOO,YAAa,CAAAL,KAAK,CAAE,CAAAb,OAAA,EAASC,IAAI,CAAA;MAC1C;EACF;AACF,CAAA;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type SuperRefinement } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Actually it is 35, but because we need to add extra space between
|
|
4
|
-
* first_name and last_name, reduce by 1 character
|
|
5
|
-
*/
|
|
6
|
-
export declare const UPS_SHIPPING_LABEL_MAX_FULL_NAME = 34;
|
|
7
|
-
export declare const FIRST_NAME_MAX_LENGTH = 17;
|
|
8
|
-
export declare const createLastNameSuperRefinement: SuperRefinement<{
|
|
9
|
-
firstName: string;
|
|
10
|
-
lastName: string;
|
|
11
|
-
}>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var zod = require('zod');
|
|
4
|
-
"use strict";
|
|
5
|
-
const UPS_SHIPPING_LABEL_MAX_FULL_NAME = 34;
|
|
6
|
-
const FIRST_NAME_MAX_LENGTH = 17;
|
|
7
|
-
const createLastNameSuperRefinement = ({
|
|
8
|
-
firstName,
|
|
9
|
-
lastName
|
|
10
|
-
}, ctx) => {
|
|
11
|
-
const returnMaxLastNameLength = Math.max(Math.max(UPS_SHIPPING_LABEL_MAX_FULL_NAME - firstName.length, 0), FIRST_NAME_MAX_LENGTH);
|
|
12
|
-
if (lastName.length > returnMaxLastNameLength) {
|
|
13
|
-
return ctx.addIssue({
|
|
14
|
-
path: ["lastName"],
|
|
15
|
-
code: zod.ZodIssueCode.too_big,
|
|
16
|
-
type: "string",
|
|
17
|
-
maximum: returnMaxLastNameLength,
|
|
18
|
-
inclusive: true
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.FIRST_NAME_MAX_LENGTH = FIRST_NAME_MAX_LENGTH;
|
|
23
|
-
exports.UPS_SHIPPING_LABEL_MAX_FULL_NAME = UPS_SHIPPING_LABEL_MAX_FULL_NAME;
|
|
24
|
-
exports.createLastNameSuperRefinement = createLastNameSuperRefinement;
|
|
25
|
-
//# sourceMappingURL=lastNameSuperRefinement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lastNameSuperRefinement.js","sources":["../../../src/utils/validations/lastNameSuperRefinement.ts"],"sourcesContent":["import { type SuperRefinement, ZodIssueCode } from \"zod\";\n\n/**\n * Actually it is 35, but because we need to add extra space between\n * first_name and last_name, reduce by 1 character\n */\nexport const UPS_SHIPPING_LABEL_MAX_FULL_NAME = 34;\nexport const FIRST_NAME_MAX_LENGTH = 17;\n\nexport const createLastNameSuperRefinement: SuperRefinement<{\n firstName: string;\n lastName: string;\n}> = ({ firstName, lastName }, ctx) => {\n const returnMaxLastNameLength = Math.max(\n Math.max(UPS_SHIPPING_LABEL_MAX_FULL_NAME - firstName.length, 0),\n FIRST_NAME_MAX_LENGTH,\n );\n\n if (lastName.length > returnMaxLastNameLength) {\n return ctx.addIssue({\n path: [\"lastName\"],\n code: ZodIssueCode.too_big,\n type: \"string\",\n maximum: returnMaxLastNameLength,\n inclusive: true,\n });\n }\n};\n"],"names":["UPS_SHIPPING_LABEL_MAX_FULL_NAME","FIRST_NAME_MAX_LENGTH","createLastNameSuperRefinement","firstName","lastName","ctx","returnMaxLastNameLength","Math","max","length","addIssue","path","code","ZodIssueCode","too_big","type","maximum","inclusive"],"mappings":";;;;AAMO,MAAMA,gCAAmC,GAAA,EAAA;AACzC,MAAMC,qBAAwB,GAAA,EAAA;AAE9B,MAAMC,gCAGRA,CAAC;EAAEC,SAAW;EAAAC;AAAA,GAAYC,GAAQ,KAAA;EACrC,MAAMC,0BAA0BC,IAAK,CAAAC,GAAA,CACnCD,IAAK,CAAAC,GAAA,CAAIR,gCAAmC,GAAAG,SAAA,CAAUM,QAAQ,CAAC,CAAA,EAC/DR,qBAAA,CACF;EAEI,IAAAG,QAAA,CAASK,SAASH,uBAAyB,EAAA;IAC7C,OAAOD,IAAIK,QAAS,CAAA;MAClBC,IAAA,EAAM,CAAC,UAAU,CAAA;MACjBC,MAAMC,GAAa,CAAAA,YAAA,CAAAC,OAAA;MACnBC,IAAM,EAAA,QAAA;MACNC,OAAS,EAAAV,uBAAA;MACTW,SAAW,EAAA;IAAA,CACZ,CAAA;EACH;AACF,CAAA;;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ZodIssueCode } from 'zod';
|
|
2
|
-
"use strict";
|
|
3
|
-
const UPS_SHIPPING_LABEL_MAX_FULL_NAME = 34;
|
|
4
|
-
const FIRST_NAME_MAX_LENGTH = 17;
|
|
5
|
-
const createLastNameSuperRefinement = ({
|
|
6
|
-
firstName,
|
|
7
|
-
lastName
|
|
8
|
-
}, ctx) => {
|
|
9
|
-
const returnMaxLastNameLength = Math.max(Math.max(UPS_SHIPPING_LABEL_MAX_FULL_NAME - firstName.length, 0), FIRST_NAME_MAX_LENGTH);
|
|
10
|
-
if (lastName.length > returnMaxLastNameLength) {
|
|
11
|
-
return ctx.addIssue({
|
|
12
|
-
path: ["lastName"],
|
|
13
|
-
code: ZodIssueCode.too_big,
|
|
14
|
-
type: "string",
|
|
15
|
-
maximum: returnMaxLastNameLength,
|
|
16
|
-
inclusive: true
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export { FIRST_NAME_MAX_LENGTH, UPS_SHIPPING_LABEL_MAX_FULL_NAME, createLastNameSuperRefinement };
|
|
21
|
-
//# sourceMappingURL=lastNameSuperRefinement.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lastNameSuperRefinement.mjs","sources":["../../../src/utils/validations/lastNameSuperRefinement.ts"],"sourcesContent":["import { type SuperRefinement, ZodIssueCode } from \"zod\";\n\n/**\n * Actually it is 35, but because we need to add extra space between\n * first_name and last_name, reduce by 1 character\n */\nexport const UPS_SHIPPING_LABEL_MAX_FULL_NAME = 34;\nexport const FIRST_NAME_MAX_LENGTH = 17;\n\nexport const createLastNameSuperRefinement: SuperRefinement<{\n firstName: string;\n lastName: string;\n}> = ({ firstName, lastName }, ctx) => {\n const returnMaxLastNameLength = Math.max(\n Math.max(UPS_SHIPPING_LABEL_MAX_FULL_NAME - firstName.length, 0),\n FIRST_NAME_MAX_LENGTH,\n );\n\n if (lastName.length > returnMaxLastNameLength) {\n return ctx.addIssue({\n path: [\"lastName\"],\n code: ZodIssueCode.too_big,\n type: \"string\",\n maximum: returnMaxLastNameLength,\n inclusive: true,\n });\n }\n};\n"],"names":["UPS_SHIPPING_LABEL_MAX_FULL_NAME","FIRST_NAME_MAX_LENGTH","createLastNameSuperRefinement","firstName","lastName","ctx","returnMaxLastNameLength","Math","max","length","addIssue","path","code","ZodIssueCode","too_big","type","maximum","inclusive"],"mappings":";;AAMO,MAAMA,gCAAmC,GAAA,EAAA;AACzC,MAAMC,qBAAwB,GAAA,EAAA;AAE9B,MAAMC,gCAGRA,CAAC;EAAEC,SAAW;EAAAC;AAAA,GAAYC,GAAQ,KAAA;EACrC,MAAMC,0BAA0BC,IAAK,CAAAC,GAAA,CACnCD,IAAK,CAAAC,GAAA,CAAIR,gCAAmC,GAAAG,SAAA,CAAUM,QAAQ,CAAC,CAAA,EAC/DR,qBAAA,CACF;EAEI,IAAAG,QAAA,CAASK,SAASH,uBAAyB,EAAA;IAC7C,OAAOD,IAAIK,QAAS,CAAA;MAClBC,IAAA,EAAM,CAAC,UAAU,CAAA;MACjBC,MAAMC,YAAa,CAAAC,OAAA;MACnBC,IAAM,EAAA,QAAA;MACNC,OAAS,EAAAV,uBAAA;MACTW,SAAW,EAAA;IAAA,CACZ,CAAA;EACH;AACF,CAAA;"}
|