@ubnt/store.core 9.4.0 → 9.5.0-money.4
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 +4 -0
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/icons/wizard/plus.svg.js +1 -1
- package/lib/assets/icons/wizard/plus.svg.mjs +2 -2
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/plus.svg +22 -4
- package/lib/assets/plus2.svg +4 -22
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.js +1 -1
- package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/plus.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/plus.svg.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.d.ts +3 -0
- package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/ProductWizard/ProductWizard.js +1 -1
- package/lib/components/ProductWizard/ProductWizard.mjs +1 -1
- package/lib/components/QuantityInput/QuantityInput.js +1 -1
- package/lib/components/QuantityInput/QuantityInput.mjs +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/utils/money/allocators/fixedAmount.d.ts +26 -0
- package/lib/utils/money/allocators/fixedAmount.js +55 -0
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -0
- package/lib/utils/money/allocators/fixedAmount.mjs +53 -0
- package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -0
- package/lib/utils/money/allocators/index.d.ts +1 -0
- package/lib/utils/money/allocators/index.js +6 -0
- package/lib/utils/money/allocators/index.js.map +1 -0
- package/lib/utils/money/allocators/index.mjs +3 -0
- package/lib/utils/money/allocators/index.mjs.map +1 -0
- package/lib/utils/money/constants.d.ts +56 -25
- package/lib/utils/money/constants.js +72 -7
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +70 -7
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/exchangeRate.d.ts +31 -0
- package/lib/utils/money/exchangeRate.js +27 -0
- package/lib/utils/money/exchangeRate.js.map +1 -0
- package/lib/utils/money/exchangeRate.mjs +23 -0
- package/lib/utils/money/exchangeRate.mjs.map +1 -0
- package/lib/utils/money/format.d.ts +10 -5
- package/lib/utils/money/format.js +22 -14
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +23 -16
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +4 -1
- package/lib/utils/money/index.js +26 -8
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +8 -4
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/misc.d.ts +68 -28
- package/lib/utils/money/misc.js +35 -64
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs +32 -43
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/money/misc.private.d.ts +23 -0
- package/lib/utils/money/misc.private.js +46 -0
- package/lib/utils/money/misc.private.js.map +1 -0
- package/lib/utils/money/misc.private.mjs +21 -0
- package/lib/utils/money/misc.private.mjs.map +1 -0
- package/lib/utils/money/shipping.d.ts +5 -0
- package/lib/utils/money/shipping.js +8 -0
- package/lib/utils/money/shipping.js.map +1 -0
- package/lib/utils/money/shipping.mjs +6 -0
- package/lib/utils/money/shipping.mjs.map +1 -0
- package/lib/utils/money/tax.d.ts +38 -2
- package/lib/utils/money/tax.js +46 -10
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +42 -11
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/tax.private.d.ts +17 -0
- package/lib/utils/money/tax.private.js +65 -0
- package/lib/utils/money/tax.private.js.map +1 -0
- package/lib/utils/money/tax.private.mjs +60 -0
- package/lib/utils/money/tax.private.mjs.map +1 -0
- package/lib/utils/money/types.d.ts +64 -3
- package/lib/utils/number.d.ts +1 -1
- package/lib/utils/number.js +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/tax/index.d.ts +1 -1
- package/lib/utils/tax/index.js +8 -1
- package/lib/utils/tax/index.js.map +1 -1
- package/lib/utils/tax/index.mjs +8 -1
- package/lib/utils/tax/index.mjs.map +1 -1
- package/lib/utils/tax/types.d.ts +2 -1
- package/lib/utils/tax/types.js +1 -0
- package/lib/utils/tax/types.js.map +1 -1
- package/lib/utils/tax/types.mjs +1 -0
- package/lib/utils/tax/types.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/utils/validations.d.ts +0 -15
- package/lib/utils/validations.js +0 -23
- package/lib/utils/validations.js.map +0 -1
- package/lib/utils/validations.mjs +0 -21
- package/lib/utils/validations.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LandingPagePro.mjs","sources":["../../../src/components/LandingPagePro/LandingPagePro.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport { Currency, StoreId } from \"../../types\";\nimport { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { maximumPriceFilterLookup } from \"../../utils/money\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\nexport const LandingPagePro = ({\n storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware &&\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) =>\n innerItem?.items &&\n innerItem.items.some(\n (subItem) =>\n getCollectionSlugFromPath(subItem.path) ===\n product.defaultCollectionSlug ||\n getCollectionSlugFromPath(subItem.path) ===\n product.organizationalCollectionSlug,\n ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug ||\n item.items.some(\n (subItem) =>\n getCollectionSlugFromPath(subItem.path) ===\n product.defaultCollectionSlug ||\n getCollectionSlugFromPath(subItem.path) ===\n product.organizationalCollectionSlug,\n ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n storeId,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["LandingPagePro","storeId","StoreId","Us","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","Amplifi","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","getCollectionSlugFromPath","path","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","subItem","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","maximumPriceFilterLookup","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoDO,MAAMA,iBAAiBA,CAAC;EAC7BC,UAAUC,OAAQ,CAAAC,EAAA;EAClBC,YAAA;EACAC,gBAAA;EACAC,WAAA;EACAC,WAAA;EACAC;AACF,CAA2B,KAAA;EACnB,MAAA;IAAEC;GAAW,GAAIC,OAAQ,EAAA;EAE/B,MAAMC,YAAe,GAAAC,OAAA,CACnB,MAAM,CAAC,CAACN,WAAY,CAAAO,WAAA,EACpB,CAACP,YAAYO,WAAW,CAAA,CAC1B;EAEM,MAAAC,UAAA,GAAoDF,QAAQ,MAAM;IAChE,MAAAG,QAAA,GACJX,aAAaY,gBAAiB,CAAAC,UAAA,KAAe,UACzCR,UAAW,CAAAS,OAAA,CAAQC,KACnB,GAAAV,UAAA,CAAWW,SAAU,C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MAAQ,EAAA;OAAI,CAE5B,GAAA,eAAAP,GAAA,CAACQ,iBAAmB,EAAA;QAAA,GAAGtH;QAAaC;MAA0B,CAAA,CAAA,EAAA,eAEhE6G,GAAA,CAACS,WAAA,EAAA;QACE,GAAGxH,gBAAA;QACJkC,QAAA;QACAoE,UAAA;QACApG,WAAA;QACAuH,cAAcA,CAAA,KAAM;UACJnE,YAAA,EAAAoE,QAAA,CAAS,CAAA,CAAE,CAAA;QAC3B,CAAA;QACAT,SAAW,EAAAV,oBAAA;QACXG;MAAA,CACF,CAAA;KACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"LandingPagePro.mjs","sources":["../../../src/components/LandingPagePro/LandingPagePro.tsx"],"sourcesContent":["import { AED, CAD, EUR } from \"@dinero.js/currencies\";\nimport { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport { Currency, StoreId } from \"../../types\";\nimport { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\n/**\n * Mapping of maximum price filter\n */\nconst maximumPriceFilterLookup = new Map([\n [CAD.code, 70000],\n [EUR.code, 70000],\n [AED.code, 70000],\n]);\n\n/**\n * @deprecated This component is deprecated and will be removed in the future.\n */\nexport const LandingPagePro = ({\n storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware &&\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) =>\n innerItem?.items &&\n innerItem.items.some(\n (subItem) =>\n getCollectionSlugFromPath(subItem.path) ===\n product.defaultCollectionSlug ||\n getCollectionSlugFromPath(subItem.path) ===\n product.organizationalCollectionSlug,\n ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug ||\n item.items.some(\n (subItem) =>\n getCollectionSlugFromPath(subItem.path) ===\n product.defaultCollectionSlug ||\n getCollectionSlugFromPath(subItem.path) ===\n product.organizationalCollectionSlug,\n ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n storeId,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["maximumPriceFilterLookup","Map","CAD","code","EUR","AED","LandingPagePro","storeId","StoreId","Us","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","Amplifi","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","getCollectionSlugFromPath","path","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","subItem","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,wBAAA,GAAA,mBAA+BC,GAAI,CAAA,CACvC,CAACC,GAAI,CAAAC,IAAA,EAAM,GAAK,CAAA,EAChB,CAACC,GAAI,CAAAD,IAAA,EAAM,GAAK,CAAA,EAChB,CAACE,GAAI,CAAAF,IAAA,EAAM,GAAK,CAAA,CACjB,CAAA;AAKM,MAAMG,iBAAiBA,CAAC;EAC7BC,UAAUC,OAAQ,CAAAC,EAAA;EAClBC,YAAA;EACAC,gBAAA;EACAC,WAAA;EACAC,WAAA;EACAC;AACF,CAA2B,KAAA;EACnB,MAAA;IAAEC;GAAW,GAAIC,OAAQ,EAAA;EAE/B,MAAMC,YAAe,GAAAC,OAAA,CACnB,MAAM,CAAC,CAACN,WAAY,CAAAO,WAAA,EACpB,CAACP,YAAYO,WAAW,CAAA,CAC1B;EAEM,MAAAC,UAAA,GAAoDF,QAAQ,MAAM;IAChE,MAAAG,QAAA,GACJX,aAAaY,gBAAiB,CAAAC,UAAA,KAAe,UACzCR,UAAW,CAAAS,OAAA,CAAQC,KACnB,GAAAV,UAAA,CAAWW,SAAU,CAAAD,KAAA;IAC3B,MAAMA,QAAQJ,QACX,CAAAM,MAAA,CACEC,QACCA,IAAK,CAAAC,EAAA,KAAOC,iBAAiBC,aAC7B,IAAAH,IAAA,CAAKC,OAAOC,gBAAiB,CAAAE,YAAA;IAAA;AAAA;A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AA;QACAmE,UAAA;QACAnG,WAAA;QACAsH,cAAcA,CAAA,KAAM;UACJnE,YAAA,EAAAoE,QAAA,CAAS,CAAA,CAAE,CAAA;QAC3B,CAAA;QACAT,SAAW,EAAAV,oBAAA;QACXG;MAAA,CACF,CAAA;KACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -10,7 +10,7 @@ var ProductWizard_styles = require('./ProductWizard.styles.js');
|
|
|
10
10
|
var Options = require('./Options/Options.js');
|
|
11
11
|
var NormalisedImage = require('../NormalisedImage/NormalisedImage.js');
|
|
12
12
|
var minus = require("../../assets/minus.svg");
|
|
13
|
-
var plus = require("../../assets/
|
|
13
|
+
var plus = require("../../assets/plus.svg");
|
|
14
14
|
var ProductWizardFootnotes = require('../ProductWizardFootnotes/ProductWizardFootnotes.js');
|
|
15
15
|
function _interopDefault(e) {
|
|
16
16
|
return e && e.__esModule ? e : {
|
|
@@ -8,7 +8,7 @@ import { WizardContainer, AddToCartContainer, QuantityAdjustWrap, MinusAdjustBut
|
|
|
8
8
|
import { ProductWizardOptions } from './Options/Options.mjs';
|
|
9
9
|
import { NormalisedImage } from '../NormalisedImage/NormalisedImage.mjs';
|
|
10
10
|
import minus__default from "../../assets/minus.svg";
|
|
11
|
-
import plus__default from "../../assets/
|
|
11
|
+
import plus__default from "../../assets/plus.svg";
|
|
12
12
|
import { ProductWizardFootnotes } from '../ProductWizardFootnotes/ProductWizardFootnotes.mjs';
|
|
13
13
|
"use strict";
|
|
14
14
|
const ProductWizard = function ProductWizard2({
|
|
@@ -6,7 +6,7 @@ require('../StyleableSvgImage/index.js');
|
|
|
6
6
|
var QuantityInput_styles = require('./QuantityInput.styles.js');
|
|
7
7
|
var StyleableSvgImage = require('../StyleableSvgImage/StyleableSvgImage.js');
|
|
8
8
|
var minus = require("../../assets/minus.svg");
|
|
9
|
-
var plus = require("../../assets/
|
|
9
|
+
var plus = require("../../assets/plus.svg");
|
|
10
10
|
function _interopDefault(e) {
|
|
11
11
|
return e && e.__esModule ? e : {
|
|
12
12
|
default: e
|
|
@@ -4,7 +4,7 @@ import '../StyleableSvgImage/index.mjs';
|
|
|
4
4
|
import { Container, Label, QuantityAdjustWrap, MinusAdjustButton, QuantityInput as QuantityInput$1, PlusAdjustButton } from './QuantityInput.styles.mjs';
|
|
5
5
|
import { StyleableSvgImage } from '../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
6
6
|
import minus__default from "../../assets/minus.svg";
|
|
7
|
-
import plus__default from "../../assets/
|
|
7
|
+
import plus__default from "../../assets/plus.svg";
|
|
8
8
|
"use strict";
|
|
9
9
|
const QuantityInput = ({
|
|
10
10
|
quantity,
|
|
@@ -12,7 +12,7 @@ require('./assets/attention.svg.js');
|
|
|
12
12
|
var InputCard_styles = require('./InputCard.styles.js');
|
|
13
13
|
require('./InputSections/index.js');
|
|
14
14
|
var CustomImage = require('../../../../CustomImage/CustomImage.js');
|
|
15
|
-
var attentionIcon = require("../../../../../assets/
|
|
15
|
+
var attentionIcon = require("../../../../../assets/attention.svg");
|
|
16
16
|
var OptionSelectSection = require('./InputSections/OptionSelectSection.js');
|
|
17
17
|
var SliderSection = require('./InputSections/SliderSection.js');
|
|
18
18
|
var CounterSection = require('./InputSections/CounterSection.js');
|
|
@@ -10,7 +10,7 @@ import './assets/attention.svg.mjs';
|
|
|
10
10
|
import { Card, Header, HeaderHeadingSection, HeadingIcon, HeadingTitle, HeaderActionSection, SubduedInfo, OverlayFilter, NotAvailableNoteWrap, NotAvailableNoteIcon, InputBody, InputSectionSpacing, Footer, FooterContent, FooterNote } from './InputCard.styles.mjs';
|
|
11
11
|
import './InputSections/index.mjs';
|
|
12
12
|
import { CustomImage } from '../../../../CustomImage/CustomImage.mjs';
|
|
13
|
-
import attentionIcon__default from "../../../../../assets/
|
|
13
|
+
import attentionIcon__default from "../../../../../assets/attention.svg";
|
|
14
14
|
import { OptionSelectSection } from './InputSections/OptionSelectSection.mjs';
|
|
15
15
|
import { SliderSection } from './InputSections/SliderSection.mjs';
|
|
16
16
|
import { CounterSection } from './InputSections/CounterSection.mjs';
|
|
@@ -11,8 +11,8 @@ require('../assets/plus.svg.js');
|
|
|
11
11
|
var Layout_styles = require('./Layout.styles.js');
|
|
12
12
|
var CustomImage = require('../../../../../CustomImage/CustomImage.js');
|
|
13
13
|
var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
|
|
14
|
-
var MinusIcon = require("../../../../../../assets/
|
|
15
|
-
var PlusIcon = require("../../../../../../assets/
|
|
14
|
+
var MinusIcon = require("../../../../../../assets/minus4.svg");
|
|
15
|
+
var PlusIcon = require("../../../../../../assets/plus5.svg");
|
|
16
16
|
function _interopDefault(e) {
|
|
17
17
|
return e && e.__esModule ? e : {
|
|
18
18
|
default: e
|
|
@@ -9,8 +9,8 @@ import '../assets/plus.svg.mjs';
|
|
|
9
9
|
import { InputWrapper, Label, InputFlexWrapper } from './Layout.styles.mjs';
|
|
10
10
|
import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
|
|
11
11
|
import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
12
|
-
import MinusIcon__default from "../../../../../../assets/
|
|
13
|
-
import PlusIcon__default from "../../../../../../assets/
|
|
12
|
+
import MinusIcon__default from "../../../../../../assets/minus4.svg";
|
|
13
|
+
import PlusIcon__default from "../../../../../../assets/plus5.svg";
|
|
14
14
|
"use strict";
|
|
15
15
|
const CounterSection = ({
|
|
16
16
|
value,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var attentionIcon = require("../../../../../../assets/
|
|
6
|
+
var attentionIcon = require("../../../../../../assets/attention.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/attention.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/attention.svg";
|
|
3
3
|
//# sourceMappingURL=attention.svg.mjs.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var MinusIcon = require("../../../../../../assets/
|
|
6
|
+
var MinusIcon = require("../../../../../../assets/minus4.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/minus4.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/minus4.svg";
|
|
3
3
|
//# sourceMappingURL=minus.svg.mjs.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var PlusIcon = require("../../../../../../assets/
|
|
6
|
+
var PlusIcon = require("../../../../../../assets/plus5.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/plus5.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/plus5.svg";
|
|
3
3
|
//# sourceMappingURL=plus.svg.mjs.map
|
|
@@ -6,7 +6,7 @@ var asset = require('../../../../../utils/asset.js');
|
|
|
6
6
|
require('./assets/attention.svg.js');
|
|
7
7
|
var Part = require('./Part.js');
|
|
8
8
|
var ProgressBarChart_styles = require('./ProgressBarChart.styles.js');
|
|
9
|
-
var attentionIcon = require("../../../../../assets/
|
|
9
|
+
var attentionIcon = require("../../../../../assets/attention2.svg");
|
|
10
10
|
function _interopDefault(e) {
|
|
11
11
|
return e && e.__esModule ? e : {
|
|
12
12
|
default: e
|
|
@@ -4,7 +4,7 @@ import { imageSrc } from '../../../../../utils/asset.mjs';
|
|
|
4
4
|
import './assets/attention.svg.mjs';
|
|
5
5
|
import { PART_GAP_PX, PART_WIDTH_PX, Part } from './Part.mjs';
|
|
6
6
|
import { ProgressBarChartContainer, ProgressBarChartHeader, ProgressBarChartTitle, ProgressBarWrapper, ProgressBarPartsContainer, ProgressBarAttentionLabel, ProgressBarAttentionLabelIcon } from './ProgressBarChart.styles.mjs';
|
|
7
|
-
import attentionIcon__default from "../../../../../assets/
|
|
7
|
+
import attentionIcon__default from "../../../../../assets/attention2.svg";
|
|
8
8
|
"use strict";
|
|
9
9
|
const ProgressBarChart = ({
|
|
10
10
|
title,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var attentionIcon = require("../../../../../../assets/
|
|
6
|
+
var attentionIcon = require("../../../../../../assets/attention2.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/attention2.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/attention2.svg";
|
|
3
3
|
//# sourceMappingURL=attention.svg.mjs.map
|
|
@@ -19,8 +19,8 @@ var ComputeResourceCalculator_types = require('../../../../ComputeResourceCalcul
|
|
|
19
19
|
var CustomImage = require('../../../../../CustomImage/CustomImage.js');
|
|
20
20
|
var SearchIcon = require("../../../../../../assets/search2.svg");
|
|
21
21
|
var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
|
|
22
|
-
var MinusIcon = require("../../../../../../assets/
|
|
23
|
-
var PlusIcon = require("../../../../../../assets/
|
|
22
|
+
var MinusIcon = require("../../../../../../assets/minus5.svg");
|
|
23
|
+
var PlusIcon = require("../../../../../../assets/plus6.svg");
|
|
24
24
|
function _interopDefault(e) {
|
|
25
25
|
return e && e.__esModule ? e : {
|
|
26
26
|
default: e
|
|
@@ -17,8 +17,8 @@ import { isMessageFormatted } from '../../../../ComputeResourceCalculator/Comput
|
|
|
17
17
|
import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
|
|
18
18
|
import SearchIcon__default from "../../../../../../assets/search2.svg";
|
|
19
19
|
import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
20
|
-
import MinusIcon__default from "../../../../../../assets/
|
|
21
|
-
import PlusIcon__default from "../../../../../../assets/
|
|
20
|
+
import MinusIcon__default from "../../../../../../assets/minus5.svg";
|
|
21
|
+
import PlusIcon__default from "../../../../../../assets/plus6.svg";
|
|
22
22
|
"use strict";
|
|
23
23
|
const PoeConsumerSelectModal = ({
|
|
24
24
|
isOpen,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var MinusIcon = require("../../../../../../assets/
|
|
6
|
+
var MinusIcon = require("../../../../../../assets/minus5.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/minus5.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/minus5.svg";
|
|
3
3
|
//# sourceMappingURL=minus.svg.mjs.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var PlusIcon = require("../../../../../../assets/
|
|
6
|
+
var PlusIcon = require("../../../../../../assets/plus6.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../../../assets/
|
|
2
|
-
export { default } from "../../../../../../assets/
|
|
1
|
+
export * from "../../../../../../assets/plus6.svg";
|
|
2
|
+
export { default } from "../../../../../../assets/plus6.svg";
|
|
3
3
|
//# sourceMappingURL=plus.svg.mjs.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Currency } from "../../../types";
|
|
2
|
+
import type { Cents, Dino, DinoCurrency } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Helper class to distribute a fixed amount (e.g. discount) between multiple items.
|
|
5
|
+
* For example when trying to apply 5$ discount to 3 items, we need to distribute it evenly as possible
|
|
6
|
+
*/
|
|
7
|
+
export declare class FixedAmountAllocator {
|
|
8
|
+
/**
|
|
9
|
+
* How much we have left to allocate for given allocation from the remaining total
|
|
10
|
+
*/
|
|
11
|
+
remainingAllocationAmount: Dino;
|
|
12
|
+
/**
|
|
13
|
+
* How much we have left to allocate in total
|
|
14
|
+
*/
|
|
15
|
+
remainingTotalAmount: Dino;
|
|
16
|
+
currency: DinoCurrency;
|
|
17
|
+
constructor({ initialAllocateAmount, initialTotalAmount, currency, }: {
|
|
18
|
+
initialAllocateAmount: Cents;
|
|
19
|
+
initialTotalAmount: Cents;
|
|
20
|
+
currency: Currency;
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* We always allocate biggest share to first item
|
|
24
|
+
*/
|
|
25
|
+
allocate(lineItemTotal: Cents, currency: Currency): Dino;
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dinero_js = require('dinero.js');
|
|
4
|
+
var errors = require('../../errors.js');
|
|
5
|
+
var misc = require('../misc.js');
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value
|
|
13
|
+
}) : obj[key] = value;
|
|
14
|
+
var __publicField = (obj, key, value) => {
|
|
15
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
class FixedAmountAllocator {
|
|
19
|
+
constructor({
|
|
20
|
+
initialAllocateAmount,
|
|
21
|
+
initialTotalAmount,
|
|
22
|
+
currency
|
|
23
|
+
}) {
|
|
24
|
+
/**
|
|
25
|
+
* How much we have left to allocate for given allocation from the remaining total
|
|
26
|
+
*/
|
|
27
|
+
__publicField(this, "remainingAllocationAmount");
|
|
28
|
+
/**
|
|
29
|
+
* How much we have left to allocate in total
|
|
30
|
+
*/
|
|
31
|
+
__publicField(this, "remainingTotalAmount");
|
|
32
|
+
__publicField(this, "currency");
|
|
33
|
+
this.remainingAllocationAmount = misc.getDinero(initialAllocateAmount, currency);
|
|
34
|
+
this.remainingTotalAmount = misc.getDinero(initialTotalAmount, currency);
|
|
35
|
+
this.currency = misc.getDineroCurrency(currency);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* We always allocate biggest share to first item
|
|
39
|
+
*/
|
|
40
|
+
allocate(lineItemTotal, currency) {
|
|
41
|
+
errors.assert(this.currency.code === currency, `Currency mismatch, expected ${currency}, got ${this.currency.code}`);
|
|
42
|
+
const lineItemTotalDinero = misc.getDinero(lineItemTotal, currency);
|
|
43
|
+
if (lineItemTotal === 0) {
|
|
44
|
+
return lineItemTotalDinero;
|
|
45
|
+
}
|
|
46
|
+
const [allocationAmount, remainingAllocationAmount] = dinero_js.allocate(this.remainingAllocationAmount, [lineItemTotal, Math.max(misc.amount(this.remainingTotalAmount) - lineItemTotal, 0)]);
|
|
47
|
+
errors.assert(!!allocationAmount, "Allocation amount is zero");
|
|
48
|
+
errors.assert(!!remainingAllocationAmount, "Remaining allocation remainder is zero");
|
|
49
|
+
this.remainingAllocationAmount = remainingAllocationAmount;
|
|
50
|
+
this.remainingTotalAmount = dinero_js.subtract(this.remainingTotalAmount, lineItemTotalDinero);
|
|
51
|
+
return dinero_js.greaterThan(allocationAmount, lineItemTotalDinero) ? lineItemTotalDinero : allocationAmount;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.FixedAmountAllocator = FixedAmountAllocator;
|
|
55
|
+
//# sourceMappingURL=fixedAmount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixedAmount.js","sources":["../../../../src/utils/money/allocators/fixedAmount.ts"],"sourcesContent":["import { allocate, greaterThan, subtract } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { amount, getDinero, getDineroCurrency } from \"../misc\";\nimport type { Cents, Dino, DinoCurrency } from \"../types\";\n\n/**\n * Helper class to distribute a fixed amount (e.g. discount) between multiple items.\n * For example when trying to apply 5$ discount to 3 items, we need to distribute it evenly as possible\n */\nexport class FixedAmountAllocator {\n /**\n * How much we have left to allocate for given allocation from the remaining total\n */\n public remainingAllocationAmount: Dino;\n /**\n * How much we have left to allocate in total\n */\n public remainingTotalAmount: Dino;\n public currency: DinoCurrency;\n\n constructor({\n initialAllocateAmount,\n initialTotalAmount,\n currency,\n }: {\n initialAllocateAmount: Cents;\n initialTotalAmount: Cents;\n currency: Currency;\n }) {\n this.remainingAllocationAmount = getDinero(initialAllocateAmount, currency);\n this.remainingTotalAmount = getDinero(initialTotalAmount, currency);\n this.currency = getDineroCurrency(currency);\n }\n\n /**\n * We always allocate biggest share to first item\n */\n allocate(lineItemTotal: Cents, currency: Currency): Dino {\n assert(\n this.currency.code === currency,\n `Currency mismatch, expected ${currency}, got ${this.currency.code}`,\n );\n const lineItemTotalDinero = getDinero(lineItemTotal, currency);\n /**\n * If total price of line items is zero, it means it's free, thus no discount\n * can be calculated (it's either 0 or infinity, but let's go with 0)\n */\n if (lineItemTotal === 0) {\n return lineItemTotalDinero;\n }\n\n const [allocationAmount, remainingAllocationAmount] = allocate(\n this.remainingAllocationAmount,\n [\n lineItemTotal,\n Math.max(amount(this.remainingTotalAmount) - lineItemTotal, 0),\n ],\n );\n\n assert(!!allocationAmount, \"Allocation amount is zero\");\n assert(\n !!remainingAllocationAmount,\n \"Remaining allocation remainder is zero\",\n );\n\n this.remainingAllocationAmount = remainingAllocationAmount;\n this.remainingTotalAmount = subtract(\n this.remainingTotalAmount,\n lineItemTotalDinero,\n );\n\n /**\n * The discount amount is evenly split but can still be higher than the line item total\n * Need to ceil the price to be not more than the line item total\n */\n return greaterThan(allocationAmount, lineItemTotalDinero)\n ? lineItemTotalDinero\n : allocationAmount;\n }\n}\n"],"names":["FixedAmountAllocator","constructor","initialAllocateAmount","initialTotalAmount","currency","__publicField","remainingAllocationAmount","getDinero","remainingTotalAmount","getDineroCurrency","allocate","lineItemTotal","assert","code","lineItemTotalDinero","allocationAmount","Math","max","amount","subtract","greaterThan"],"mappings":";;;;;;;;;;;;;;;;;AAWO,MAAMA,oBAAqB,CAAA;EAWhCC,WAAYA,CAAA;IACVC,qBAAA;IACAC,kBAAA;IACAC;EAAA,CAKC,EAAA;IAfH;AAAA;AAAA;IAAOC,aAAA,CAAA,IAAA,EAAA,2BAAA,CAAA;IAIP;AAAA;AAAA;IAAOA,aAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IAWA,IAAA,CAAAC,yBAAA,GAA4BC,IAAAA,CAAAA,SAAU,CAAAL,qBAAA,EAAuBE,QAAQ,CAAA;IACrE,IAAA,CAAAI,oBAAA,GAAuBD,IAAAA,CAAAA,SAAU,CAAAJ,kBAAA,EAAoBC,QAAQ,CAAA;IAC7D,IAAA,CAAAA,QAAA,GAAWK,uBAAkBL,QAAQ,CAAA;EAC5C;EAAA;AAAA;AAAA;EAKAM,QAAAA,CAASC,eAAsBP,QAA0B,EAAA;IACvDQ,MAAA,CAAAA,MAAA,CACE,IAAA,CAAKR,SAASS,IAAS,KAAAT,QAAA,EACQ,+BAAAA,QAAiB,SAAA,IAAA,CAAKA,SAASS,IAAI,EAAA,CACpE;IACM,MAAAC,mBAAA,GAAsBP,IAAAA,CAAAA,SAAU,CAAAI,aAAA,EAAeP,QAAQ,CAAA;IAK7D,IAAIO,kBAAkB,CAAG,EAAA;MAChB,OAAAG,mBAAA;IACT;IAEM,MAAA,CAACC,gBAAkB,EAAAT,yBAAyB,CAAI,GAAAI,SAAA,CAAAA,QAAA,CACpD,IAAK,CAAAJ,yBAAA,EACL,CACEK,aAAA,EACAK,KAAKC,GAAI,CAAAC,WAAA,CAAO,KAAKV,oBAAoB,CAAA,GAAIG,eAAe,CAAC,CAAA,CAC/D,CACF;IAEOC,MAAAA,CAAAA,MAAA,CAAA,CAAC,CAACG,gBAAA,EAAkB,2BAA2B,CAAA;IACtDH,MAAA,CAAAA,MAAA,CACE,CAAC,CAACN,yBAAA,EACF,wCAAA,CACF;IAEA,IAAA,CAAKA,yBAA4B,GAAAA,yBAAA;IACjC,IAAA,CAAKE,oBAAuB,GAAAW,SAAA,CAAAA,QAAA,CAC1B,IAAK,CAAAX,oBAAA,EACLM,mBAAA,CACF;IAMA,OAAOM,SAAY,CAAAA,WAAA,CAAAL,gBAAA,EAAkBD,mBAAmB,CAAA,GACpDA,mBACA,GAAAC,gBAAA;EACN;AACF;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { allocate, subtract, greaterThan } from 'dinero.js';
|
|
2
|
+
import { assert } from '../../errors.mjs';
|
|
3
|
+
import { getDinero, getDineroCurrency, amount } from '../misc.mjs';
|
|
4
|
+
"use strict";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value
|
|
11
|
+
}) : obj[key] = value;
|
|
12
|
+
var __publicField = (obj, key, value) => {
|
|
13
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
14
|
+
return value;
|
|
15
|
+
};
|
|
16
|
+
class FixedAmountAllocator {
|
|
17
|
+
constructor({
|
|
18
|
+
initialAllocateAmount,
|
|
19
|
+
initialTotalAmount,
|
|
20
|
+
currency
|
|
21
|
+
}) {
|
|
22
|
+
/**
|
|
23
|
+
* How much we have left to allocate for given allocation from the remaining total
|
|
24
|
+
*/
|
|
25
|
+
__publicField(this, "remainingAllocationAmount");
|
|
26
|
+
/**
|
|
27
|
+
* How much we have left to allocate in total
|
|
28
|
+
*/
|
|
29
|
+
__publicField(this, "remainingTotalAmount");
|
|
30
|
+
__publicField(this, "currency");
|
|
31
|
+
this.remainingAllocationAmount = getDinero(initialAllocateAmount, currency);
|
|
32
|
+
this.remainingTotalAmount = getDinero(initialTotalAmount, currency);
|
|
33
|
+
this.currency = getDineroCurrency(currency);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* We always allocate biggest share to first item
|
|
37
|
+
*/
|
|
38
|
+
allocate(lineItemTotal, currency) {
|
|
39
|
+
assert(this.currency.code === currency, `Currency mismatch, expected ${currency}, got ${this.currency.code}`);
|
|
40
|
+
const lineItemTotalDinero = getDinero(lineItemTotal, currency);
|
|
41
|
+
if (lineItemTotal === 0) {
|
|
42
|
+
return lineItemTotalDinero;
|
|
43
|
+
}
|
|
44
|
+
const [allocationAmount, remainingAllocationAmount] = allocate(this.remainingAllocationAmount, [lineItemTotal, Math.max(amount(this.remainingTotalAmount) - lineItemTotal, 0)]);
|
|
45
|
+
assert(!!allocationAmount, "Allocation amount is zero");
|
|
46
|
+
assert(!!remainingAllocationAmount, "Remaining allocation remainder is zero");
|
|
47
|
+
this.remainingAllocationAmount = remainingAllocationAmount;
|
|
48
|
+
this.remainingTotalAmount = subtract(this.remainingTotalAmount, lineItemTotalDinero);
|
|
49
|
+
return greaterThan(allocationAmount, lineItemTotalDinero) ? lineItemTotalDinero : allocationAmount;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export { FixedAmountAllocator };
|
|
53
|
+
//# sourceMappingURL=fixedAmount.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixedAmount.mjs","sources":["../../../../src/utils/money/allocators/fixedAmount.ts"],"sourcesContent":["import { allocate, greaterThan, subtract } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { amount, getDinero, getDineroCurrency } from \"../misc\";\nimport type { Cents, Dino, DinoCurrency } from \"../types\";\n\n/**\n * Helper class to distribute a fixed amount (e.g. discount) between multiple items.\n * For example when trying to apply 5$ discount to 3 items, we need to distribute it evenly as possible\n */\nexport class FixedAmountAllocator {\n /**\n * How much we have left to allocate for given allocation from the remaining total\n */\n public remainingAllocationAmount: Dino;\n /**\n * How much we have left to allocate in total\n */\n public remainingTotalAmount: Dino;\n public currency: DinoCurrency;\n\n constructor({\n initialAllocateAmount,\n initialTotalAmount,\n currency,\n }: {\n initialAllocateAmount: Cents;\n initialTotalAmount: Cents;\n currency: Currency;\n }) {\n this.remainingAllocationAmount = getDinero(initialAllocateAmount, currency);\n this.remainingTotalAmount = getDinero(initialTotalAmount, currency);\n this.currency = getDineroCurrency(currency);\n }\n\n /**\n * We always allocate biggest share to first item\n */\n allocate(lineItemTotal: Cents, currency: Currency): Dino {\n assert(\n this.currency.code === currency,\n `Currency mismatch, expected ${currency}, got ${this.currency.code}`,\n );\n const lineItemTotalDinero = getDinero(lineItemTotal, currency);\n /**\n * If total price of line items is zero, it means it's free, thus no discount\n * can be calculated (it's either 0 or infinity, but let's go with 0)\n */\n if (lineItemTotal === 0) {\n return lineItemTotalDinero;\n }\n\n const [allocationAmount, remainingAllocationAmount] = allocate(\n this.remainingAllocationAmount,\n [\n lineItemTotal,\n Math.max(amount(this.remainingTotalAmount) - lineItemTotal, 0),\n ],\n );\n\n assert(!!allocationAmount, \"Allocation amount is zero\");\n assert(\n !!remainingAllocationAmount,\n \"Remaining allocation remainder is zero\",\n );\n\n this.remainingAllocationAmount = remainingAllocationAmount;\n this.remainingTotalAmount = subtract(\n this.remainingTotalAmount,\n lineItemTotalDinero,\n );\n\n /**\n * The discount amount is evenly split but can still be higher than the line item total\n * Need to ceil the price to be not more than the line item total\n */\n return greaterThan(allocationAmount, lineItemTotalDinero)\n ? lineItemTotalDinero\n : allocationAmount;\n }\n}\n"],"names":["FixedAmountAllocator","constructor","initialAllocateAmount","initialTotalAmount","currency","__publicField","remainingAllocationAmount","getDinero","remainingTotalAmount","getDineroCurrency","allocate","lineItemTotal","assert","code","lineItemTotalDinero","allocationAmount","Math","max","amount","subtract","greaterThan"],"mappings":";;;;;;;;;;;;;;;AAWO,MAAMA,oBAAqB,CAAA;EAWhCC,WAAYA,CAAA;IACVC,qBAAA;IACAC,kBAAA;IACAC;EAAA,CAKC,EAAA;IAfH;AAAA;AAAA;IAAOC,aAAA,CAAA,IAAA,EAAA,2BAAA,CAAA;IAIP;AAAA;AAAA;IAAOA,aAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IAWA,IAAA,CAAAC,yBAAA,GAA4BC,SAAU,CAAAL,qBAAA,EAAuBE,QAAQ,CAAA;IACrE,IAAA,CAAAI,oBAAA,GAAuBD,SAAU,CAAAJ,kBAAA,EAAoBC,QAAQ,CAAA;IAC7D,IAAA,CAAAA,QAAA,GAAWK,kBAAkBL,QAAQ,CAAA;EAC5C;EAAA;AAAA;AAAA;EAKAM,QAAAA,CAASC,eAAsBP,QAA0B,EAAA;IACvDQ,MAAA,CACE,IAAA,CAAKR,SAASS,IAAS,KAAAT,QAAA,EACQ,+BAAAA,QAAiB,SAAA,IAAA,CAAKA,SAASS,IAAI,EAAA,CACpE;IACM,MAAAC,mBAAA,GAAsBP,SAAU,CAAAI,aAAA,EAAeP,QAAQ,CAAA;IAK7D,IAAIO,kBAAkB,CAAG,EAAA;MAChB,OAAAG,mBAAA;IACT;IAEM,MAAA,CAACC,gBAAkB,EAAAT,yBAAyB,CAAI,GAAAI,QAAA,CACpD,IAAK,CAAAJ,yBAAA,EACL,CACEK,aAAA,EACAK,KAAKC,GAAI,CAAAC,MAAA,CAAO,KAAKV,oBAAoB,CAAA,GAAIG,eAAe,CAAC,CAAA,CAC/D,CACF;IAEOC,MAAA,CAAA,CAAC,CAACG,gBAAA,EAAkB,2BAA2B,CAAA;IACtDH,MAAA,CACE,CAAC,CAACN,yBAAA,EACF,wCAAA,CACF;IAEA,IAAA,CAAKA,yBAA4B,GAAAA,yBAAA;IACjC,IAAA,CAAKE,oBAAuB,GAAAW,QAAA,CAC1B,IAAK,CAAAX,oBAAA,EACLM,mBAAA,CACF;IAMA,OAAOM,WAAY,CAAAL,gBAAA,EAAkBD,mBAAmB,CAAA,GACpDA,mBACA,GAAAC,gBAAA;EACN;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./fixedAmount";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|