@anker-in/headless-ui 1.3.7 → 1.3.9
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/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +5 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
- package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.d.ts +11 -0
- package/dist/cjs/biz-components/Listing/const.js +1 -1
- package/dist/cjs/biz-components/Listing/const.js.map +3 -3
- package/dist/cjs/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
- package/dist/cjs/biz-components/Listing/hooks/useComponentData.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useComponentData.js.map +7 -0
- package/dist/cjs/biz-components/index.d.ts +5 -1
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/Countdown.js +1 -1
- package/dist/cjs/components/Countdown.js.map +3 -3
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +5 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
- package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.d.ts +11 -0
- package/dist/esm/biz-components/Listing/const.js +1 -1
- package/dist/esm/biz-components/Listing/const.js.map +3 -3
- package/dist/esm/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
- package/dist/esm/biz-components/Listing/hooks/useComponentData.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useComponentData.js.map +7 -0
- package/dist/esm/biz-components/index.d.ts +5 -1
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/Countdown.js +1 -1
- package/dist/esm/components/Countdown.js.map +3 -3
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +3 -3
- package/package.json +1 -1
- package/style.css +39 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Button, Grid, GridItem, Picture, Heading } from '../../../../../components/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport type { BundleListItem, ProductVariant, ProductPrice, ProductOption } from '../../../types/product'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\nimport { gaTrack } from '../../../../../shared/track.js'\n\nconst ProductSummary = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n profile,\n addOrder,\n setAddOrder,\n } = useBizProductContext()\n\n const productSummaryData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductSummary')?.data || {}\n }, [product?.payload])\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n const finalPrice = currentProductPrice.minus(savingDetail?.coupon).minus(currentBundlePrice).toNumber()\n return parseFloat(finalPrice.toFixed(2))\n }, [currentProductVariant, checkedBundle, profile, savingDetail?.member, savingDetail?.coupon])\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n // \u6839\u636E\u6DFB\u52A0\u987A\u5E8F\u751F\u6210\u5DF2\u6DFB\u52A0\u4EA7\u54C1\u7684\u5217\u8868\n const orderedJoinedProducts = useMemo(() => {\n const result: Array<{ type: 'bundle' | 'gift' | 'exchange'; key: string }> = []\n\n // \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6DFB\u52A0\n if (addOrder) {\n addOrder.forEach((type, index) => {\n if (joinedRecommendBuyProducts[type]?.value) {\n result.push({ type, key: `${type}-${index}` })\n }\n })\n }\n\n return result\n }, [addOrder, joinedRecommendBuyProducts])\n\n const productOptionsText = useMemo(() => {\n const quantity = selectedOptions?.quantity || ''\n const color = selectedOptions?.color || selectedOptions?.colour || selectedOptions?.couleur || ''\n return `${quantity && color ? `${quantity} | ${color}` : quantity || color}`\n }, [selectedOptions?.quantity, selectedOptions?.color, selectedOptions?.colour, selectedOptions?.couleur])\n\n const variantImage = useMemo(() => {\n const variantProductSummary =\n variant?.payload?.components?.find((item: any) => item.componentKey === 'ProductSummary')?.data || {}\n const { image_1920, image_1440, image_1024, image_768, image_390 } = variantProductSummary?.thumbnail || {}\n const variantProductGalleryItemImage = variantProductSummary?.thumbnail\n ? `${image_1920} 1920, ${image_1440} 1440, ${image_1024} 1024, ${image_768} 768, ${image_390} 390`\n : variant.image?.url\n return variantProductGalleryItemImage || variant.image?.url\n }, [variant.image?.url, variant?.payload?.components])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16\">\n <div className=\"laptop:rounded-2xl bg-[#F5F5F7]\">\n <Grid className=\"tablet:p-8 tablet:!pb-0 px-4 pt-6\">\n <GridItem className=\"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4\">\n <Heading\n className=\"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]\"\n html={productSummaryData?.readyWant?.replace?.('{title}', product?.title)}\n />\n <div className=\"\">\n <Picture\n source={variantImage}\n className=\"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <ExposureDetector\n exposureKey=\"listing_selector\"\n onExposure={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: 'listing_selector',\n position: 1,\n },\n })\n }}\n >\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={product.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={productOptionsText}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {summaryFinalPrice < variant?.price?.amount && (\n <Text\n className=\"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n </ExposureDetector>\n {/* \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6E32\u67D3\u5DF2\u6DFB\u52A0\u7684\u4EA7\u54C1 */}\n {orderedJoinedProducts.map(({ type, key }) => {\n if (type === 'gift' && joinedRecommendBuyProducts?.gift?.value) {\n return (\n <ProductGiftSummary\n key={key}\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )\n }\n if (type === 'bundle' && joinedRecommendBuyProducts?.bundle?.value) {\n return (\n <ProductBundleSummary\n key={key}\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )\n }\n if (type === 'exchange' && joinedRecommendBuyProducts?.exchange?.value) {\n return (\n <ProductExchangeSummary\n key={key}\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )\n }\n return null\n })}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"laptop-md:mt-8 mt-6\">\n <Text className=\"laptop-md:text-[18px] text-sm font-bold\" html={productSummaryData?.recommendBuy} />\n <div className=\"laptop-md:gap-4 mt-4 flex flex-col gap-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'exchange'])\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'bundle'])\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'gift'])\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl text-right font-bold\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: parseFloat(finalPrice.toFixed(2)), currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"mt-4 flex justify-end gap-3\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n loading={addToCartLoading}\n className=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n loading={buyNowLoading}\n variant=\"primary\"\n className=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale) ?? []\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale) ?? []\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-4\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-1\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n )}\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel } = freeGift || {}\n const { options } = gift || {}\n\n const giftOptionsText = useMemo(() => {\n const giftColorOption = (options?.find(\n option => option.name === 'color' || option.name === 'colour' || option.name === 'couleur'\n ) || {}) as ProductOption\n const giftQuantityOption = options?.find(option => option.name === 'quantity') || ({} as ProductOption)\n const giftColorOptionText = giftColorOption ? giftColorOption.values?.[0]?.label : ''\n const giftQuantityOptionText = giftQuantityOption ? giftQuantityOption.values?.[0]?.label : ''\n return `${giftColorOptionText && giftQuantityOptionText ? giftQuantityOptionText + ' | ' + giftColorOptionText : giftQuantityOptionText || giftColorOptionText} | ${freeLabel}`\n }, [freeLabel, options])\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={gift?.product?.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={giftOptionsText}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"laptop-md:text-2xl text-base font-bold\" html={freeLabel} />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={exchange?.product?.title}\n />\n <Text className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductSummary)\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_decimal", "import_textFormat", "import_Styles", "import_track", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setSavingDetail", "addToCartLoading", "buyNowLoading", "profile", "addOrder", "setAddOrder", "productSummaryData", "
|
|
4
|
+
"sourcesContent": ["import { Text, Button, Grid, GridItem, Picture, Heading } from '../../../../../components/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useComponentData } from '../../../hooks/useComponentData.js'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport type { BundleListItem, ProductVariant, ProductPrice, ProductOption } from '../../../types/product'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\nimport { gaTrack } from '../../../../../shared/track.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nconst ProductSummary = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n profile,\n addOrder,\n setAddOrder,\n } = useBizProductContext()\n\n const productSummaryData = useComponentData('ProductSummary') ?? {}\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n const finalPrice = currentProductPrice.minus(savingDetail?.coupon).minus(currentBundlePrice).toNumber()\n return parseFloat(finalPrice.toFixed(2))\n }, [currentProductVariant, checkedBundle, profile, savingDetail?.member, savingDetail?.coupon])\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n // \u6839\u636E\u6DFB\u52A0\u987A\u5E8F\u751F\u6210\u5DF2\u6DFB\u52A0\u4EA7\u54C1\u7684\u5217\u8868\n const orderedJoinedProducts = useMemo(() => {\n const result: Array<{ type: 'bundle' | 'gift' | 'exchange'; key: string }> = []\n\n // \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6DFB\u52A0\n if (addOrder) {\n addOrder.forEach((type, index) => {\n if (joinedRecommendBuyProducts[type]?.value) {\n result.push({ type, key: `${type}-${index}` })\n }\n })\n }\n\n return result\n }, [addOrder, joinedRecommendBuyProducts])\n\n const productOptionsText = useMemo(() => {\n const quantity = selectedOptions?.quantity || ''\n const color = selectedOptions?.color || selectedOptions?.colour || selectedOptions?.couleur || ''\n return `${quantity && color ? `${quantity} | ${color}` : quantity || color}`\n }, [selectedOptions?.quantity, selectedOptions?.color, selectedOptions?.colour, selectedOptions?.couleur])\n\n const variantImage = useMemo(() => {\n const { image_1920, image_1440, image_1024, image_768, image_390 } = productSummaryData?.thumbnail || {}\n const responsiveSource = productSummaryData?.thumbnail\n ? `${image_1920} 1920, ${image_1440} 1440, ${image_1024} 1024, ${image_768} 768, ${image_390} 390`\n : variant.image?.url\n return responsiveSource || variant.image?.url\n }, [productSummaryData?.thumbnail, variant.image?.url])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16\">\n <div className=\"laptop:rounded-2xl bg-[#F5F5F7]\">\n <Grid className=\"tablet:p-8 tablet:!pb-0 px-4 pt-6\">\n <GridItem className=\"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4\">\n <Heading\n className=\"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]\"\n html={productSummaryData?.readyWant?.replace?.('{title}', product?.title)}\n />\n <div className=\"\">\n <Picture\n source={variantImage}\n className=\"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <ExposureDetector\n exposureKey=\"listing_selector\"\n onExposure={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: 'listing_selector',\n position: 1,\n },\n })\n }}\n >\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={product.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={productOptionsText}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {summaryFinalPrice < variant?.price?.amount && (\n <Text\n className=\"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n </ExposureDetector>\n {/* \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6E32\u67D3\u5DF2\u6DFB\u52A0\u7684\u4EA7\u54C1 */}\n {orderedJoinedProducts.map(({ type, key }) => {\n if (type === 'gift' && joinedRecommendBuyProducts?.gift?.value) {\n return (\n <ProductGiftSummary\n key={key}\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )\n }\n if (type === 'bundle' && joinedRecommendBuyProducts?.bundle?.value) {\n return (\n <ProductBundleSummary\n key={key}\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )\n }\n if (type === 'exchange' && joinedRecommendBuyProducts?.exchange?.value) {\n return (\n <ProductExchangeSummary\n key={key}\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )\n }\n return null\n })}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"laptop-md:mt-8 mt-6\">\n <Text className=\"laptop-md:text-[18px] text-sm font-bold\" html={productSummaryData?.recommendBuy} />\n <div className=\"laptop-md:gap-4 mt-4 flex flex-col gap-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'exchange'])\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'bundle'])\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'gift'])\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl text-right font-bold\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: parseFloat(finalPrice.toFixed(2)), currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"mt-4 flex justify-end gap-3\">\n <CartActionButtons\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart}\n buyNowText={copyWriting?.shopNow}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n addToCartClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n buyNowClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n />\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale) ?? []\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale) ?? []\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-4\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-1\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n )}\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel } = freeGift || {}\n const { options } = gift || {}\n\n const giftOptionsText = useMemo(() => {\n const giftColorOption = (options?.find(\n option => option.name === 'color' || option.name === 'colour' || option.name === 'couleur'\n ) || {}) as ProductOption\n const giftQuantityOption = options?.find(option => option.name === 'quantity') || ({} as ProductOption)\n const giftColorOptionText = giftColorOption ? giftColorOption.values?.[0]?.label : ''\n const giftQuantityOptionText = giftQuantityOption ? giftQuantityOption.values?.[0]?.label : ''\n return `${giftColorOptionText && giftQuantityOptionText ? giftQuantityOptionText + ' | ' + giftColorOptionText : giftQuantityOptionText || giftColorOptionText} | ${freeLabel}`\n }, [freeLabel, options])\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={gift?.product?.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={giftOptionsText}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"laptop-md:text-2xl text-base font-bold\" html={freeLabel} />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={exchange?.product?.title}\n />\n <Text className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductSummary)\n"],
|
|
5
|
+
"mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA6GU,IAAAI,EAAA,6BA7GVC,EAA+D,8CAC/DC,EAAqC,0CACrCC,EAAiC,8CACjCC,EAA6C,iBAC7CC,EAA4B,mCAC5BC,EAA+B,6CAE/BC,EAAoB,yBACpBC,EAAgC,wCAChCC,EAA2B,2CAC3BR,EAAiC,8CACjCS,EAA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C1CyB,EAAczB,CAAI,CACpB,EACA,UAAU,+BAET,SAAAsB,EAASxE,GAAa,OAASA,GAAa,IAC/C,GAEJ,GACF,CAEJ,EAEMuD,EAAyB,CAAC,CAC9B,kBAAA8B,EACA,SAAA7B,EACA,WAAAe,EACA,OAAAC,CACF,IAKM,CACJ,KAAM,CAAE,OAAAzE,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAChD,CAAE,2BAAAsF,CAA2B,KAAI,wBAAqB,EAE5D,SACE,QAAC,OAAI,UAAU,0CACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,OAAQ9B,GAAU,OAAO,IACzB,UAAU,wHACZ,KACA,QAAC,OAAI,UAAU,0DACb,oBAAC,QACC,UAAU,kFACV,KAAMA,GAAU,SAAS,MAC3B,KACA,OAAC,QAAK,UAAU,gFAAgF,GAClG,GACF,KACA,QAAC,OAAI,UAAU,+CACZ,WAAC,CAACA,MACD,QAAC,OAAI,UAAU,0BACb,oBAAC,QACC,UAAU,yCACV,QAAM,eAAY,CAChB,OAAQA,EAAS,YAAY,QAAU,EACvC,OAAAzD,EACA,aAAcyD,EAAS,MAAM,YAC/B,CAAC,EACH,KACA,OAAC,QACC,UAAU,qEACV,QAAM,eAAY,CAChB,OAAQA,EAAS,OAAO,QAAU,EAClC,OAAAzD,EACA,aAAcyD,EAAS,MAAM,YAC/B,CAAC,EACH,GACF,EAEDe,MACC,OAAC,UACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACbe,IAA6Bd,EAAS,OAAYhB,CAAQ,EAC1D6B,EAAkB7B,CAAQ,CAC5B,EACA,UAAU,+BAET,SAAAgB,EAASxE,GAAa,OAASA,GAAa,IAC/C,GAEJ,GACF,CAEJ,EAEA,IAAOhB,MAAQ,cAAWc,EAAc",
|
|
6
|
+
"names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_useComponentData", "import_react", "import_utils", "import_AiuiProvider", "import_decimal", "import_textFormat", "import_Styles", "import_track", "import_CartActionButtons", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setSavingDetail", "addToCartLoading", "buyNowLoading", "profile", "addOrder", "setAddOrder", "productSummaryData", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "v", "currentBundlePrice", "Decimal", "currentProductPrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "orderedJoinedProducts", "result", "type", "index", "productOptionsText", "quantity", "color", "variantImage", "image_1920", "image_1440", "image_1024", "image_768", "image_390", "key", "ProductGiftSummary", "gift", "prev", "t", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "CartActionButtons", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "setCheckedBundle", "bundleVariants", "giftOperation", "setCheckedGift", "freeLabel", "options", "giftOptionsText", "giftColorOption", "option", "giftQuantityOption", "giftColorOptionText", "giftQuantityOptionText", "exchangeOperation", "setCheckedExchangePurchase"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var E=Object.create;var s=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var j=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},N=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!_.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(n=R(e,r))||n.enumerable});return t};var q=(t,e,o)=>(o=t!=null?E(O(t)):{},N(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),z=t=>N(s({},"__esModule",{value:!0}),t);var $={};j($,{default:()=>W});module.exports=z($);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),S=require("../../../../AiuiProvider/index.js"),h=require("../../../BizProductProvider.js"),x=require("react"),i=require("../../../utils/index.js"),b=require("../../../utils/textFormat.js"),w=require("../../../hooks/useBenefits.js"),T=q(require("../../CartActionButtons/index.js"));const U=({totalSavingsSlot:t}={})=>{const{copyWriting:e,locale:o="us"}=(0,S.useAiuiContext)(),{variant:n,finalPrice:r,totalSavings:d,isLogin:u,comparePrice:P,onAddToCart:k,onBuyNow:A,savingDetail:p,addToCartLoading:B,buyNowLoading:F,discount:G,memberFunctionResult:f}=(0,h.useBizProductContext)(),M=(0,w.useBenefits)({variant:n}),{commonCoupon:c,memberDiscount:m}=M;console.log(r,"finalPrice");const L=(0,x.useMemo)(()=>(0,b.replaceTemplate)(e?.totalSavings||"",{amount:(0,i.formatPrice)({amount:d,currencyCode:n.price.currencyCode,locale:o})}),[e?.totalSavings,d,n.price.currencyCode,o]),g=(0,x.useMemo)(()=>{if(!e?.unlockedSaving)return;const C=c?.enable?Number(c?.config?.fixed_value||0):0,v=m?.enable?m.config?.amount??0:0,y=Math.round((f?.withoutCouponMaxMemberTotalSave?Math.max(v,C):v+C)*100)/100;if(!(y<=0))return(0,b.replaceTemplate)(e.unlockedSaving,{amount:(0,i.formatPrice)({amount:y,currencyCode:n.price.currencyCode,locale:o})})},[e?.unlockedSaving,c?.enable,c?.config?.fixed_value,m?.enable,m?.config?.amount,f,n.price.currencyCode,o]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[n.availableForSale?(0,a.jsxs)("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,i.formatPrice)({amount:parseFloat(r.toFixed(2)),currencyCode:n.price.currencyCode,locale:o})}),(d>0||p?.member>0&&u)&&(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,i.formatPrice)({amount:P,currencyCode:n.price.currencyCode,locale:o})}),p?.member>0&&u&&(0,a.jsx)(l.Text,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(d>0||p?.member>0&&u?(0,a.jsx)(l.Text,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${L}`}):g?(0,a.jsx)(l.Text,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:g}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(T.default,{availableForSale:n.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:B,buyNowLoading:F,onAddToCart:k,onBuyNow:A})})]})};var W=U;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text,
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_textFormat", "import_useBenefits", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "discount", "memberFunctionResult", "benefits", "commonCoupon", "memberDiscount", "totalSavingsText", "unlockedSavingText", "couponSaving", "memberSaving", "totalUnlocked"]
|
|
4
|
+
"sourcesContent": ["import { Text, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo, type ReactNode } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nexport interface ProductActionsProps {\n /** \u81EA\u5B9A\u4E49\u603B\u8282\u7701\u7EC4\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 totalSavings \u663E\u793A */\n totalSavingsSlot?: ReactNode\n}\n\nconst ProductActions = ({ totalSavingsSlot }: ProductActionsProps = {}) => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n discount,\n memberFunctionResult,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n console.log(finalPrice, 'finalPrice')\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const unlockedSavingText = useMemo(() => {\n if (!copyWriting?.unlockedSaving) return undefined\n\n const couponSaving = commonCoupon?.enable ? Number(commonCoupon?.config?.fixed_value || 0) : 0\n const memberSaving = memberDiscount?.enable ? (memberDiscount.config?.amount ?? 0) : 0\n\n // \u4E0D\u53EF\u53E0\u52A0\u65F6\u53D6\u4F1A\u5458\u4EF7\u4E0E code \u6298\u6263\u7684\u6700\u5927\u503C\uFF0C\u53EF\u53E0\u52A0\u65F6\u53D6\u4E8C\u8005\u4E4B\u548C\n const totalUnlocked = Math.round((\n memberFunctionResult?.withoutCouponMaxMemberTotalSave\n ? Math.max(memberSaving, couponSaving)\n : memberSaving + couponSaving\n ) * 100) / 100\n\n if (totalUnlocked <= 0) return undefined\n\n return replaceTemplate(copyWriting.unlockedSaving, {\n amount: formatPrice({\n amount: totalUnlocked,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })\n }, [\n copyWriting?.unlockedSaving,\n commonCoupon?.enable,\n commonCoupon?.config?.fixed_value,\n memberDiscount?.enable,\n memberDiscount?.config?.amount,\n memberFunctionResult,\n variant.price.currencyCode,\n locale,\n ])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4\"\n className=\"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"laptop-md:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: parseFloat(finalPrice.toFixed(2)),\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {totalSavingsSlot ||\n (totalSavings > 0 || (savingDetail?.member > 0 && isLogin) ? (\n <Text\n className=\"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n ) : unlockedSavingText ? (\n <Text\n className=\"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={unlockedSavingText}\n />\n ) : null)}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <CartActionButtons\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart ?? 'Add to Cart'}\n buyNowText={copyWriting?.buyNow ?? 'Buy Now'}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n />\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgFU,IAAAI,EAAA,6BAhFVC,EAAgC,8CAChCC,EAA+B,6CAC/BC,EAAqC,0CACrCC,EAAwC,iBACxCC,EAA4B,mCAC5BC,EAAgC,wCAChCC,EAA4B,yCAC5BC,EAA8B,+CAO9B,MAAMC,EAAiB,CAAC,CAAE,iBAAAC,CAAiB,EAAyB,CAAC,IAAM,CACzE,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CAC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,yFACV,QAAM,eAAY,CAChB,OAAQ,WAAWC,EAAW,QAAQ,CAAC,CAAC,EACxC,aAAcD,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GACEG,EAAe,GAAMK,GAAc,OAAS,GAAKJ,OACjD,OAAC,QACC,UAAU,qHACV,QAAM,eAAY,CAChB,OAAQC,EACR,aAAcJ,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,EAEDQ,GAAc,OAAS,GAAKJ,MAC3B,OAAC,QACC,UAAU,gEACV,KAAML,GAAa,aAAe,eACpC,GAEJ,EACCD,IACEK,EAAe,GAAMK,GAAc,OAAS,GAAKJ,KAChD,OAAC,QACC,UAAU,4HACV,KAAM,GAAGY,CAAgB,GAC3B,EACEC,KACF,OAAC,QACC,UAAU,oIACV,KAAMA,EACR,EACE,OACR,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMlB,GAAa,SAAW,WAAY,KAEnG,OAAC,OAAI,UAAU,2CACb,mBAAC,EAAAsB,QAAA,CACC,iBAAkBpB,EAAQ,iBAC1B,cAAeF,GAAa,WAAa,cACzC,WAAYA,GAAa,QAAU,UACnC,iBAAkBU,EAClB,cAAeC,EACf,YAAaJ,EACb,SAAUC,EACZ,EACF,GACF,CAEJ,EAEA,IAAOrB,EAAQW",
|
|
6
|
+
"names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_textFormat", "import_useBenefits", "import_CartActionButtons", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "discount", "memberFunctionResult", "benefits", "commonCoupon", "memberDiscount", "totalSavingsText", "unlockedSavingText", "couponSaving", "memberSaving", "totalUnlocked", "CartActionButtons"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var b=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},m=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!g.call(t,o)&&o!==r&&p(t,o,{get:()=>e[o],enumerable:!(l=v(e,o))||l.enumerable});return t};var P=(t,e,r)=>(r=t!=null?b(N(t)):{},m(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),y=t=>m(p({},"__esModule",{value:!0}),t);var C={};w(C,{default:()=>B});module.exports=y(C);var a=require("react/jsx-runtime"),i=require("../../../../components/index.js"),n=require("../index.js"),c=require("../../BizProductProvider.js"),u=require("../../hooks/useComponentData.js"),s=P(require("./ScrollSpyNav/index.js")),f=require("../../../../shared/Styles.js");const x=({onSpyNavItemClick:t,totalSavingsSlot:e,actionsSlot:r})=>{const{product:l,renderRating:o}=(0,c.useBizProductContext)(),d=(0,u.useComponentData)("PurchaseBar")??[];return(0,a.jsxs)("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[(0,a.jsx)(i.Container,{children:(0,a.jsxs)("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[(0,a.jsxs)("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[(0,a.jsx)(i.Heading,{size:2,className:"line-clamp-2 text-wrap",html:l?.title}),(0,a.jsx)("div",{className:"laptop-md:block mt-3 hidden",children:(0,a.jsx)(s.default,{tabs:d,className:"",renderRating:o,onSpyNavItemClick:t})})]}),(0,a.jsx)("div",{className:"laptop-md:block hidden shrink-0",children:r??(0,a.jsx)(n.ProductActions,{totalSavingsSlot:e})})]})}),(0,a.jsxs)(i.Container,{className:"laptop-md:hidden relative",children:[(0,a.jsx)("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),(0,a.jsx)(s.default,{tabs:d,renderRating:o,onSpyNavItemClick:t})]})]})};var B=(0,f.withLayout)(x);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "
|
|
4
|
+
"sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiBU,IAAAI,EAAA,6BAjBVC,EAAmC,2CAEnCC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAiC,2CACjCC,EAAyB,sCACzBC,EAA2B,wCAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,KAAI,wBAAqB,EAEjDC,KAAkB,oBAAiB,aAAa,GAAK,CAAC,EAE5D,SACE,QAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,oBAAC,aACC,oBAAC,OAAI,UAAU,4GACb,qBAAC,OAAI,UAAU,oDACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,yBAAyB,KAAMF,GAAS,MAAO,KAC3E,OAAC,OAAI,UAAU,8BACb,mBAAC,EAAAG,QAAA,CACC,KAAMD,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,KACA,OAAC,OAAI,UAAU,kCACZ,SAAAE,MAAe,OAAC,kBAAe,iBAAkBD,EAAkB,EACtE,GACF,EACF,KACA,QAAC,aAAU,UAAU,4BACnB,oBAAC,OAAI,UAAU,iDAAiD,KAChE,OAAC,EAAAK,QAAA,CAAa,KAAMD,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOV,KAAQ,cAAWS,CAAW",
|
|
6
|
+
"names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import__", "import_BizProductProvider", "import_useComponentData", "import_ScrollSpyNav", "import_Styles", "PurchaseBar", "onSpyNavItemClick", "totalSavingsSlot", "actionsSlot", "product", "renderRating", "PurchaseBarData", "ScrollSpyNav"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
export interface SlideUpModalProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
showModal: boolean;
|
|
5
|
+
closeModal: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const SlideUpModal: ({ title, showModal, closeModal, children, className, }: PropsWithChildren<SlideUpModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default SlideUpModal;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.create;var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var h=(t,a)=>{for(var o in a)s(t,o,{get:a[o],enumerable:!0})},r=(t,a,o,l)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of v(a))!f.call(t,i)&&i!==o&&s(t,i,{get:()=>a[i],enumerable:!(l=c(a,i))||l.enumerable});return t};var x=(t,a,o)=>(o=t!=null?p(u(t)):{},r(a||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),N=t=>r(s({},"__esModule",{value:!0}),t);var w={};h(w,{default:()=>y});module.exports=N(w);var e=require("react/jsx-runtime"),m=require("../../../../components/index.js"),b=require("../../../../helpers/index.js"),C=require("react"),n=require("framer-motion"),d=x(require("../../../HeaderNavigation/icons/Close.js"));const g=({title:t,showModal:a,closeModal:o,children:l,className:i})=>(0,e.jsx)(n.motion.div,{animate:a?{opacity:1}:{opacity:0,pointerEvents:"none"},transition:{duration:.15,bounce:0},className:"fixed inset-0 z-[1000] bg-black/50 opacity-0 tablet:flex tablet:items-center tablet:justify-center",children:(0,e.jsxs)(n.motion.div,{animate:a?{y:0}:{y:"100%"},transition:{duration:.2,ease:"easeOut"},className:(0,b.cn)("absolute bottom-0 left-0 right-0 rounded-t-box overflow-hidden bg-white","tablet:static tablet:rounded-box tablet:h-auto tablet:max-h-[80vh] tablet:w-[896px] tablet:max-w-[90vw]",i),children:[(0,e.jsx)(n.motion.div,{animate:a?{scale:1}:{scale:.95},transition:{duration:.15,bounce:0},className:"hidden size-full tablet:block",children:(0,e.jsxs)("div",{className:"relative size-full overflow-auto",children:[(0,e.jsxs)("div",{className:"sticky top-0 z-[2] bg-white",children:[t&&(0,e.jsx)(m.Heading,{size:2,className:"w-full py-6 px-4 text-xl tablet:px-8 tablet:pt-4 tablet:pb-2 font-bold",children:t}),(0,e.jsx)("button",{onClick:o,className:"absolute right-4 top-4 z-[2]","aria-label":"Close modal",children:(0,e.jsx)(d.default,{className:"size-6"})})]}),l]})}),(0,e.jsxs)("div",{className:"flex flex-col max-h-[80vh] tablet:hidden",children:[(0,e.jsxs)("div",{className:"relative shrink-0 bg-white",children:[t&&(0,e.jsx)("p",{className:"w-full py-4 pl-5 pr-12 text-xl font-bold",children:t}),(0,e.jsx)("button",{onClick:o,className:"absolute right-4 top-4 z-[2]","aria-label":"Close modal",children:(0,e.jsx)(d.default,{className:"size-6"})})]}),(0,e.jsx)("div",{className:"overflow-y-auto min-h-0 flex-1",children:l})]})]})});var y=g;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/SlideUpModal/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Heading } from '../../../../components/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { type PropsWithChildren } from 'react'\nimport { motion } from 'framer-motion'\nimport Close from '../../../HeaderNavigation/icons/Close.js'\n\nexport interface SlideUpModalProps {\n title?: string\n showModal: boolean\n closeModal: () => void\n className?: string\n}\n\nconst SlideUpModal = ({\n title,\n showModal,\n closeModal,\n children,\n className,\n}: PropsWithChildren<SlideUpModalProps>) => {\n return (\n <motion.div\n animate={showModal ? { opacity: 1 } : { opacity: 0, pointerEvents: 'none'}}\n transition={{ duration: 0.15, bounce: 0 }}\n className=\"fixed inset-0 z-[1000] bg-black/50 opacity-0 tablet:flex tablet:items-center tablet:justify-center\"\n >\n <motion.div\n animate={showModal ? { y: 0 } : { y: '100%'}}\n transition={{ duration: 0.2, ease: 'easeOut'}}\n className={cn(\n 'absolute bottom-0 left-0 right-0 rounded-t-box overflow-hidden bg-white',\n 'tablet:static tablet:rounded-box tablet:h-auto tablet:max-h-[80vh] tablet:w-[896px] tablet:max-w-[90vw]',\n className\n )}\n >\n <motion.div\n animate={showModal ? { scale: 1 } : { scale: 0.95 }}\n transition={{ duration: 0.15, bounce: 0 }}\n className=\"hidden size-full tablet:block\"\n >\n <div className=\"relative size-full overflow-auto\">\n <div className=\"sticky top-0 z-[2] bg-white\">\n {title && (\n <Heading size={2} className=\"w-full py-6 px-4 text-xl tablet:px-8 tablet:pt-4 tablet:pb-2 font-bold\">\n {title}\n </Heading>\n )}\n <button onClick={closeModal} className=\"absolute right-4 top-4 z-[2]\" aria-label=\"Close modal\">\n <Close className=\"size-6\" />\n </button>\n </div>\n {children}\n </div>\n </motion.div>\n <div className=\"flex flex-col max-h-[80vh] tablet:hidden\">\n <div className=\"relative shrink-0 bg-white\">\n {title && <p className=\"w-full py-4 pl-5 pr-12 text-xl font-bold\">{title}</p>}\n <button onClick={closeModal} className=\"absolute right-4 top-4 z-[2]\" aria-label=\"Close modal\">\n <Close className=\"size-6\" />\n </button>\n </div>\n <div className=\"overflow-y-auto min-h-0 flex-1\">{children}</div>\n </div>\n </motion.div>\n </mot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,KACA,OAAC,OAAI,UAAU,iCAAkC,SAAAF,EAAS,GAC5D,GACF,EACF,EAIJ,IAAOZ,EAAQQ",
|
|
6
|
+
"names": ["SlideUpModal_exports", "__export", "SlideUpModal_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_framer_motion", "import_Close", "SlideUpModal", "title", "showModal", "closeModal", "children", "className", "Close"]
|
|
7
|
+
}
|
|
@@ -27,3 +27,14 @@ export declare const PRICE_SYMBOL: {
|
|
|
27
27
|
es: string;
|
|
28
28
|
};
|
|
29
29
|
export declare const COLOR_LABEL: string[];
|
|
30
|
+
/**
|
|
31
|
+
* 黑名单:这些 componentKey 有独立的 variant 取值逻辑,
|
|
32
|
+
* 不参与"是否整体切换到 variant 数据源"的判断。
|
|
33
|
+
* - ProductGallery:自己做 product + variant 字段级 merge
|
|
34
|
+
* - ProductBanner:纯 variant.payload 取值,无 product fallback
|
|
35
|
+
*
|
|
36
|
+
* 规则:variant.payload.components 中,排除这些 key 之后,
|
|
37
|
+
* 如果还有其他 componentKey 存在,才整体切换到 variant 数据源。
|
|
38
|
+
* 如果排除后为空(如 variant 只配了 ProductGallery),则继续用 Product 数据源。
|
|
39
|
+
*/
|
|
40
|
+
export declare const VARIANT_PAYLOAD_EXCLUDED_KEYS: readonly ["ProductGallery", "ProductBanner"];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var E=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var o=(e,r)=>{for(var A in r)E(e,A,{get:r[A],enumerable:!0})},I=(e,r,A,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let L of N(r))!f.call(e,L)&&L!==A&&E(e,L,{get:()=>r[L],enumerable:!(c=x(r,L))||c.enumerable});return e};var O=e=>I(E({},"__esModule",{value:!0}),e);var s={};o(s,{COLOR_LABEL:()=>S,CouponChannel:()=>D,DiscountType:()=>_,PRICE_SYMBOL:()=>P,VARIANT_PAYLOAD_EXCLUDED_KEYS:()=>d});module.exports=O(s);var _=(c=>(c.fixedAmount="fixed_amount",c.percentage="percentage",c.fixedDiscountAmount="fix_discount_amount",c))(_||{}),D=(t=>(t.LIGHTNING_DEAL="LIGHTNING_DEAL",t.DEAL="LIGHTNING_DEAL",t.COUPON="COUPON",t.PED="PED",t.WS24="WS24",t.WSTD="WSTD",t.WSCH="WSCH",t))(D||{});const P={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"},S=["color","colour","couleur","cor","colore","farbe","\uC0C9","\u8272","\u30AB\u30E9\u30FC","f\xE4rg","farve"],d=["ProductGallery","ProductBanner"];
|
|
2
2
|
//# sourceMappingURL=const.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Listing/const.ts"],
|
|
4
|
-
"sourcesContent": ["export enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n fixedDiscountAmount = 'fix_discount_amount',\n}\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '\uC0C9',\n '\u8272',\n '\u30AB\u30E9\u30FC',\n 'f\u00E4rg',\n 'farve',\n]\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,iBAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["const_exports", "__export", "COLOR_LABEL", "CouponChannel", "DiscountType", "PRICE_SYMBOL", "__toCommonJS"]
|
|
4
|
+
"sourcesContent": ["export enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n fixedDiscountAmount = 'fix_discount_amount',\n}\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '\uC0C9',\n '\u8272',\n '\u30AB\u30E9\u30FC',\n 'f\u00E4rg',\n 'farve',\n]\n\n/**\n * \u9ED1\u540D\u5355\uFF1A\u8FD9\u4E9B componentKey \u6709\u72EC\u7ACB\u7684 variant \u53D6\u503C\u903B\u8F91\uFF0C\n * \u4E0D\u53C2\u4E0E\"\u662F\u5426\u6574\u4F53\u5207\u6362\u5230 variant \u6570\u636E\u6E90\"\u7684\u5224\u65AD\u3002\n * - ProductGallery\uFF1A\u81EA\u5DF1\u505A product + variant \u5B57\u6BB5\u7EA7 merge\n * - ProductBanner\uFF1A\u7EAF variant.payload \u53D6\u503C\uFF0C\u65E0 product fallback\n *\n * \u89C4\u5219\uFF1Avariant.payload.components \u4E2D\uFF0C\u6392\u9664\u8FD9\u4E9B key \u4E4B\u540E\uFF0C\n * \u5982\u679C\u8FD8\u6709\u5176\u4ED6 componentKey \u5B58\u5728\uFF0C\u624D\u6574\u4F53\u5207\u6362\u5230 variant \u6570\u636E\u6E90\u3002\n * \u5982\u679C\u6392\u9664\u540E\u4E3A\u7A7A\uFF08\u5982 variant \u53EA\u914D\u4E86 ProductGallery\uFF09\uFF0C\u5219\u7EE7\u7EED\u7528 Product \u6570\u636E\u6E90\u3002\n */\nexport const VARIANT_PAYLOAD_EXCLUDED_KEYS = ['ProductGallery', 'ProductBanner'] as const\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,iBAAAC,EAAA,kCAAAC,IAAA,eAAAC,EAAAP,GAAO,IAAKI,OACVA,EAAA,YAAc,eACdA,EAAA,WAAa,aACbA,EAAA,oBAAsB,sBAHZA,OAAA,IAMAD,OACVA,EAAA,eAAiB,iBACjBA,EAAA,KAAO,iBACPA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAUL,MAAME,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN,EAEaH,EAAc,CACzB,QACA,SACA,UACA,MACA,SACA,QACA,SACA,SACA,qBACA,UACA,OACF,EAYaI,EAAgC,CAAC,iBAAkB,eAAe",
|
|
6
|
+
"names": ["const_exports", "__export", "COLOR_LABEL", "CouponChannel", "DiscountType", "PRICE_SYMBOL", "VARIANT_PAYLOAD_EXCLUDED_KEYS", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useComponentData<T = any>(componentKey: string): T | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(o,n)=>{for(var t in n)r(o,t,{get:n[t],enumerable:!0})},p=(o,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of m(n))!s.call(o,e)&&e!==t&&r(o,e,{get:()=>n[e],enumerable:!(a=i(n,e))||a.enumerable});return o};var c=o=>p(r({},"__esModule",{value:!0}),o);var l={};f(l,{useComponentData:()=>y});module.exports=c(l);var u=require("react"),d=require("../BizProductProvider.js");function y(o){const{resolvedPayload:n}=(0,d.useBizProductContext)();return(0,u.useMemo)(()=>n?.components?.find(t=>t.componentKey===o)?.data,[n,o])}
|
|
2
|
+
//# sourceMappingURL=useComponentData.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/useComponentData.ts"],
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react'\nimport { useBizProductContext } from '../BizProductProvider.js'\n\nexport function useComponentData<T = any>(componentKey: string): T | undefined {\n const { resolvedPayload } = useBizProductContext()\n return useMemo(() => {\n return resolvedPayload?.components?.find((item: any) => item.componentKey === componentKey)?.data\n }, [resolvedPayload, componentKey])\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwB,iBACxBC,EAAqC,oCAE9B,SAASH,EAA0BI,EAAqC,CAC7E,KAAM,CAAE,gBAAAC,CAAgB,KAAI,wBAAqB,EACjD,SAAO,WAAQ,IACNA,GAAiB,YAAY,KAAMC,GAAcA,EAAK,eAAiBF,CAAY,GAAG,KAC5F,CAACC,EAAiBD,CAAY,CAAC,CACpC",
|
|
6
|
+
"names": ["useComponentData_exports", "__export", "useComponentData", "__toCommonJS", "import_react", "import_BizProductProvider", "componentKey", "resolvedPayload", "item"]
|
|
7
|
+
}
|
|
@@ -42,7 +42,7 @@ export { default as CreativeModule } from './CreativeModule/index.js';
|
|
|
42
42
|
export { default as GraphicOverlay } from './GraphicOverlay/index.js';
|
|
43
43
|
export { default as Specs } from './Specs/index.js';
|
|
44
44
|
export { default as TabGroup } from './TabsGroup/index.js';
|
|
45
|
-
export { default as BizProductProvider } from './Listing/BizProductProvider.js';
|
|
45
|
+
export { default as BizProductProvider, useBizProductContext } from './Listing/BizProductProvider.js';
|
|
46
46
|
export { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js';
|
|
47
47
|
export { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js';
|
|
48
48
|
export type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js';
|
|
@@ -62,6 +62,10 @@ export { default as ProductDetail } from './Listing/components/ProductCard/Produ
|
|
|
62
62
|
export { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js';
|
|
63
63
|
export { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js';
|
|
64
64
|
export { default as PaidShipping } from './Listing/components/PaidShipping/index.js';
|
|
65
|
+
export { default as CartActionButtons } from './Listing/components/CartActionButtons/index.js';
|
|
66
|
+
export type { CartActionButtonsProps } from './Listing/components/CartActionButtons/index.js';
|
|
67
|
+
export { default as ProductServiceBenefits } from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js';
|
|
68
|
+
export type { ProductServiceBenefitsProps, ServiceBenefitItem, } from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js';
|
|
65
69
|
export { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js';
|
|
66
70
|
export { default as GraphicMore } from './GraphicMore/index.js';
|
|
67
71
|
export { default as Features } from './Features/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var rt=Object.create;var p=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty;var st=(t,r)=>{for(var a in r)p(t,a,{get:r[a],enumerable:!0})},m=(t,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ot(r))!pt.call(t,i)&&i!==a&&p(t,i,{get:()=>r[i],enumerable:!(u=at(r,i))||u.enumerable});return t};var e=(t,r,a)=>(a=t!=null?rt(it(t)):{},m(r||!t||!t.__esModule?p(a,"default",{value:t,enumerable:!0}):a,t)),ft=t=>m(p({},"__esModule",{value:!0}),t);var ct={};st(ct,{AccordionCards:()=>j.default,ActiveShelf:()=>_e.default,ActivityMechanism:()=>h.default,ActivitySchedule:()=>n.default,AiuiProvider:()=>R.default,AnchorNavigation:()=>qe.default,AplusDesc:()=>ye.default,BenefitsTab:()=>le.default,BizProductProvider:()=>Y.default,BrandCardLink:()=>ge.default,BrandEquity:()=>S.default,BuyOneGetOneShelf:()=>Ke.default,Category:()=>B.default,CreativeModule:()=>K.default,CreditsProductCard:()=>f.CreditsProductCard,CreditsShelf:()=>f.default,DownLoad:()=>Pe.default,Evaluate:()=>T.default,EventSchedule:()=>Re.default,Faq:()=>L.default,FeatureCards:()=>je.default,FeatureShowcase:()=>ke.default,FeaturedBlogPosts:()=>be.default,Features:()=>xe.default,FootCharger:()=>Ce.default,FooterNavigation:()=>W.default,GiftBox:()=>he.default,GiftShelf:()=>x.default,GiftTierShelf:()=>y.default,Graphic:()=>b.default,GraphicAttractionBlock:()=>V.default,GraphicMore:()=>ne.default,GraphicOverlay:()=>_.default,HeaderNavigation:()=>E.default,HeroBanner:()=>I.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>lt,ImageOverlayShelf:()=>Qe.default,ImageTextFeature:()=>Ie.default,ImageTextOverlay:()=>Xe.default,ImageWithText:()=>De.default,Ksp:()=>Be.default,Marquee:()=>A.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeReview:()=>k.default,MarqueeTextContent:()=>o.MarqueeTextContent,MediaEndorsement:()=>Ye.default,MediaPlayerBase:()=>D.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>F.default,MediaSceneSwitcher:()=>Oe.default,MediaSceneSwitcherV2:()=>Ve.default,MediaShelf:()=>Ue.default,MediaTextOverlay:()=>Je.default,MemberEquity:()=>P.default,MiniCart:()=>Ze.default,MiniCartCircleProgress:()=>$e.default,MiniCartDialog:()=>l.default,MiniCartDialogComponent:()=>l.MiniCartDialog,MultiLayoutGraphicBlock:()=>O.default,PAYLOAD_COMPONENT_MAP:()=>dt,PaidShipping:()=>ue.default,ProductActions:()=>Q.default,ProductBanner:()=>pe.default,ProductBenefits:()=>$.default,ProductBenefitsTabs:()=>Z.default,ProductBundle:()=>oe.default,ProductCard:()=>X.default,ProductCompare:()=>Te.default,ProductCoupon:()=>ie.default,ProductDetail:()=>de.default,ProductExchangePurchase:()=>re.default,ProductFreeGift:()=>te.default,ProductGallery:()=>fe.default,ProductGridBox:()=>se.default,ProductHero:()=>we.default,ProductHighlight:()=>ee.default,ProductLottery:()=>ve.default,ProductNav:()=>We.default,ProductOptions:()=>ae.default,ProductPaidShipping:()=>me.default,ProductSummary:()=>ce.default,PromotionalBar:()=>Ne.default,PurchaseBar:()=>J.default,SceneProductCard:()=>d.SceneProductCard,SceneShelf:()=>d.default,SceneShelfV2:()=>c.default,SceneShelfV2ProductCard:()=>c.SceneShelfV2ProductCard,SceneShelfV3:()=>ze.default,SearchPage:()=>q.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>He.default,SelectStore:()=>Se.default,ShelfDisplay:()=>v.default,Slogan:()=>C.default,Spacer:()=>M.default,Specs:()=>U.default,SpecsComparison:()=>Le.default,TabGroup:()=>z.default,TabWithImage:()=>Ae.default,Tabs:()=>H.default,TabsWithMedia:()=>Ge.default,ThreeDCarousel:()=>Ee.default,Title:()=>g.default,VideoFeature:()=>Fe.default,WebPushPopup:()=>et.default,WheelLottery:()=>Me.default,WhyChoose:()=>w.default,useEmarsysWebPush:()=>tt.useEmarsysWebPush,withLayout:()=>N.withLayout});module.exports=ft(ct);var n=e(require("./ActivitySchedule/index.js")),x=e(require("./GiftShelf/index.js")),y=e(require("./GiftTierShelf/index.js")),h=e(require("./ActivityMechanism/index.js")),S=e(require("./BrandEquity/index.js")),P=e(require("./MemberEquity/index.js")),C=e(require("./Slogan/index.js")),g=e(require("./Title/index.js")),M=e(require("./Spacer/index.js")),v=e(require("./ShelfDisplay/index.js")),T=e(require("./Evaluate/index.js")),B=e(require("./Category/index.js")),I=e(require("./HeroBanner/index.js")),j=e(require("./AccordionCards/index.js")),b=e(require("./Graphic/index.js")),D=e(require("./MediaPlayerBase/index.js")),F=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),A=e(require("./Marquee/index.js")),k=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),L=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),O=e(require("./MultiLayoutGraphicBlock/index.js")),V=e(require("./GraphicAttractionBlock/index.js")),E=e(require("./HeaderNavigation/index.js")),W=e(require("./FooterNavigation/index.js")),q=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),N=require("../shared/Styles.js"),R=e(require("./AiuiProvider/index.js")),H=e(require("./Tabs/index.js")),K=e(require("./CreativeModule/index.js")),_=e(require("./GraphicOverlay/index.js")),U=e(require("./Specs/index.js")),z=e(require("./TabsGroup/index.js")),Y=e(require("./Listing/BizProductProvider.js")),J=e(require("./Listing/components/PurchaseBar/index.js")),Q=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),se=e(require("./Listing/components/ProductCard/ProductGridBox.js")),fe=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),de=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),ce=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),le=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ue=e(require("./Listing/components/PaidShipping/index.js")),me=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),ne=e(require("./GraphicMore/index.js")),xe=e(require("./Features/index.js")),ye=e(require("./AplusDesc/index.js")),he=e(require("./GiftBox/index.js")),Se=e(require("./SelectStore/index.js")),Pe=e(require("./DownLoad/index.js")),Ce=e(require("./FootCharger/index.js")),ge=e(require("./BrandCardLink/index.js")),lt=e(require("./IPRedirect/index.js")),Me=e(require("./WheelLottery/index.js")),ve=e(require("./ProductLottery/index.js")),Te=e(require("./ProductCompare/index.js")),Be=e(require("./Ksp/index.js")),Ie=e(require("./ImageTextFeature/index.js")),je=e(require("./FeatureCards/index.js")),be=e(require("./FeaturedBlogPosts/index.js")),De=e(require("./ImageWithText/index.js")),Fe=e(require("./VideoFeature/index.js")),Ge=e(require("./TabsWithMedia/index.js")),Ae=e(require("./TabWithImage/index.js")),ke=e(require("./FeatureShowcase/index.js")),we=e(require("./ProductHero/index.js")),Le=e(require("./SpecsComparison/index.js")),Oe=e(require("./MediaSceneSwitcher/index.js")),Ve=e(require("./MediaSceneSwitcherV2/index.js")),Ee=e(require("./ThreeDCarousel/index.js")),We=e(require("./ProductNav/index.js")),qe=e(require("./AnchorNavigation/index.js")),Ne=e(require("./PromotionalBar/index.js")),Re=e(require("./EventSchedule/index.js")),He=e(require("./SecondaryBanner/index.js")),Ke=e(require("./BuyOneGetOneShelf/index.js")),_e=e(require("./ActiveShelf/index.js")),Ue=e(require("./MediaShelf/index.js")),f=e(require("./CreditsShelf/index.js")),d=e(require("./SceneShelf/index.js")),c=e(require("./SceneShelfV2/index.js")),ze=e(require("./SceneShelfV3/index.js")),Ye=e(require("./MediaEndorsement/index.js")),Je=e(require("./MediaTextOverlay/index.js")),Qe=e(require("./ImageOverlayShelf/index.js")),Xe=e(require("./ImageTextOverlay/index.js")),Ze=e(require("./MiniCart/index.js")),$e=e(require("./MiniCart/CircleProgress.js")),l=e(require("./MiniCart/MiniCartDialog.js")),et=e(require("./WebPushPopup/index.js")),tt=require("../hooks/useEmarsysWebPush.js");const dt={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"TabsBlock","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-active-shelf":"ActiveShelf","ipc-media-shelf":"MediaShelf","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts"};
|
|
1
|
+
"use strict";var ot=Object.create;var p=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var dt=(t,r)=>{for(var a in r)p(t,a,{get:r[a],enumerable:!0})},m=(t,r,a,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of pt(r))!ft.call(t,i)&&i!==a&&p(t,i,{get:()=>r[i],enumerable:!(l=it(r,i))||l.enumerable});return t};var e=(t,r,a)=>(a=t!=null?ot(st(t)):{},m(r||!t||!t.__esModule?p(a,"default",{value:t,enumerable:!0}):a,t)),ct=t=>m(p({},"__esModule",{value:!0}),t);var nt={};dt(nt,{AccordionCards:()=>b.default,ActiveShelf:()=>Ue.default,ActivityMechanism:()=>S.default,ActivitySchedule:()=>x.default,AiuiProvider:()=>H.default,AnchorNavigation:()=>Re.default,AplusDesc:()=>Se.default,BenefitsTab:()=>ue.default,BizProductProvider:()=>f.default,BrandCardLink:()=>ve.default,BrandEquity:()=>P.default,BuyOneGetOneShelf:()=>ze.default,CartActionButtons:()=>le.default,Category:()=>I.default,CreativeModule:()=>_.default,CreditsProductCard:()=>d.CreditsProductCard,CreditsShelf:()=>d.default,DownLoad:()=>ge.default,Evaluate:()=>T.default,EventSchedule:()=>Ke.default,Faq:()=>O.default,FeatureCards:()=>De.default,FeatureShowcase:()=>we.default,FeaturedBlogPosts:()=>Fe.default,Features:()=>he.default,FootCharger:()=>Me.default,FooterNavigation:()=>q.default,GiftBox:()=>Pe.default,GiftShelf:()=>y.default,GiftTierShelf:()=>h.default,Graphic:()=>D.default,GraphicAttractionBlock:()=>E.default,GraphicMore:()=>ye.default,GraphicOverlay:()=>z.default,HeaderNavigation:()=>W.default,HeroBanner:()=>j.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>lt,ImageOverlayShelf:()=>Ze.default,ImageTextFeature:()=>be.default,ImageTextOverlay:()=>$e.default,ImageWithText:()=>Ae.default,Ksp:()=>je.default,Marquee:()=>L.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeReview:()=>k.default,MarqueeTextContent:()=>o.MarqueeTextContent,MediaEndorsement:()=>Qe.default,MediaPlayerBase:()=>F.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>A.default,MediaSceneSwitcher:()=>Ee.default,MediaSceneSwitcherV2:()=>We.default,MediaShelf:()=>Ye.default,MediaTextOverlay:()=>Xe.default,MemberEquity:()=>C.default,MiniCart:()=>et.default,MiniCartCircleProgress:()=>tt.default,MiniCartDialog:()=>n.default,MiniCartDialogComponent:()=>n.MiniCartDialog,MultiLayoutGraphicBlock:()=>V.default,PAYLOAD_COMPONENT_MAP:()=>ut,PaidShipping:()=>ne.default,ProductActions:()=>Q.default,ProductBanner:()=>pe.default,ProductBenefits:()=>$.default,ProductBenefitsTabs:()=>Z.default,ProductBundle:()=>oe.default,ProductCard:()=>X.default,ProductCompare:()=>Ie.default,ProductCoupon:()=>ie.default,ProductDetail:()=>de.default,ProductExchangePurchase:()=>re.default,ProductFreeGift:()=>te.default,ProductGallery:()=>fe.default,ProductGridBox:()=>se.default,ProductHero:()=>Oe.default,ProductHighlight:()=>ee.default,ProductLottery:()=>Te.default,ProductNav:()=>Ne.default,ProductOptions:()=>ae.default,ProductPaidShipping:()=>xe.default,ProductServiceBenefits:()=>me.default,ProductSummary:()=>ce.default,PromotionalBar:()=>He.default,PurchaseBar:()=>J.default,SceneProductCard:()=>c.SceneProductCard,SceneShelf:()=>c.default,SceneShelfV2:()=>u.default,SceneShelfV2ProductCard:()=>u.SceneShelfV2ProductCard,SceneShelfV3:()=>Je.default,SearchPage:()=>N.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>_e.default,SelectStore:()=>Ce.default,ShelfDisplay:()=>B.default,Slogan:()=>g.default,Spacer:()=>v.default,Specs:()=>U.default,SpecsComparison:()=>Ve.default,TabGroup:()=>Y.default,TabWithImage:()=>ke.default,Tabs:()=>K.default,TabsWithMedia:()=>Le.default,ThreeDCarousel:()=>qe.default,Title:()=>M.default,VideoFeature:()=>Ge.default,WebPushPopup:()=>rt.default,WheelLottery:()=>Be.default,WhyChoose:()=>w.default,useBizProductContext:()=>f.useBizProductContext,useEmarsysWebPush:()=>at.useEmarsysWebPush,withLayout:()=>R.withLayout});module.exports=ct(nt);var x=e(require("./ActivitySchedule/index.js")),y=e(require("./GiftShelf/index.js")),h=e(require("./GiftTierShelf/index.js")),S=e(require("./ActivityMechanism/index.js")),P=e(require("./BrandEquity/index.js")),C=e(require("./MemberEquity/index.js")),g=e(require("./Slogan/index.js")),M=e(require("./Title/index.js")),v=e(require("./Spacer/index.js")),B=e(require("./ShelfDisplay/index.js")),T=e(require("./Evaluate/index.js")),I=e(require("./Category/index.js")),j=e(require("./HeroBanner/index.js")),b=e(require("./AccordionCards/index.js")),D=e(require("./Graphic/index.js")),F=e(require("./MediaPlayerBase/index.js")),A=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),L=e(require("./Marquee/index.js")),k=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),O=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),V=e(require("./MultiLayoutGraphicBlock/index.js")),E=e(require("./GraphicAttractionBlock/index.js")),W=e(require("./HeaderNavigation/index.js")),q=e(require("./FooterNavigation/index.js")),N=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),R=require("../shared/Styles.js"),H=e(require("./AiuiProvider/index.js")),K=e(require("./Tabs/index.js")),_=e(require("./CreativeModule/index.js")),z=e(require("./GraphicOverlay/index.js")),U=e(require("./Specs/index.js")),Y=e(require("./TabsGroup/index.js")),f=e(require("./Listing/BizProductProvider.js")),J=e(require("./Listing/components/PurchaseBar/index.js")),Q=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),se=e(require("./Listing/components/ProductCard/ProductGridBox.js")),fe=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),de=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),ce=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),ue=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ne=e(require("./Listing/components/PaidShipping/index.js")),le=e(require("./Listing/components/CartActionButtons/index.js")),me=e(require("./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js")),xe=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),ye=e(require("./GraphicMore/index.js")),he=e(require("./Features/index.js")),Se=e(require("./AplusDesc/index.js")),Pe=e(require("./GiftBox/index.js")),Ce=e(require("./SelectStore/index.js")),ge=e(require("./DownLoad/index.js")),Me=e(require("./FootCharger/index.js")),ve=e(require("./BrandCardLink/index.js")),lt=e(require("./IPRedirect/index.js")),Be=e(require("./WheelLottery/index.js")),Te=e(require("./ProductLottery/index.js")),Ie=e(require("./ProductCompare/index.js")),je=e(require("./Ksp/index.js")),be=e(require("./ImageTextFeature/index.js")),De=e(require("./FeatureCards/index.js")),Fe=e(require("./FeaturedBlogPosts/index.js")),Ae=e(require("./ImageWithText/index.js")),Ge=e(require("./VideoFeature/index.js")),Le=e(require("./TabsWithMedia/index.js")),ke=e(require("./TabWithImage/index.js")),we=e(require("./FeatureShowcase/index.js")),Oe=e(require("./ProductHero/index.js")),Ve=e(require("./SpecsComparison/index.js")),Ee=e(require("./MediaSceneSwitcher/index.js")),We=e(require("./MediaSceneSwitcherV2/index.js")),qe=e(require("./ThreeDCarousel/index.js")),Ne=e(require("./ProductNav/index.js")),Re=e(require("./AnchorNavigation/index.js")),He=e(require("./PromotionalBar/index.js")),Ke=e(require("./EventSchedule/index.js")),_e=e(require("./SecondaryBanner/index.js")),ze=e(require("./BuyOneGetOneShelf/index.js")),Ue=e(require("./ActiveShelf/index.js")),Ye=e(require("./MediaShelf/index.js")),d=e(require("./CreditsShelf/index.js")),c=e(require("./SceneShelf/index.js")),u=e(require("./SceneShelfV2/index.js")),Je=e(require("./SceneShelfV3/index.js")),Qe=e(require("./MediaEndorsement/index.js")),Xe=e(require("./MediaTextOverlay/index.js")),Ze=e(require("./ImageOverlayShelf/index.js")),$e=e(require("./ImageTextOverlay/index.js")),et=e(require("./MiniCart/index.js")),tt=e(require("./MiniCart/CircleProgress.js")),n=e(require("./MiniCart/MiniCartDialog.js")),rt=e(require("./WebPushPopup/index.js")),at=require("../hooks/useEmarsysWebPush.js");const ut={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-active-shelf":"ActiveShelf","ipc-media-shelf":"MediaShelf","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts"};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|