@anker-in/headless-ui 1.0.20-alpha.1761288487826 → 1.0.20-alpha.1761299957235

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
  3. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  4. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Listing/{ProductProvider.d.ts → BizProductProvider.d.ts} +8 -4
  6. package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
  7. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
  8. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  9. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -4
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +21 -3
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  31. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  32. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  33. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  34. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  36. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  37. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  38. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  39. package/dist/cjs/biz-components/Listing/index.d.ts +1 -1
  40. package/dist/cjs/biz-components/Listing/index.js +1 -1
  41. package/dist/cjs/biz-components/Listing/index.js.map +3 -3
  42. package/dist/cjs/biz-components/Listing/types.d.ts +7 -0
  43. package/dist/cjs/biz-components/Listing/types.js +1 -1
  44. package/dist/cjs/biz-components/Listing/types.js.map +1 -1
  45. package/dist/cjs/biz-components/index.d.ts +1 -1
  46. package/dist/cjs/biz-components/index.js +1 -1
  47. package/dist/cjs/biz-components/index.js.map +3 -3
  48. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  49. package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
  50. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  51. package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
  52. package/dist/esm/biz-components/Listing/{ProductProvider.d.ts → BizProductProvider.d.ts} +8 -4
  53. package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
  54. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
  55. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  56. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  57. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -4
  58. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +21 -3
  59. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  60. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  61. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  62. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  63. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  64. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  65. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  66. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  67. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  68. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  73. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  74. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  75. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  76. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  77. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  78. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  79. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  80. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  81. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  82. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  83. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  84. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  85. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  86. package/dist/esm/biz-components/Listing/index.d.ts +1 -1
  87. package/dist/esm/biz-components/Listing/index.js +1 -1
  88. package/dist/esm/biz-components/Listing/index.js.map +3 -3
  89. package/dist/esm/biz-components/Listing/types.d.ts +7 -0
  90. package/dist/esm/biz-components/index.d.ts +1 -1
  91. package/dist/esm/biz-components/index.js +1 -1
  92. package/dist/esm/biz-components/index.js.map +2 -2
  93. package/package.json +1 -1
  94. package/dist/cjs/biz-components/Listing/ProductProvider.js +0 -2
  95. package/dist/cjs/biz-components/Listing/ProductProvider.js.map +0 -7
  96. package/dist/esm/biz-components/Listing/ProductProvider.js +0 -2
  97. package/dist/esm/biz-components/Listing/ProductProvider.js.map +0 -7
