@anker-in/headless-ui 1.1.9-alpha.1764059925254 → 1.1.9-alpha.1764075005685

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 (39) hide show
  1. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +13 -2
  2. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  3. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  4. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  5. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +3 -3
  6. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  7. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  14. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  15. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  16. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  17. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  18. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  19. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  20. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +13 -2
  21. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  22. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  23. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  24. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +2 -2
  25. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  26. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  27. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  28. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
  29. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  30. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
  31. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  32. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  33. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  34. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  35. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  36. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  37. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  38. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  39. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.tsx"],
4
- "sourcesContent": ["import { Button, Checkbox, Text, Picture, Heading, Link } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport ModalContainer from './ProductBenefitsTabs/ModalContainer.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\n// \u6587\u6848\u914D\u7F6E\u63A5\u53E3\ninterface BenefitsTabTextConfig {\n // Coupon \u76F8\u5173\n couponCode?: string // \"Code\"\n copyCode?: string // \"Copy Code\"\n copied?: string // \"Copied\"\n expired?: string // \"Expired\"\n offCoupon?: string // \"off coupon\"\n offMemberOnly?: string // \"{amount} off Member Only\"\n loginNow?: string // \"login now\"\n selectFreeGift?: string // \"You can select the free gift below.\"\n bundleSaveUpTo?: string // \"Bundle purchases save extra up to\"\n bundleOffer?: string // \"We offer {count} bundle for you\"\n creditsTitle?: string // \"Soundcore credits for cash\"\n creditsDesc?: string // \"100 Soundcore credits=$1\"\n\n // Tab \u6807\u7B7E\n off?: string // \"off\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n memberBenefitsNotLoginText?: string //\n\n // Member Benefits \u90E8\u5206\n forNewMember?: string // \"for New Member\"\n expressShipping?: string // \"Express Shipping Method\"\n creditsAfterActivation?: string // \"You will get soundcoreCredits after activation.\"\n active?: string // \"Active\"\n\n // Installment \u90E8\u5206\n flexibleInstallment?: string // \"Flexible installment payment\"\n}\n\nexport type ProductBenefitsTabsValueType = 'coupon' | 'membership' | 'pay' | 'installment'\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\ninterface BenefitsTabProps {\n textConfig?: BenefitsTabTextConfig\n}\n\n// \u9ED8\u8BA4\u6587\u6848\u914D\u7F6E\nconst defaultTextConfig: Required<BenefitsTabTextConfig> = {\n couponCode: 'Code',\n copyCode: 'Copy Code',\n copied: 'Copied',\n expired: 'Expired',\n offCoupon: '{discount} off coupon',\n offMemberOnly: '{amount} off Member Only',\n loginNow: 'Login now',\n selectFreeGift: 'You can select the free gift below.',\n bundleSaveUpTo: 'Bundle purchases save extra up to',\n bundleOffer: 'We offer {count} bundle for you',\n creditsTitle: 'Soundcore credits for cash',\n creditsDesc: '100 Soundcore credits=$1',\n off: ' off',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n memberBenefitsNotLoginText: 'Sign Up to Get Benefits Below',\n forNewMember: '{amount} off for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => boolean | undefined\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n couponBgColor?: string\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n benefitPayloadData,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n benefitPayloadData: any\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const [checked, setChecked] = useState(false)\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n style={{\n background: item.couponBgColor || 'white',\n }}\n className={cn(\n 'laptop:h-[112px] lg-desktop:h-[130px] relative h-[100px] overflow-hidden p-3',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\n )}\n {...(item.useAble && {\n role: 'button',\n tabIndex: 0,\n onClick: () => {\n const shouldChange = item?.onUseChange?.(checked)\n if (shouldChange !== false) {\n setChecked(!checked)\n }\n },\n })}\n >\n {item?.bgImage?.url && (\n <Picture\n source={item.bgImage.url}\n alt={item.bgImage.alt}\n className=\"absolute bottom-0 right-0 w-auto\"\n imgClassName=\"object-contain\"\n />\n )}\n <div className=\"z-1 relative \">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-primary mr-2 rounded-full border-[1.6px] border-[#D1D1D1]\"\n checked={item?.isAutoUse}\n />\n )}\n <Text\n html={item.title}\n className=\"laptop:text-[20px] lg-desktop:text-[24px] text-[16px] font-bold leading-[1.2]\"\n />\n </div>\n {item.description && (\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"lg-desktop:text-[16px] mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F]\"\n >\n {item.description}\n </Text>\n )}\n {item.code && (\n <div className=\"desktop:mt-2 flex items-center gap-2\">\n <Text\n html={`${benefitPayloadData?.couponBenefitData?.commonCoupon?.couponCode}: ${item.code}`}\n className=\"lg-desktop:text-[16px] text-[14px] font-bold text-[#3D3D3F]\"\n />\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(item.code || '')\n }}\n >\n {isCopied\n ? couponCopy?.copied || benefitPayloadData?.couponBenefitData?.commonCoupon?.copied\n : couponCopy?.copy || benefitPayloadData?.couponBenefitData?.commonCoupon?.copyCode}\n </Link>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"lg-desktop:mt-[24px] text-brand-0 desktop:mt-4 lg-desktop:text-[16px] md-l:hidden mt-[14px] text-left text-[14px] font-bold text-[#1F2021]\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || benefitPayloadData?.couponBenefitData?.commonCoupon?.expired\n )}\n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n benefitPayloadData,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig>; benefitPayloadData: any }) => {\n return (\n <div className={cn('laptop:grid laptop:grid-cols-2 desktop:grid-cols-1 flex flex-col gap-3', className)}>\n {coupons?.map((item, index) => (\n <CouponItem key={index} item={item} textConfig={textConfig} benefitPayloadData={benefitPayloadData} />\n ))}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n isLogin,\n profile,\n variant,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n product,\n } = useBizProductContext()\n\n const productBenefitsData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductBenefits')?.data || {}\n }, [product?.payload])\n\n const [isFlexModalOpen, setIsFlexModalOpen] = useState(false)\n\n const benefits = useBenefits({ variant })\n const { locale = 'us', copyWriting } = useAiuiContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const benefitPayloadData = useMemo(() => {\n const couponBenefitData = productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'coupon') ?? {}\n const membershipBenefitData =\n productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'membership') ?? {}\n const installmentBenefitData =\n productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'installment') ?? {}\n const payBenefitData = productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'pay') ?? {}\n return { couponBenefitData, membershipBenefitData, installmentBenefitData, payBenefitData }\n }, [productBenefitsData])\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: savingDetail?.coupon > 0,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n onUseChange: (value: boolean) => {\n const couponSaving = value ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n },\n title: replaceTemplate(benefitPayloadData?.couponBenefitData?.commonCoupon?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n }\n : null,\n memberDiscount.enable\n ? {\n useAble: true,\n isAutoUse: Boolean(profile?.email) && !!savingDetail?.member,\n title: replaceTemplate(benefitPayloadData?.couponBenefitData?.member?.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {profile?.email\n ? benefitPayloadData?.couponBenefitData?.member?.memberDiscounts\n : (benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLogin?.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {profile?.email ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {benefitPayloadData?.couponBenefitData?.member?.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (profile?.email) {\n const memberSaving = value ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n // setSavingDetail(prev => ({\n // ...prev,\n // member: value ? (memberDiscount?.config?.amount ?? 0) : 0,\n // }))\n return true\n } else {\n openSignInPopup?.()\n return false\n }\n },\n }\n : null,\n levelDiscount.enable\n ? {\n title: levelDiscount?.config?.title ?? '',\n description: levelDiscount?.config?.tag ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.levelDiscount?.bgImage,\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: benefitPayloadData?.couponBenefitData?.freeGift?.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.freeGift?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n bundle.enable\n ? {\n title: `${benefitPayloadData?.couponBenefitData?.bundle?.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: benefitPayloadData?.couponBenefitData?.bundle?.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.bundle?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.fullGift?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n creditsRedemption.enable\n ? {\n title: benefitPayloadData?.couponBenefitData?.creditsRedemption?.creditsTitle,\n description: benefitPayloadData?.couponBenefitData?.creditsRedemption?.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.creditsRedemption?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n ].filter(Boolean)\n\n useEffect(() => {\n setProductBenefitsTabsValue(coupons?.length ? 'coupon' : 'membership')\n }, [coupons?.length])\n\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<ProductBenefitsTabsValueType>('coupon')\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n const handleProductBenefitsTabListClick = (\n el: React.MouseEvent<HTMLButtonElement>,\n value: ProductBenefitsTabsValueType\n ) => {\n setProductBenefitsTabsValue(value)\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const benefitTabs = useMemo(() => {\n return productBenefitsData?.benefitTabs\n ?.map((item: any) => {\n if (item?.value === 'coupon' && !coupons?.length) {\n return null\n }\n return item\n })\n .filter(Boolean)\n }, [productBenefitsData, coupons])\n\n return (\n <ProductBenefitsTabs\n className=\"relative\"\n onValueChange={value => setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'installment')}\n value={productBenefitsTabsValue}\n >\n <div className=\"absolute right-0 top-0 z-[1] h-[40px] w-[25px] rounded-xl bg-gradient-to-r from-transparent to-[#EAEAEC]\"></div>\n <ProductBenefitsTabs.List ref={scrollContainerRef}>\n {benefitTabs?.map((item: any) => (\n <ProductBenefitsTabs.Trigger\n key={item?.value}\n className={cn(productBenefitsTabsValue === item.value && 'text-[#1D1D1F]')}\n value={item.value}\n onClick={e => handleProductBenefitsTabListClick(e, item?.value)}\n >\n {item.label}\n </ProductBenefitsTabs.Trigger>\n ))}\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .benefits-tabs-content::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content\n value=\"coupon\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto\"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n textConfig={mergedTextConfig}\n benefitPayloadData={benefitPayloadData}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n <ProductBenefitsTabs.Content\n value=\"membership\"\n className={cn('benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px]', {\n 'overflow-y-auto': profile?.email,\n })}\n >\n <div className=\"lg-desktop:p-4 p-3\">\n {!profile?.email && (\n <h3 className=\"desktop:mb-2 mb-1 text-left text-lg font-bold !leading-[1.3]\">\n {benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLoginText}\n </h3>\n )}\n <div\n className={cn('rounded-lg', {\n 'benefits-tabs-content desktop:h-[108px] h-[80px] overflow-y-auto': !profile?.email,\n })}\n >\n <ul\n className={`desktop:[&_li]:py-4 list-none \n [&_li:first-child]:rounded-t-lg [&_li:last-child]:rounded-b-lg [&_li:last-child]:last:border-b-0 [&_li]:flex\n [&_li]:items-center [&_li]:gap-2 [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4 [&_li]:py-[10px]\n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li className=\"justify-between\">\n <div className=\"flex gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M20 3.5C21.6569 3.5 23 4.84315 23 6.5V9.65625C23 10.0791 22.7342 10.4566 22.3359 10.5986C21.6665 10.8372 21.1816 11.4844 21.1816 12.25C21.1816 13.0156 21.6665 13.6628 22.3359 13.9014C22.7342 14.0434 23 14.4209 23 14.8438V18C23 19.6569 21.6569 21 20 21H4C2.34315 21 1 19.6569 1 18V14.8438L1.01172 14.6875C1.06803 14.3301 1.31557 14.0256 1.66406 13.9014C2.33345 13.6628 2.81836 13.0156 2.81836 12.25C2.81836 11.4844 2.33345 10.8372 1.66406 10.5986C1.26583 10.4566 1 10.0791 1 9.65625V6.5C1 4.84315 2.34315 3.5 4 3.5H20ZM4 5.5C3.44772 5.5 3 5.94772 3 6.5V9.03125C4.08987 9.68678 4.81836 10.8833 4.81836 12.25C4.81836 13.6165 4.08963 14.8122 3 15.4678V18C3 18.5523 3.44772 19 4 19H20C20.5523 19 21 18.5523 21 18V15.4678C19.9104 14.8122 19.1816 13.6165 19.1816 12.25C19.1816 10.8833 19.9101 9.68677 21 9.03125V6.5C21 5.94772 20.5523 5.5 20 5.5H4ZM15.793 6.79297C16.1835 6.40244 16.8165 6.40244 17.207 6.79297C17.5976 7.18349 17.5976 7.81651 17.207 8.20703L8.20703 17.207C7.81651 17.5976 7.18349 17.5976 6.79297 17.207C6.40244 16.8165 6.40244 16.1835 6.79297 15.793L15.793 6.79297ZM15.25 13.25C16.3546 13.25 17.25 14.1454 17.25 15.25C17.25 16.3546 16.3546 17.25 15.25 17.25C14.1454 17.25 13.25 16.3546 13.25 15.25C13.25 14.1454 14.1454 13.25 15.25 13.25ZM15.25 14.75C14.9739 14.75 14.75 14.9739 14.75 15.25C14.75 15.5261 14.9739 15.75 15.25 15.75C15.5261 15.75 15.75 15.5261 15.75 15.25C15.75 14.9739 15.5261 14.75 15.25 14.75ZM8.75 6.75C9.85457 6.75 10.75 7.64543 10.75 8.75C10.75 9.85457 9.85457 10.75 8.75 10.75C7.64543 10.75 6.75 9.85457 6.75 8.75C6.75 7.64543 7.64543 6.75 8.75 6.75ZM8.75 8.25C8.47386 8.25 8.25 8.47386 8.25 8.75C8.25 9.02614 8.47386 9.25 8.75 9.25C9.02614 9.25 9.25 9.02614 9.25 8.75C9.25 8.47386 9.02614 8.25 8.75 8.25Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {replaceTemplate(benefitPayloadData?.membershipBenefitData?.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n )}\n {benefitPayloadData?.membershipBenefitData?.equities?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index} className=\"justify-between gap-2\">\n <button\n onClick={() => openModal?.({ title: item.label, content: item.modalText })}\n key={index}\n className=\"flex justify-between\"\n >\n <Picture source={item.icon} alt={item.text} className=\"desktop:size-6 size-4 shrink-0\" />\n <Text className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">{item.text}</Text>\n </button>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n ) : (\n <li key={index} className=\"justify-between\">\n <div className=\"flex items-center gap-2\">\n <Picture source={item.icon} alt={item.text} className=\"desktop:size-6 size-4 shrink-0\" />\n <Text as=\"p\" className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">\n {item.label}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n )\n )}\n {/* <li className=\"justify-between\">\n <div className=\"flex items-center gap-2\">\n <Picture\n source={benefitPayloadData?.membershipBenefitData.memberPriceIcon}\n alt={benefitPayloadData?.membershipBenefitData.memberPriceDesc}\n className=\" size-6 shrink-0\"\n />\n <Text as=\"p\" className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">\n {benefitPayloadData?.membershipBenefitData.memberPriceDesc}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li> */}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li className=\"justify-between\">\n <div className=\"flex gap-2\">\n <svg\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {benefitPayloadData?.membershipBenefitData?.expressShipping}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {/* \u7528\u6237\u672A\u6FC0\u6D3B\uFF0C\u4E14\u672A\u767B\u5F55\uFF0C\u5219\u663E\u793A\u6FC0\u6D3B\u94FE\u63A5 */}\n {!activated && Boolean(profile?.email) ? (\n <>\n {benefitPayloadData?.membershipBenefitData?.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {benefitPayloadData?.membershipBenefitData?.active}\n </span>\n </>\n ) : (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!profile?.email && (\n <div className=\"desktop:pt-4 pt-2\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n <ProductBenefitsTabs.Content\n value=\"pay\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto \"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {benefitPayloadData?.payBenefitData?.payMethod}\n </Heading>\n <div className=\"lg-desktop:p-4 flex items-center justify-between gap-2 rounded-lg bg-white p-3\">\n <div className=\"flex items-center gap-2\">\n <Picture\n source={benefitPayloadData?.payBenefitData?.icon}\n className=\"desktop:size-[70px] desktop:h-[34px] size-[40px] h-[20px] shrink-0\"\n />\n <Text\n as=\"p\"\n className=\"x:text-[14px] text-left text-[16px] font-bold\"\n html={benefitPayloadData?.payBenefitData?.withCheckout}\n />\n </div>\n <button\n className=\"hover:text-brand-0 desktop:text-[16px] whitespace-nowrap text-sm font-bold underline\"\n onClick={() => setIsFlexModalOpen(true)}\n >\n {benefitPayloadData?.payBenefitData?.learnMore}\n </button>\n </div>\n </div>\n\n <ModalContainer showModal={isFlexModalOpen} closeModal={() => setIsFlexModalOpen(false)}>\n <Picture source={benefitPayloadData?.payBenefitData?.payImage}></Picture>\n </ModalContainer>\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content\n value=\"installment\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto \"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {benefitPayloadData?.installmentBenefitData?.flexibleInstallment}\n </Heading>\n <div className=\"lg-desktop:p-4 overflow-hidden rounded-lg bg-white p-3\">{renderInstallments}</div>\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nconst CheckedIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" {...props}>\n <path\n d=\"M4 9.19472L8.51935 13.667L16.2668 6.00024\"\n stroke=\"#2BBC4F\"\n strokeWidth=\"1.67\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nexport default withLayout(BenefitsTab)\n"],
5
- "mappings": "AAqHM,OAmGU,YAAAA,EAnGV,OAAAC,EA6CI,QAAAC,MA7CJ,oBArHN,OAAS,UAAAC,GAAQ,YAAAC,GAAU,QAAAC,EAAM,WAAAC,EAAS,WAAAC,EAAS,QAAAC,OAAY,qCAC/D,OAAOC,MAAyB,iCAChC,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,eAAAC,OAAmB,gCAC5B,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,mBAAAC,MAAuB,+BAChC,OAAgB,aAAAC,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAC5D,OAAS,kBAAAC,MAAsB,oCAC/B,OAAOC,OAAkB,uCACzB,OAAOC,OAAa,4BACpB,OAAS,MAAAC,MAAU,kCACnB,OAAOC,OAAoB,0CAC3B,OAAS,cAAAC,OAAkB,kCA+C3B,MAAMC,GAAqD,CACzD,WAAY,OACZ,SAAU,YACV,OAAQ,SACR,QAAS,UACT,UAAW,wBACX,cAAe,2BACf,SAAU,YACV,eAAgB,sCAChB,eAAgB,oCAChB,YAAa,kCACb,aAAc,6BACd,YAAa,2BACb,IAAK,OACL,uBAAwB,8DACxB,2BAA4B,gCAC5B,aAAc,8BACd,gBAAiB,0BACjB,uBAAwB,mDACxB,OAAQ,SACR,oBAAqB,+BACvB,EAoBMC,GAAa,CAAC,CAClB,KAAAC,EACA,WAAAC,EACA,mBAAAC,CACF,IAIM,CACJ,KAAM,CAAE,aAAAC,CAAa,EAAIX,EAAe,EAClC,CAAE,OAA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K,QAAQ,YAAY,KAAK,OAAQ,GAAG4F,EACjG,SAAA5F,EAAC,QACC,EAAE,4CACF,OAAO,UACP,YAAY,OACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIJ,IAAO6F,GAAQvE,GAAWsB,EAAW",
6
- "names": ["Fragment", "jsx", "jsxs", "Button", "Checkbox", "Text", "Picture", "Heading", "Link", "ProductBenefitsTabs", "useBizProductContext", "useBenefits", "formatPrice", "replaceTemplate", "useEffect", "useMemo", "useRef", "useState", "useAiuiContext", "useCountDown", "useCopy", "cn", "ModalContainer", "withLayout", "defaultTextConfig", "CouponItem", "item", "textConfig", "benefitPayloadData", "trackingData", "isCopied", "copyToClipboard", "checked", "setChecked", "couponCopy", "days", "hours", "minutes", "seconds", "openModal", "event", "CouponContent", "coupons", "className", "index", "BenefitsTab", "isLogin", "profile", "variant", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "product", "productBenefitsData", "isFlexModalOpen", "setIsFlexModalOpen", "benefits", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "couponBenefitData", "membershipBenefitData", "installmentBenefitData", "payBenefitData", "value", "couponSaving", "memberSaving", "setProductBenefitsTabsValue", "productBenefitsTabsValue", "handleActivate", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft", "benefitTabs", "e", "CheckedIcon", "props", "BenefitsTab_default"]
4
+ "sourcesContent": ["import { Button, Checkbox, Text, Picture, Heading, Link } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport ModalContainer from './ProductBenefitsTabs/ModalContainer.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\n// \u6587\u6848\u914D\u7F6E\u63A5\u53E3\ninterface BenefitsTabTextConfig {\n // Coupon \u76F8\u5173\n couponCode?: string // \"Code\"\n copyCode?: string // \"Copy Code\"\n copied?: string // \"Copied\"\n expired?: string // \"Expired\"\n offCoupon?: string // \"off coupon\"\n offMemberOnly?: string // \"{amount} off Member Only\"\n loginNow?: string // \"login now\"\n selectFreeGift?: string // \"You can select the free gift below.\"\n bundleSaveUpTo?: string // \"Bundle purchases save extra up to\"\n bundleOffer?: string // \"We offer {count} bundle for you\"\n creditsTitle?: string // \"Soundcore credits for cash\"\n creditsDesc?: string // \"100 Soundcore credits=$1\"\n\n // Tab \u6807\u7B7E\n off?: string // \"off\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n memberBenefitsNotLoginText?: string //\n\n // Member Benefits \u90E8\u5206\n forNewMember?: string // \"for New Member\"\n expressShipping?: string // \"Express Shipping Method\"\n creditsAfterActivation?: string // \"You will get soundcoreCredits after activation.\"\n active?: string // \"Active\"\n\n // Installment \u90E8\u5206\n flexibleInstallment?: string // \"Flexible installment payment\"\n}\n\nexport type ProductBenefitsTabsValueType = 'coupon' | 'membership' | 'pay' | 'installment'\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\ninterface BenefitsTabProps {\n textConfig?: BenefitsTabTextConfig\n}\n\n// \u9ED8\u8BA4\u6587\u6848\u914D\u7F6E\nconst defaultTextConfig: Required<BenefitsTabTextConfig> = {\n couponCode: 'Code',\n copyCode: 'Copy Code',\n copied: 'Copied',\n expired: 'Expired',\n offCoupon: '{discount} off coupon',\n offMemberOnly: '{amount} off Member Only',\n loginNow: 'Login now',\n selectFreeGift: 'You can select the free gift below.',\n bundleSaveUpTo: 'Bundle purchases save extra up to',\n bundleOffer: 'We offer {count} bundle for you',\n creditsTitle: 'Soundcore credits for cash',\n creditsDesc: '100 Soundcore credits=$1',\n off: ' off',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n memberBenefitsNotLoginText: 'Sign Up to Get Benefits Below',\n forNewMember: '{amount} off for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => boolean | undefined\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n couponBgColor?: string\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n benefitPayloadData,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n benefitPayloadData: any\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const [checked, setChecked] = useState(false)\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n style={{\n background: item.couponBgColor || 'white',\n }}\n className={cn(\n 'laptop:h-[112px] lg-desktop:h-[130px] relative h-[100px] overflow-hidden p-3',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\n )}\n {...(item.useAble && {\n role: 'button',\n tabIndex: 0,\n onClick: () => {\n const shouldChange = item?.onUseChange?.(checked)\n if (shouldChange !== false) {\n setChecked(!checked)\n }\n },\n })}\n >\n {item?.bgImage?.url && (\n <Picture\n source={item.bgImage.url}\n alt={item.bgImage.alt}\n className=\"absolute bottom-0 right-0 w-auto\"\n imgClassName=\"object-contain\"\n />\n )}\n <div className=\"z-1 relative \">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-primary mr-2 rounded-full border-[1.6px] border-[#D1D1D1]\"\n checked={item?.isAutoUse}\n />\n )}\n <Text\n html={item.title}\n className=\"laptop:text-[20px] lg-desktop:text-[24px] text-[16px] font-bold leading-[1.2]\"\n />\n </div>\n {item.description && (\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"lg-desktop:text-[16px] mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F]\"\n >\n {item.description}\n </Text>\n )}\n {item.code && (\n <div className=\"desktop:mt-2 flex items-center gap-2\">\n <Text\n html={`${benefitPayloadData?.couponBenefitData?.commonCoupon?.couponCode}: ${item.code}`}\n className=\"lg-desktop:text-[16px] text-[14px] font-bold text-[#3D3D3F]\"\n />\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(item.code || '')\n }}\n >\n {isCopied\n ? couponCopy?.copied || benefitPayloadData?.couponBenefitData?.commonCoupon?.copied\n : couponCopy?.copy || benefitPayloadData?.couponBenefitData?.commonCoupon?.copyCode}\n </Link>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"lg-desktop:mt-[24px] text-brand-0 desktop:mt-4 lg-desktop:text-[16px] md-l:hidden mt-[14px] text-left text-[14px] font-bold text-[#1F2021]\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || benefitPayloadData?.couponBenefitData?.commonCoupon?.expired\n )}\n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n benefitPayloadData,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig>; benefitPayloadData: any }) => {\n return (\n <div className={cn('laptop:grid laptop:grid-cols-2 desktop:grid-cols-1 flex flex-col gap-3', className)}>\n {coupons?.map((item, index) => (\n <CouponItem key={index} item={item} textConfig={textConfig} benefitPayloadData={benefitPayloadData} />\n ))}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n profile,\n variant,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n product,\n creditsRedemption: creditsRedemptionData,\n } = useBizProductContext()\n\n const { used_points = 0, available_points = 0 } = creditsRedemptionData ?? {}\n\n const productBenefitsData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductBenefits')?.data || {}\n }, [product?.payload])\n\n const [isFlexModalOpen, setIsFlexModalOpen] = useState(false)\n\n const benefits = useBenefits({ variant })\n const { locale = 'us', copyWriting } = useAiuiContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const benefitPayloadData = useMemo(() => {\n const couponBenefitData = productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'coupon') ?? {}\n const membershipBenefitData =\n productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'membership') ?? {}\n const installmentBenefitData =\n productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'installment') ?? {}\n const payBenefitData = productBenefitsData?.benefitTabs?.find((item: any) => item?.value === 'pay') ?? {}\n return { couponBenefitData, membershipBenefitData, installmentBenefitData, payBenefitData }\n }, [productBenefitsData])\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: savingDetail?.coupon > 0,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n onUseChange: (value: boolean) => {\n const couponSaving = value ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n },\n title: replaceTemplate(benefitPayloadData?.couponBenefitData?.commonCoupon?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n }\n : null,\n memberDiscount.enable\n ? {\n useAble: true,\n isAutoUse: Boolean(profile?.email) && !!savingDetail?.member,\n title: replaceTemplate(benefitPayloadData?.couponBenefitData?.member?.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {profile?.email\n ? benefitPayloadData?.couponBenefitData?.member?.memberDiscounts\n : (benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLogin?.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {profile?.email ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {benefitPayloadData?.couponBenefitData?.member?.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (profile?.email) {\n const memberSaving = value ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n // setSavingDetail(prev => ({\n // ...prev,\n // member: value ? (memberDiscount?.config?.amount ?? 0) : 0,\n // }))\n return true\n } else {\n openSignInPopup?.()\n return false\n }\n },\n }\n : null,\n levelDiscount.enable\n ? {\n title: levelDiscount?.config?.title ?? '',\n description: levelDiscount?.config?.tag ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.levelDiscount?.bgImage,\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: benefitPayloadData?.couponBenefitData?.freeGift?.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.freeGift?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n bundle.enable\n ? {\n title: `${benefitPayloadData?.couponBenefitData?.bundle?.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: benefitPayloadData?.couponBenefitData?.bundle?.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.bundle?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.fullGift?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n creditsRedemption.enable\n ? {\n title: benefitPayloadData?.couponBenefitData?.creditsRedemption?.creditsTitle,\n description: benefitPayloadData?.couponBenefitData?.creditsRedemption?.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: benefitPayloadData?.couponBenefitData?.creditsRedemption?.bgImage,\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n ].filter(Boolean)\n\n useEffect(() => {\n setProductBenefitsTabsValue(coupons?.length ? 'coupon' : 'membership')\n }, [coupons?.length])\n\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<ProductBenefitsTabsValueType>('coupon')\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n const handleProductBenefitsTabListClick = (\n el: React.MouseEvent<HTMLButtonElement>,\n value: ProductBenefitsTabsValueType\n ) => {\n setProductBenefitsTabsValue(value)\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const benefitTabs = useMemo(() => {\n return productBenefitsData?.benefitTabs\n ?.map((item: any) => {\n if (item?.value === 'coupon' && !coupons?.length) {\n return null\n }\n return item\n })\n .filter(Boolean)\n }, [productBenefitsData, coupons])\n\n return (\n <ProductBenefitsTabs\n className=\"relative\"\n onValueChange={value => setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'installment')}\n value={productBenefitsTabsValue}\n >\n <div className=\"absolute right-0 top-0 z-[1] h-[40px] w-[25px] rounded-xl bg-gradient-to-r from-transparent to-[#EAEAEC]\"></div>\n <ProductBenefitsTabs.List ref={scrollContainerRef}>\n {benefitTabs?.map((item: any) => (\n <ProductBenefitsTabs.Trigger\n key={item?.value}\n className={cn(productBenefitsTabsValue === item.value && 'text-[#1D1D1F]')}\n value={item.value}\n onClick={e => handleProductBenefitsTabListClick(e, item?.value)}\n >\n {item.label}\n </ProductBenefitsTabs.Trigger>\n ))}\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .benefits-tabs-content::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content\n value=\"coupon\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto\"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n textConfig={mergedTextConfig}\n benefitPayloadData={benefitPayloadData}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n <ProductBenefitsTabs.Content\n value=\"membership\"\n className={cn('benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px]', {\n 'overflow-y-auto': profile?.email,\n })}\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <div\n className={cn('rounded-lg', {\n 'benefits-tabs-content lg-desktop:h-[calc(240px-100px)] desktop:h-[calc(196px-80px)] laptop:h-[calc(220px-72px)] h-[calc(180px-73px)] overflow-y-auto':\n !profile?.email,\n })}\n >\n {!profile?.email && (\n <h3 className=\"desktop:mb-2 mb-1 text-left text-lg font-bold !leading-[1.3]\">\n {benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLoginText}\n </h3>\n )}\n <ul\n className={`desktop:[&_li]:py-4 list-none \n [&_li:first-child]:rounded-t-lg [&_li:last-child]:rounded-b-lg [&_li:last-child]:last:border-b-0 [&_li]:flex\n [&_li]:items-center [&_li]:gap-2 [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4 [&_li]:py-[10px]\n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li className=\"justify-between\">\n <div className=\"flex gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M20 3.5C21.6569 3.5 23 4.84315 23 6.5V9.65625C23 10.0791 22.7342 10.4566 22.3359 10.5986C21.6665 10.8372 21.1816 11.4844 21.1816 12.25C21.1816 13.0156 21.6665 13.6628 22.3359 13.9014C22.7342 14.0434 23 14.4209 23 14.8438V18C23 19.6569 21.6569 21 20 21H4C2.34315 21 1 19.6569 1 18V14.8438L1.01172 14.6875C1.06803 14.3301 1.31557 14.0256 1.66406 13.9014C2.33345 13.6628 2.81836 13.0156 2.81836 12.25C2.81836 11.4844 2.33345 10.8372 1.66406 10.5986C1.26583 10.4566 1 10.0791 1 9.65625V6.5C1 4.84315 2.34315 3.5 4 3.5H20ZM4 5.5C3.44772 5.5 3 5.94772 3 6.5V9.03125C4.08987 9.68678 4.81836 10.8833 4.81836 12.25C4.81836 13.6165 4.08963 14.8122 3 15.4678V18C3 18.5523 3.44772 19 4 19H20C20.5523 19 21 18.5523 21 18V15.4678C19.9104 14.8122 19.1816 13.6165 19.1816 12.25C19.1816 10.8833 19.9101 9.68677 21 9.03125V6.5C21 5.94772 20.5523 5.5 20 5.5H4ZM15.793 6.79297C16.1835 6.40244 16.8165 6.40244 17.207 6.79297C17.5976 7.18349 17.5976 7.81651 17.207 8.20703L8.20703 17.207C7.81651 17.5976 7.18349 17.5976 6.79297 17.207C6.40244 16.8165 6.40244 16.1835 6.79297 15.793L15.793 6.79297ZM15.25 13.25C16.3546 13.25 17.25 14.1454 17.25 15.25C17.25 16.3546 16.3546 17.25 15.25 17.25C14.1454 17.25 13.25 16.3546 13.25 15.25C13.25 14.1454 14.1454 13.25 15.25 13.25ZM15.25 14.75C14.9739 14.75 14.75 14.9739 14.75 15.25C14.75 15.5261 14.9739 15.75 15.25 15.75C15.5261 15.75 15.75 15.5261 15.75 15.25C15.75 14.9739 15.5261 14.75 15.25 14.75ZM8.75 6.75C9.85457 6.75 10.75 7.64543 10.75 8.75C10.75 9.85457 9.85457 10.75 8.75 10.75C7.64543 10.75 6.75 9.85457 6.75 8.75C6.75 7.64543 7.64543 6.75 8.75 6.75ZM8.75 8.25C8.47386 8.25 8.25 8.47386 8.25 8.75C8.25 9.02614 8.47386 9.25 8.75 9.25C9.02614 9.25 9.25 9.02614 9.25 8.75C9.25 8.47386 9.02614 8.25 8.75 8.25Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {replaceTemplate(benefitPayloadData?.membershipBenefitData?.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n )}\n {benefitPayloadData?.membershipBenefitData?.equities?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index} className=\"justify-between gap-2\">\n <button\n onClick={() => openModal?.({ title: item.label, content: item.modalText })}\n key={index}\n className=\"flex justify-between\"\n >\n <Picture source={item.icon} alt={item.text} className=\"desktop:size-6 size-4 shrink-0\" />\n <Text className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">{item.text}</Text>\n </button>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n ) : (\n <li key={index} className=\"justify-between\">\n <div className=\"flex items-center gap-2\">\n <Picture source={item.icon} alt={item.text} className=\"desktop:size-6 size-4 shrink-0\" />\n <Text as=\"p\" className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">\n {item.label}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n )\n )}\n {/* <li className=\"justify-between\">\n <div className=\"flex items-center gap-2\">\n <Picture\n source={benefitPayloadData?.membershipBenefitData.memberPriceIcon}\n alt={benefitPayloadData?.membershipBenefitData.memberPriceDesc}\n className=\" size-6 shrink-0\"\n />\n <Text as=\"p\" className=\"x:text-[14px] text-wrap text-left text-[16px] font-bold\">\n {benefitPayloadData?.membershipBenefitData.memberPriceDesc}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li> */}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li className=\"justify-between\">\n <div className=\"flex gap-2\">\n <svg\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {benefitPayloadData?.membershipBenefitData?.expressShipping}\n </Text>\n </div>\n {Boolean(profile?.email) && <CheckedIcon />}\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg\n className=\"desktop:size-6 size-4\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"x:text-[14px] text-left text-[16px] font-bold\">\n {!profile?.email ? (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n ) : !activated ? (\n <>\n {benefitPayloadData?.membershipBenefitData?.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {benefitPayloadData?.membershipBenefitData?.active}\n </span>\n </>\n ) : used_points < available_points ? (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n ) : (\n benefitPayloadData?.membershipBenefitData?.creditsInsufficient\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!profile?.email && (\n <div className=\"desktop:pt-4 pt-2\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n <ProductBenefitsTabs.Content\n value=\"pay\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto \"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {benefitPayloadData?.payBenefitData?.payMethod}\n </Heading>\n <div className=\"lg-desktop:p-4 flex items-center justify-between gap-2 rounded-lg bg-white p-3\">\n <div className=\"flex items-center gap-2\">\n <Picture\n source={benefitPayloadData?.payBenefitData?.icon}\n className=\"desktop:size-[70px] desktop:h-[34px] size-[40px] h-[20px] shrink-0\"\n />\n <Text\n as=\"p\"\n className=\"x:text-[14px] text-left text-[16px] font-bold\"\n html={benefitPayloadData?.payBenefitData?.withCheckout}\n />\n </div>\n <button\n className=\"hover:text-brand-0 desktop:text-[16px] whitespace-nowrap text-sm font-bold underline\"\n onClick={() => setIsFlexModalOpen(true)}\n >\n {benefitPayloadData?.payBenefitData?.learnMore}\n </button>\n </div>\n </div>\n\n <ModalContainer showModal={isFlexModalOpen} closeModal={() => setIsFlexModalOpen(false)}>\n <Picture source={benefitPayloadData?.payBenefitData?.payImage}></Picture>\n </ModalContainer>\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content\n value=\"installment\"\n className=\"benefits-tabs-content lg-desktop:h-[240px] desktop:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto \"\n >\n <div className=\"lg-desktop:p-4 p-3\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {benefitPayloadData?.installmentBenefitData?.flexibleInstallment}\n </Heading>\n <div className=\"lg-desktop:p-4 overflow-hidden rounded-lg bg-white p-3\">{renderInstallments}</div>\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nconst CheckedIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" {...props}>\n <path\n d=\"M4 9.19472L8.51935 13.667L16.2668 6.00024\"\n stroke=\"#2BBC4F\"\n strokeWidth=\"1.67\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nexport default withLayout(BenefitsTab)\n"],
5
+ "mappings": "AAqHM,OAmGU,YAAAA,EAnGV,OAAAC,EA6CI,QAAAC,MA7CJ,oBArHN,OAAS,UAAAC,GAAQ,YAAAC,GAAU,QAAAC,EAAM,WAAAC,EAAS,WAAAC,EAAS,QAAAC,OAAY,qCAC/D,OAAOC,MAAyB,iCAChC,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,eAAAC,OAAmB,gCAC5B,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,mBAAAC,MAAuB,+BAChC,OAAgB,aAAAC,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAC5D,OAAS,kBAAAC,MAAsB,oCAC/B,OAAOC,OAAkB,uCACzB,OAAOC,OAAa,4BACpB,OAAS,MAAAC,MAAU,kCACnB,OAAOC,OAAoB,0CAC3B,OAAS,cAAAC,OAAkB,kCA+C3B,MAAMC,GAAqD,CACzD,WAAY,OACZ,SAAU,YACV,OAAQ,SACR,QAAS,UACT,UAAW,wBACX,cAAe,2BACf,SAAU,YACV,eAAgB,sCAChB,eAAgB,oCAChB,YAAa,kCACb,aAAc,6BACd,YAAa,2BACb,IAAK,OACL,uBAAwB,8DACxB,2BAA4B,gCAC5B,aAAc,8BACd,gBAAiB,0BACjB,uBAAwB,mDACxB,OAAQ,SACR,oBAAqB,+BACvB,EAoBMC,GAAa,CAAC,CAClB,KAAAC,EACA,WAAAC,EACA,mBAAAC,CACF,IAIM,CACJ,KAAM,CAAE,aAAAC,CAAa,EAAIX,EAAe,EAClC,CAAE,OAA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,OAAI,UAAU,qBACb,UAAAD,EAACM,EAAA,CAAQ,KAAM,EAAG,UAAU,mCACzB,SAAAqB,GAAoB,wBAAwB,oBAC/C,EACA3B,EAAC,OAAI,UAAU,yDAA0D,SAAA+C,EAAmB,GAC9F,EACF,GACF,CAEJ,EAEM8C,EAAeC,GAEjB9F,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAQ,GAAG8F,EACjG,SAAA9F,EAAC,QACC,EAAE,4CACF,OAAO,UACP,YAAY,OACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIJ,IAAO+F,GAAQzE,GAAWsB,EAAW",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Checkbox", "Text", "Picture", "Heading", "Link", "ProductBenefitsTabs", "useBizProductContext", "useBenefits", "formatPrice", "replaceTemplate", "useEffect", "useMemo", "useRef", "useState", "useAiuiContext", "useCountDown", "useCopy", "cn", "ModalContainer", "withLayout", "defaultTextConfig", "CouponItem", "item", "textConfig", "benefitPayloadData", "trackingData", "isCopied", "copyToClipboard", "checked", "setChecked", "couponCopy", "days", "hours", "minutes", "seconds", "openModal", "event", "CouponContent", "coupons", "className", "index", "BenefitsTab", "profile", "variant", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "product", "creditsRedemptionData", "used_points", "available_points", "productBenefitsData", "isFlexModalOpen", "setIsFlexModalOpen", "benefits", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "couponBenefitData", "membershipBenefitData", "installmentBenefitData", "payBenefitData", "value", "couponSaving", "memberSaving", "setProductBenefitsTabsValue", "productBenefitsTabsValue", "handleActivate", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft", "benefitTabs", "e", "CheckedIcon", "props", "BenefitsTab_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useEffect as v,useState as N}from"react";import{Dialog as y,DialogTrigger as D,DialogContent as C,DialogHeader as E,DialogTitle as h,Grid as c,GridItem as o,Text as G}from"../../../../../../components/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import I from"./Select.js";import{useAiuiContext as k}from"../../../../../AiuiProvider/index.js";import{formatPrice as f}from"../../../../utils/index.js";import{ShopifyColorOption as z}from"./ShopifyColorOption.js";const P=()=>{const{locale:x="us",copyWriting:n}=k(),{compareData:r,product:g}=w(),[m,u]=N();v(()=>{u(r?.availableCompareList[0]?.handle)},[r?.availableCompareList]);const d=[r?.currentProductCompareData?.product,r?.availableCompareList.find(a=>a.handle===m)?.product].filter(Boolean);return r?.specificationKeys?s(y,{children:[e(D,{className:"text-base font-bold leading-[1.4]",children:n?.compare}),s(C,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[e(E,{className:"laptop:pt-4 laptop:pb-3 pb-2 pt-4",children:e(h,{className:"text-sm font-bold text-[#6D6D6F]",children:n?.compare})}),s(c,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#595959]",children:n?.product||"Product"})}),e(o,{span:1,children:e(G,{as:"div",className:"flex h-[68px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-4 text-[16px] font-bold",html:r.currentProductCompareData?.shortName||g.title})}),m&&e(o,{span:1,children:e(I,{className:"h-[68px] px-4",value:m,onChange:a=>{u(a)},list:r.options})})]}),s(c,{className:"laptop:gap-8 laptop:py-8 grid-cols-3 py-6",children:[e(o,{span:1}),d.map((a,i)=>e(o,{span:1,className:"flex items-center",children:e("img",{src:a.images[0].url,alt:a.title,className:"size-[100px]",role:"presentation"})},i))]}),s(c,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(o,{span:1}),d.map((a,i)=>{const t=a.variants[0];return e(o,{span:1,className:"flex h-full",children:e("div",{className:"flex flex-col gap-[8px]",children:t.price.amount<9999999&&e("div",{className:"flex items-center gap-[8px]",children:s("div",{className:"flex items-center gap-[6px]",children:[e("span",{className:"text-[18px] font-bold",children:f({locale:x,amount:t?.coupons?.[0]?.variant_price4wscode||t.price.amount,currencyCode:t.price.currencyCode})}),Number(t?.coupons?.[0]?.variant_price4wscode)>0&&e("span",{className:"text-[18px] font-bold text-[#6D6D6F] line-through",children:f({locale:x,amount:t.price.amount,currencyCode:t.price.currencyCode})})]})})})},i)})]}),s(c,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:n?.color||"Color"})}),d.map((a,i)=>{const t=a.options?.find(l=>["color","colour","couleur"].find(p=>l.name.toLowerCase().includes(p)))?.values.map(l=>l.label);return e(o,{span:1,className:"flex h-full",children:t?.length&&e("div",{className:"flex items-center gap-4",children:t.map(l=>e(z,{label:l,className:"size-6"},l))})},i)})]}),e(c,{className:"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]",children:r.specificationKeys?.map(a=>s(o,{span:12,className:"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:a}),d.map((i,t)=>{let p=i.metafields?.global?.specifications?.find(b=>b?.key===a)?.value||"";switch(p.trim().toLowerCase()){case"true":p="\u2714\uFE0F";break;case"false":p="\u274C";break;default:break}return e("div",{className:"flex items-center",children:e("div",{className:"text-[16px] font-bold text-[#1D1D1F]",children:p})},t)})]},a))})]})]}):null};var A=P;export{A as default};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as v,useState as N}from"react";import{Dialog as y,DialogTrigger as D,DialogContent as C,DialogHeader as h,DialogTitle as E,Grid as c,GridItem as o,Text as G}from"../../../../../../components/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import I from"./Select.js";import{useAiuiContext as k}from"../../../../../AiuiProvider/index.js";import{formatPrice as f}from"../../../../utils/index.js";import{ShopifyColorOption as z}from"./ShopifyColorOption.js";const P=()=>{const{locale:u="us",copyWriting:n}=k(),{compareData:l,product:g}=w(),[m,x]=N();v(()=>{x(l?.availableCompareList[0]?.handle)},[l?.availableCompareList]);const d=[l?.currentProductCompareData?.product,l?.availableCompareList.find(a=>a.handle===m)?.product].filter(Boolean);return l?.specificationKeys?r(y,{children:[e(D,{className:"text-base font-bold leading-[1.4]",children:n?.compare}),r(C,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:p-0 laptop:w-[896px] z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden !py-0 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[e(h,{className:"laptop:pt-4 laptop:pb-3 laptop:px-8 px-4 pb-2 pt-4",children:e(E,{className:"laptop:text-[24px] text-left text-[20px] font-bold",children:n?.compare})}),r("div",{className:"laptop:px-8 h-[calc(80vh-64px)] overflow-y-auto px-4",children:[r(c,{className:"laptop:py-3 grid-cols-3 items-center gap-[40px] py-4",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#595959]",children:n?.product||"Product"})}),e(o,{span:1,children:e(G,{as:"div",className:"rounded-btn flex h-[48px] w-full items-center border border-[#E8E8E8] px-4 text-[16px] font-bold",html:l.currentProductCompareData?.shortName||g.title})}),m&&e(o,{span:1,children:e(I,{className:"rounded-btn h-[48px] px-4",value:m,onChange:a=>{x(a)},list:l.options})})]}),r(c,{className:"laptop:gap-8 laptop:py-3 grid-cols-3 py-4",children:[e(o,{span:1}),d.map((a,p)=>e(o,{span:1,className:"flex items-center",children:e("img",{src:a.images[0].url,alt:a.title,className:"size-[100px]",role:"presentation"})},p))]}),r(c,{className:"laptop:py-3 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e(o,{span:1}),d.map((a,p)=>{const t=a.variants[0];return e(o,{span:1,className:"flex h-full",children:e("div",{className:"flex flex-col gap-[8px]",children:t.price.amount<9999999&&e("div",{className:"flex items-center gap-[8px]",children:r("div",{className:"flex items-center gap-[6px]",children:[e("span",{className:"text-[18px] font-bold",children:f({locale:u,amount:t?.coupons?.[0]?.variant_price4wscode||t.price.amount,currencyCode:t.price.currencyCode})}),Number(t?.coupons?.[0]?.variant_price4wscode)>0&&e("span",{className:"text-[18px] font-bold text-[#6D6D6F] line-through",children:f({locale:u,amount:t.price.amount,currencyCode:t.price.currencyCode})})]})})})},p)})]}),r(c,{className:"laptop:py-3 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:n?.color||"Color"})}),d.map((a,p)=>{const t=a.options?.find(s=>["color","colour","couleur"].find(i=>s.name.toLowerCase().includes(i)))?.values.map(s=>s.label);return e(o,{span:1,className:"flex h-full",children:t?.length&&e("div",{className:"flex items-center gap-4",children:t.map(s=>e(z,{label:s,className:"size-6"},s))})},p)})]}),e(c,{className:"laptop:gap-0 grid-cols-12 items-center gap-0 border-b border-[#E8E8E8]",children:l.specificationKeys?.map(a=>r(o,{span:12,className:"laptop:py-3 laptop:gap-4 grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:a}),d.map((p,t)=>{let i=p.metafields?.global?.specifications?.find(b=>b?.key===a)?.value||"";switch(i.trim().toLowerCase()){case"true":i="\u2714\uFE0F";break;case"false":i="\u274C";break;default:break}return e("div",{className:"flex items-center",children:e("div",{className:"text-[16px] font-bold text-[#1D1D1F]",children:i})},t)})]},a))})]})]})]}):null};var A=P;export{A as default};
2
2
  //# sourceMappingURL=CompareModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.tsx"],
4
- "sourcesContent": ["import { useEffect, useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n Button,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { ShopifyColorOption } from './ShopifyColorOption.js'\n\nconst CompareModal = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { compareData, product } = useBizProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.compare}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 pb-2 pt-4\">\n <DialogTitle className=\"text-sm font-bold text-[#6D6D6F]\">{copyWriting?.compare}</DialogTitle>\n </DialogHeader>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">{copyWriting?.product || 'Product'}</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"flex h-[68px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-4 text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n className=\"h-[68px] px-4\"\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"laptop:gap-8 laptop:py-8 grid-cols-3 py-6\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img src={product.images[0].url} alt={product.title} className=\"size-[100px]\" role=\"presentation\" />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n {/* <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div> */}\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[18px] font-bold\">\n {formatPrice({\n locale,\n amount: variant?.coupons?.[0]?.variant_price4wscode || variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n {Number(variant?.coupons?.[0]?.variant_price4wscode) > 0 && (\n <span className=\"text-[18px] font-bold text-[#6D6D6F] line-through\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )}\n </div>\n </div>\n )}\n {/* <Button variant=\"primary\" size=\"lg\">\n {copyWriting?.shopNow || 'Shop Now'}\n </Button> */}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#6D6D6F]\">{copyWriting?.color || 'Color'}</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {colors?.length && (\n <div className=\"flex items-center gap-4\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"size-6\" />\n ))}\n </div>\n )}\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#6D6D6F]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-bold text-[#1D1D1F]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
5
- "mappings": "A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useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n Button,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { ShopifyColorOption } from './ShopifyColorOption.js'\n\nconst CompareModal = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { compareData, product } = useBizProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.compare}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:p-0 laptop:w-[896px] z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden !py-0 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 laptop:px-8 px-4 pb-2 pt-4\">\n <DialogTitle className=\"laptop:text-[24px] text-left text-[20px] font-bold\">\n {copyWriting?.compare}\n </DialogTitle>\n </DialogHeader>\n <div className=\"laptop:px-8 h-[calc(80vh-64px)] overflow-y-auto px-4\">\n <Grid className=\"laptop:py-3 grid-cols-3 items-center gap-[40px] py-4\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">{copyWriting?.product || 'Product'}</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"rounded-btn flex h-[48px] w-full items-center border border-[#E8E8E8] px-4 text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n className=\"rounded-btn h-[48px] px-4\"\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"laptop:gap-8 laptop:py-3 grid-cols-3 py-4\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img src={product.images[0].url} alt={product.title} className=\"size-[100px]\" role=\"presentation\" />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"laptop:py-3 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n {/* <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div> */}\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[18px] font-bold\">\n {formatPrice({\n locale,\n amount: variant?.coupons?.[0]?.variant_price4wscode || variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n {Number(variant?.coupons?.[0]?.variant_price4wscode) > 0 && (\n <span className=\"text-[18px] font-bold text-[#6D6D6F] line-through\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )}\n </div>\n </div>\n )}\n {/* <Button variant=\"primary\" size=\"lg\">\n {copyWriting?.shopNow || 'Shop Now'}\n </Button> */}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"laptop:py-3 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#6D6D6F]\">{copyWriting?.color || 'Color'}</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {colors?.length && (\n <div className=\"flex items-center gap-4\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"size-6\" />\n ))}\n </div>\n )}\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"laptop:gap-0 grid-cols-12 items-center gap-0 border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"laptop:py-3 laptop:gap-4 grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#6D6D6F]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-bold text-[#1D1D1F]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
5
+ "mappings": "AAqCM,cAAAA,EAWI,QAAAC,MAXJ,oBArCN,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC,OACE,UAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,YAAAC,EACA,QA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vF,EACCK,EAAS,IAAI,CAACH,EAASK,IAAiB,CACvC,MAAME,EAASP,EAAQ,SACnB,KAAKQ,GACL,CAAC,QAAS,SAAU,SAAS,EAAE,KAAKC,GAAaD,EAAO,KAAK,YAAY,EAAE,SAASC,CAAS,CAAC,CAChG,GACE,OAAO,IAAIL,GAASA,EAAM,KAAK,EACnC,OACEzB,EAACU,EAAA,CAAS,KAAM,EAAsB,UAAU,cAC7C,SAAAkB,GAAQ,QACP5B,EAAC,OAAI,UAAU,0BACZ,SAAA4B,EAAO,IAAIG,GACV/B,EAACgB,EAAA,CAA+B,MAAOe,EAAO,UAAU,UAA/BA,CAAwC,CAClE,EACH,GANoBL,CAQxB,CAEJ,CAAC,GACH,EACA1B,EAACS,EAAA,CAAK,UAAU,yEACb,SAAAW,EAAY,mBAAmB,IAAKY,GAEjC/B,EAACS,EAAA,CACC,KAAM,GACN,UAAU,mGAIV,UAAAV,EAAC,OAAI,UAAU,uCAAwC,SAAAgC,EAAI,EAE1DR,EAAS,IAAI,CAACH,EAASK,IAAiB,CAKvC,IAAIO,EAHFZ,EAAQ,YAAY,QAAQ,gBAAgB,KACzCa,GAAmCA,GAAe,MAAQF,CAC7D,GAAG,OAAS,GAEd,OAAQC,EAAK,KAAK,EAAE,YAAY,EAAG,CACjC,IAAK,OACHA,EAAO,eACP,MACF,IAAK,QACHA,EAAO,SACP,MACF,QACE,KACJ,CACA,OACEjC,EAAC,OAAuB,UAAU,oBAEhC,SAAAA,EAAC,OAAI,UAAU,uCAAwC,SAAAiC,EAAK,GAFpDP,CAGV,CAEJ,CAAC,IA3BIM,CA4BP,CAEH,EACH,GACF,GACF,GACF,EAvJ0C,IAyJ9C,EAEA,IAAOG,EAAQlB",
6
6
  "names": ["jsx", "jsxs", "useEffect", "useState", "Dialog", "DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "Grid", "GridItem", "Text", "useBizProductContext", "Select", "useAiuiContext", "formatPrice", "ShopifyColorOption", "CompareModal", "locale", "copyWriting", "compareData", "product", "selectedProductHandle", "setSelectedProductHandle", "products", "value", "productIndex", "variant", "colors", "option", "predicate", "label", "key", "text", "specification", "CompareModal_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as e}from"react/jsx-runtime";import{useAiuiContext as p}from"../../../../../AiuiProvider/index.js";import{Dialog as r,DialogTrigger as c,DialogContent as g,DialogHeader as n,DialogTitle as m,Grid as d,GridItem as x,Text as i}from"../../../../../../components/index.js";import{useBizProductContext as D}from"../../../../BizProductProvider.js";const N=()=>{const{product:s}=D(),{copyWriting:a}=p();return e(r,{children:[o(c,{className:"text-base font-bold leading-[1.4]",children:a?.specs}),e(g,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[o(n,{className:"laptop:pt-4 laptop:pb-3 pb-2 pt-4",children:o(m,{className:"text-sm font-bold text-[#6D6D6F]",children:a?.specs})}),o(d,{className:"laptop:gap-8 laptop:py-8 py-6",children:s.metafields?.global?.specifications?.map(({key:l,value:t})=>e(x,{span:6,className:"flex flex-col gap-1",children:[o(i,{className:"text-[18px] font-bold text-[#1D1D1F]",children:l}),o(i,{className:"text-[18px] font-bold text-[#86868C]",html:t?.trim().toLowerCase()==="true"?"\u2714\uFE0F":t?.trim().toLowerCase()==="false"?"\u274C":t})]},l))})]})]})};export{N as SpecsModal};
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{useAiuiContext as s}from"../../../../../AiuiProvider/index.js";import{Dialog as r,DialogTrigger as c,DialogContent as g,DialogHeader as x,DialogTitle as n,Grid as d,GridItem as m,Text as p}from"../../../../../../components/index.js";import{useBizProductContext as f}from"../../../../BizProductProvider.js";const N=()=>{const{product:i}=f(),{copyWriting:a}=s();return e(r,{children:[o(c,{className:"text-base font-bold leading-[1.4]",children:a?.specs}),e(g,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:p-0 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[o(x,{className:"laptop:pt-4 laptop:pb-3 laptop:px-8 px-4 pb-2 pt-4",children:o(n,{className:"laptop:text-[24px] text-left text-[20px] font-bold",children:a?.specs})}),o("div",{className:"laptop:px-8 overflow-y-auto px-4",children:o(d,{className:"laptop:gap-8 laptop:py-8 py-6",children:i.metafields?.global?.specifications?.map(({key:l,value:t})=>e(m,{span:6,className:"flex flex-col gap-1",children:[o(p,{className:"text-[18px] font-bold text-[#1D1D1F]",children:l}),o(p,{className:"text-[18px] font-bold text-[#86868C]",html:t?.trim().toLowerCase()==="true"?"\u2714\uFE0F":t?.trim().toLowerCase()==="false"?"\u274C":t})]},l))})})]})]})};export{N as SpecsModal};
2
2
  //# sourceMappingURL=SpecsModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nexport const SpecsModal = () => {\n const { product } = useBizProductContext()\n const { copyWriting } = useAiuiContext()\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.specs}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 pb-2 pt-4\">\n <DialogTitle className=\"text-sm font-bold text-[#6D6D6F]\">{copyWriting?.specs}</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 py-6\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={6} key={key} className=\"flex flex-col gap-1\">\n <Text className=\"text-[18px] font-bold text-[#1D1D1F]\">{key}</Text>\n <Text\n className=\"text-[18px] font-bold text-[#86868C]\"\n html={\n value?.trim().toLowerCase() === 'true' ? '\u2714\uFE0F' : value?.trim().toLowerCase() === 'false' ? '\u274C' : value\n }\n />\n </GridItem>\n ))}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n"],
5
- "mappings": "AAmBM,cAAAA,EAUM,QAAAC,MAVN,oBAnBN,OAAS,kBAAAC,MAAsB,uCAC/B,OACE,UAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,YAAAC,EACA,QAAAC,MACK,wCACP,OAAS,wBAAAC,MAA4B,oCAE9B,MAAMC,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAC,CAAQ,EAAIF,EAAqB,EACnC,CAAE,YAAAG,CAAY,EAAIZ,EAAe,EAEvC,OACED,EAACE,EAAA,CACC,UAAAH,EAACI,EAAA,CAAc,UAAU,oCAAqC,SAAAU,GAAa,MAAM,EACjFb,EAACI,EAAA,CACC,iBAAiB,UACjB,UAAU,8QAEV,UAAAL,EAACM,EAAA,CAAa,UAAU,qCACtB,SAAAN,EAACO,EAAA,CAAY,UAAU,mCAAoC,SAAAO,GAAa,MAAM,EAChF,EACAd,EAACQ,EAAA,CAAK,UAAU,gCACb,SAAAK,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAE,EAAK,MAAAC,CAAM,IAC7Df,EAACQ,EAAA,CAAS,KAAM,EAAa,UAAU,sBACrC,UAAAT,EAACU,EAAA,CAAK,UAAU,uCAAwC,SAAAK,EAAI,EAC5Df,EAACU,EAAA,CACC,UAAU,uCACV,KACEM,GAAO,KAAK,EAAE,YAAY,IAAM,OAAS,eAAOA,GAAO,KAAK,EAAE,YAAY,IAAM,QAAU,SAAMA,EAEpG,IAPsBD,CAQxB,CACD,EACH,GACF,GACF,CAEJ",
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nexport const SpecsModal = () => {\n const { product } = useBizProductContext()\n const { copyWriting } = useAiuiContext()\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.specs}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:p-0 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 laptop:px-8 px-4 pb-2 pt-4\">\n <DialogTitle className=\"laptop:text-[24px] text-left text-[20px] font-bold\">{copyWriting?.specs}</DialogTitle>\n </DialogHeader>\n <div className=\"laptop:px-8 overflow-y-auto px-4\">\n <Grid className=\"laptop:gap-8 laptop:py-8 py-6\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={6} key={key} className=\"flex flex-col gap-1\">\n <Text className=\"text-[18px] font-bold text-[#1D1D1F]\">{key}</Text>\n <Text\n className=\"text-[18px] font-bold text-[#86868C]\"\n html={\n value?.trim().toLowerCase() === 'true'\n ? '\u2714\uFE0F'\n : value?.trim().toLowerCase() === 'false'\n ? '\u274C'\n : value\n }\n />\n </GridItem>\n ))}\n </Grid>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
5
+ "mappings": "AAmBM,cAAAA,EAWQ,QAAAC,MAXR,oBAnBN,OAAS,kBAAAC,MAAsB,uCAC/B,OACE,UAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,YAAAC,EACA,QAAAC,MACK,wCACP,OAAS,wBAAAC,MAA4B,oCAE9B,MAAMC,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAC,CAAQ,EAAIF,EAAqB,EACnC,CAAE,YAAAG,CAAY,EAAIZ,EAAe,EAEvC,OACED,EAACE,EAAA,CACC,UAAAH,EAACI,EAAA,CAAc,UAAU,oCAAqC,SAAAU,GAAa,MAAM,EACjFb,EAACI,EAAA,CACC,iBAAiB,UACjB,UAAU,wQAEV,UAAAL,EAACM,EAAA,CAAa,UAAU,qDACtB,SAAAN,EAACO,EAAA,CAAY,UAAU,qDAAsD,SAAAO,GAAa,MAAM,EAClG,EACAd,EAAC,OAAI,UAAU,mCACb,SAAAA,EAACQ,EAAA,CAAK,UAAU,gCACb,SAAAK,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAE,EAAK,MAAAC,CAAM,IAC7Df,EAACQ,EAAA,CAAS,KAAM,EAAa,UAAU,sBACrC,UAAAT,EAACU,EAAA,CAAK,UAAU,uCAAwC,SAAAK,EAAI,EAC5Df,EAACU,EAAA,CACC,UAAU,uCACV,KACEM,GAAO,KAAK,EAAE,YAAY,IAAM,OAC5B,eACAA,GAAO,KAAK,EAAE,YAAY,IAAM,QAC9B,SACAA,EAEV,IAXsBD,CAYxB,CACD,EACH,EACF,GACF,GACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "useAiuiContext", "Dialog", "DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "Grid", "GridItem", "Text", "useBizProductContext", "SpecsModal", "product", "copyWriting", "key", "value"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as ve,jsx as e,jsxs as y}from"react/jsx-runtime";import{useAiuiContext as K}from"../../../../AiuiProvider/index.js";import{Text as ee,Picture as V,Badge as te}from"../../../../../components/index.js";import{useCallback as x,useMemo as z,useState as k,forwardRef as U,useRef as I,useEffect as R,useImperativeHandle as le}from"react";import{Swiper as D,SwiperSlide as B}from"swiper/react";import{Navigation as $,Mousewheel as Z,Thumbs as F,Pagination as q}from"swiper/modules";import{cn as w}from"../../../../../helpers/index.js";import{GalleryTabType as L}from"./types.js";import{Content as ae,List as ie,Root as oe,Trigger as re}from"@radix-ui/react-tabs";import{useBizProductContext as j}from"../../../BizProductProvider.js";import{useVariantMedia as se}from"../../../hooks/use-variant-media.js";import{SpecsModal as ne}from"./components/SpecsModal.js";import ce from"./components/CompareModal.js";import{formatPrice as de}from"../../../utils/index.js";import{withLayout as ue}from"../../../../../shared/Styles.js";import{gaTrack as pe}from"../../../../../shared/track.js";import{ExposureDetector as be}from"../../../../../components/index.js";const J=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),Q=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),me=()=>{const{copyWriting:t}=K(),{product:r,variant:g,selectedOptions:N}=j(),b=se({product:r,variant:g}),[u,h]=k(null),P=I(null),m=g?.metafields?.component?.custom_media_list;let a,v,E,S;m&&m?.available?(a=m?.product||[],v=m?.scenarios||[],E=m?.keyFeatures||[],S=m?.video||[]):(a=b?.productList,v=b?.sceneList,E=b?.keyFeaturesList,S=b?.videoList);const c=z(()=>[...a,...v,...S],[a,v,S]),p={productList:a,sceneList:v,keyFeaturesList:E,videoList:S},l=z(()=>(r?.payload?.components?.find(i=>i.componentKey==="ProductGallery")?.data||[])?.map(i=>{let W=p[i?.galleries]||[];if(i?.images&&Array.isArray(i.images)&&i.images.length>0){const Y=i.images.map(n=>{const G=[];if(n.image_1920&&n.image_1920.trim()&&G.push(`${n.image_1920} 1920`),n.image_1440&&n.image_1440.trim()&&G.push(`${n.image_1440} 1440`),n.image_1024&&n.image_1024.trim()&&G.push(`${n.image_1024} 1024`),n.image_768&&n.image_768.trim()&&G.push(`${n.image_768} 767`),n.image_390&&n.image_390.trim()&&G.push(`${n.image_390} 390`),G.length>0){const O=G.join(", ");return{image:{url:O,altText:i.comment?.content||""},_fromImages:!0,_responsiveSource:O}}return null}).filter(n=>n!==null);Y.length>0&&(W=Y)}return{...i,galleries:W}}).filter(i=>i.galleries.length>0),[r?.payload,p]),[f,o]=k(l?.[0]),[d,_]=k(0),[C,T]=k(null),M=x(()=>{const s=(d+1)%l.length;_(s),o(l[s]),T(0)},[d,l]),A=x(()=>{const s=d===0?l.length-1:d-1;_(s),o(l[s]);const i=l[s]?.galleries||[];T(i.length-1)},[d,l]);R(()=>{d!=null&&requestAnimationFrame(()=>{P.current?.scrollToTab(d)})},[d]),R(()=>{o(l[0]),_(0)},[g?.id]);const X=(s,i)=>{switch(s?.galleryTabType){case L.GALLERY_IMAGE_MAIN:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_FEATURES:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_SCENE:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_VIDEO:return e(fe,{...s,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});default:return null}};return e("div",{id:"ipc-product-gallery",children:y(oe,{className:"relative",value:f?.tabValue,defaultValue:l?.[0]?.tabValue,children:[e("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:l.map((s,i)=>e(ae,{className:"h-full",value:s.tabValue,children:X(s,i)},s.tabValue))}),e(ge,{ref:P,galleryTabs:l,activeGalleryTab:f,setActiveGalleryTab:o,setActiveTabIndex:_,setTargetSlideIndex:T})]})})},ge=U((t,r)=>{const{galleryTabs:g,activeGalleryTab:N,setActiveGalleryTab:b,setActiveTabIndex:u,setTargetSlideIndex:h}=t,{product:P}=j(),m=I(null),a=I(new Map),v=x(c=>{if(m.current){const p=m.current,l=c.currentTarget,f=l.offsetLeft-p.offsetWidth/2+l.offsetWidth/2;p.scrollTo({left:f,behavior:"smooth"})}},[]),E=x((c,p,l)=>{b(p),u(l),h(0),v(c)},[b,u,h,v]),S=x(c=>{if(m.current&&g[c]){const p=m.current,l=g[c],f=a.current.get(l.tabValue);if(f){const o=f.offsetLeft-p.offsetWidth/2+f.offsetWidth/2;p.scrollTo({left:o,behavior:"smooth"})}}},[g]);return le(r,()=>({scrollToTab:S})),y("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[e(ie,{ref:m,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:g?.map((c,p)=>e(re,{ref:l=>{l?a.current.set(c.tabValue,l):a.current.delete(c.tabValue)},className:w("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",c.tabValue===N?.tabValue&&"bg-white"),onClick:l=>E(l,c,p),value:c.tabValue,children:c.tabLabel},c.tabValue+p))})}),e("div",{className:"laptop:gap-2 laptop:flex hidden",children:P.metafields?.global?.specifications&&y(ve,{children:[e(ne,{})," | ",e(ce,{})]})})]})}),H=U((t,r)=>{const{locale:g="us",copyWriting:N}=K(),{variant:b,totalSavings:u}=j(),h=I(null),[P,m]=k(null),[a,v]=k(null),E=I(null),[S,c]=k(!1),p=z(()=>{if(t?.galleryTabType===L.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===L.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,L.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),l=x(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),f=x(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return R(()=>{a&&t.targetSlideIndex&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(D,{ref:r,className:"h-full",onSwiper:v,onTouchEnd:(o,d)=>{o.isBeginning&&o.swipeDirection==="prev"?l():o.isEnd&&o.swipeDirection==="next"&&f()},pagination:{clickable:!0,el:h.current},thumbs:{swiper:P},modules:[Z,F,$,q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((o,d)=>{const _=`${t.tabValue}-${d}`,C=()=>{pe({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${b.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:d+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},T=o?._responsiveSource||o?.image?.url||"";return e(B,{className:"h-full",children:e(be,{onExposure:C,exposureKey:_,threshold:.5,duration:2e3,className:"h-full",children:e(V,{source:T,alt:o?.image?.altText,className:w("h-full",p),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+d)})}),b.availableForSale&&!!u&&!t.index&&e(te,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${de({amount:u,currencyCode:b?.price?.currencyCode,locale:g})} ${N?.off}`}),e("div",{className:w("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:l,children:e(J,{className:w("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:w("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:f,children:e(Q,{className:w("tablet:size-10 lg-desktop:size-12")})}),y("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[e("div",{className:"tablet:block hidden",children:e(D,{className:"flex items-center justify-between",onSwiper:m,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[$,F],children:t?.galleries?.map((o,d)=>e(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:e(V,{source:o.image?.url,alt:o.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+d))})}),!t?.index&&y("div",{className:"flex items-center gap-2",children:[e(V,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),e("div",{className:"relative max-w-[528px] overflow-hidden",children:e("div",{ref:E,className:w("line-clamp-2"),style:{},children:e(ee,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),e("div",{ref:h,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#1D1D1F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),fe=t=>{const[r,g]=k(null),N=x(()=>{r?.isBeginning?t.onPrevTab?.():r?.slidePrev()},[r,t]),b=x(()=>{r?.isEnd?t.onNextTab?.():r?.slideNext()},[r,t]);return R(()=>{r&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(r.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[r,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(D,{className:"h-full",onSwiper:g,onTouchEnd:(u,h)=>{u.isBeginning&&u.swipeDirection==="prev"?N():u.isEnd&&u.swipeDirection==="next"&&b()},modules:[Z,F,$,q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((u,h)=>e(B,{className:"h-full",children:y("video",{controls:!0,className:"size-full object-cover",children:[e("track",{kind:"captions"}),e("source",{src:u?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:u?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:u?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+h))}),e("div",{className:w("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:N,children:e(J,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:w("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:b,children:e(Q,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Re=t=>e("div",{children:"3D View"});var Ve=ue(me);export{Ve as default};
1
+ import{Fragment as he,jsx as e,jsxs as y}from"react/jsx-runtime";import{useAiuiContext as Z}from"../../../../AiuiProvider/index.js";import{Text as ae,Picture as B,Badge as le}from"../../../../../components/index.js";import{useCallback as w,useMemo as $,useState as G,forwardRef as q,useRef as M,useEffect as D,useImperativeHandle as ie}from"react";import{Swiper as F,SwiperSlide as j}from"swiper/react";import{Navigation as H,Mousewheel as J,Thumbs as W,Pagination as Q}from"swiper/modules";import{cn as S}from"../../../../../helpers/index.js";import{GalleryTabType as L}from"./types.js";import{Content as oe,List as re,Root as se,Trigger as ne}from"@radix-ui/react-tabs";import{useBizProductContext as Y}from"../../../BizProductProvider.js";import{useVariantMedia as ce}from"../../../hooks/use-variant-media.js";import{SpecsModal as de}from"./components/SpecsModal.js";import ue from"./components/CompareModal.js";import{formatPrice as pe}from"../../../utils/index.js";import{withLayout as me}from"../../../../../shared/Styles.js";import{gaTrack as be}from"../../../../../shared/track.js";import{ExposureDetector as ge}from"../../../../../components/index.js";const X=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),ee=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),fe=()=>{const{copyWriting:t}=Z(),{product:r,variant:p,selectedOptions:N}=Y(),m=ce({product:r,variant:p}),[d,h]=G(null),_=M(null),b=p?.metafields?.component?.custom_media_list;let l,f,E,k;b&&b?.available?(l=b?.product||[],f=b?.scenarios||[],E=b?.keyFeatures||[],k=b?.video||[]):(l=m?.productList,f=m?.sceneList,E=m?.keyFeaturesList,k=m?.videoList);const n=$(()=>[...l,...f,...k],[l,f,k]),u={productList:l,sceneList:f,keyFeaturesList:E,videoList:k},a=$(()=>{const o=r?.payload?.components?.find(v=>v.componentKey==="ProductGallery")?.data||[],x=p?.payload?.components?.find(v=>v.componentKey==="ProductGallery")?.data||[];return o?.map(v=>{const V=x?.find(z=>v?.galleries===z?.galleries);let O=u[v?.galleries]||[];if(V?.images&&Array.isArray(V.images)&&V.images.length>0){const z=V.images.map(s=>{const P=[];if(s.image_1920&&s.image_1920.trim()&&P.push(`${s.image_1920} 1920`),s.image_1440&&s.image_1440.trim()&&P.push(`${s.image_1440} 1440`),s.image_1024&&s.image_1024.trim()&&P.push(`${s.image_1024} 1024`),s.image_768&&s.image_768.trim()&&P.push(`${s.image_768} 767`),s.image_390&&s.image_390.trim()&&P.push(`${s.image_390} 390`),P.length>0){const U=P.join(", ");return{image:{url:U,altText:v.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(s=>s!==null);z.length>0&&(O=z)}return{...v,galleries:O}}).filter(v=>v.galleries.length>0)},[p?.payload,u,r?.payload]),[g,i]=G(a?.[0]),[c,C]=G(0),[I,T]=G(null),A=w(()=>{const o=(c+1)%a.length;C(o),i(a[o]),T(0)},[c,a]),R=w(()=>{const o=c===0?a.length-1:c-1;C(o),i(a[o]);const x=a[o]?.galleries||[];T(x.length-1)},[c,a]);D(()=>{c!=null&&requestAnimationFrame(()=>{_.current?.scrollToTab(c)})},[c]),D(()=>{i(a[0]),C(0)},[p?.id]);const te=(o,x)=>{switch(o?.galleryTabType){case L.GALLERY_IMAGE_MAIN:return e(K,{...o,index:x,onNextTab:A,onPrevTab:R,targetSlideIndex:I,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_FEATURES:return e(K,{...o,index:x,onNextTab:A,onPrevTab:R,targetSlideIndex:I,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_SCENE:return e(K,{...o,index:x,onNextTab:A,onPrevTab:R,targetSlideIndex:I,onSlideChange:()=>T(null)});case L.GALLERY_VIDEO:return e(ye,{...o,onNextTab:A,onPrevTab:R,targetSlideIndex:I,onSlideChange:()=>T(null)});default:return null}};return e("div",{id:"ipc-product-gallery",children:y(se,{className:"relative",value:g?.tabValue,defaultValue:a?.[0]?.tabValue,children:[e("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:a.map((o,x)=>e(oe,{className:"h-full",value:o.tabValue,children:te(o,x)},o.tabValue))}),e(ve,{ref:_,galleryTabs:a,activeGalleryTab:g,setActiveGalleryTab:i,setActiveTabIndex:C,setTargetSlideIndex:T})]})})},ve=q((t,r)=>{const{galleryTabs:p,activeGalleryTab:N,setActiveGalleryTab:m,setActiveTabIndex:d,setTargetSlideIndex:h}=t,{product:_}=Y(),b=M(null),l=M(new Map),f=w(n=>{if(b.current){const u=b.current,a=n.currentTarget,g=a.offsetLeft-u.offsetWidth/2+a.offsetWidth/2;u.scrollTo({left:g,behavior:"smooth"})}},[]),E=w((n,u,a)=>{m(u),d(a),h(0),f(n)},[m,d,h,f]),k=w(n=>{if(b.current&&p[n]){const u=b.current,a=p[n],g=l.current.get(a.tabValue);if(g){const i=g.offsetLeft-u.offsetWidth/2+g.offsetWidth/2;u.scrollTo({left:i,behavior:"smooth"})}}},[p]);return ie(r,()=>({scrollToTab:k})),y("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[e(re,{ref:b,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:p?.map((n,u)=>e(ne,{ref:a=>{a?l.current.set(n.tabValue,a):l.current.delete(n.tabValue)},className:S("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",n.tabValue===N?.tabValue&&"bg-white"),onClick:a=>E(a,n,u),value:n.tabValue,children:n.tabLabel},n.tabValue+u))})}),e("div",{className:"laptop:gap-2 laptop:flex hidden",children:_.metafields?.global?.specifications&&y(he,{children:[e(de,{})," | ",e(ue,{})]})})]})}),K=q((t,r)=>{const{locale:p="us",copyWriting:N}=Z(),{variant:m,totalSavings:d}=Y(),h=M(null),[_,b]=G(null),[l,f]=G(null),E=M(null),[k,n]=G(!1),u=$(()=>{if(t?.galleryTabType===L.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===L.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,L.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),a=w(()=>{l?.isBeginning?t.onPrevTab?.():l?.slidePrev()},[l,t]),g=w(()=>{l?.isEnd?t.onNextTab?.():l?.slideNext()},[l,t]);return D(()=>{l&&t.targetSlideIndex&&(l.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[l,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(F,{ref:r,className:"h-full",onSwiper:f,onTouchEnd:(i,c)=>{i.isBeginning&&i.swipeDirection==="prev"?a():i.isEnd&&i.swipeDirection==="next"&&g()},pagination:{clickable:!0,el:h.current},thumbs:{swiper:_},modules:[J,W,H,Q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((i,c)=>{const C=`${t.tabValue}-${c}`,I=()=>{be({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${m.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:c+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},T=i?._responsiveSource||i?.image?.url||"";return e(j,{className:"h-full",children:e(ge,{onExposure:I,exposureKey:C,threshold:.5,duration:2e3,className:"h-full",children:e(B,{source:T,alt:i?.image?.altText,className:S("h-full",u),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+c)})}),m.availableForSale&&!!d&&!t.index&&e(le,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${pe({amount:d,currencyCode:m?.price?.currencyCode,locale:p})} ${N?.off}`}),e("div",{className:S("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:a,children:e(X,{className:S("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:S("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:g,children:e(ee,{className:S("tablet:size-10 lg-desktop:size-12")})}),y("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[e("div",{className:"tablet:block hidden",children:e(F,{className:"flex items-center justify-between",onSwiper:b,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[H,W],children:t?.galleries?.map((i,c)=>e(j,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:e(B,{source:i.image?.url,alt:i.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+c))})}),!t?.index&&y("div",{className:"flex items-center gap-2",children:[e(B,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),e("div",{className:"relative max-w-[528px] overflow-hidden",children:e("div",{ref:E,className:S("line-clamp-2"),style:{},children:e(ae,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),e("div",{ref:h,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#1D1D1F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),ye=t=>{const[r,p]=G(null),N=w(()=>{r?.isBeginning?t.onPrevTab?.():r?.slidePrev()},[r,t]),m=w(()=>{r?.isEnd?t.onNextTab?.():r?.slideNext()},[r,t]);return D(()=>{r&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(r.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[r,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(F,{className:"h-full",onSwiper:p,onTouchEnd:(d,h)=>{d.isBeginning&&d.swipeDirection==="prev"?N():d.isEnd&&d.swipeDirection==="next"&&m()},modules:[J,W,H,Q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((d,h)=>e(j,{className:"h-full",children:y("video",{controls:!0,className:"size-full object-cover",children:[e("track",{kind:"captions"}),e("source",{src:d?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:d?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:d?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+h))}),e("div",{className:S("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:N,children:e(X,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:S("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:m,children:e(ee,{className:"tablet:size-10 lg-desktop:size-12"})})]})},ze=t=>e("div",{children:"3D View"});var De=me(fe);export{De as default};
2
2
  //# sourceMappingURL=index.js.map