@@ -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, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useProductContext } from '../../../ProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n onAddToCart,\n onBuyNow,\n savingDetail,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n } = useProductContext()\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift ? undefined : giftVariant,\n })\n }, [bundleVariant, giftVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary bg-[#F5F5F7] mt-16\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 desktop:col-start-1 desktop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 desktop:col-start-7 laptop:mt-0 desktop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture source={variant.image?.url || product?.images?.[0]?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {coupon && (\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n giftStatus={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift}\n />\n )}\n {joinedRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n bundleStatus={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle || initialRecommendBuyProducts?.gift) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ gift })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n giftStatus={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ bundle })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n bundleStatus={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n {coupon && (\n <Text\n className=\"text-base desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2\">\n <Button size=\"lg\" variant=\"secondary\" className=\"w-1/2\" onClick={() => onAddToCart?.()}>\n {copyWriting?.addToCart}\n </Button>\n <Button size=\"lg\" variant=\"primary\" className=\"w-1/2\" onClick={() => onBuyNow?.()}>\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift } = useProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\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 return { bundleVariant, giftVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleStatus,\n bundleListItem,\n}: {\n bundleOperation: (bundle: BundleListItem) => void\n bundleStatus: boolean\n bundleListItem: BundleListItem\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {bundleStatus && (\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariants[0]?.price,\n locale,\n currencyCode: bundleVariants[0]?.variant?.price?.currencyCode,\n })}\n />\n )}\n <Button\n size={bundleStatus ? 'icon' : 'lg'}\n variant={bundleStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedBundle?.(bundleStatus ? undefined : bundleListItem)\n bundleOperation(bundleListItem)\n }}\n className={cn('shrink-0 size-auto', {\n underline: bundleStatus,\n })}\n >\n {bundleStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n giftStatus,\n gift,\n}: {\n giftOperation: (gift: ProductVariant) => void\n giftStatus: boolean\n gift: ProductVariant\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useProductContext()\n const { freeLabel } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture source={gift?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {giftStatus && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n <Button\n size={giftStatus ? 'icon' : 'lg'}\n variant={giftStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedGift?.(giftStatus ? undefined : gift)\n giftOperation(gift)\n }}\n className={cn('shrink-0 size-auto', {\n underline: giftStatus,\n })}\n >\n {giftStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkDQ,IAAAI,EAAA,6BAlDRC,EAA0E,qCAE1EC,EAAkC,oCAClCC,EAA6C,iBAC7CC,EAA4B,0BAC5BC,EAA+B,oCAE/BC,EAAmB,kCACnBC,EAAoB,yBAEpB,MAAMC,EAAiB,CAAC,CAAC,IAA2B,CAClD,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,2BAAAC,EACA,8BAAAC,CACF,KAAI,qBAAkB,EAGtB,GAAI,CADgBT,EAAQ,iBACV,OAAO,KAEzB,KAAM,CAAE,cAAAU,EAAe,YAAAC,CAAY,EAAIC,EAAwB,GAAK,CAAC,EAC/D,CAACC,EAA6BC,CAA8B,KAAI,YAGnE,KAEH,aAAU,IAAM,CACdA,EAA+B,CAC7B,OAAQN,EAA2B,OAAS,OAAYE,EACxD,KAAMF,EAA2B,KAAO,OAAYG,CACtD,CAAC,CACH,EAAG,CAACD,EAAeC,EAAaH,CAA0B,CAAC,EAE3D,MAAMO,KAA8B,WAClC,IAAM,IAAI,EAAAC,QAAQd,CAAY,EAAE,MAAMK,EAAa,QAAQ,EAAE,SAAS,EACtE,CAACL,EAAcK,CAAY,CAC7B,EAEA,SACE,OAAC,OAAI,UAAU,yCACb,oBAAC,QAAK,UAAU,uBACd,qBAAC,YAAS,UAAU,qDAClB,oBAAC,WACC,UAAU,+HACV,KAAM,GAAGR,EAAQ,KAAK,wDACxB,KACA,OAAC,OAAI,U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AS,UACjC,QAAS,IAAM,CACbE,IAAmBF,EAAe,OAAYC,CAAc,EAC5DF,EAAgBE,CAAc,CAChC,EACA,aAAW,MAAG,qBAAsB,CAClC,UAAWD,CACb,CAAC,EAEA,SAAAA,EAAe,SAAW,QAC7B,GACF,GACF,CAEJ,EAEMd,EAAqB,CAAC,CAC1B,cAAAkB,EACA,WAAAC,EACA,KAAAlB,CACF,IAIM,CACJ,KAAM,CAAE,OAAArB,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,SAAAyB,EAAU,eAAAe,CAAe,KAAI,qBAAkB,EACjD,CAAE,UAAAC,CAAU,EAAIhB,GAAY,CAAC,EAEnC,SACE,QAAC,OAAI,UAAU,oCACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQJ,GAAM,OAAO,IAAK,UAAU,uBAAuB,KACpE,QAAC,OAAI,UAAU,0DACb,oBAAC,QACC,UAAU,mEACV,KAAMA,GAAM,SAAS,MACvB,KACA,OAAC,QACC,UAAU,8EACV,KAAM,QAAQoB,CAAS,GACzB,GACF,GACF,KACA,QAAC,OAAI,UAAU,+CACZ,UAAAF,MACC,QAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,UAAU,uCAAuC,KAAME,EAAW,KACxE,OAAC,QACC,UAAU,mEACV,QAAM,eAAY,CAChB,OAAQpB,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,KAEF,OAAC,UACC,KAAMkB,EAAa,OAAS,KAC5B,QAASA,EAAa,OAAS,UAC/B,QAAS,IAAM,CACbC,IAAiBD,EAAa,OAAYlB,CAAI,EAC9CiB,EAAcjB,CAAI,CACpB,EACA,aAAW,MAAG,qBAAsB,CAClC,UAAWkB,CACb,CAAC,EAEA,SAAAA,EAAa,SAAW,QAC3B,GACF,GACF,CAEJ,EAEA,IAAOlD,EAAQU",
6
- "names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_helpers", "import_decimal", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "onAddToCart", "onBuyNow", "savingDetail", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "bundleVariant", "giftVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "Decimal", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "checkedBundle", "freeGift", "checkedGift", "bundleList", "giftList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "bundleOperation", "bundleStatus", "bundleListItem", "setCheckedBundle", "bundleVariants", "giftOperation", "giftStatus", "setCheckedGift", "freeLabel"]
4
+ "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n onAddToCart,\n onBuyNow,\n savingDetail,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift ? undefined : giftVariant,\n })\n }, [bundleVariant, giftVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary bg-[#F5F5F7] mt-16\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 desktop:col-start-1 desktop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 desktop:col-start-7 laptop:mt-0 desktop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture source={variant.image?.url || product?.images?.[0]?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {coupon && (\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n giftStatus={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift}\n />\n )}\n {joinedRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n bundleStatus={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle || initialRecommendBuyProducts?.gift) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ gift })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n giftStatus={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ bundle })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n bundleStatus={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n {coupon && (\n <Text\n className=\"text-base desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2\">\n <Button size=\"lg\" variant=\"secondary\" className=\"w-1/2\" onClick={() => onAddToCart?.()}>\n {copyWriting?.addToCart}\n </Button>\n <Button size=\"lg\" variant=\"primary\" className=\"w-1/2\" onClick={() => onBuyNow?.()}>\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift } = useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\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 return { bundleVariant, giftVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleStatus,\n bundleListItem,\n}: {\n bundleOperation: (bundle: BundleListItem) => void\n bundleStatus: boolean\n bundleListItem: BundleListItem\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {bundleStatus && (\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariants[0]?.price,\n locale,\n currencyCode: bundleVariants[0]?.variant?.price?.currencyCode,\n })}\n />\n )}\n <Button\n size={bundleStatus ? 'icon' : 'lg'}\n variant={bundleStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedBundle?.(bundleStatus ? undefined : bundleListItem)\n bundleOperation(bundleListItem)\n }}\n className={cn('shrink-0 size-auto', {\n underline: bundleStatus,\n })}\n >\n {bundleStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n giftStatus,\n gift,\n}: {\n giftOperation: (gift: ProductVariant) => void\n giftStatus: boolean\n gift: ProductVariant\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture source={gift?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {giftStatus && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n <Button\n size={giftStatus ? 'icon' : 'lg'}\n variant={giftStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedGift?.(giftStatus ? undefined : gift)\n giftOperation(gift)\n }}\n className={cn('shrink-0 size-auto', {\n underline: giftStatus,\n })}\n >\n {giftStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkDQ,IAAAI,EAAA,6BAlDRC,EAA0E,qCAE1EC,EAAqC,uCACrCC,EAA6C,iBAC7CC,EAA4B,0BAC5BC,EAA+B,oCAE/BC,EAAmB,kCACnBC,EAAoB,yBAEpB,MAAMC,EAAiB,CAAC,CAAC,IAA2B,CAClD,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,2BAAAC,EACA,8BAAAC,CACF,KAAI,wBAAqB,EAGzB,GAAI,CADgBT,EAAQ,iBACV,OAAO,KAEzB,KAAM,CAAE,cAAAU,EAAe,YAAAC,CAAY,EAAIC,EAAwB,GAAK,CAAC,EAC/D,CAACC,EAA6BC,CAA8B,KAAI,YAGnE,KAEH,aAAU,IAAM,CACdA,EAA+B,CAC7B,OAAQN,EAA2B,OAAS,OAAYE,EACxD,KAAMF,EAA2B,KAAO,OAAYG,CACtD,CAAC,CACH,EAAG,CAACD,EAAeC,EAAaH,CAA0B,CAAC,EAE3D,MAAMO,KAA8B,WAClC,IAAM,IAAI,EAAAC,QAAQd,CAAY,EAAE,MAAMK,EAAa,QAAQ,EAAE,SAAS,EACtE,CAACL,EAAcK,CAAY,CAC7B,EAEA,SACE,OAAC,OAAI,UAAU,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AEA,SAAAA,EAAa,SAAW,QAC3B,GACF,GACF,CAEJ,EAEA,IAAOlD,EAAQU",
6
+ "names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_helpers", "import_decimal", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "onAddToCart", "onBuyNow", "savingDetail", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "bundleVariant", "giftVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "Decimal", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "checkedBundle", "freeGift", "checkedGift", "bundleList", "giftList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "bundleOperation", "bundleStatus", "bundleListItem", "setCheckedBundle", "bundleVariants", "giftOperation", "giftStatus", "setCheckedGift", "freeLabel"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var y=Object.create;var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var a in e)n(t,a,{get:e[a],enumerable:!0})},x=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of w(e))!P.call(t,r)&&r!==a&&n(t,r,{get:()=>e[r],enumerable:!(i=C(e,r))||i.enumerable});return t};var B=(t,e,a)=>(a=t!=null?y(h(t)):{},x(e||!t||!t.__esModule?n(a,"default",{value:t,enumerable:!0}):a,t)),A=t=>x(n({},"__esModule",{value:!0}),t);var T={};S(T,{default:()=>k});module.exports=A(T);var o=require("react/jsx-runtime"),l=require("../../../../../components"),p=require("../../../../AiuiProvider/index.js"),f=require("../../../ProductProvider.js"),v=require("react"),c=require("../../../utils"),s=B(require("decimal.js"));const F=()=>{const{copyWriting:t,locale:e="us"}=(0,p.useAiuiContext)(),{variant:a,finalPrice:i,totalSavings:r,comparePrice:m,onAddToCart:N,onBuyNow:g,savingDetail:d,coupon:u}=(0,f.useProductContext)(),b=(0,v.useMemo)(()=>new s.default(m).minus(d.freeGift).toNumber(),[m,d]);return(0,o.jsxs)("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[a.availableForSale?(0,o.jsxs)("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(l.Text,{className:"text-xl font-bold leading-[1.2] tablet:text-2xl",html:(0,c.formatPrice)({amount:i,currencyCode:a.price.currencyCode,locale:e})}),u&&(0,o.jsx)(l.Text,{className:"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl",html:(0,c.formatPrice)({amount:b,currencyCode:a.price.currencyCode,locale:e})})]}),u&&(0,o.jsx)(l.Text,{className:"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl",html:`${t?.totalSavings} ${(0,c.formatPrice)({amount:new s.default(b).minus(new s.default(i)).toNumber(),currencyCode:a.price.currencyCode,locale:e})}`})]}):(0,o.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:t?.soldOut??"Sold Out"}),(0,o.jsxs)("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[(0,o.jsx)(l.Button,{variant:"secondary",disabled:!a.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>N?.(),children:t?.addToCart??"Add to Cart"}),(0,o.jsx)(l.Button,{variant:"primary",disabled:!a.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>g?.(),children:t?.buyNow??"Buy Now"})]})]})};var k=F;
1
+ "use strict";var y=Object.create;var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var a in e)n(t,a,{get:e[a],enumerable:!0})},x=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of w(e))!B.call(t,i)&&i!==a&&n(t,i,{get:()=>e[i],enumerable:!(r=C(e,i))||r.enumerable});return t};var S=(t,e,a)=>(a=t!=null?y(h(t)):{},x(e||!t||!t.__esModule?n(a,"default",{value:t,enumerable:!0}):a,t)),A=t=>x(n({},"__esModule",{value:!0}),t);var z={};P(z,{default:()=>k});module.exports=A(z);var o=require("react/jsx-runtime"),l=require("../../../../../components"),p=require("../../../../AiuiProvider/index.js"),f=require("../../../BizProductProvider.js"),v=require("react"),c=require("../../../utils"),s=S(require("decimal.js"));const F=()=>{const{copyWriting:t,locale:e="us"}=(0,p.useAiuiContext)(),{variant:a,finalPrice:r,totalSavings:i,comparePrice:d,onAddToCart:g,onBuyNow:N,savingDetail:m,coupon:u}=(0,f.useBizProductContext)();console.log(m,"savingDetail");const b=(0,v.useMemo)(()=>new s.default(d).minus(m.freeGift).toNumber(),[d,m]);return(0,o.jsxs)("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[a.availableForSale?(0,o.jsxs)("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(l.Text,{className:"text-xl font-bold leading-[1.2] tablet:text-2xl",html:(0,c.formatPrice)({amount:r,currencyCode:a.price.currencyCode,locale:e})}),u&&(0,o.jsx)(l.Text,{className:"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl",html:(0,c.formatPrice)({amount:b,currencyCode:a.price.currencyCode,locale:e})})]}),u&&(0,o.jsx)(l.Text,{className:"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl",html:`${t?.totalSavings} ${(0,c.formatPrice)({amount:new s.default(b).minus(new s.default(r)).toNumber(),currencyCode:a.price.currencyCode,locale:e})}`})]}):(0,o.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:t?.soldOut??"Sold Out"}),(0,o.jsxs)("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[(0,o.jsx)(l.Button,{variant:"secondary",disabled:!a.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>g?.(),children:t?.addToCart??"Add to Cart"}),(0,o.jsx)(l.Button,{variant:"primary",disabled:!a.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>N?.(),children:t?.buyNow??"Buy Now"})]})]})};var k=F;
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, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useProductContext } from '../../../ProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const { variant, finalPrice, totalSavings, comparePrice, onAddToCart, onBuyNow, savingDetail, coupon } =\n useProductContext()\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold leading-[1.2] tablet:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {coupon &&<Text\n className=\"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />}\n </div>\n {coupon && (\n <Text\n className=\"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl\"\n html={`${copyWriting?.totalSavings} ${formatPrice({ amount: new Decimal(comparePriceRemovedFreeGift).minus(new Decimal(finalPrice)).toNumber(), currencyCode: variant.price.currencyCode, locale })}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBU,IAAAI,EAAA,6BArBVC,EAA6B,qCAC7BC,EAA+B,6CAC/BC,EAAkC,uCAClCC,EAAwB,iBACxBC,EAA4B,0BAC5BC,EAAoB,yBAEpB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CAAE,QAAAC,EAAS,WAAAC,EAAY,aAAAC,EAAc,aAAAC,EAAc,YAAAC,EAAa,SAAAC,EAAU,aAAAC,EAAc,OAAAC,CAAO,KACnG,qBAAkB,EAEdC,KAA8B,WAClC,IAAM,IAAI,EAAAC,QAAQN,CAAY,EAAE,MAAMG,EAAa,QAAQ,EAAE,SAAS,EACtE,CAACH,EAAcG,CAAY,CAC7B,EAEA,SACE,QAAC,OAAI,UAAU,6EACZ,UAAAN,EAAQ,oBACP,QAAC,OAAI,UAAU,sEACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QACC,UAAU,kDACV,QAAM,eAAY,CAAE,OAAQC,EAAY,aAAcD,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,EAC5F,EACCQ,MAAS,OAAC,QACT,UAAU,2EACV,QAAM,eAAY,CAChB,OAAQC,EACR,aAAcR,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GACF,EACCQ,MACC,OAAC,QACC,UAAU,iEACV,KAAM,GAAGT,GAAa,YAAY,OAAI,eAAY,CAAE,OAAQ,IAAI,EAAAW,QAAQD,CAA2B,EAAE,MAAM,IAAI,EAAAC,QAAQR,CAAU,CAAC,EAAE,SAAS,EAAG,aAAcD,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAAC,GACrM,GAEJ,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMD,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMI,IAAc,EAE5B,SAAAN,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAW,EAEzB,SAAAP,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOV,EAAQS",
6
- "names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_ProductProvider", "import_react", "import_utils", "import_decimal", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "comparePriceRemovedFreeGift", "Decimal"]
4
+ "sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const { variant, finalPrice, totalSavings, comparePrice, onAddToCart, onBuyNow, savingDetail, coupon } =\n useBizProductContext()\n\n console.log(savingDetail, 'savingDetail')\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold leading-[1.2] tablet:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {coupon &&<Text\n className=\"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />}\n </div>\n {coupon && (\n <Text\n className=\"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl\"\n html={`${copyWriting?.totalSavings} ${formatPrice({ amount: new Decimal(comparePriceRemovedFreeGift).minus(new Decimal(finalPrice)).toNumber(), currencyCode: variant.price.currencyCode, locale })}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={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AO,CAAC,CAAC,GACrM,GAEJ,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMD,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMI,IAAc,EAE5B,SAAAN,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAW,EAEzB,SAAAP,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOV,EAAQS",
6
+ "names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_decimal", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "comparePriceRemovedFreeGift", "Decimal"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var k=(o,e)=>{for(var a in e)c(o,a,{get:e[a],enumerable:!0})},C=(o,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of y(e))!g.call(o,l)&&l!==a&&c(o,l,{get:()=>e[l],enumerable:!(s=h(e,l))||s.enumerable});return o};var w=o=>C(c({},"__esModule",{value:!0}),o);var E={};k(E,{DesktopScrollSpyNav:()=>b,MobileScrollSpyNav:()=>u});module.exports=w(E);var t=require("react/jsx-runtime"),A=require("../../../../AiuiProvider/index.js"),p=require("../../../../../helpers/index.js"),n=require("react"),f=require("gsap"),m=require("../../../ProductProvider.js");const u=({tabs:o,purchaseBarHeight:e,onSpyNavItemClick:a})=>{const[s,l]=(0,n.useState)(!1),[r,v]=(0,n.useState)(o?.[0]),d=(0,n.useRef)(null),{renderRating:x}=(0,m.useProductContext)(),N=(0,n.useCallback)(i=>{v(i),a?.(i),l(!1)},[]),S=(0,n.useCallback)(()=>{l(!s),f.gsap.fromTo(d?.current,{height:0},{height:"auto",duration:.5,ease:"power2.inOut"})},[s]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("button",{className:"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black",onClick:S,children:r?.label}),(0,t.jsxs)("div",{className:(0,p.cn)("absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0",{hidden:!s}),style:{height:`calc(100dvh - ${e}px)`},children:[(0,t.jsxs)("div",{ref:d,className:"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white",children:[o?.map(i=>(0,t.jsx)("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",onClick:()=>N(i),children:i.label},i.id)),(0,t.jsx)("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",children:x})]}),(0,t.jsx)("div",{className:"flex-1",onClick:()=>l(!1)})]})]})},b=({tabs:o,onSpyNavItemClick:e})=>{const[a,s]=(0,n.useState)(o?.[0]),l=(0,n.useCallback)(r=>{s(r),e?.(r)},[]);return(0,t.jsx)("div",{className:"flex gap-8",children:o?.map(r=>(0,t.jsxs)("button",{className:"text-sm relative py-[10px] font-bold",onClick:()=>l(r),children:[r.label,(0,t.jsx)("div",{className:(0,p.cn)("absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0",{"w-full":a?.id===r.id})})]},r.id))})};
1
+ "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var k=(o,e)=>{for(var a in e)c(o,a,{get:e[a],enumerable:!0})},C=(o,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of y(e))!g.call(o,l)&&l!==a&&c(o,l,{get:()=>e[l],enumerable:!(s=h(e,l))||s.enumerable});return o};var w=o=>C(c({},"__esModule",{value:!0}),o);var E={};k(E,{DesktopScrollSpyNav:()=>b,MobileScrollSpyNav:()=>u});module.exports=w(E);var t=require("react/jsx-runtime"),A=require("../../../../AiuiProvider/index.js"),p=require("../../../../../helpers/index.js"),n=require("react"),f=require("gsap"),m=require("../../../BizProductProvider.js");const u=({tabs:o,purchaseBarHeight:e,onSpyNavItemClick:a})=>{const[s,l]=(0,n.useState)(!1),[r,v]=(0,n.useState)(o?.[0]),d=(0,n.useRef)(null),{renderRating:x}=(0,m.useBizProductContext)(),N=(0,n.useCallback)(i=>{v(i),a?.(i),l(!1)},[]),S=(0,n.useCallback)(()=>{l(!s),f.gsap.fromTo(d?.current,{height:0},{height:"auto",duration:.5,ease:"power2.inOut"})},[s]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("button",{className:"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black",onClick:S,children:r?.label}),(0,t.jsxs)("div",{className:(0,p.cn)("absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0",{hidden:!s}),style:{height:`calc(100dvh - ${e}px)`},children:[(0,t.jsxs)("div",{ref:d,className:"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white",children:[o?.map(i=>(0,t.jsx)("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",onClick:()=>N(i),children:i.label},i.id)),(0,t.jsx)("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",children:x})]}),(0,t.jsx)("div",{className:"flex-1",onClick:()=>l(!1)})]})]})},b=({tabs:o,onSpyNavItemClick:e})=>{const[a,s]=(0,n.useState)(o?.[0]),l=(0,n.useCallback)(r=>{s(r),e?.(r)},[]);return(0,t.jsx)("div",{className:"flex gap-8",children:o?.map(r=>(0,t.jsxs)("button",{className:"text-sm relative py-[10px] font-bold",onClick:()=>l(r),children:[r.label,(0,t.jsx)("div",{className:(0,p.cn)("absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0",{"w-full":a?.id===r.id})})]},r.id))})};
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/ScrollSpyNav/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useProductContext } from '../../../ProductProvider.js'\n\nconst MobileScrollSpyNav = ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [dropdownOpen, setDropdownOpen] = useState(false)\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n const dropdownRef = useRef<HTMLDivElement>(null)\n const { renderRating } = useProductContext()\n \n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n setDropdownOpen(false)\n }, [])\n\n const onDropdownOpen = useCallback(() => {\n setDropdownOpen(!dropdownOpen)\n gsap.fromTo(dropdownRef?.current, { height: 0 }, { height: 'auto', duration: 0.5, ease: 'power2.inOut' })\n }, [dropdownOpen])\n\n return (\n <div>\n <button\n className=\"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black\"\n onClick={onDropdownOpen}\n >\n {activeTab?.label}\n </button>\n <div\n className={cn('absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0', {\n ['hidden']: !dropdownOpen,\n })}\n style={{\n height: `calc(100dvh - ${purchaseBarHeight}px)`,\n }}\n >\n <div ref={dropdownRef} className=\"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white\">\n {tabs?.map(tab => (\n <button\n className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\"\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n </button>\n ))}\n <button className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\">{renderRating}</button>\n </div>\n <div className=\"flex-1\" onClick={() => setDropdownOpen(false)} />\n </div>\n </div>\n )\n}\n\nconst DesktopScrollSpyNav = ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n\n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n }, [])\n\n return (\n <div className=\"flex gap-8\">\n {tabs?.map(tab => (\n <button className=\"text-sm relative py-[10px] font-bold\" key={tab.id} onClick={() => onTabClick(tab)}>\n {tab.label}\n <div\n className={cn('absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0', {\n 'w-full': activeTab?.id === tab.id,\n })}\n />\n </button>\n ))}\n </div>\n )\n}\n\nexport { MobileScrollSpyNav, DesktopScrollSpyNav }\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,uBAAAC,IAAA,eAAAC,EAAAJ,GA0BM,IAAAK,EAAA,6BA1BNC,EAA+B,6CAC/BC,EAAmB,2CACnBC,EAA8C,iBAC9CC,EAAqB,gBAErBC,EAAkC,uCAElC,MAAMP,EAAqB,CAAC,CAAE,KAAAQ,EAAM,kBAAAC,EAAmB,kBAAAC,CAAkB,IAAyB,CAChG,KAAM,CAACC,EAAcC,CAAe,KAAI,YAAS,EAAK,EAChD,CAACC,EAAWC,CAAY,KAAI,YAASN,IAAO,CAAC,CAAC,EAC9CO,KAAc,UAAuB,IAAI,EACzC,CAAE,aAAAC,CAAa,KAAI,qBAAkB,EAErCC,KAAa,eAAaC,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,EACvBN,EAAgB,EAAK,CACvB,EAAG,CAAC,CAAC,EAECO,KAAiB,eAAY,IAAM,CACvCP,EAAgB,CAACD,CAAY,EAC7B,OAAK,OAAOI,GAAa,QAAS,CAAE,OAAQ,CAAE,EAAG,CAAE,OAAQ,OAAQ,SAAU,GAAK,KAAM,cAAe,CAAC,CAC1G,EAAG,CAACJ,CAAY,CAAC,EAEjB,SACE,QAAC,OACC,oBAAC,UACC,UAAU,uFACV,QAASQ,EAER,SAAAN,GAAW,MACd,KACA,QAAC,OACC,aAAW,MAAG,mEAAoE,CAC/E,OAAW,CAACF,CACf,CAAC,EACD,MAAO,CACL,OAAQ,iBAAiBF,CAAiB,KAC5C,EAEA,qBAAC,OAAI,IAAKM,EAAa,UAAU,mEAC9B,UAAAP,GAAM,IAAIU,MACT,OAAC,UACC,UAAU,qDAEV,QAAS,IAAMD,EAAWC,CAAG,EAE5B,SAAAA,EAAI,OAHAA,EAAI,EAIX,CACD,KACD,OAAC,UAAO,UAAU,qDAAsD,SAAAF,EAAa,GACvF,KACA,OAAC,OAAI,UAAU,SAAS,QAAS,IAAMJ,EAAgB,EAAK,EAAG,GACjE,GACF,CAEJ,EAEMb,EAAsB,CAAC,CAAE,KAAAS,EAAM,kBAAAE,CAAkB,IAAyB,CAC9E,KAAM,CAACG,EAAWC,CAAY,KAAI,YAASN,IAAO,CAAC,CAAC,EAE9CS,KAAa,eAAaC,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,CACzB,EAAG,CAAC,CAAC,EAEL,SACE,OAAC,OAAI,UAAU,aACZ,SAAAV,GAAM,IAAIU,MACT,QAAC,UAAO,UAAU,uCAAoD,QAAS,IAAMD,EAAWC,CAAG,EAChG,UAAAA,EAAI,SACL,OAAC,OACC,aAAW,MAAG,0FAA2F,CACvG,SAAUL,GAAW,KAAOK,EAAI,EAClC,CAAC,EACH,IAN4DA,EAAI,EAOlE,CACD,EACH,CAEJ",
6
- "names": ["ScrollSpyNav_exports", "__export", "DesktopScrollSpyNav", "MobileScrollSpyNav", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_helpers", "import_react", "import_gsap", "import_ProductProvider", "tabs", "purchaseBarHeight", "onSpyNavItemClick", "dropdownOpen", "setDropdownOpen", "activeTab", "setActiveTab", "dropdownRef", "renderRating", "onTabClick", "tab", "onDropdownOpen"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\n\nconst MobileScrollSpyNav = ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [dropdownOpen, setDropdownOpen] = useState(false)\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n const dropdownRef = useRef<HTMLDivElement>(null)\n const { renderRating } = useBizProductContext()\n \n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n setDropdownOpen(false)\n }, [])\n\n const onDropdownOpen = useCallback(() => {\n setDropdownOpen(!dropdownOpen)\n gsap.fromTo(dropdownRef?.current, { height: 0 }, { height: 'auto', duration: 0.5, ease: 'power2.inOut' })\n }, [dropdownOpen])\n\n return (\n <div>\n <button\n className=\"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black\"\n onClick={onDropdownOpen}\n >\n {activeTab?.label}\n </button>\n <div\n className={cn('absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0', {\n ['hidden']: !dropdownOpen,\n })}\n style={{\n height: `calc(100dvh - ${purchaseBarHeight}px)`,\n }}\n >\n <div ref={dropdownRef} className=\"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white\">\n {tabs?.map(tab => (\n <button\n className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\"\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n </button>\n ))}\n <button className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\">{renderRating}</button>\n </div>\n <div className=\"flex-1\" onClick={() => setDropdownOpen(false)} />\n </div>\n </div>\n )\n}\n\nconst DesktopScrollSpyNav = ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n\n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n }, [])\n\n return (\n <div className=\"flex gap-8\">\n {tabs?.map(tab => (\n <button className=\"text-sm relative py-[10px] font-bold\" key={tab.id} onClick={() => onTabClick(tab)}>\n {tab.label}\n <div\n className={cn('absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0', {\n 'w-full': activeTab?.id === tab.id,\n })}\n />\n </button>\n ))}\n </div>\n )\n}\n\nexport { MobileScrollSpyNav, DesktopScrollSpyNav }\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,uBAAAC,IAAA,eAAAC,EAAAJ,GA0BM,IAAAK,EAAA,6BA1BNC,EAA+B,6CAC/BC,EAAmB,2CACnBC,EAA8C,iBAC9CC,EAAqB,gBAErBC,EAAqC,0CAErC,MAAMP,EAAqB,CAAC,CAAE,KAAAQ,EAAM,kBAAAC,EAAmB,kBAAAC,CAAkB,IAAyB,CAChG,KAAM,CAACC,EAAcC,CAAe,KAAI,YAAS,EAAK,EAChD,CAACC,EAAWC,CAAY,KAAI,YAASN,IAAO,CAAC,CAAC,EAC9CO,KAAc,UAAuB,IAAI,EACzC,CAAE,aAAAC,CAAa,KAAI,wBAAqB,EAExCC,KAAa,eAAaC,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,EACvBN,EAAgB,EAAK,CACvB,EAAG,CAAC,CAAC,EAECO,KAAiB,eAAY,IAAM,CACvCP,EAAgB,CAACD,CAAY,EAC7B,OAAK,OAAOI,GAAa,QAAS,CAAE,OAAQ,CAAE,EAAG,CAAE,OAAQ,OAAQ,SAAU,GAAK,KAAM,cAAe,CAAC,CAC1G,EAAG,CAACJ,CAAY,CAAC,EAEjB,SACE,QAAC,OACC,oBAAC,UACC,UAAU,uFACV,QAASQ,EAER,SAAAN,GAAW,MACd,KACA,QAAC,OACC,aAAW,MAAG,mEAAoE,CAC/E,OAAW,CAACF,CACf,CAAC,EACD,MAAO,CACL,OAAQ,iBAAiBF,CAAiB,KAC5C,EAEA,qBAAC,OAAI,IAAKM,EAAa,UAAU,mEAC9B,UAAAP,GAAM,IAAIU,MACT,OAAC,UACC,UAAU,qDAEV,QAAS,IAAMD,EAAWC,CAAG,EAE5B,SAAAA,EAAI,OAHAA,EAAI,EAIX,CACD,KACD,OAAC,UAAO,UAAU,qDAAsD,SAAAF,EAAa,GACvF,KACA,OAAC,OAAI,UAAU,SAAS,QAAS,IAAMJ,EAAgB,EAAK,EAAG,GACjE,GACF,CAEJ,EAEMb,EAAsB,CAAC,CAAE,KAAAS,EAAM,kBAAAE,CAAkB,IAAyB,CAC9E,KAAM,CAACG,EAAWC,CAAY,KAAI,YAASN,IAAO,CAAC,CAAC,EAE9CS,KAAa,eAAaC,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,CACzB,EAAG,CAAC,CAAC,EAEL,SACE,OAAC,OAAI,UAAU,aACZ,SAAAV,GAAM,IAAIU,MACT,QAAC,UAAO,UAAU,uCAAoD,QAAS,IAAMD,EAAWC,CAAG,EAChG,UAAAA,EAAI,SACL,OAAC,OACC,aAAW,MAAG,0FAA2F,CACvG,SAAUL,GAAW,KAAOK,EAAI,EAClC,CAAC,EACH,IAN4DA,EAAI,EAOlE,CACD,EACH,CAEJ",
6
+ "names": ["ScrollSpyNav_exports", "__export", "DesktopScrollSpyNav", "MobileScrollSpyNav", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_helpers", "import_react", "import_gsap", "import_BizProductProvider", "tabs", "purchaseBarHeight", "onSpyNavItemClick", "dropdownOpen", "setDropdownOpen", "activeTab", "setActiveTab", "dropdownRef", "renderRating", "onTabClick", "tab", "onDropdownOpen"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var v=(a,e)=>{for(var o in e)c(a,o,{get:e[o],enumerable:!0})},g=(a,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!x.call(a,r)&&r!==o&&c(a,r,{get:()=>e[r],enumerable:!(l=h(e,r))||l.enumerable});return a};var N=a=>g(c({},"__esModule",{value:!0}),a);var k={};v(k,{default:()=>S});module.exports=N(k);var t=require("react/jsx-runtime"),s=require("react"),p=require("../../../../components"),D=require("gsap"),j=require("../../../AiuiProvider/index.js"),A=require("../../../../helpers/index.js"),u=require("../index.js"),d=require("../../ProductProvider.js"),i=require("./ScrollSpyNav/index.js");const P=({onSpyNavItemClick:a})=>{const[e,o]=(0,s.useState)(0),{isMobile:l,product:r,renderRating:f,isDesktop:m}=(0,d.useProductContext)(),n=(0,s.useMemo)(()=>r?.payload?.components?.find(b=>b.componentKey==="PurchaseBar")?.data||[],[r?.payload]);return(0,s.useEffect)(()=>{o(document.querySelector("#purchase-bar")?.clientHeight||0)},[]),(0,t.jsx)("div",{id:"purchase-bar",className:"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]",children:(0,t.jsx)(p.Container,{className:"py-3 desktop:pt-6 desktop:pb-0",children:(0,t.jsxs)("div",{className:"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full",children:[(0,t.jsxs)("div",{className:"flex-1 tablet:flex-none",children:[(0,t.jsx)(p.Heading,{size:2,className:"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]",html:r?.title}),m&&(0,t.jsxs)("div",{className:"flex justify-between gap-8 items-center mt-3",children:[(0,t.jsx)(i.DesktopScrollSpyNav,{tabs:n,onSpyNavItemClick:a}),f]})]}),m?(0,t.jsx)(u.ProductActions,{}):(0,t.jsx)(i.MobileScrollSpyNav,{tabs:n,purchaseBarHeight:e,onSpyNavItemClick:a})]})})})};var S=P;
1
+ "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var v=(a,e)=>{for(var o in e)c(a,o,{get:e[o],enumerable:!0})},g=(a,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!x.call(a,r)&&r!==o&&c(a,r,{get:()=>e[r],enumerable:!(l=h(e,r))||l.enumerable});return a};var N=a=>g(c({},"__esModule",{value:!0}),a);var B={};v(B,{default:()=>S});module.exports=N(B);var t=require("react/jsx-runtime"),s=require("react"),p=require("../../../../components"),z=require("gsap"),M=require("../../../AiuiProvider/index.js"),A=require("../../../../helpers/index.js"),u=require("../index.js"),d=require("../../BizProductProvider.js"),i=require("./ScrollSpyNav/index.js");const P=({onSpyNavItemClick:a})=>{const[e,o]=(0,s.useState)(0),{isMobile:l,product:r,renderRating:f,isDesktop:m}=(0,d.useBizProductContext)(),n=(0,s.useMemo)(()=>r?.payload?.components?.find(b=>b.componentKey==="PurchaseBar")?.data||[],[r?.payload]);return(0,s.useEffect)(()=>{o(document.querySelector("#purchase-bar")?.clientHeight||0)},[]),(0,t.jsx)("div",{id:"purchase-bar",className:"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]",children:(0,t.jsx)(p.Container,{className:"py-3 desktop:pt-6 desktop:pb-0",children:(0,t.jsxs)("div",{className:"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full",children:[(0,t.jsxs)("div",{className:"flex-1 tablet:flex-none",children:[(0,t.jsx)(p.Heading,{size:2,className:"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]",html:r?.title}),m&&(0,t.jsxs)("div",{className:"flex justify-between gap-8 items-center mt-3",children:[(0,t.jsx)(i.DesktopScrollSpyNav,{tabs:n,onSpyNavItemClick:a}),f]})]}),m?(0,t.jsx)(u.ProductActions,{}):(0,t.jsx)(i.MobileScrollSpyNav,{tabs:n,purchaseBarHeight:e,onSpyNavItemClick:a})]})})})};var S=P;
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 { useCallback, useEffect, useRef, useState, useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components'\nimport type { PurchaseBarProps, ScrollSpyNavProps, ScrollSpyNavItem } from './types.js'\nimport { gsap } from 'gsap'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ProductActions } from '../index.js'\nimport { useProductContext } from '../../ProductProvider.js'\nimport { MobileScrollSpyNav, DesktopScrollSpyNav } from './ScrollSpyNav/index.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const { isMobile, product, renderRating, isDesktop } = useProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\n\n useEffect(() => {\n setPurchaseBarHeight(document.querySelector('#purchase-bar')?.clientHeight || 0)\n }, [])\n\n return (\n <div id=\"purchase-bar\" className=\"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]\">\n <Container className=\"py-3 desktop:pt-6 desktop:pb-0\">\n <div className=\"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full\">\n <div className=\"flex-1 tablet:flex-none\">\n <Heading\n size={2}\n className=\"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]\"\n html={product?.title}\n />\n {isDesktop && (\n <div className=\"flex justify-between gap-8 items-center mt-3\">\n <DesktopScrollSpyNav tabs={PurchaseBarData} onSpyNavItemClick={onSpyNavItemClick} />\n {renderRating}\n </div>\n )}\n </div>\n {!isDesktop ? (\n <MobileScrollSpyNav\n tabs={PurchaseBarData}\n purchaseBarHeight={purchaseBarHeight}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n ) : (\n <ProductActions />\n )}\n </div>\n </Container>\n </div>\n )\n}\n\nexport default PurchaseBar\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2BY,IAAAI,EAAA,6BA3BZC,EAAkE,iBAClEC,EAAiD,kCAEjDC,EAAqB,gBACrBC,EAA+B,0CAC/BC,EAAmB,wCACnBC,EAA+B,uBAC/BC,EAAkC,oCAClCC,EAAwD,mCAExD,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAACC,EAAmBC,CAAoB,KAAI,YAAS,CAAC,EACtD,CAAE,SAAAC,EAAU,QAAAC,EAAS,aAAAC,EAAc,UAAAC,CAAU,KAAI,qBAAkB,EAEnEC,KAAkB,WAAQ,IACvBH,GAAS,SAAS,YAAY,KAAMI,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACJ,GAAS,OAAO,CAAC,EAErB,sBAAU,IAAM,CACdF,EAAqB,SAAS,cAAc,eAAe,GAAG,cAAgB,CAAC,CACjF,EAAG,CAAC,CAAC,KAGH,OAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,mBAAC,aAAU,UAAU,iCACnB,oBAAC,OAAI,UAAU,iFACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,KAAM,EACN,UAAU,mFACV,KAAME,GAAS,MACjB,EACCE,MACC,QAAC,OAAI,UAAU,+CACb,oBAAC,uBAAoB,KAAMC,EAAiB,kBAAmBP,EAAmB,EACjFK,GACH,GAEJ,EACEC,KAOA,OAAC,mBAAe,KANhB,OAAC,sBACC,KAAMC,EACN,kBAAmBN,EACnB,kBAAmBD,EACrB,GAIJ,EACF,EACF,CAEJ,EAEA,IAAOZ,EAAQW",
6
- "names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_gsap", "import_AiuiProvider", "import_helpers", "import__", "import_ProductProvider", "import_ScrollSpyNav", "PurchaseBar", "onSpyNavItemClick", "purchaseBarHeight", "setPurchaseBarHeight", "isMobile", "product", "renderRating", "isDesktop", "PurchaseBarData", "item"]
4
+ "sourcesContent": ["import { useCallback, useEffect, useRef, useState, useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components'\nimport type { PurchaseBarProps, ScrollSpyNavProps, ScrollSpyNavItem } from './types.js'\nimport { gsap } from 'gsap'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { MobileScrollSpyNav, DesktopScrollSpyNav } from './ScrollSpyNav/index.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const { isMobile, product, renderRating, isDesktop } = useBizProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\n\n useEffect(() => {\n setPurchaseBarHeight(document.querySelector('#purchase-bar')?.clientHeight || 0)\n }, [])\n\n return (\n <div id=\"purchase-bar\" className=\"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]\">\n <Container className=\"py-3 desktop:pt-6 desktop:pb-0\">\n <div className=\"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full\">\n <div className=\"flex-1 tablet:flex-none\">\n <Heading\n size={2}\n className=\"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]\"\n html={product?.title}\n />\n {isDesktop && (\n <div className=\"flex justify-between gap-8 items-center mt-3\">\n <DesktopScrollSpyNav tabs={PurchaseBarData} onSpyNavItemClick={onSpyNavItemClick} />\n {renderRating}\n </div>\n )}\n </div>\n {!isDesktop ? (\n <MobileScrollSpyNav\n tabs={PurchaseBarData}\n purchaseBarHeight={purchaseBarHeight}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n ) : (\n <ProductActions />\n )}\n </div>\n </Container>\n </div>\n )\n}\n\nexport default PurchaseBar\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2BY,IAAAI,EAAA,6BA3BZC,EAAkE,iBAClEC,EAAiD,kCAEjDC,EAAqB,gBACrBC,EAA+B,0CAC/BC,EAAmB,wCACnBC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAwD,mCAExD,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAACC,EAAmBC,CAAoB,KAAI,YAAS,CAAC,EACtD,CAAE,SAAAC,EAAU,QAAAC,EAAS,aAAAC,EAAc,UAAAC,CAAU,KAAI,wBAAqB,EAEtEC,KAAkB,WAAQ,IACvBH,GAAS,SAAS,YAAY,KAAMI,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACJ,GAAS,OAAO,CAAC,EAErB,sBAAU,IAAM,CACdF,EAAqB,SAAS,cAAc,eAAe,GAAG,cAAgB,CAAC,CACjF,EAAG,CAAC,CAAC,KAGH,OAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,mBAAC,aAAU,UAAU,iCACnB,oBAAC,OAAI,UAAU,iFACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,KAAM,EACN,UAAU,mFACV,KAAME,GAAS,MACjB,EACCE,MACC,QAAC,OAAI,UAAU,+CACb,oBAAC,uBAAoB,KAAMC,EAAiB,kBAAmBP,EAAmB,EACjFK,GACH,GAEJ,EACEC,KAOA,OAAC,mBAAe,KANhB,OAAC,sBACC,KAAMC,EACN,kBAAmBN,EACnB,kBAAmBD,EACrB,GAIJ,EACF,EACF,CAEJ,EAEA,IAAOZ,EAAQW",
6
+ "names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_gsap", "import_AiuiProvider", "import_helpers", "import__", "import_BizProductProvider", "import_ScrollSpyNav", "PurchaseBar", "onSpyNavItemClick", "purchaseBarHeight", "setPurchaseBarHeight", "isMobile", "product", "renderRating", "isDesktop", "PurchaseBarData", "item"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var x=(e,n)=>{for(var l in n)u(e,l,{get:n[l],enumerable:!0})},D=(e,n,l,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of C(n))!I.call(e,t)&&t!==l&&u(e,t,{get:()=>n[t],enumerable:!(i=h(n,t))||i.enumerable});return e};var G=e=>D(u({},"__esModule",{value:!0}),e);var R={};x(R,{useBenefits:()=>P});module.exports=G(R);var m=require("../ProductProvider"),d=require("../utils/helper"),p=require("../../AiuiProvider/index.js");const P=({variant:e})=>{const{coupon:n,product:l,bundle:i,freeGift:t,memberFunctionResult:a,creditsRedemptionAmount:s}=(0,m.useProductContext)(),{trackingData:f}=(0,p.useAiuiContext)(),r=Math.max(a?.withCouponMemberTotalSave??0,a?.withoutCouponMaxMemberTotalSave??0),g=!!(f?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),c=f?.freeGift,b=c?.excludeProducts?.map(o=>typeof o=="object"&&"sku"in o?o.sku:o)??[],B=f?.levelDiscount&&(0,d.checkItemAvailableForProduct)({product:l,variant:e,item:f?.levelDiscount});return{commonCoupon:{enable:!!n,config:n??{}},freeGift:{enable:!!t&&!!t?.giftList?.length,config:t},bundle:{enable:!!i&&!!i?.bundleList?.length&&Math.max(...i?.bundleList?.map(o=>o.savings??0))>0,config:i},memberDiscount:{enable:r>0,config:{amount:r,description:a?.labels?.find(o=>o.key==="benefit_tab_string")?.value}},creditsRedemption:{enable:!!s&&s>0,config:{amount:s,label:f?.creditsRedemptionLabel}},paidShipping:{enable:g,config:{}},fullGift:{enable:!!(c&&!b.includes(e.sku)),config:c??{}},levelDiscount:{enable:!!B,config:f?.levelDiscount??{}}}};
1
+ "use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var x=(e,n)=>{for(var l in n)u(e,l,{get:n[l],enumerable:!0})},D=(e,n,l,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of C(n))!I.call(e,t)&&t!==l&&u(e,t,{get:()=>n[t],enumerable:!(i=h(n,t))||i.enumerable});return e};var G=e=>D(u({},"__esModule",{value:!0}),e);var R={};x(R,{useBenefits:()=>P});module.exports=G(R);var m=require("../BizProductProvider"),d=require("../utils/helper"),p=require("../../AiuiProvider/index.js");const P=({variant:e})=>{const{coupon:n,product:l,bundle:i,freeGift:t,memberFunctionResult:a,creditsRedemptionAmount:s,discount:v}=(0,m.useBizProductContext)(),{trackingData:f}=(0,p.useAiuiContext)(),r=Math.max(a?.withCouponMemberTotalSave??0,a?.withoutCouponMaxMemberTotalSave??0),g=!!(f?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),c=f?.freeGift,b=c?.excludeProducts?.map(o=>typeof o=="object"&&"sku"in o?o.sku:o)??[],B=f?.levelDiscount&&(0,d.checkItemAvailableForProduct)({product:l,variant:e,item:f?.levelDiscount});return{commonCoupon:{enable:!!n,config:n??{}},freeGift:{enable:!!t&&!!t?.giftList?.length,config:t},bundle:{enable:!!i&&!!i?.bundleList?.length&&Math.max(...i?.bundleList?.map(o=>o.savings??0))>0,config:i},memberDiscount:{enable:r>0,config:{amount:r,description:a?.labels?.find(o=>o.key==="benefit_tab_string")?.value}},creditsRedemption:{enable:!!s&&s>0,config:{amount:s,label:f?.creditsRedemptionLabel}},paidShipping:{enable:g,config:{}},fullGift:{enable:!!(c&&!b.includes(e.sku)),config:c??{}},levelDiscount:{enable:!!B,config:f?.levelDiscount??{}}}};
2
2
  //# sourceMappingURL=useBenefits.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/biz-components/Listing/hooks/useBenefits.ts"],
4
- "sourcesContent": ["import { useProductContext } from '../ProductProvider'\nimport type { ProductVariant, FreeGift, Bundle } from '../types/product'\nimport { checkItemAvailableForProduct } from '../utils/helper'\n\n\nimport { useAiuiContext } from '../../AiuiProvider/index.js'\n\ninterface BenefitsParams {\n variant: ProductVariant\n}\n\ninterface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {\n enable: boolean\n config?: T // \u539F\u59CB\u914D\u7F6E\n}\n\ninterface BenefitsResult {\n /**\n * \u901A\u7528\u4F18\u60E0\u5238\n */\n commonCoupon?: BenefitItemConfig\n /**\n * \u4E70\u8D60\n */\n freeGift: BenefitItemConfig<FreeGift>\n /**\n * \u6346\u7ED1\u6298\u6263\n */\n bundle: BenefitItemConfig<Bundle>\n /**\n * \u4F1A\u5458\u4EF7\n */\n memberDiscount: BenefitItemConfig\n /**\n * \u79EF\u5206\u62B5\u73B0\n */\n creditsRedemption: BenefitItemConfig\n /**\n * \u9AD8\u6807\u7269\u6D41\n */\n paidShipping: BenefitItemConfig\n\n /**\n * \u6EE1\u8D60\n */\n fullGift: BenefitItemConfig\n\n /**\n * \u6EE1\u51CF\u6298\u6263\n */\n levelDiscount: BenefitItemConfig\n}\n\n/**\n * \u5546\u54C1\u6743\u76CA\n * \u83B7\u53D6\u5F53\u524Dsku \u6240\u6709\u7684\u6743\u76CA\n * \u5305\u62EC \u901A\u7528\u4F18\u60E0\u5238\uFF0C\u4F1A\u5458\u4EF7\uFF0C\u6EE1\u51CF\uFF0C\u6346\u7ED1\u6298\u6263\uFF0C\u4E70\u8D60 \uFF0C\u6EE1\u8D60 \uFF0C\u79EF\u5206\u62B5\u73B0\n * @returns\n */\nexport const useBenefits = ({\n variant,\n}: BenefitsParams): BenefitsResult => {\n const { coupon, product, bundle, freeGift, memberFunctionResult, creditsRedemptionAmount } = useProductContext()\n\n const { trackingData } = useAiuiContext()\n\n const total = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n // \u9AD8\u6807\u7269\u6D41\n const showPaidShipping = Boolean(\n trackingData?.paidShipping &&\n variant.requiresShipping &&\n !variant?.metafields?.global?.presell &&\n !variant?.metafields?.global?.HideShipping\n )\n\n // \u811A\u672C\u6EE1\u8D60\n const fullGift = trackingData?.freeGift\n const excludeProducts =\n fullGift?.excludeProducts?.map((item: any) => (typeof item === 'object' && 'sku' in item ? item.sku : item)) ?? []\n\n const showLevelDiscount =\n trackingData?.levelDiscount &&\n checkItemAvailableForProduct({ product, variant, item: trackingData?.levelDiscount })\n\n return {\n commonCoupon: {\n enable: Boolean(coupon),\n config: coupon ?? {},\n },\n freeGift: {\n enable: Boolean(freeGift) && !!freeGift?.giftList?.length,\n config: freeGift,\n },\n bundle: {\n enable:\n Boolean(bundle) &&\n !!bundle?.bundleList?.length &&\n Math.max(...bundle?.bundleList?.map(item => item.savings ?? 0)) > 0, // \u6709\u4F18\u60E0\u624D\u5C55\u793A\n config: bundle,\n },\n memberDiscount: {\n enable: total > 0,\n config: {\n amount: total,\n description: memberFunctionResult?.labels?.find((item: any) => item.key === 'benefit_tab_string')?.value,\n },\n },\n creditsRedemption: {\n enable: Boolean(creditsRedemptionAmount) && creditsRedemptionAmount! > 0,\n config: { amount: creditsRedemptionAmount, label: trackingData?.creditsRedemptionLabel },\n },\n paidShipping: {\n enable: showPaidShipping,\n config: {},\n },\n fullGift: {\n enable: Boolean(fullGift && !excludeProducts.includes(variant.sku)),\n config: fullGift ?? {},\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AcA,EAAK,MAAQ,oBAAoB,GAAG,KACrG,CACF,EACA,kBAAmB,CACjB,OAAQ,EAAQN,GAA4BA,EAA2B,EACvE,OAAQ,CAAE,OAAQA,EAAyB,MAAOC,GAAc,sBAAuB,CACzF,EACA,aAAc,CACZ,OAAQE,EACR,OAAQ,CAAC,CACX,EACA,SAAU,CACR,OAAQ,GAAQC,GAAY,CAACC,EAAgB,SAASX,EAAQ,GAAG,GACjE,OAAQU,GAAY,CAAC,CACvB,EACA,cAAe,CACb,OAAQ,EAAQG,EAChB,OAAQN,GAAc,eAAiB,CAAC,CAC1C,CACF,CACF",
6
- "names": ["useBenefits_exports", "__export", "useBenefits", "__toCommonJS", "import_ProductProvider", "import_helper", "import_AiuiProvider", "variant", "coupon", "product", "bundle", "freeGift", "memberFunctionResult", "creditsRedemptionAmount", "trackingData", "total", "showPaidShipping", "fullGift", "excludeProducts", "item", "showLevelDiscount"]
4
+ "sourcesContent": ["import { useBizProductContext } from '../BizProductProvider'\nimport type { ProductVariant, FreeGift, Bundle } from '../types/product'\nimport { checkItemAvailableForProduct } from '../utils/helper'\n\n\nimport { useAiuiContext } from '../../AiuiProvider/index.js'\n\ninterface BenefitsParams {\n variant: ProductVariant\n}\n\ninterface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {\n enable: boolean\n config?: T // \u539F\u59CB\u914D\u7F6E\n}\n\ninterface BenefitsResult {\n /**\n * \u901A\u7528\u4F18\u60E0\u5238\n */\n commonCoupon?: BenefitItemConfig\n /**\n * \u4E70\u8D60\n */\n freeGift: BenefitItemConfig<FreeGift>\n /**\n * \u6346\u7ED1\u6298\u6263\n */\n bundle: BenefitItemConfig<Bundle>\n /**\n * \u4F1A\u5458\u4EF7\n */\n memberDiscount: BenefitItemConfig\n /**\n * \u79EF\u5206\u62B5\u73B0\n */\n creditsRedemption: BenefitItemConfig\n /**\n * \u9AD8\u6807\u7269\u6D41\n */\n paidShipping: BenefitItemConfig\n\n /**\n * \u6EE1\u8D60\n */\n fullGift: BenefitItemConfig\n\n /**\n * \u6EE1\u51CF\u6298\u6263\n */\n levelDiscount: BenefitItemConfig\n}\n\n/**\n * \u5546\u54C1\u6743\u76CA\n * \u83B7\u53D6\u5F53\u524Dsku \u6240\u6709\u7684\u6743\u76CA\n * \u5305\u62EC \u901A\u7528\u4F18\u60E0\u5238\uFF0C\u4F1A\u5458\u4EF7\uFF0C\u6EE1\u51CF\uFF0C\u6346\u7ED1\u6298\u6263\uFF0C\u4E70\u8D60 \uFF0C\u6EE1\u8D60 \uFF0C\u79EF\u5206\u62B5\u73B0\n * @returns\n */\nexport const useBenefits = ({\n variant,\n}: BenefitsParams): BenefitsResult => {\n const { coupon, product, bundle, freeGift, memberFunctionResult, creditsRedemptionAmount, discount } = useBizProductContext()\n\n const { trackingData } = useAiuiContext()\n\n const total = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n // \u9AD8\u6807\u7269\u6D41\n const showPaidShipping = Boolean(\n trackingData?.paidShipping &&\n variant.requiresShipping &&\n !variant?.metafields?.global?.presell &&\n !variant?.metafields?.global?.HideShipping\n )\n\n // \u811A\u672C\u6EE1\u8D60\n const fullGift = trackingData?.freeGift\n const excludeProducts =\n fullGift?.excludeProducts?.map((item: any) => (typeof item === 'object' && 'sku' in item ? item.sku : item)) ?? []\n\n const showLevelDiscount =\n trackingData?.levelDiscount &&\n checkItemAvailableForProduct({ product, variant, item: trackingData?.levelDiscount })\n\n return {\n commonCoupon: {\n enable: Boolean(coupon),\n config: coupon ?? {},\n },\n freeGift: {\n enable: Boolean(freeGift) && !!freeGift?.giftList?.length,\n config: freeGift,\n },\n bundle: {\n enable:\n Boolean(bundle) &&\n !!bundle?.bundleList?.length &&\n Math.max(...bundle?.bundleList?.map(item => item.savings ?? 0)) > 0, // \u6709\u4F18\u60E0\u624D\u5C55\u793A\n config: bundle,\n },\n memberDiscount: {\n enable: total > 0,\n config: {\n amount: total,\n description: memberFunctionResult?.labels?.find((item: any) => item.key === 'benefit_tab_string')?.value,\n },\n },\n creditsRedemption: {\n enable: Boolean(creditsRedemptionAmount) && creditsRedemptionAmount! > 0,\n config: { amount: creditsRedemptionAmount, label: trackingData?.creditsRedemptionLabel },\n },\n paidShipping: {\n enable: showPaidShipping,\n config: {},\n },\n fullGift: {\n enable: Boolean(fullGift && !excludeProducts.includes(variant.sku)),\n config: fullGift ?? {},\n },\n levelDiscount: {\n enable: Boolean(showLevelDiscount),\n config: trackingData?.levelDiscount ?? {},\n },\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAqC,iCAErCC,EAA6C,2BAG7CC,EAA+B,uCAsDxB,MAAMJ,EAAc,CAAC,CAC1B,QAAAK,CACF,IAAsC,CACpC,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,OAAAC,EAAQ,SAAAC,EAAU,qBAAAC,EAAsB,wBAAAC,EAAyB,SAAAC,CAAS,KAAI,wBAAqB,EAEtH,CAAE,aAAAC,CAAa,KAAI,kBAAe,EAElCC,EAAQ,KAAK,IACjBJ,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAGMK,EAAmB,GACvBF,GAAc,cACZR,EAAQ,kBACR,CAACA,GAAS,YAAY,QAAQ,SAC9B,CAACA,GAAS,YAAY,QAAQ,cAI5BW,EAAWH,GAAc,SACzBI,EACJD,GAAU,iBAAiB,IAAKE,GAAe,OAAOA,GAAS,UAAY,QAASA,EAAOA,EAAK,IAAMA,CAAK,GAAK,CAAC,EAE7GC,EACJN,GAAc,kBACd,gCAA6B,CAAE,QAAAN,EAAS,QAAAF,EAAS,KAAMQ,GAAc,aAAc,CAAC,EAEtF,MAAO,CACL,aAAc,CACZ,OAAQ,EAAQP,EAChB,OAAQA,GAAU,CAAC,CACrB,EACA,SAAU,CACR,OAAQ,EAAQG,GAAa,CAAC,CAACA,GAAU,UAAU,OACnD,OAAQA,CACV,EACA,OAAQ,CACN,OACE,EAAQD,GACR,CAAC,CAACA,GAAQ,YAAY,QACtB,KAAK,IAAI,GAAGA,GAAQ,YAAY,IAAIU,GAAQA,EAAK,SAAW,CAAC,CAAC,EAAI,EACpE,OAAQV,CACV,EACA,eAAgB,CACd,OAAQM,EAAQ,EAChB,OAAQ,CACN,OAAQA,EACR,YAAaJ,GAAsB,QAAQ,KAAMQ,GAAcA,EAAK,MAAQ,oBAAoB,GAAG,KACrG,CACF,EACA,kBAAmB,CACjB,OAAQ,EAAQP,GAA4BA,EAA2B,EACvE,OAAQ,CAAE,OAAQA,EAAyB,MAAOE,GAAc,sBAAuB,CACzF,EACA,aAAc,CACZ,OAAQE,EACR,OAAQ,CAAC,CACX,EACA,SAAU,CACR,OAAQ,GAAQC,GAAY,CAACC,EAAgB,SAASZ,EAAQ,GAAG,GACjE,OAAQW,GAAY,CAAC,CACvB,EACA,cAAe,CACb,OAAQ,EAAQG,EAChB,OAAQN,GAAc,eAAiB,CAAC,CAC1C,CACF,CACF",
6
+ "names": ["useBenefits_exports", "__export", "useBenefits", "__toCommonJS", "import_BizProductProvider", "import_helper", "import_AiuiProvider", "variant", "coupon", "product", "bundle", "freeGift", "memberFunctionResult", "creditsRedemptionAmount", "discount", "trackingData", "total", "showPaidShipping", "fullGift", "excludeProducts", "item", "showLevelDiscount"]
7
7
  }
@@ -1,3 +1,3 @@
1
- import { type ProductContextType } from './ProductProvider.js';
1
+ import { type ProductContextType } from './BizProductProvider.js';
2
2
  declare const Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>>;
3
3
  export default Listing;
@@ -1,2 +1,2 @@
1
- "use strict";var z=Object.create;var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},p=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of J(o))!Q.call(e,r)&&r!==t&&d(e,r,{get:()=>o[r],enumerable:!(n=F(o,r))||n.enumerable});return e};var E=(e,o,t)=>(t=e!=null?z(K(e)):{},p(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),H=e=>p(d({},"__esModule",{value:!0}),e);var W={};V(W,{default:()=>U});module.exports=H(W);var i=require("react/jsx-runtime"),m=require("../AiuiProvider/index.js"),c=require("./components/index.js"),u=E(require("./ProductProvider.js")),y=require("./components/index.js"),a=require("react-responsive");const l=({product:e,renderRating:o,variant:t,selectedOptions:n,setSelectedOptions:r,isLogin:X,finalPrice:f,coupon:P,comparePrice:v,totalSavings:C,savingDetail:S,freeGift:g,bundle:h,checkedBundle:k,checkedGift:N,setCheckedBundle:x,setCheckedGift:B,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:G,renderAffirm:L,renderKlarna:O,renderPaypal:T})=>{const{locale:Y}=(0,m.useAiuiContext)(),s=(0,a.useMediaQuery)({query:"(max-width: 768px)"}),q=(0,a.useMediaQuery)({query:"(min-width: 1440px)"});return(0,i.jsx)(u.default,{product:e,isMobile:s,isDesktop:q,freeGift:g,renderRating:o,finalPrice:f,comparePrice:v,totalSavings:C,savingDetail:S,variant:t,selectedOptions:n,setSelectedOptions:r,bundle:h,coupon:P,checkedBundle:k,checkedGift:N,setCheckedBundle:x,setCheckedGift:B,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:G,renderAffirm:L,renderKlarna:O,renderPaypal:T,children:(0,i.jsxs)("div",{id:"ipc-listing",children:[(0,i.jsx)(c.PurchaseBar,{onSpyNavItemClick:j=>{console.log(j)}}),s&&(0,i.jsx)("div",{className:"fixed bottom-0 left-0 w-full z-[60]",children:(0,i.jsx)(c.ProductActions,{})}),(0,i.jsx)(y.ProductCard,{})]})})};l.displayName="Listing";var U=l;
1
+ "use strict";var j=Object.create;var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},p=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of J(o))!Q.call(e,r)&&r!==t&&d(e,r,{get:()=>o[r],enumerable:!(n=F(o,r))||n.enumerable});return e};var E=(e,o,t)=>(t=e!=null?j(K(e)):{},p(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),H=e=>p(d({},"__esModule",{value:!0}),e);var W={};V(W,{default:()=>U});module.exports=H(W);var i=require("react/jsx-runtime"),m=require("../AiuiProvider/index.js"),c=require("./components/index.js"),u=E(require("./BizProductProvider.js")),y=require("./components/index.js"),a=require("react-responsive");const l=({product:e,renderRating:o,variant:t,selectedOptions:n,setSelectedOptions:r,isLogin:X,finalPrice:f,coupon:P,comparePrice:v,totalSavings:C,savingDetail:S,freeGift:g,bundle:h,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderAffirm:G,renderKlarna:L,renderPaypal:O})=>{const{locale:Y}=(0,m.useAiuiContext)(),s=(0,a.useMediaQuery)({query:"(max-width: 768px)"}),T=(0,a.useMediaQuery)({query:"(min-width: 1440px)"});return(0,i.jsx)(u.default,{product:e,isMobile:s,isDesktop:T,freeGift:g,renderRating:o,finalPrice:f,comparePrice:v,totalSavings:C,savingDetail:S,variant:t,selectedOptions:n,setSelectedOptions:r,bundle:h,coupon:P,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderAffirm:G,renderKlarna:L,renderPaypal:O,children:(0,i.jsxs)("div",{id:"ipc-listing",children:[(0,i.jsx)(c.PurchaseBar,{onSpyNavItemClick:q=>{console.log(q)}}),s&&(0,i.jsx)("div",{className:"fixed bottom-0 left-0 w-full z-[60]",children:(0,i.jsx)(c.ProductActions,{})}),(0,i.jsx)(y.ProductCard,{})]})})};l.displayName="Listing";var U=l;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport ProductProvider, { type ProductContextType } from './ProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <ProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderAffirm={renderAffirm}\n renderKlarna={renderKlarna}\n renderPaypal={renderPaypal}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 w-full z-[60]\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </ProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA+EM,IAAAI,EAAA,6BA/ENC,EAA+B,oCAC/BC,EAA4C,iCAE5CC,EAAyD,mCACzDD,EAA4B,iCAE5BE,EAA8B,4BAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,KAAI,kBAAe,EAE5BC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAY,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,SACE,OAAC,EAAAC,QAAA,CACC,QAAS/B,EACT,SAAU6B,EACV,UAAWC,EACX,SAAUnB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,aAAcC,EACd,aAAcC,EACd,aAAcC,EAEd,oBAAC,OAAI,GAAG,cACN,oBAAC,eAAY,kBArCQK,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAmCyD,EAClDH,MACC,OAAC,OAAI,UAAU,sCACb,mBAAC,mBAAe,EAClB,KAEF,OAAC,gBAAY,GACf,EACF,CAEJ,EAEA9B,EAAQ,YAAc,UAEtB,IAAOP,EAAQO",
6
- "names": ["Listing_exports", "__export", "Listing_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_ProductProvider", "import_react_responsive", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderAffirm", "renderKlarna", "renderPaypal", "locale", "isMobile", "isDesktop", "ProductProvider", "tab"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport BizProductProvider, { type ProductContextType } from './BizProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <BizProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderAffirm={renderAffirm}\n renderKlarna={renderKlarna}\n renderPaypal={renderPaypal}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 w-full z-[60]\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </BizProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA+EM,IAAAI,EAAA,6BA/ENC,EAA+B,oCAC/BC,EAA4C,iCAE5CC,EAA4D,sCAC5DD,EAA4B,iCAE5BE,EAA8B,4BAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,KAAI,kBAAe,EAE5BC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAY,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,SACE,OAAC,EAAAC,QAAA,CACC,QAAS/B,EACT,SAAU6B,EACV,UAAWC,EACX,SAAUnB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,aAAcC,EACd,aAAcC,EACd,aAAcC,EAEd,oBAAC,OAAI,GAAG,cACN,oBAAC,eAAY,kBArCQK,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAmCyD,EAClDH,MACC,OAAC,OAAI,UAAU,sCACb,mBAAC,mBAAe,EAClB,KAEF,OAAC,gBAAY,GACf,EACF,CAEJ,EAEA9B,EAAQ,YAAc,UAEtB,IAAOP,EAAQO",
6
+ "names": ["Listing_exports", "__export", "Listing_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_BizProductProvider", "import_react_responsive", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderAffirm", "renderKlarna", "renderPaypal", "locale", "isMobile", "isDesktop", "BizProductProvider", "tab"]
7
7
  }
@@ -19,3 +19,10 @@ export type CompareData = {
19
19
  };
20
20
  show: boolean;
21
21
  };
22
+ export type DiscountData = {
23
+ codeSavings: number;
24
+ scriptSavings: number;
25
+ totalSavings: number;
26
+ comparePrice: number;
27
+ finalPrice: number;
28
+ };
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var s=(r,t,p,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of i(t))!c.call(r,e)&&e!==p&&a(r,e,{get:()=>t[e],enumerable:!(o=m(t,e))||o.enumerable});return r};var n=r=>s(a({},"__esModule",{value:!0}),r);var d={};module.exports=n(d);
1
+ "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var c=(e,t,p,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of i(t))!n.call(e,r)&&r!==p&&a(e,r,{get:()=>t[r],enumerable:!(o=m(t,r))||o.enumerable});return e};var s=e=>c(a({},"__esModule",{value:!0}),e);var u={};module.exports=s(u);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/types.ts"],
4
- "sourcesContent": ["import type { Product } from './types/product'\n\nexport type CompareProductItem = {\n handle: string\n shortName: string\n compareProductCollection?: string\n}\n\nexport type CompareItem = { product: Product } & CompareProductItem\n\nexport type CompareData = {\n data: {\n availableCompareList: Array<CompareItem>\n currentProductCompareData?: CompareItem\n options: { value: string; text: string }[]\n specificationKeys?: string[]\n }\n show: boolean\n}\n"],
4
+ "sourcesContent": ["import type { Product } from './types/product'\n\nexport type CompareProductItem = {\n handle: string\n shortName: string\n compareProductCollection?: string\n}\n\nexport type CompareItem = { product: Product } & CompareProductItem\n\nexport type CompareData = {\n data: {\n availableCompareList: Array<CompareItem>\n currentProductCompareData?: CompareItem\n options: { value: string; text: string }[]\n specificationKeys?: string[]\n }\n show: boolean\n}\n\nexport type DiscountData = {\n codeSavings: number\n scriptSavings: number\n totalSavings: number\n comparePrice: number\n finalPrice: number\n}"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -40,7 +40,7 @@ export { default as Paginator } from './Paginator/index.js';
40
40
  export { default as CollectionsBanner } from './CollectionsBanner/index.js';
41
41
  export { default as TextMarquee } from './TextMarquee/index.js';
42
42
  export { default as CollectionShelves } from './CollectionShelves/index.js';
43
- export { default as ProductProvider } from './Listing/ProductProvider.js';
43
+ export { default as BizProductProvider } from './Listing/BizProductProvider.js';
44
44
  export { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js';
45
45
  export { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js';
46
46
  export { default as ProductCard } from './Listing/components/ProductCard/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var he=Object.create;var l=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var Ge=(r,t)=>{for(var a in t)l(r,a,{get:t[a],enumerable:!0})},d=(r,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of Be(t))!Ce.call(r,f)&&f!==a&&l(r,f,{get:()=>t[f],enumerable:!(p=ye(t,f))||p.enumerable});return r};var e=(r,t,a)=>(a=r!=null?he(ge(r)):{},d(t||!r||!r.__esModule?l(a,"default",{value:r,enumerable:!0}):a,r)),Me=r=>d(l({},"__esModule",{value:!0}),r);var Se={};Ge(Se,{AccordionCards:()=>B.default,AiuiProvider:()=>H.default,AplusDesc:()=>se.default,BenefitsTab:()=>le.default,BrandEquity:()=>s.default,Category:()=>h.default,CollectionShelves:()=>K.default,CollectionsBanner:()=>z.default,CollectionsFilters:()=>W.default,CreativeModule:()=>I.default,DownLoad:()=>ie.default,Evaluate:()=>P.default,Faq:()=>A.default,Features:()=>de.default,FilterCardWrap:()=>O.default,FilterCardWrapItem:()=>_.default,FilterHeader:()=>N.default,FilterList:()=>w.default,FootCharger:()=>ce.default,FooterNavigation:()=>k.default,GiftBox:()=>me.default,Graphic:()=>g.default,GraphicAttractionBlock:()=>q.default,GraphicMore:()=>pe.default,GraphicOverlay:()=>j.default,HeaderNavigation:()=>v.default,HeroBanner:()=>y.default,IPC_SEARCH_PAGE:()=>u.IPC_SEARCH_PAGE,Listing:()=>L.default,Marquee:()=>S.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>C.default,MediaPlayerMulti:()=>M.default,MediaPlayerSticky:()=>G.default,MemberEquity:()=>m.default,MultiLayoutGraphicBlock:()=>T.default,Paginator:()=>R.default,PaidShipping:()=>ue.default,ProductActions:()=>V.default,ProductBenefitsTabs:()=>Y.default,ProductBundle:()=>re.default,ProductCard:()=>X.default,ProductDetail:()=>oe.default,ProductFreeGift:()=>$.default,ProductGallery:()=>ae.default,ProductGridBox:()=>te.default,ProductHighlight:()=>Z.default,ProductOptions:()=>ee.default,ProductProvider:()=>Q.default,ProductSummary:()=>fe.default,PurchaseBar:()=>U.default,SearchPage:()=>b.default,SearchPageTabType:()=>u.SearchPageTabType,SelectStore:()=>xe.default,ShelfDisplay:()=>n.default,Slogan:()=>x.default,Spacer:()=>c.default,Specs:()=>ne.default,TabGroup:()=>Pe.default,Tabs:()=>D.default,TextMarquee:()=>J.default,Title:()=>i.default,WhyChoose:()=>F.default,withLayout:()=>E.withLayout});module.exports=Me(Se);var s=e(require("./BrandEquity/index.js")),m=e(require("./MemberEquity/index.js")),x=e(require("./Slogan/index.js")),i=e(require("./Title/index.js")),c=e(require("./Spacer/index.js")),n=e(require("./ShelfDisplay/index.js")),P=e(require("./Evaluate/index.js")),h=e(require("./Category/index.js")),y=e(require("./HeroBanner/index.js")),B=e(require("./AccordionCards/index.js")),g=e(require("./Graphic/index.js")),C=e(require("./MediaPlayerBase/index.js")),G=e(require("./MediaPlayerSticky/index.js")),M=e(require("./MediaPlayerMulti/index.js")),S=e(require("./Marquee/index.js")),F=e(require("./WhyChoose/index.js")),A=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),T=e(require("./MultiLayoutGraphicBlock/index.js")),q=e(require("./GraphicAttractionBlock/index.js")),v=e(require("./HeaderNavigation/index.js")),k=e(require("./FooterNavigation/index.js")),L=e(require("./Listing/index.js")),b=e(require("./SearchPage/index.js")),u=require("./SearchPage/types.js"),E=require("../shared/Styles.js"),H=e(require("./AiuiProvider/index.js")),D=e(require("./Tabs/index.js")),I=e(require("./CreativeModule/index.js")),j=e(require("./GraphicOverlay/index.js")),W=e(require("./CollectionsFilters/index.js")),w=e(require("./CollectionsFilters/FilterList.js")),N=e(require("./CollectionsFilters/FilterHeader.js")),O=e(require("./CollectionsFilters/FilterCardWrap.js")),_=e(require("./CollectionsFilters/FilterCardWrapItem.js")),R=e(require("./Paginator/index.js")),z=e(require("./CollectionsBanner/index.js")),J=e(require("./TextMarquee/index.js")),K=e(require("./CollectionShelves/index.js")),Q=e(require("./Listing/ProductProvider.js")),U=e(require("./Listing/components/PurchaseBar/index.js")),V=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Y=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),te=e(require("./Listing/components/ProductCard/ProductGridBox.js")),ae=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),fe=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),le=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab")),ue=e(require("./Listing/components/PaidShipping/index.js")),pe=e(require("./GraphicMore/index.js")),de=e(require("./Features/index.js")),se=e(require("./AplusDesc/index.js")),me=e(require("./GiftBox/index.js")),xe=e(require("./SelectStore/index.js")),ie=e(require("./DownLoad/index.js")),ce=e(require("./FootCharger/index.js")),ne=e(require("./Specs/index.js")),Pe=e(require("./TabsGroup/index.js"));
1
+ "use strict";var he=Object.create;var l=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var Ge=(r,t)=>{for(var a in t)l(r,a,{get:t[a],enumerable:!0})},d=(r,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of Be(t))!Ce.call(r,f)&&f!==a&&l(r,f,{get:()=>t[f],enumerable:!(p=ye(t,f))||p.enumerable});return r};var e=(r,t,a)=>(a=r!=null?he(ge(r)):{},d(t||!r||!r.__esModule?l(a,"default",{value:r,enumerable:!0}):a,r)),Me=r=>d(l({},"__esModule",{value:!0}),r);var Se={};Ge(Se,{AccordionCards:()=>B.default,AiuiProvider:()=>H.default,AplusDesc:()=>se.default,BenefitsTab:()=>le.default,BizProductProvider:()=>Q.default,BrandEquity:()=>s.default,Category:()=>h.default,CollectionShelves:()=>K.default,CollectionsBanner:()=>R.default,CollectionsFilters:()=>W.default,CreativeModule:()=>I.default,DownLoad:()=>ie.default,Evaluate:()=>P.default,Faq:()=>A.default,Features:()=>de.default,FilterCardWrap:()=>O.default,FilterCardWrapItem:()=>_.default,FilterHeader:()=>N.default,FilterList:()=>w.default,FootCharger:()=>ce.default,FooterNavigation:()=>k.default,GiftBox:()=>me.default,Graphic:()=>g.default,GraphicAttractionBlock:()=>q.default,GraphicMore:()=>pe.default,GraphicOverlay:()=>j.default,HeaderNavigation:()=>v.default,HeroBanner:()=>y.default,IPC_SEARCH_PAGE:()=>u.IPC_SEARCH_PAGE,Listing:()=>L.default,Marquee:()=>S.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>C.default,MediaPlayerMulti:()=>M.default,MediaPlayerSticky:()=>G.default,MemberEquity:()=>m.default,MultiLayoutGraphicBlock:()=>T.default,Paginator:()=>z.default,PaidShipping:()=>ue.default,ProductActions:()=>V.default,ProductBenefitsTabs:()=>Y.default,ProductBundle:()=>re.default,ProductCard:()=>X.default,ProductDetail:()=>oe.default,ProductFreeGift:()=>$.default,ProductGallery:()=>ae.default,ProductGridBox:()=>te.default,ProductHighlight:()=>Z.default,ProductOptions:()=>ee.default,ProductSummary:()=>fe.default,PurchaseBar:()=>U.default,SearchPage:()=>b.default,SearchPageTabType:()=>u.SearchPageTabType,SelectStore:()=>xe.default,ShelfDisplay:()=>n.default,Slogan:()=>x.default,Spacer:()=>c.default,Specs:()=>ne.default,TabGroup:()=>Pe.default,Tabs:()=>D.default,TextMarquee:()=>J.default,Title:()=>i.default,WhyChoose:()=>F.default,withLayout:()=>E.withLayout});module.exports=Me(Se);var s=e(require("./BrandEquity/index.js")),m=e(require("./MemberEquity/index.js")),x=e(require("./Slogan/index.js")),i=e(require("./Title/index.js")),c=e(require("./Spacer/index.js")),n=e(require("./ShelfDisplay/index.js")),P=e(require("./Evaluate/index.js")),h=e(require("./Category/index.js")),y=e(require("./HeroBanner/index.js")),B=e(require("./AccordionCards/index.js")),g=e(require("./Graphic/index.js")),C=e(require("./MediaPlayerBase/index.js")),G=e(require("./MediaPlayerSticky/index.js")),M=e(require("./MediaPlayerMulti/index.js")),S=e(require("./Marquee/index.js")),F=e(require("./WhyChoose/index.js")),A=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),T=e(require("./MultiLayoutGraphicBlock/index.js")),q=e(require("./GraphicAttractionBlock/index.js")),v=e(require("./HeaderNavigation/index.js")),k=e(require("./FooterNavigation/index.js")),L=e(require("./Listing/index.js")),b=e(require("./SearchPage/index.js")),u=require("./SearchPage/types.js"),E=require("../shared/Styles.js"),H=e(require("./AiuiProvider/index.js")),D=e(require("./Tabs/index.js")),I=e(require("./CreativeModule/index.js")),j=e(require("./GraphicOverlay/index.js")),W=e(require("./CollectionsFilters/index.js")),w=e(require("./CollectionsFilters/FilterList.js")),N=e(require("./CollectionsFilters/FilterHeader.js")),O=e(require("./CollectionsFilters/FilterCardWrap.js")),_=e(require("./CollectionsFilters/FilterCardWrapItem.js")),z=e(require("./Paginator/index.js")),R=e(require("./CollectionsBanner/index.js")),J=e(require("./TextMarquee/index.js")),K=e(require("./CollectionShelves/index.js")),Q=e(require("./Listing/BizProductProvider.js")),U=e(require("./Listing/components/PurchaseBar/index.js")),V=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Y=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),te=e(require("./Listing/components/ProductCard/ProductGridBox.js")),ae=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),fe=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),le=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab")),ue=e(require("./Listing/components/PaidShipping/index.js")),pe=e(require("./GraphicMore/index.js")),de=e(require("./Features/index.js")),se=e(require("./AplusDesc/index.js")),me=e(require("./GiftBox/index.js")),xe=e(require("./SelectStore/index.js")),ie=e(require("./DownLoad/index.js")),ce=e(require("./FootCharger/index.js")),ne=e(require("./Specs/index.js")),Pe=e(require("./TabsGroup/index.js"));
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/biz-components/index.ts"],
4
- "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as Listing } from './Listing/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as CollectionsFilters } from './CollectionsFilters/index.js'\nexport { default as FilterList } from './CollectionsFilters/FilterList.js'\nexport { default as FilterHeader } from './CollectionsFilters/FilterHeader.js'\nexport { default as FilterCardWrap } from './CollectionsFilters/FilterCardWrap.js'\nexport { default as FilterCardWrapItem } from './CollectionsFilters/FilterCardWrapItem.js'\nexport { default as Paginator } from './Paginator/index.js'\nexport { default as CollectionsBanner } from './CollectionsBanner/index.js'\nexport { default as TextMarquee } from './TextMarquee/index.js'\nexport { default as CollectionShelves } from './CollectionShelves/index.js'\nexport { default as ProductProvider } from './Listing/ProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n"],
5
- "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,q1DAAAE,GAAAF,IAAA,IAAAG,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C,wCAC1CC,EAA8C,4CAC9CC,EAAsC,iDACtCC,EAAwC,mDACxCC,EAA0C,qDAC1CC,EAA8C,yDAC9CC,EAAqC,mCACrCC,EAA6C,2CAC7CC,EAAuC,qCACvCC,EAA6C,2CAC7CC,EAA2C,2CAC3CC,EAAuC,wDACvCC,EAA0C,uEAC1CC,EAAuC,wDACvCC,EAA+C,0FAC/CC,EAA4C,uFAC5CC,EAA2C,sFAC3CC,GAA0C,qFAC1CC,GAAyC,oFACzCC,GAA0C,iEAC1CC,GAA0C,uEAC1CC,GAAyC,sEACzCC,GAA0C,uEAC1CC,GAAuC,yEACvCC,GAAwC,yDACxCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAqC,mCACrCC,GAAmC,iCACnCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAuC,qCACvCC,GAAiC,+BACjCC,GAAoC",
6
- "names": ["biz_components_exports", "__export", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_Listing", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_CollectionsFilters", "import_FilterList", "import_FilterHeader", "import_FilterCardWrap", "import_FilterCardWrapItem", "import_Paginator", "import_CollectionsBanner", "import_TextMarquee", "import_CollectionShelves", "import_ProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductOptions", "import_ProductBundle", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_Specs", "import_TabsGroup"]
4
+ "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as Listing } from './Listing/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as CollectionsFilters } from './CollectionsFilters/index.js'\nexport { default as FilterList } from './CollectionsFilters/FilterList.js'\nexport { default as FilterHeader } from './CollectionsFilters/FilterHeader.js'\nexport { default as FilterCardWrap } from './CollectionsFilters/FilterCardWrap.js'\nexport { default as FilterCardWrapItem } from './CollectionsFilters/FilterCardWrapItem.js'\nexport { default as Paginator } from './Paginator/index.js'\nexport { default as CollectionsBanner } from './CollectionsBanner/index.js'\nexport { default as TextMarquee } from './TextMarquee/index.js'\nexport { default as CollectionShelves } from './CollectionShelves/index.js'\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n"],
5
+ "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,w1DAAAE,GAAAF,IAAA,IAAAG,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C,wCAC1CC,EAA8C,4CAC9CC,EAAsC,iDACtCC,EAAwC,mDACxCC,EAA0C,qDAC1CC,EAA8C,yDAC9CC,EAAqC,mCACrCC,EAA6C,2CAC7CC,EAAuC,qCACvCC,EAA6C,2CAC7CC,EAA8C,8CAC9CC,EAAuC,wDACvCC,EAA0C,uEAC1CC,EAAuC,wDACvCC,EAA+C,0FAC/CC,EAA4C,uFAC5CC,EAA2C,sFAC3CC,GAA0C,qFAC1CC,GAAyC,oFACzCC,GAA0C,iEAC1CC,GAA0C,uEAC1CC,GAAyC,sEACzCC,GAA0C,uEAC1CC,GAAuC,yEACvCC,GAAwC,yDACxCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAqC,mCACrCC,GAAmC,iCACnCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAuC,qCACvCC,GAAiC,+BACjCC,GAAoC",
6
+ "names": ["biz_components_exports", "__export", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_Listing", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_CollectionsFilters", "import_FilterList", "import_FilterHeader", "import_FilterCardWrap", "import_FilterCardWrapItem", "import_Paginator", "import_CollectionsBanner", "import_TextMarquee", "import_CollectionShelves", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductOptions", "import_ProductBundle", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_Specs", "import_TabsGroup"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as O,jsx as e,jsxs as l}from"react/jsx-runtime";import{useEffect as b,useMemo as M,useState as k}from"react";import{Picture as m,Text as n,Container as C,Link as c}from"../../components/index.js";import F from"../Subscribe/index.js";import{FooterNavigationBlockType as u}from"./types.js";import{AddIcon as N,SubtractIcon as g,ArrowRightIcon as D,CountryIcon as A}from"./icons/index.js";import{useMediaQuery as y}from"react-responsive";import{cn as f}from"../../helpers/utils.js";import{withLayout as L}from"../../shared/Styles.js";const E=({data:{footerNavigation:s}={},currentCountry:d,event:t})=>{const[o,r]=k(!1),x=y({query:"(max-width: 1440px)"});b(()=>{r(x)},[x]);const p=M(()=>s?.footerBlocks?.find(a=>a?.blockType===u.Brand)?.country||{},[s]);return l(C,{childClassName:"bg-black py-8 laptop:py-16 flex flex-col desktop:gap-16 gap-8",children:[e(n,{html:s?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),s?.footerBlocks?.map(a=>{if(a?.blockType===u.Signup)return e(S,{data:a,onSubmit:t?.signup});if(a?.blockType===u.Brand)return e(z,{data:a,isMobile:o,event:t,currentCountry:d});if(a?.blockType===u.Main)return e(T,{data:{...a,country:p},event:t,isMobile:o,currentCountry:d})})]})},S=({data:s,onSubmit:d})=>l("div",{className:"desktop:py-16 desktop:gap-16 laptop:rounded-2xl laptop:px-8 desktop:flex-row flex flex-col gap-8 rounded-btn bg-[#1D1D1F] px-4 py-8",children:[e(F,{subscribeMetadata:s?.signup,className:"desktop:flex-[744]",onSubmit:d}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),l("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[l("div",{className:"flex-1",children:[e(n,{html:s?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:s?.enjoy?.enjoys?.map(t=>l("div",{className:"flex-start flex gap-2",children:[e(m,{source:t?.icon?.url,alt:t?.icon?.alt,className:"size-5 shrink-0"}),e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})]},t?.id))})]}),e("div",{className:"w-px bg-[#3D3E3F] hidden desktop:block"}),l("div",{className:"flex-1",children:[e(n,{html:s?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:s?.benefit?.benefits?.map(t=>e(c,{href:t?.link,asChild:!t?.link,className:"no-underline",children:e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},t?.id))})]})]})]}),T=({data:s,event:d,isMobile:t,currentCountry:o})=>{const[r,x]=k(!1),{services:p,mainNav:a,country:h}=s;return l("div",{className:"flex flex-col gap-8",children:[l("div",{className:f({"desktop:gap-16 flex":p?.download?.title}),children:[l("div",{className:f("w-full",{"desktop:flex-[1260]":p?.download?.title}),children:[e(n,{html:p?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:f("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":p?.download?.title}),children:p?.storeBenefits?.reasons?.map(i=>l("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-5 shrink-0"}),e(c,{href:i?.link,asChild:!i?.link,className:"no-underline",children:e(n,{html:i?.label,className:"text-sm desktop:text-base font-bold leading-[1.2] text-[#B6B6BA]"})})]},i?.id))})]}),e(w,{className:f({"desktop:flex-[404] hidden desktop:block":p?.download?.title}),title:p?.download?.title,apps:p?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]"}),l("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(v,{title:a?.products?.title,lists:a?.products?.products}),e(v,{title:a?.explore?.title,lists:a?.explore?.explores}),e(v,{title:a?.support?.title,lists:a?.support?.supports}),l("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[l("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(n,{as:"p",html:a?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white"}),t&&e("button",{onClick:()=>x(!r),children:r?e(g,{width:20,height:20}):e(N,{width:20,height:20})})]}),(r&&t||!t)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",children:a?.contact?.contacts?.map(i=>l("div",{className:"flex items-start gap-2",children:[e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-5 shrink-0"}),e(c,{href:i?.link,className:"no-underline",children:e(n,{html:i?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})})]},i?.id))}),e(B,{country:o||h,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:t,onChangeCountry:d?.country}),e("div",{className:"desktop:hidden mt-8",children:e(w,{title:p?.download?.title,apps:p?.download?.apps})}),!!a?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",children:a?.socials?.map(i=>e(c,{href:i?.link,children:e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-8 shrink-0"})},i?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",children:a?.payment?.map(i=>e(c,{href:i?.link,children:e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"h-[28px] w-[44px] shrink-0"})},i?.id))})]})]})]})},z=({data:s,isMobile:d,event:t,currentCountry:o})=>l("div",{className:"flex flex-col gap-4",children:[l("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[l("div",{className:"laptop:flex-row laptop:items-end desktop:flex-[980] flex flex-col items-start gap-4",children:[e(n,{html:s?.brand?.currentBrand,className:"text-[#B6B6BA]"}),e("div",{className:"laptop:block hidden h-[20px] w-px bg-[#B6B6BA] laptop:mb-[10px]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4 laptop:mb-[10px]",children:s?.brand?.brands?.map(r=>e(c,{href:r?.link,children:e(n,{html:r?.icon,className:"text-[#B6B6BA] hover:text-white"})},r?.id))})]}),e(B,{country:o||s?.country,className:"desktop:flex-[316] desktop:block hidden mt-5",isMobile:d,onChangeCountry:t?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),l("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(n,{html:s?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:s?.policy?.policies?.map(r=>e(c,{href:r?.link,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline",children:r?.label},r?.id))})]})]}),v=({title:s,lists:d,className:t})=>{const[o,r]=k(!1),[x,p]=k(!1),a=y({query:"(max-width: 1440px)"});return b(()=>{p(a)},[a]),l("div",{className:f("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",t),children:[l("div",{className:"flex items-center justify-between",onClick:()=>r(!o),children:[e(n,{as:"p",html:s,className:"text-xl font-bold leading-[1.2] text-white"}),x&&e(O,{children:o?e(g,{width:20,height:20}):e(N,{width:20,height:20})})]}),(o&&x||!x)&&e("div",{className:"mt-4 flex flex-col gap-2",children:d?.map(h=>e(c,{href:h?.link,className:"no-underline",children:e(n,{html:h?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},h?.id))})]})},w=({title:s,apps:d,className:t})=>d?.length?l("div",{className:t,children:[e(n,{html:s,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",children:d?.map(o=>l("div",{className:"flex flex-col items-center gap-[6px]",children:[e(c,{href:o?.link,children:e(m,{source:o?.icon?.url,alt:o?.icon?.alt,className:"size-10 shrink-0"})}),o?.label&&e(n,{html:o?.label,className:"text-xs font-bold text-[#999999]"})]},o?.id))})]}):null,B=({country:s,isMobile:d,className:t,onChangeCountry:o})=>e("div",{className:f("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",t),onClick:()=>o?.(),children:l("div",{className:"flex items-center justify-between",children:[l("div",{className:"flex cursor-pointer items-center gap-2",children:[e(A,{width:20,height:20,className:"shrink-0"}),e(n,{as:"p",html:s?.countryName||s?.country,className:"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white"})]}),d&&e("button",{children:e(D,{width:20,height:20})})]})});var K=L(E);export{K as default};
1
+ import{Fragment as O,jsx as e,jsxs as l}from"react/jsx-runtime";import{useEffect as b,useMemo as M,useState as k}from"react";import{Picture as m,Text as n,Container as C,Link as c}from"../../components/index.js";import F from"../Subscribe/index.js";import{FooterNavigationBlockType as u}from"./types.js";import{AddIcon as N,SubtractIcon as g,ArrowRightIcon as D,CountryIcon as A}from"./icons/index.js";import{useMediaQuery as y}from"react-responsive";import{cn as f}from"../../helpers/utils.js";import{withLayout as L}from"../../shared/Styles.js";const E=({data:{footerNavigation:s}={},currentCountry:d,event:t})=>{const[o,r]=k(!1),x=y({query:"(max-width: 1440px)"});b(()=>{r(x)},[x]);const p=M(()=>s?.footerBlocks?.find(a=>a?.blockType===u.Brand)?.country||{},[s]);return l(C,{childClassName:"bg-black py-8 laptop:py-16 flex flex-col desktop:gap-16 gap-8",children:[e(n,{html:s?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),s?.footerBlocks?.map(a=>{if(a?.blockType===u.Signup)return e(S,{data:a,onSubmit:t?.signup});if(a?.blockType===u.Brand)return e(z,{data:a,isMobile:o,event:t,currentCountry:d});if(a?.blockType===u.Main)return e(T,{data:{...a,country:p},event:t,isMobile:o,currentCountry:d})})]})},S=({data:s,onSubmit:d})=>l("div",{className:"desktop:py-16 desktop:gap-16 laptop:rounded-2xl laptop:px-8 desktop:flex-row flex flex-col gap-8 rounded-btn bg-[#1D1D1F] px-4 py-8",children:[e(F,{subscribeMetadata:s?.signup,className:"desktop:flex-[744]",onSubmit:d}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),l("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[l("div",{className:"flex-1",children:[e(n,{html:s?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:s?.enjoy?.enjoys?.map(t=>l("div",{className:"flex-start flex gap-2",children:[e(m,{source:t?.icon?.url,alt:t?.icon?.alt,className:"size-5 shrink-0"}),e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})]},t?.id))})]}),e("div",{className:"w-px bg-[#3D3E3F] hidden desktop:block"}),l("div",{className:"flex-1",children:[e(n,{html:s?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:s?.benefit?.benefits?.map(t=>e(c,{href:t?.link,asChild:!t?.link,className:"no-underline",children:e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},t?.id))})]})]})]}),T=({data:s,event:d,isMobile:t,currentCountry:o})=>{const[r,x]=k(!1),{services:p,mainNav:a,country:h}=s;return l("div",{className:"flex flex-col gap-8",children:[l("div",{className:f({"desktop:gap-16 flex":p?.download?.title}),children:[l("div",{className:f("w-full",{"desktop:flex-[1260]":p?.download?.title}),children:[e(n,{html:p?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:f("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":p?.download?.title}),children:p?.storeBenefits?.reasons?.map(i=>l("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-5 shrink-0"}),e(c,{href:i?.link,asChild:!i?.link,className:"no-underline",children:e(n,{html:i?.label,className:"text-sm desktop:text-base font-bold leading-[1.2] text-[#B6B6BA]"})})]},i?.id))})]}),e(w,{className:f({"desktop:flex-[404] hidden desktop:block":p?.download?.title}),title:p?.download?.title,apps:p?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]"}),l("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(v,{title:a?.products?.title,lists:a?.products?.products}),e(v,{title:a?.explore?.title,lists:a?.explore?.explores}),e(v,{title:a?.support?.title,lists:a?.support?.supports}),l("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[l("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(n,{as:"p",html:a?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white"}),t&&e("button",{onClick:()=>x(!r),children:r?e(g,{width:20,height:20}):e(N,{width:20,height:20})})]}),(r&&t||!t)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",children:a?.contact?.contacts?.map(i=>l("div",{className:"flex items-start gap-2",children:[e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-5 shrink-0"}),e(c,{href:i?.link,className:"no-underline",children:e(n,{html:i?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})})]},i?.id))}),e(B,{country:o||h,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:t,onChangeCountry:d?.country}),e("div",{className:"desktop:hidden mt-8",children:e(w,{title:p?.download?.title,apps:p?.download?.apps})}),!!a?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",children:a?.socials?.map(i=>e(c,{href:i?.link,children:e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"size-8 shrink-0"})},i?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",children:a?.payment?.map(i=>e(c,{href:i?.link,children:e(m,{source:i?.icon?.url,alt:i?.icon?.alt,className:"h-[28px] w-[44px] shrink-0"})},i?.id))})]})]})]})},z=({data:s,isMobile:d,event:t,currentCountry:o})=>l("div",{className:"flex flex-col gap-4",children:[l("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[l("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[e(n,{html:s?.brand?.currentBrand,className:"text-[#B6B6BA]"}),e("div",{className:"laptop:block hidden h-[20px] w-px bg-[#B6B6BA] laptop:mb-[10px]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:s?.brand?.brands?.map(r=>e(c,{href:r?.link,children:e(n,{html:r?.icon,className:"text-[#B6B6BA] hover:text-white"})},r?.id))})]}),e(B,{country:o||s?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:d,onChangeCountry:t?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),l("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(n,{html:s?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:s?.policy?.policies?.map(r=>e(c,{href:r?.link,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline",children:r?.label},r?.id))})]})]}),v=({title:s,lists:d,className:t})=>{const[o,r]=k(!1),[x,p]=k(!1),a=y({query:"(max-width: 1440px)"});return b(()=>{p(a)},[a]),l("div",{className:f("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",t),children:[l("div",{className:"flex items-center justify-between",onClick:()=>r(!o),children:[e(n,{as:"p",html:s,className:"text-xl font-bold leading-[1.2] text-white"}),x&&e(O,{children:o?e(g,{width:20,height:20}):e(N,{width:20,height:20})})]}),(o&&x||!x)&&e("div",{className:"mt-4 flex flex-col gap-2",children:d?.map(h=>e(c,{href:h?.link,className:"no-underline",children:e(n,{html:h?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},h?.id))})]})},w=({title:s,apps:d,className:t})=>d?.length?l("div",{className:t,children:[e(n,{html:s,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",children:d?.map(o=>l("div",{className:"flex flex-col items-center gap-[6px]",children:[e(c,{href:o?.link,children:e(m,{source:o?.icon?.url,alt:o?.icon?.alt,className:"size-10 shrink-0"})}),o?.label&&e(n,{html:o?.label,className:"text-xs font-bold text-[#999999]"})]},o?.id))})]}):null,B=({country:s,isMobile:d,className:t,onChangeCountry:o})=>e("div",{className:f("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",t),onClick:()=>o?.(),children:l("div",{className:"flex items-center justify-between",children:[l("div",{className:"flex cursor-pointer items-center gap-2",children:[e(A,{width:20,height:20,className:"shrink-0"}),e(n,{as:"p",html:s?.countryName||s?.country,className:"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white"})]}),d&&e("button",{children:e(D,{width:20,height:20})})]})});var K=L(E);export{K as default};
2
2
  //# sourceMappingURL=index.js.map