@anker-in/headless-ui 1.3.62 → 1.3.63

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 (77) hide show
  1. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  2. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  3. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
  4. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
  5. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  6. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +1 -1
  7. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +12 -0
  8. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js +1 -1
  9. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
  10. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +1 -1
  11. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +1 -1
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +6 -0
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.d.ts +13 -0
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.js +2 -0
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.js.map +7 -0
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.d.ts +13 -0
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.js +2 -0
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.js.map +7 -0
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.d.ts +19 -0
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.js +2 -0
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.js.map +7 -0
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.d.ts +18 -0
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.js +2 -0
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.js.map +7 -0
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.d.ts +7 -0
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js +2 -0
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js.map +7 -0
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.d.ts +33 -0
  31. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.js +2 -0
  32. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.js.map +7 -0
  33. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.d.ts +72 -0
  34. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.js +2 -0
  35. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.js.map +7 -0
  36. package/dist/cjs/biz-components/index.d.ts +3 -0
  37. package/dist/cjs/biz-components/index.js +1 -1
  38. package/dist/cjs/biz-components/index.js.map +3 -3
  39. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  40. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  41. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
  42. package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
  43. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  44. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +1 -1
  45. package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +12 -0
  46. package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
  47. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +1 -1
  48. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +1 -1
  49. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +6 -0
  50. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  51. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  52. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.d.ts +13 -0
  53. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.js +2 -0
  54. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.js.map +7 -0
  55. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.d.ts +13 -0
  56. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.js +2 -0
  57. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.js.map +7 -0
  58. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.d.ts +19 -0
  59. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.js +2 -0
  60. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.js.map +7 -0
  61. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.d.ts +18 -0
  62. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.js +2 -0
  63. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.js.map +7 -0
  64. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.d.ts +7 -0
  65. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js +2 -0
  66. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js.map +7 -0
  67. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.d.ts +33 -0
  68. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.js +2 -0
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.js.map +7 -0
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.d.ts +72 -0
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.js +1 -0
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/types.js.map +7 -0
  73. package/dist/esm/biz-components/index.d.ts +3 -0
  74. package/dist/esm/biz-components/index.js +1 -1
  75. package/dist/esm/biz-components/index.js.map +2 -2
  76. package/package.json +1 -1
  77. package/style.css +67 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.tsx"],
4
- "sourcesContent": ["/* eslint-disable react/no-unknown-property */\nimport { Button, Checkbox, Text, Picture, Heading, Link } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useComponentData } from '../../../hooks/useComponentData.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// \u5012\u8BA1\u65F6\u6309\u94AE\uFF08memo \u9694\u79BB\uFF0C\u907F\u514D\u5916\u5C42 CouponItem \u6BCF\u79D2\u91CD\u6E32\u67D3\uFF09\nconst CouponCountdown = React.memo(function CouponCountdown({\n endsAt,\n daysLeft,\n endsText,\n daysText,\n hurryLabel,\n expiredText,\n onOpenModal,\n}: {\n endsAt: string\n daysLeft: number\n endsText: string\n daysText: string\n hurryLabel: string\n expiredText: string\n onOpenModal: () => void\n}) {\n const { days, hours, minutes, seconds } = useCountDown({ endTime: endsAt })\n\n return (\n <button\n onClick={onOpenModal}\n className=\"lg-desktop:mt-[24px] text-brand-0 laptop-md:mt-4 lg-desktop:text-[16px] md-l:hidden mt-[14px] text-left text-[14px] font-bold text-[#1F2021]\"\n >\n {Number(days) < Number(daysLeft) ? (\n <>\n <span>\n {endsText} {days === '00' ? '0' : days} {daysText}\n </span>\n <span className=\"font-bold\">\n {` ${hours.toString()}:${minutes.toString()}:${seconds.toString()}`}\n </span>\n </>\n ) : (\n hurryLabel || expiredText\n )}\n </button>\n )\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 { 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=\"laptop-md: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 <CouponCountdown\n endsAt={item.ends_at}\n daysLeft={couponCopy?.hurry?.daysLeft ?? 0}\n endsText={couponCopy?.ends ?? ''}\n daysText={couponCopy?.days ?? ''}\n hurryLabel={couponCopy?.hurry?.label ?? ''}\n expiredText={benefitPayloadData?.couponBenefitData?.commonCoupon?.expired ?? ''}\n onOpenModal={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n />\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 laptop-md: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 creditsRedemption: creditsRedemptionData,\n } = useBizProductContext()\n\n const { usedPoints = 0, availablePoints = 0 } = creditsRedemptionData ?? {}\n const [isInstallmentMounted, setIsInstallmentMounted] = useState(false)\n\n const productBenefitsData = useComponentData('ProductBenefits') ?? {}\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, functionFreeGift, 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 functionFreeGift.enable\n ? {\n title: functionFreeGift?.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 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} ${bundle.config?.maxSavings}`,\n borderStyle: 'inset',\n description: benefitPayloadData?.couponBenefitData?.bundle?.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleOptions?.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 useEffect(() => {\n setIsInstallmentMounted(false)\n }, [variant?.id])\n\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<ProductBenefitsTabsValueType>('coupon')\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\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 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 if (!ProductBenefitsTabs) return null\n\n return (\n <ProductBenefitsTabs\n className=\"relative\"\n onValueChange={value => {\n setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'pay' | 'installment')\n if (value === 'installment') {\n setIsInstallmentMounted(true)\n } else {\n setIsInstallmentMounted(false)\n }\n }}\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-[#080A0F]')}\n value={item.value}\n onClick={e => handleProductBenefitsTabListClick(e, item?.value)}\n >\n {item.label}\n </ProductBenefitsTabs.Trigger>\n ))}\n </ProductBenefitsTabs.List>\n {/* TODO: @seasail \u7528tailwind \u539F\u5B50\u7C7B\u6216\u8005\u884C\u5185\u6837\u5F0F(Inline Style)\u4EE3\u66FF jsx global */}\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] laptop-md: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] laptop-md: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)] laptop-md: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=\"laptop-md:mb-2 mb-1 text-left text-lg font-bold !leading-[1.3]\">\n {benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLoginText}\n </h3>\n )}\n <ul\n className={`laptop-md:[&_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 {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg\n className=\"laptop-md: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 {!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 {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=\"laptop-md: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=\"laptop-md: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=\"laptop-md: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=\"laptop-md: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 </ul>\n </div>\n {!profile?.email && (\n <div className=\"laptop-md: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] laptop-md: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=\"laptop-md:size-[70px] laptop-md: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 laptop-md: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 forceMount={true}\n className={cn(\n 'benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto ',\n isInstallmentMounted ? 'block' : 'hidden'\n )}\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": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA8GQ,IAAAI,EAAA,6BA7GRC,EAA+D,8CAC/DC,EAAgC,6CAChCC,EAAqC,0CACrCC,EAAiC,8CACjCC,EAA4B,yCAC5BC,EAA4B,mCAC5BC,EAAgC,wCAChCC,EAA4D,oBAC5DC,EAA+B,6CAC/BC,EAAyB,mDACzBC,EAAoB,wCACpBC,EAAmB,2CACnBC,EAA2B,sDAC3BC,EAA2B,2CA+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,EAGMC,GAAkB,EAAAC,QAAM,KAAK,SAAyB,CAC1D,OAAAC,EACA,SAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,YAAAC,CACF,EAQG,CACD,KAAM,CAAE,KAAAC,EAAM,MAAAC,EAAO,QAAAC,EAAS,QAAAC,CAAQ,KAAI,EAAAC,SAAa,CAAE,QAASX,CAAO,CAAC,EAE1E,SACE,OAAC,UACC,QAASM,EACT,UAAU,+IAET,gBAAOC,CAAI,EAAI,OAAON,CAAQ,KAC7B,oBACE,qBAAC,QACE,UAAAC,EAAS,IAAEK,IAAS,KAAO,IAAMA,EAAK,IAAEJ,GAC3C,KACA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,KACA,QAAC,EAAA6B,QAAoB,QAApB,CACC,MAAM,MACN,UAAU,6GAEV,qBAAC,OAAI,UAAU,qBACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,mCACzB,SAAAhE,GAAoB,gBAAgB,UACvC,KACA,QAAC,OAAI,UAAU,iFACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,OAAQA,GAAoB,gBAAgB,KAC5C,UAAU,yEACZ,KACA,OAAC,QACC,GAAG,IACH,UAAU,gDACV,KAAMA,GAAoB,gBAAgB,aAC5C,GACF,KACA,OAAC,UACC,UAAU,yFACV,QAAS,IAAMgC,EAAmB,EAAI,EAErC,SAAAhC,GAAoB,gBAAgB,UACvC,GACF,GACF,KAEA,OAAC,EAAAmE,QAAA,CAAe,UAAWpC,GAAiB,WAAY,IAAMC,EAAmB,EAAK,EACpF,mBAAC,WAAQ,OAAQhC,GAAoB,gBAAgB,SAAU,EACjE,GACF,KAEA,OAAC,EAAAgE,QAAoB,QAApB,CACC,MAAM,cACN,WAAY,GACZ,aAAW,MACT,6GACApC,GAAuB,QAAU,QACnC,EAEA,oBAAC,OAAI,UAAU,qBACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,mCACzB,SAAA5B,GAAoB,wBAAwB,oBAC/C,KACA,OAAC,OAAI,UAAU,yDAA0D,SAAAiB,EAAmB,GAC9F,EACF,GACF,EA/Q+B,IAiRnC,EAEMiD,EAAeE,MAEjB,OAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAQ,GAAGA,EACjG,mBAAC,QACC,EAAE,4CACF,OAAO,UACP,YAAY,OACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIJ,IAAOvG,MAAQ,cAAWiD,EAAW",
6
- "names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_BizProductProvider", "import_useComponentData", "import_useBenefits", "import_utils", "import_textFormat", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "import_helpers", "import_ModalContainer", "import_Styles", "defaultTextConfig", "CouponCountdown", "React", "endsAt", "daysLeft", "endsText", "daysText", "hurryLabel", "expiredText", "onOpenModal", "days", "hours", "minutes", "seconds", "useCountDown", "CouponItem", "item", "textConfig", "benefitPayloadData", "trackingData", "isCopied", "copyToClipboard", "useCopy", "checked", "setChecked", "couponCopy", "openModal", "event", "CouponContent", "coupons", "className", "index", "BenefitsTab", "profile", "variant", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "creditsRedemptionData", "usedPoints", "availablePoints", "isInstallmentMounted", "setIsInstallmentMounted", "productBenefitsData", "isFlexModalOpen", "setIsFlexModalOpen", "benefits", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "functionFreeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "couponBenefitData", "membershipBenefitData", "installmentBenefitData", "payBenefitData", "value", "couponSaving", "memberSaving", "setProductBenefitsTabsValue", "productBenefitsTabsValue", "handleActivate", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft", "benefitTabs", "ProductBenefitsTabs", "e", "CheckedIcon", "ModalContainer", "props"]
4
+ "sourcesContent": ["/* eslint-disable react/no-unknown-property */\nimport { Button, Checkbox, Text, Picture, Heading, Link } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useComponentData } from '../../../hooks/useComponentData.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'\nimport CreditCouponRedeem from './CreditCouponRedeem/index.js'\nimport type { CreditCouponRedeemProps } from './CreditCouponRedeem/index.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 /**\n * \u79EF\u5206\u5151\u6362 Coupon \u6A21\u5757\uFF08membership tab \u5185\u65B0\u589E\u533A\u5757\uFF09\u3002\n * \u672A\u4F20\u5165\u65F6\u4E0D\u6E32\u67D3\u8BE5\u533A\u5757\uFF1B\u6570\u636E/\u4EA4\u4E92\u72B6\u6001\u9700\u7531\u8C03\u7528\u65B9\u8BA1\u7B97\u548C\u7EF4\u62A4\uFF0C\u672C\u7EC4\u4EF6\u4E0D\u505A\u4E1A\u52A1\u5224\u65AD\u3002\n */\n creditCouponRedeem?: CreditCouponRedeemProps\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// \u5012\u8BA1\u65F6\u6309\u94AE\uFF08memo \u9694\u79BB\uFF0C\u907F\u514D\u5916\u5C42 CouponItem \u6BCF\u79D2\u91CD\u6E32\u67D3\uFF09\nconst CouponCountdown = React.memo(function CouponCountdown({\n endsAt,\n daysLeft,\n endsText,\n daysText,\n hurryLabel,\n expiredText,\n onOpenModal,\n}: {\n endsAt: string\n daysLeft: number\n endsText: string\n daysText: string\n hurryLabel: string\n expiredText: string\n onOpenModal: () => void\n}) {\n const { days, hours, minutes, seconds } = useCountDown({ endTime: endsAt })\n\n return (\n <button\n onClick={onOpenModal}\n className=\"lg-desktop:mt-[24px] text-brand-0 laptop-md:mt-4 lg-desktop:text-[16px] md-l:hidden mt-[14px] text-left text-[14px] font-bold text-[#1F2021]\"\n >\n {Number(days) < Number(daysLeft) ? (\n <>\n <span>\n {endsText} {days === '00' ? '0' : days} {daysText}\n </span>\n <span className=\"font-bold\">{` ${hours.toString()}:${minutes.toString()}:${seconds.toString()}`}</span>\n </>\n ) : (\n hurryLabel || expiredText\n )}\n </button>\n )\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 { 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=\"laptop-md: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 <CouponCountdown\n endsAt={item.ends_at}\n daysLeft={couponCopy?.hurry?.daysLeft ?? 0}\n endsText={couponCopy?.ends ?? ''}\n daysText={couponCopy?.days ?? ''}\n hurryLabel={couponCopy?.hurry?.label ?? ''}\n expiredText={benefitPayloadData?.couponBenefitData?.commonCoupon?.expired ?? ''}\n onOpenModal={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n />\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 laptop-md: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 = ({ creditCouponRedeem, 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 creditsRedemption: creditsRedemptionData,\n } = useBizProductContext()\n\n const { usedPoints = 0, availablePoints = 0 } = creditsRedemptionData ?? {}\n const [isInstallmentMounted, setIsInstallmentMounted] = useState(false)\n\n const productBenefitsData = useComponentData('ProductBenefits') ?? {}\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 {\n memberDiscount,\n commonCoupon,\n creditsRedemption,\n freeGift,\n functionFreeGift,\n bundle,\n paidShipping,\n fullGift,\n 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 functionFreeGift.enable\n ? {\n title: functionFreeGift?.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 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} ${bundle.config?.maxSavings}`,\n borderStyle: 'inset',\n description: benefitPayloadData?.couponBenefitData?.bundle?.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleOptions?.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 useEffect(() => {\n setIsInstallmentMounted(false)\n }, [variant?.id])\n\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<ProductBenefitsTabsValueType>('coupon')\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\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 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 if (!ProductBenefitsTabs) return null\n\n return (\n <ProductBenefitsTabs\n className=\"relative\"\n onValueChange={value => {\n setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'pay' | 'installment')\n if (value === 'installment') {\n setIsInstallmentMounted(true)\n } else {\n setIsInstallmentMounted(false)\n }\n }}\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-[#080A0F]')}\n value={item.value}\n onClick={e => handleProductBenefitsTabListClick(e, item?.value)}\n >\n {item.label}\n </ProductBenefitsTabs.Trigger>\n ))}\n </ProductBenefitsTabs.List>\n {/* TODO: @seasail \u7528tailwind \u539F\u5B50\u7C7B\u6216\u8005\u884C\u5185\u6837\u5F0F(Inline Style)\u4EE3\u66FF jsx global */}\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] laptop-md: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(\n 'benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto'\n )}\n >\n <div className=\"lg-desktop:p-4 p-3\">\n {creditCouponRedeem && (\n <div className=\"laptop-md:mb-4 mb-2\">\n <CreditCouponRedeem {...creditCouponRedeem} />\n </div>\n )}\n <div\n className={cn('rounded-lg', {\n 'benefits-tabs-content lg-desktop:h-[calc(240px-100px)] laptop-md: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=\"laptop-md:mb-2 mb-1 text-left text-lg font-bold !leading-[1.3]\">\n {benefitPayloadData?.membershipBenefitData?.memberBenefitsNotLoginText}\n </h3>\n )}\n <ul\n className={`laptop-md:[&_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 {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg\n className=\"laptop-md: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 {!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 {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=\"laptop-md: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=\"laptop-md: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=\"laptop-md: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=\"laptop-md: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 </ul>\n </div>\n {!profile?.email && (\n <div className=\"laptop-md: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] laptop-md: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=\"laptop-md:size-[70px] laptop-md: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 laptop-md: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 forceMount={true}\n className={cn(\n 'benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto ',\n isInstallmentMounted ? 'block' : 'hidden'\n )}\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": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAqHQ,IAAAI,EAAA,6BApHRC,EAA+D,8CAC/DC,EAAgC,6CAChCC,EAAqC,0CACrCC,EAAiC,8CACjCC,EAA4B,yCAC5BC,EAA4B,mCAC5BC,EAAgC,wCAChCC,EAA4D,oBAC5DC,EAA+B,6CAC/BC,EAAyB,mDACzBC,EAAoB,wCACpBC,EAAmB,2CACnBC,EAA2B,sDAC3BC,EAA2B,2CAC3BC,EAA+B,4CAqD/B,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,EAGMC,GAAkB,EAAAC,QAAM,KAAK,SAAyB,CAC1D,OAAAC,EACA,SAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,YAAAC,CACF,EAQG,CACD,KAAM,CAAE,KAAAC,EAAM,MAAAC,EAAO,QAAAC,EAAS,QAAAC,CAAQ,KAAI,EAAAC,SAAa,CAAE,QAASX,CAAO,CAAC,EAE1E,SACE,OAAC,UACC,QAASM,EACT,UAAU,+IAET,gBAAOC,CA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,IAAO1G,MAAQ,cAAWkD,EAAW",
6
+ "names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_BizProductProvider", "import_useComponentData", "import_useBenefits", "import_utils", "import_textFormat", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "import_helpers", "import_ModalContainer", "import_Styles", "import_CreditCouponRedeem", "defaultTextConfig", "CouponCountdown", "React", "endsAt", "daysLeft", "endsText", "daysText", "hurryLabel", "expiredText", "onOpenModal", "days", "hours", "minutes", "seconds", "useCountDown", "CouponItem", "item", "textConfig", "benefitPayloadData", "trackingData", "isCopied", "copyToClipboard", "useCopy", "checked", "setChecked", "couponCopy", "openModal", "event", "CouponContent", "coupons", "className", "index", "BenefitsTab", "creditCouponRedeem", "profile", "variant", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "creditsRedemptionData", "usedPoints", "availablePoints", "isInstallmentMounted", "setIsInstallmentMounted", "productBenefitsData", "isFlexModalOpen", "setIsFlexModalOpen", "benefits", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "functionFreeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "couponBenefitData", "membershipBenefitData", "installmentBenefitData", "payBenefitData", "value", "couponSaving", "memberSaving", "setProductBenefitsTabsValue", "productBenefitsTabsValue", "handleActivate", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft", "benefitTabs", "ProductBenefitsTabs", "e", "CreditCouponRedeem", "CheckedIcon", "ModalContainer", "props"]
7
7
  }
@@ -0,0 +1,13 @@
1
+ import type { CreditCouponRuleData, CreditCouponRedeemModalCopy } from './types.js';
2
+ export interface CouponInitProps {
3
+ item: CreditCouponRuleData;
4
+ copy: CreditCouponRedeemModalCopy;
5
+ loading?: boolean;
6
+ errorMessage?: string;
7
+ onConfirm: () => void;
8
+ }
9
+ declare const CouponInit: {
10
+ ({ item, copy, loading, errorMessage, onConfirm }: CouponInitProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ export default CouponInit;
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(l,t)=>{for(var s in t)i(l,s,{get:t[s],enumerable:!0})},v=(l,t,s,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f(t))!u.call(l,a)&&a!==s&&i(l,a,{get:()=>t[a],enumerable:!(p=d(t,a))||p.enumerable});return l};var C=l=>v(i({},"__esModule",{value:!0}),l);var N={};c(N,{default:()=>b});module.exports=C(N);var e=require("react/jsx-runtime"),o=require("../../../../../../components/index.js"),n=require("../../../../../../helpers/index.js");const x=({item:l,copy:t,loading:s=!1,errorMessage:p,onConfirm:a})=>(0,e.jsxs)("div",{className:"coupon-init flex flex-col gap-6",children:[(0,e.jsxs)("div",{className:"max-h-[500px] overflow-y-auto text-center bg-[#F5F5F7] px-[48px] py-[24px] md:max-h-[400px] md:px-[16px]",children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[(0,e.jsx)(o.Picture,{source:t.modalIcon,className:"h-full [&_img]:h-full"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[24px] text-[32px] font-extrabold text-white",children:`${l.value} Off`})]}),(0,e.jsx)(o.Text,{as:"p",html:l.consumeCreditsLabel,className:"mt-[8px] text-[24px] font-bold"}),l.rules&&l.rules.length>0&&(0,e.jsxs)("div",{className:"w-full text-left mt-[8px]",children:[t.ruleLabel&&(0,e.jsx)(o.Text,{as:"p",size:4,className:"text-info-secondary mb-1 text-[14px] font-bold",children:t.ruleLabel}),(0,e.jsx)("ul",{className:"ml-4 flex flex-col gap-1",children:l.rules.map((m,r)=>(0,e.jsx)("li",{className:"text-info-secondary list-disc text-[14px] font-bold",children:(0,e.jsx)(o.Text,{as:"span",size:4,html:m})},r))})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 px-[48px] pb-[24px]",children:[(0,e.jsx)(o.Text,{as:"p",html:t.confirmTitle,className:"text-info-primary text-center text-[20px] font-bold"}),(0,e.jsx)(o.Button,{variant:"primary",size:"lg",className:(0,n.cn)("w-full"),loading:s,onClick:a,children:t.confirmButton}),p&&(0,e.jsx)(o.Text,{as:"p",size:4,html:p,className:"text-center text-[14px] font-bold text-[#FF0000]"})]})]});x.displayName="CouponInit";var b=x;
2
+ //# sourceMappingURL=CouponInit.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponInit.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport type { CreditCouponRuleData, CreditCouponRedeemModalCopy } from './types.js'\n\nexport interface CouponInitProps {\n item: CreditCouponRuleData\n copy: CreditCouponRedeemModalCopy\n loading?: boolean\n errorMessage?: string\n onConfirm: () => void\n}\n\nconst CouponInit = ({ item, copy, loading = false, errorMessage, onConfirm }: CouponInitProps) => {\n return (\n <div className=\"coupon-init flex flex-col gap-6\">\n <div\n className={\n 'max-h-[500px] overflow-y-auto text-center bg-[#F5F5F7] px-[48px] py-[24px] md:max-h-[400px] md:px-[16px]'\n }\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n <Picture source={copy.modalIcon} className=\"h-full [&_img]:h-full\" />\n <div className=\"absolute bottom-[8px] left-[24px] text-[32px] font-extrabold text-white\">{`${item.value} Off`}</div>\n </div>\n\n <Text as=\"p\" html={item.consumeCreditsLabel} className=\"mt-[8px] text-[24px] font-bold\" />\n {item.rules && item.rules.length > 0 && (\n <div className=\"w-full text-left mt-[8px]\">\n {copy.ruleLabel && (\n <Text as=\"p\" size={4} className=\"text-info-secondary mb-1 text-[14px] font-bold\">\n {copy.ruleLabel}\n </Text>\n )}\n <ul className=\"ml-4 flex flex-col gap-1\">\n {item.rules.map((rule, index) => (\n <li key={index} className=\"text-info-secondary list-disc text-[14px] font-bold\">\n <Text as=\"span\" size={4} html={rule} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n\n <div className=\"flex flex-col gap-2 px-[48px] pb-[24px]\">\n <Text as=\"p\" html={copy.confirmTitle} className=\"text-info-primary text-center text-[20px] font-bold\" />\n <Button variant=\"primary\" size=\"lg\" className={cn('w-full')} loading={loading} onClick={onConfirm}>\n {copy.confirmButton}\n </Button>\n {errorMessage && (\n <Text as=\"p\" size={4} html={errorMessage} className=\"text-center text-[14px] font-bold text-[#FF0000]\" />\n )}\n </div>\n </div>\n )\n}\n\nCouponInit.displayName = 'CouponInit'\n\nexport default CouponInit\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAoBQ,IAAAI,EAAA,6BApBRC,EAAsC,iDACtCC,EAAmB,8CAWnB,MAAMC,EAAa,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAU,GAAO,aAAAC,EAAc,UAAAC,CAAU,OAEvE,QAAC,OAAI,UAAU,kCACb,qBAAC,OACC,UACE,2GAGF,qBAAC,OAAI,UAAU,uCACb,oBAAC,WAAQ,OAAQH,EAAK,UAAW,UAAU,wBAAwB,KACnE,OAAC,OAAI,UAAU,0EAA2E,YAAGD,EAAK,KAAK,OAAO,GAChH,KAEA,OAAC,QAAK,GAAG,IAAI,KAAMA,EAAK,oBAAqB,UAAU,iCAAiC,EACvFA,EAAK,OAASA,EAAK,MAAM,OAAS,MACjC,QAAC,OAAI,UAAU,4BACZ,UAAAC,EAAK,cACJ,OAAC,QAAK,GAAG,IAAI,KAAM,EAAG,UAAU,iDAC7B,SAAAA,EAAK,UACR,KAEF,OAAC,MAAG,UAAU,2BACX,SAAAD,EAAK,MAAM,IAAI,CAACK,EAAMC,OACrB,OAAC,MAAe,UAAU,sDACxB,mBAAC,QAAK,GAAG,OAAO,KAAM,EAAG,KAAMD,EAAM,GAD9BC,CAET,CACD,EACH,GACF,GAEJ,KAEA,QAAC,OAAI,UAAU,0CACb,oBAAC,QAAK,GAAG,IAAI,KAAML,EAAK,aAAc,UAAU,sDAAsD,KACtG,OAAC,UAAO,QAAQ,UAAU,KAAK,KAAK,aAAW,MAAG,QAAQ,EAAG,QAASC,EAAS,QAASE,EACrF,SAAAH,EAAK,cACR,EACCE,MACC,OAAC,QAAK,GAAG,IAAI,KAAM,EAAG,KAAMA,EAAc,UAAU,mDAAmD,GAE3G,GACF,EAIJJ,EAAW,YAAc,aAEzB,IAAOL,EAAQK",
6
+ "names": ["CouponInit_exports", "__export", "CouponInit_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "CouponInit", "item", "copy", "loading", "errorMessage", "onConfirm", "rule", "index"]
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { CreditCouponRuleData, CreditCouponRedeemModalCopy } from './types.js';
2
+ export interface CouponSuccessProps {
3
+ couponCode: string;
4
+ copy: CreditCouponRedeemModalCopy;
5
+ item: CreditCouponRuleData;
6
+ /** 当前商品 SKU(埋点上报) */
7
+ sku: string;
8
+ }
9
+ declare const CouponSuccess: {
10
+ ({ couponCode, item, copy, sku }: CouponSuccessProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ export default CouponSuccess;
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.create;var l=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},n=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of C(t))!y.call(e,p)&&p!==o&&l(e,p,{get:()=>t[p],enumerable:!(c=f(t,p))||c.enumerable});return e};var N=(e,t,o)=>(o=e!=null?m(b(e)):{},n(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),g=e=>n(l({},"__esModule",{value:!0}),e);var k={};v(k,{default:()=>h});module.exports=g(k);var s=require("react/jsx-runtime"),a=require("../../../../../../components/index.js"),r=N(require("../../../../hooks/useCopy.js")),x=require("./tracking.js");const d=({couponCode:e,item:t,copy:o,sku:c})=>{const{copy:p,copied:i}=(0,r.default)(),u=()=>{p(e),(0,x.trackCodeCopy)({sku:c},{code:e})};return(0,s.jsxs)("div",{className:"coupon-success flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"coupon-success-body bg-container-secondary flex flex-col items-center gap-2 rounded-[16px] px-[48px] py-[24px] md:px-[16px] text-center",children:[(0,s.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[(0,s.jsx)(a.Picture,{source:o.modalIcon,className:"h-full [&_img]:h-full"}),(0,s.jsx)("div",{className:"absolute bottom-[8px] left-[24px] text-[32px] font-extrabold text-white",children:`${t.value} Off`})]}),(0,s.jsxs)("div",{className:"coupon-success-code mt-[8px] flex items-center gap-2",children:[(0,s.jsx)(a.Text,{as:"span",size:2,className:"text-info-primary text-[24px] font-bold",children:e}),(0,s.jsx)("button",{type:"button",onClick:u,disabled:i,className:"text-info-primary shrink-0 text-[16px] font-bold underline disabled:pointer-events-none",children:i?o.copiedLabel||"Copied":o.copyLabel||"Copy"})]})]}),(0,s.jsxs)("div",{className:"coupon-success-footer flex flex-col gap-2 text-center px-[48px] pb-[24px]",children:[(0,s.jsx)(a.Text,{as:"p",html:o.successTitle,className:"text-info-primary text-[20px] font-bold"}),(0,s.jsx)(a.Text,{as:"p",size:4,html:o.successDesc,className:"text-info-secondary text-[14px] font-bold"})]})]})};d.displayName="CouponSuccess";var h=d;
2
+ //# sourceMappingURL=CouponSuccess.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CouponSuccess.tsx"],
4
+ "sourcesContent": ["import { Picture, Text } from '../../../../../../components/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { trackCodeCopy } from './tracking.js'\nimport type { CreditCouponRuleData, CreditCouponRedeemModalCopy } from './types.js'\n\nexport interface CouponSuccessProps {\n couponCode: string\n copy: CreditCouponRedeemModalCopy\n item: CreditCouponRuleData\n /** \u5F53\u524D\u5546\u54C1 SKU\uFF08\u57CB\u70B9\u4E0A\u62A5\uFF09 */\n sku: string\n}\n\nconst CouponSuccess = ({ couponCode, item, copy, sku }: CouponSuccessProps) => {\n const { copy: copyToClipboard, copied } = useCopy()\n\n const handleCopy = () => {\n copyToClipboard(couponCode)\n // 05 \u6298\u6263\u7801\u590D\u5236\n trackCodeCopy({ sku }, { code: couponCode })\n }\n\n return (\n <div className=\"coupon-success flex flex-col gap-6\">\n <div className=\"coupon-success-body bg-container-secondary flex flex-col items-center gap-2 rounded-[16px] px-[48px] py-[24px] md:px-[16px] text-center\">\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n <Picture source={copy.modalIcon} className=\"h-full [&_img]:h-full\" />\n <div className=\"absolute bottom-[8px] left-[24px] text-[32px] font-extrabold text-white\">{`${item.value} Off`}</div>\n </div>\n <div className=\"coupon-success-code mt-[8px] flex items-center gap-2\">\n <Text as=\"span\" size={2} className=\"text-info-primary text-[24px] font-bold\">\n {couponCode}\n </Text>\n <button\n type=\"button\"\n onClick={handleCopy}\n disabled={copied}\n className=\"text-info-primary shrink-0 text-[16px] font-bold underline disabled:pointer-events-none\"\n >\n {copied ? copy.copiedLabel || 'Copied' : copy.copyLabel || 'Copy'}\n </button>\n </div>\n </div>\n <div className=\"coupon-success-footer flex flex-col gap-2 text-center px-[48px] pb-[24px]\">\n <Text as=\"p\" html={copy.successTitle} className=\"text-info-primary text-[20px] font-bold\" />\n <Text as=\"p\" size={4} html={copy.successDesc} className=\"text-info-secondary text-[14px] font-bold\" />\n </div>\n </div>\n )\n}\n\nCouponSuccess.displayName = 'CouponSuccess'\n\nexport default CouponSuccess\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyBQ,IAAAI,EAAA,6BAzBRC,EAA8B,iDAC9BC,EAAoB,2CACpBC,EAA8B,yBAW9B,MAAMC,EAAgB,CAAC,CAAE,WAAAC,EAAY,KAAAC,EAAM,KAAAC,EAAM,IAAAC,CAAI,IAA0B,CAC7E,KAAM,CAAE,KAAMC,EAAiB,OAAAC,CAAO,KAAI,EAAAC,SAAQ,EAE5CC,EAAa,IAAM,CACvBH,EAAgBJ,CAAU,KAE1B,iBAAc,CAAE,IAAAG,CAAI,EAAG,CAAE,KAAMH,CAAW,CAAC,CAC7C,EAEA,SACE,QAAC,OAAI,UAAU,qCACb,qBAAC,OAAI,UAAU,0IACb,qBAAC,OAAI,UAAU,uCACb,oBAAC,WAAQ,OAAQE,EAAK,UAAW,UAAU,wBAAwB,KACnE,OAAC,OAAI,UAAU,0EAA2E,YAAGD,EAAK,KAAK,OAAO,GAChH,KACA,QAAC,OAAI,UAAU,uDACb,oBAAC,QAAK,GAAG,OAAO,KAAM,EAAG,UAAU,0CAChC,SAAAD,EACH,KACA,OAAC,UACC,KAAK,SACL,QAASO,EACT,SAAUF,EACV,UAAU,0FAET,SAAAA,EAASH,EAAK,aAAe,SAAWA,EAAK,WAAa,OAC7D,GACF,GACF,KACA,QAAC,OAAI,UAAU,4EACb,oBAAC,QAAK,GAAG,IAAI,KAAMA,EAAK,aAAc,UAAU,0CAA0C,KAC1F,OAAC,QAAK,GAAG,IAAI,KAAM,EAAG,KAAMA,EAAK,YAAa,UAAU,4CAA4C,GACtG,GACF,CAEJ,EAEAH,EAAc,YAAc,gBAE5B,IAAON,EAAQM",
6
+ "names": ["CouponSuccess_exports", "__export", "CouponSuccess_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_useCopy", "import_tracking", "CouponSuccess", "couponCode", "item", "copy", "sku", "copyToClipboard", "copied", "useCopy", "handleCopy"]
7
+ }
@@ -0,0 +1,19 @@
1
+ import type { CreditCouponRuleData, CreditCouponRedeemModalCopy } from './types.js';
2
+ export interface CreditCouponListItemProps {
3
+ item: CreditCouponRuleData;
4
+ redeemLabel?: string;
5
+ unLoginLabel?: string;
6
+ iconUrl?: string;
7
+ className?: string;
8
+ copy: CreditCouponRedeemModalCopy;
9
+ /** 发起真实兑换请求,成功 resolve 兑换码,失败 reject Error(message 作为弹窗错误文案) */
10
+ onConfirm: (item: CreditCouponRuleData) => Promise<string>;
11
+ onModalOpenChange?: (open: boolean) => void;
12
+ /** 当前商品 SKU(埋点上报) */
13
+ sku: string;
14
+ }
15
+ declare const CreditCouponListItem: {
16
+ ({ item, redeemLabel, unLoginLabel, iconUrl, className, copy, onConfirm, onModalOpenChange, sku, }: CreditCouponListItemProps): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ };
19
+ export default CreditCouponListItem;
@@ -0,0 +1,2 @@
1
+ "use strict";var F=Object.create;var C=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var Q=(e,o)=>{for(var i in o)C(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of H(o))!K.call(e,d)&&d!==i&&C(e,d,{get:()=>o[d],enumerable:!(l=G(o,d))||l.enumerable});return e};var R=(e,o,i)=>(i=e!=null?F(J(e)):{},N(o||!e||!e.__esModule?C(i,"default",{value:e,enumerable:!0}):i,e)),V=e=>N(C({},"__esModule",{value:!0}),e);var X={};Q(X,{default:()=>W});module.exports=V(X);var n=require("react/jsx-runtime"),p=require("react"),m=require("../../../../../../components/index.js"),S=require("../../../../../../helpers/index.js"),w=R(require("../../../../hooks/useCopy.js")),I=require("../../../../BizProductProvider.js"),P=R(require("./RedeemCouponModal.js")),t=require("./tracking.js");const L=({item:e,redeemLabel:o="Redeem",unLoginLabel:i,iconUrl:l,className:d,copy:c,onConfirm:M,onModalOpenChange:x,sku:s})=>{const{profile:u,openSignUpPopup:T,openAuthCodePopup:k}=(0,I.useBizProductContext)(),{copy:z,copied:h}=(0,w.default)(),[O,b]=(0,p.useState)(!1),[_,f]=(0,p.useState)("idle"),[D,v]=(0,p.useState)(),[E,y]=(0,p.useState)(),[U,$]=(0,p.useState)(),a=U??e.code,g=(0,t.resolveUserIdentity)(u),j=()=>{u?u.activated?((0,t.trackEntryClick)({sku:s},{entryType:"get_discount",userIdentity:g}),b(!0),(0,t.trackPopupImpression)({sku:s},{popupSource:"direct"}),x?.(!0)):((0,t.trackEntryClick)({sku:s},{entryType:"get_discount",userIdentity:g}),k?.(()=>{b(!0),(0,t.trackPopupImpression)({sku:s},{popupSource:"after_login"}),x?.(!0)})):((0,t.trackEntryClick)({sku:s},{entryType:"members_only",userIdentity:g}),T?.())},A=async()=>{f("loading"),y(void 0);try{const r=await M(e);v(r),$(r),f("success"),(0,t.trackRedeemSuccess)({sku:s},{result:"success"})}catch(r){y(r instanceof Error?r.message:String(r)),f("error"),(0,t.trackRedeemSuccess)({sku:s},{result:"fail"})}},B=()=>{a&&(z(a),(0,t.trackCodeCopy)({sku:s},{code:a}))},q=r=>{b(r),r||(f("idle"),v(void 0),y(void 0)),x?.(r)};return(0,n.jsxs)("li",{className:(0,S.cn)("credit-coupon-list-item border-lines-secondary flex h-[84px] items-center gap-3 border-b bg-white px-4 last:border-b-0 first:rounded-t-2xl last:rounded-b-2xl",d),children:[(0,n.jsxs)("div",{className:"relative size-[70px] flex items-center",children:[l&&(0,n.jsx)(m.Picture,{source:l,alt:e.title,className:"w-full h-fit",imgClassName:"w-full object-contain"}),e.value&&(0,n.jsx)("div",{className:"absolute inset-0 left-[18px] flex items-center text-right text-[12px] text-white font-[800]",children:`${e.value} Off`})]}),(0,n.jsxs)("div",{className:"credit-coupon-list-item-info flex min-w-0 flex-1 flex-col gap-1",children:[(0,n.jsx)(m.Text,{as:"p",size:2,html:e.title,className:"credit-coupon-list-item-title text-info-primary line-clamp-2 text-[16px] md:text-[14px] font-bold"}),a&&(0,n.jsxs)(m.Text,{as:"span",size:2,className:"credit-coupon-list-item-code-text text-info-secondary text-[14px] md:text-[13px] font-bold",children:[c.codeLabel?`${c.codeLabel}: `:"",a]})]}),a?(0,n.jsx)("button",{type:"button",onClick:B,disabled:h,className:"credit-coupon-list-item-copy text-info-primary shrink-0 text-[16px] md:text-[14px] font-bold underline disabled:pointer-events-none",children:h?c.copiedLabel||"Copied":c.copyLabel||"Copy"}):(0,n.jsx)("button",{type:"button",onClick:j,className:"credit-coupon-list-item-cta text-info-primary shrink-0 whitespace-nowrap text-[16px] md:text-[14px] font-bold underline",children:u?o:i}),(0,n.jsx)(P.default,{open:O,onOpenChange:q,item:e,copy:c,redeemStatus:_,couponCode:D,errorMessage:E,onConfirm:A,sku:s})]})};L.displayName="CreditCouponListItem";var W=L;
2
+ //# sourceMappingURL=CreditCouponListItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/CreditCouponListItem.tsx"],
4
+ "sourcesContent": ["import { useState } from 'react'\nimport { Text, Picture } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport RedeemCouponModal from './RedeemCouponModal.js'\nimport {\n trackEntryClick,\n trackPopupImpression,\n trackRedeemSuccess,\n trackCodeCopy,\n resolveUserIdentity,\n} from './tracking.js'\nimport type { CreditCouponRuleData, CreditCouponRedeemModalCopy, RedeemStatus } from './types.js'\n\nexport interface CreditCouponListItemProps {\n item: CreditCouponRuleData\n redeemLabel?: string\n unLoginLabel?: string\n iconUrl?: string\n className?: string\n copy: CreditCouponRedeemModalCopy\n /** \u53D1\u8D77\u771F\u5B9E\u5151\u6362\u8BF7\u6C42\uFF0C\u6210\u529F resolve \u5151\u6362\u7801\uFF0C\u5931\u8D25 reject Error\uFF08message \u4F5C\u4E3A\u5F39\u7A97\u9519\u8BEF\u6587\u6848\uFF09 */\n onConfirm: (item: CreditCouponRuleData) => Promise<string>\n onModalOpenChange?: (open: boolean) => void\n /** \u5F53\u524D\u5546\u54C1 SKU\uFF08\u57CB\u70B9\u4E0A\u62A5\uFF09 */\n sku: string\n}\n\nconst CreditCouponListItem = ({\n item,\n redeemLabel = 'Redeem',\n unLoginLabel,\n iconUrl,\n className,\n copy,\n onConfirm,\n onModalOpenChange,\n sku,\n}: CreditCouponListItemProps) => {\n const { profile, openSignUpPopup, openAuthCodePopup } = useBizProductContext()\n const { copy: copyToClipboard, copied } = useCopy()\n\n // \u5151\u6362\u72B6\u6001\u673A + \u5F39\u7A97\uFF0C\u5747\u5185\u805A\u5728\u5355\u6761 item \u5185\u90E8\n const [modalOpen, setModalOpen] = useState(false)\n const [redeemStatus, setRedeemStatus] = useState<RedeemStatus>('idle')\n const [couponCode, setCouponCode] = useState<string>()\n const [errorMessage, setErrorMessage] = useState<string>()\n // \u672C\u6B21\u4F1A\u8BDD\u5151\u6362\u6210\u529F\u540E\u8BB0\u5F55\u7684 code\uFF1B\u9875\u9762\u5237\u65B0\u540E\u7531 item.code \u627F\u63A5\u6301\u4E45\u6001\n const [redeemedCode, setRedeemedCode] = useState<string>()\n\n const code = redeemedCode ?? item.code\n const userIdentity = resolveUserIdentity(profile)\n\n const handleItemClick = () => {\n if (!profile) {\n // \u672A\u767B\u5F55\uFF1A\u4E0A\u62A5 members_only \u5165\u53E3\u70B9\u51FB\u540E\u5524\u8D77\u6CE8\u518C\u5F39\u7A97\n trackEntryClick({ sku }, { entryType: 'members_only', userIdentity })\n openSignUpPopup?.()\n } else if (!profile.activated) {\n // \u5DF2\u767B\u5F55\u672A\u6FC0\u6D3B\uFF1A\u4E0A\u62A5 get_discount \u5165\u53E3\u70B9\u51FB\u540E\u5524\u8D77\u6FC0\u6D3B\u5F39\u7A97\uFF1B\n // \u6FC0\u6D3B\u6210\u529F\u540E\uFF08onSuccess \u56DE\u8C03\uFF09\u81EA\u52A8\u6253\u5F00 redeem \u5F39\u7A97\uFF0C\u7EE7\u7EED\u5151\u6362\n trackEntryClick({ sku }, { entryType: 'get_discount', userIdentity })\n openAuthCodePopup?.(() => {\n setModalOpen(true)\n trackPopupImpression({ sku }, { popupSource: 'after_login' })\n onModalOpenChange?.(true)\n })\n } else {\n // \u5DF2\u767B\u5F55\u5DF2\u6FC0\u6D3B\uFF1A\u4E0A\u62A5\u5165\u53E3\u70B9\u51FB + \u5F39\u7A97\u66DD\u5149\uFF08direct \u8DEF\u5F84\uFF09\n trackEntryClick({ sku }, { entryType: 'get_discount', userIdentity })\n setModalOpen(true)\n trackPopupImpression({ sku }, { popupSource: 'direct' })\n onModalOpenChange?.(true)\n }\n }\n\n const handleConfirm = async () => {\n setRedeemStatus('loading')\n setErrorMessage(undefined)\n try {\n const newCode = await onConfirm(item)\n setCouponCode(newCode)\n setRedeemedCode(newCode)\n setRedeemStatus('success')\n // 04 \u5151\u6362\u6210\u529F\n trackRedeemSuccess({ sku }, { result: 'success' })\n } catch (err) {\n setErrorMessage(err instanceof Error ? err.message : String(err))\n setRedeemStatus('error')\n // \u5151\u6362\u5931\u8D25\u4E5F\u4E0A\u62A5\uFF0Ccomponent_description \u4E3A fail\uFF08\u9884\u7559\uFF09\n trackRedeemSuccess({ sku }, { result: 'fail' })\n }\n }\n\n const handleCopy = () => {\n if (!code) return\n copyToClipboard(code)\n // 05 \u6298\u6263\u7801\u590D\u5236\n trackCodeCopy({ sku }, { code })\n }\n\n const handleOpenChange = (open: boolean) => {\n setModalOpen(open)\n if (!open) {\n // \u5173\u95ED\u5F39\u7A97\u540E\u91CD\u7F6E\u5F39\u7A97\u77AC\u65F6\u72B6\u6001\uFF0C\u4E0B\u6B21\u6253\u5F00\u56DE\u5230\u521D\u59CB\u786E\u8BA4\u6001\uFF1BredeemedCode \u4FDD\u7559\u7528\u4E8E\u5217\u8868\u5C55\u793A\n setRedeemStatus('idle')\n setCouponCode(undefined)\n setErrorMessage(undefined)\n }\n onModalOpenChange?.(open)\n }\n\n return (\n <li\n className={cn(\n 'credit-coupon-list-item border-lines-secondary flex h-[84px] items-center gap-3 border-b bg-white px-4 last:border-b-0 first:rounded-t-2xl last:rounded-b-2xl',\n className\n )}\n >\n <div className=\"relative size-[70px] flex items-center\">\n {iconUrl && (\n <Picture source={iconUrl} alt={item.title} className=\"w-full h-fit\" imgClassName=\"w-full object-contain\" />\n )}\n {item.value && (\n <div className=\"absolute inset-0 left-[18px] flex items-center text-right text-[12px] text-white font-[800]\">\n {`${item.value} Off`}\n </div>\n )}\n </div>\n <div className=\"credit-coupon-list-item-info flex min-w-0 flex-1 flex-col gap-1\">\n <Text\n as=\"p\"\n size={2}\n html={item.title}\n className=\"credit-coupon-list-item-title text-info-primary line-clamp-2 text-[16px] md:text-[14px] font-bold\"\n />\n {code && (\n <Text\n as=\"span\"\n size={2}\n className=\"credit-coupon-list-item-code-text text-info-secondary text-[14px] md:text-[13px] font-bold\"\n >\n {copy.codeLabel ? `${copy.codeLabel}: ` : ''}\n {code}\n </Text>\n )}\n </div>\n {code ? (\n <button\n type=\"button\"\n onClick={handleCopy}\n disabled={copied}\n className=\"credit-coupon-list-item-copy text-info-primary shrink-0 text-[16px] md:text-[14px] font-bold underline disabled:pointer-events-none\"\n >\n {copied ? copy.copiedLabel || 'Copied' : copy.copyLabel || 'Copy'}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={handleItemClick}\n className=\"credit-coupon-list-item-cta text-info-primary shrink-0 whitespace-nowrap text-[16px] md:text-[14px] font-bold underline\"\n >\n {profile ? redeemLabel : unLoginLabel}\n </button>\n )}\n <RedeemCouponModal\n open={modalOpen}\n onOpenChange={handleOpenChange}\n item={item}\n copy={copy}\n redeemStatus={redeemStatus}\n couponCode={couponCode}\n errorMessage={errorMessage}\n onConfirm={handleConfirm}\n sku={sku}\n />\n </li>\n )\n}\n\nCreditCouponListItem.displayName = 'CreditCouponListItem'\n\nexport default CreditCouponListItem\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwHM,IAAAI,EAAA,6BAxHNC,EAAyB,iBACzBC,EAA8B,iDAC9BC,EAAmB,8CACnBC,EAAoB,2CACpBC,EAAqC,6CACrCC,EAA8B,qCAC9BC,EAMO,yBAiBP,MAAMC,EAAuB,CAAC,CAC5B,KAAAC,EACA,YAAAC,EAAc,SACd,aAAAC,EACA,QAAAC,EACA,UAAAC,EACA,KAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,IAAAC,CACF,IAAiC,CAC/B,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,kBAAAC,CAAkB,KAAI,wBAAqB,EACvE,CAAE,KAAMC,EAAiB,OAAAC,CAAO,KAAI,EAAAC,SAAQ,EAG5C,CAACC,EAAWC,CAAY,KAAI,YAAS,EAAK,EAC1C,CAACC,EAAcC,CAAe,KAAI,YAAuB,MAAM,EAC/D,CAACC,EAAYC,CAAa,KAAI,YAAiB,EAC/C,CAACC,EAAcC,CAAe,KAAI,YAAiB,EAEnD,CAACC,EAAcC,CAAe,KAAI,YAAiB,EAEnDC,EAAOF,GAAgBvB,EAAK,KAC5B0B,KAAe,uBAAoBjB,CAAO,EAE1CkB,EAAkB,IAAM,CACvBlB,EAIOA,EAAQ,cAWlB,mBAAgB,CAAE,IAAAD,CAAI,EAAG,CAAE,UAAW,eAAgB,aAAAkB,CAAa,CAAC,EACpEV,EAAa,EAAI,KACjB,wBAAqB,CAAE,IAAAR,CAAI,EAAG,CAAE,YAAa,QAAS,CAAC,EACvDD,IAAoB,EAAI,OAXxB,mBAAgB,CAAE,IAAAC,CAAI,EAAG,CAAE,UAAW,eAAgB,aAAAkB,CAAa,CAAC,EAC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KAAMA,EAAK,MACX,UAAU,oGACZ,EACCyB,MACC,QAAC,QACC,GAAG,OACH,KAAM,EACN,UAAU,6FAET,UAAApB,EAAK,UAAY,GAAGA,EAAK,SAAS,KAAO,GACzCoB,GACH,GAEJ,EACCA,KACC,OAAC,UACC,KAAK,SACL,QAASM,EACT,SAAUlB,EACV,UAAU,sIAET,SAAAA,EAASR,EAAK,aAAe,SAAWA,EAAK,WAAa,OAC7D,KAEA,OAAC,UACC,KAAK,SACL,QAASsB,EACT,UAAU,2HAET,SAAAlB,EAAUR,EAAcC,EAC3B,KAEF,OAAC,EAAAgC,QAAA,CACC,KAAMnB,EACN,aAAciB,EACd,KAAMhC,EACN,KAAMK,EACN,aAAcY,EACd,WAAYE,EACZ,aAAcE,EACd,UAAWO,EACX,IAAKpB,EACP,GACF,CAEJ,EAEAT,EAAqB,YAAc,uBAEnC,IAAOV,EAAQU",
6
+ "names": ["CreditCouponListItem_exports", "__export", "CreditCouponListItem_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_helpers", "import_useCopy", "import_BizProductProvider", "import_RedeemCouponModal", "import_tracking", "CreditCouponListItem", "item", "redeemLabel", "unLoginLabel", "iconUrl", "className", "copy", "onConfirm", "onModalOpenChange", "sku", "profile", "openSignUpPopup", "openAuthCodePopup", "copyToClipboard", "copied", "useCopy", "modalOpen", "setModalOpen", "redeemStatus", "setRedeemStatus", "couponCode", "setCouponCode", "errorMessage", "setErrorMessage", "redeemedCode", "setRedeemedCode", "code", "userIdentity", "handleItemClick", "handleConfirm", "newCode", "err", "handleCopy", "handleOpenChange", "open", "RedeemCouponModal"]
7
+ }
@@ -0,0 +1,18 @@
1
+ import type { CreditCouponRuleData, CreditCouponRedeemModalCopy, RedeemStatus } from './types.js';
2
+ export interface RedeemCouponModalProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ item: CreditCouponRuleData | null;
6
+ copy: CreditCouponRedeemModalCopy;
7
+ redeemStatus: RedeemStatus;
8
+ couponCode?: string;
9
+ errorMessage?: string;
10
+ onConfirm: () => void;
11
+ /** 当前商品 SKU(埋点上报) */
12
+ sku: string;
13
+ }
14
+ declare const RedeemCouponModal: {
15
+ ({ open, onOpenChange, item, copy, redeemStatus, couponCode, errorMessage, onConfirm, sku, }: RedeemCouponModalProps): import("react/jsx-runtime").JSX.Element | null;
16
+ displayName: string;
17
+ };
18
+ export default RedeemCouponModal;
@@ -0,0 +1,2 @@
1
+ "use strict";var M=Object.create;var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var b=(o,e)=>{for(var n in e)t(o,n,{get:e[n],enumerable:!0})},l=(o,e,n,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!v.call(o,r)&&r!==n&&t(o,r,{get:()=>e[r],enumerable:!(p=y(e,r))||p.enumerable});return o};var u=(o,e,n)=>(n=o!=null?M(h(o)):{},l(e||!o||!o.__esModule?t(n,"default",{value:o,enumerable:!0}):n,o)),k=o=>l(t({},"__esModule",{value:!0}),o);var N={};b(N,{default:()=>x});module.exports=k(N);var d=require("react/jsx-runtime"),a=require("../../../../../../components/index.js"),C=require("../../../../../../helpers/index.js"),s=u(require("./CouponInit.js")),g=u(require("./CouponSuccess.js"));const m=({open:o,onOpenChange:e,item:n,copy:p,redeemStatus:r,couponCode:i,errorMessage:f,onConfirm:c,sku:R})=>n?(0,d.jsx)(a.Dialog,{open:o,onOpenChange:e,children:(0,d.jsx)(a.DialogContent,{className:(0,C.cn)("redeem-coupon-modal-root p-0 rounded-[16px] overflow-hidden"),children:r==="success"&&i?(0,d.jsx)(g.default,{item:n,couponCode:i,copy:p,sku:R}):(0,d.jsx)(s.default,{item:n,copy:p,loading:r==="loading",errorMessage:r==="error"?f:void 0,onConfirm:c})})}):null;m.displayName="RedeemCouponModal";var x=m;
2
+ //# sourceMappingURL=RedeemCouponModal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/RedeemCouponModal.tsx"],
4
+ "sourcesContent": ["import { Dialog, DialogContent } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport CouponInit from './CouponInit.js'\nimport CouponSuccess from './CouponSuccess.js'\nimport type { CreditCouponRuleData, CreditCouponRedeemModalCopy, RedeemStatus } from './types.js'\n\nexport interface RedeemCouponModalProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n item: CreditCouponRuleData | null\n copy: CreditCouponRedeemModalCopy\n redeemStatus: RedeemStatus\n couponCode?: string\n errorMessage?: string\n onConfirm: () => void\n /** \u5F53\u524D\u5546\u54C1 SKU\uFF08\u57CB\u70B9\u4E0A\u62A5\uFF09 */\n sku: string\n}\n\nconst RedeemCouponModal = ({\n open,\n onOpenChange,\n item,\n copy,\n redeemStatus,\n couponCode,\n errorMessage,\n onConfirm,\n sku,\n}: RedeemCouponModalProps) => {\n if (!item) return null\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className={cn('redeem-coupon-modal-root p-0 rounded-[16px] overflow-hidden')}>\n {redeemStatus === 'success' && couponCode ? (\n <CouponSuccess item={item} couponCode={couponCode} copy={copy} sku={sku} />\n ) : (\n <CouponInit\n item={item}\n copy={copy}\n loading={redeemStatus === 'loading'}\n errorMessage={redeemStatus === 'error' ? errorMessage : undefined}\n onConfirm={onConfirm}\n />\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nRedeemCouponModal.displayName = 'RedeemCouponModal'\n\nexport default RedeemCouponModal\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAoCU,IAAAI,EAAA,6BApCVC,EAAsC,iDACtCC,EAAmB,8CACnBC,EAAuB,8BACvBC,EAA0B,iCAgB1B,MAAMC,EAAoB,CAAC,CACzB,KAAAC,EACA,aAAAC,EACA,KAAAC,EACA,KAAAC,EACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EACA,UAAAC,EACA,IAAAC,CACF,IACON,KAGH,OAAC,UAAO,KAAMF,EAAM,aAAcC,EAChC,mBAAC,iBAAc,aAAW,MAAG,6DAA6D,EACvF,SAAAG,IAAiB,WAAaC,KAC7B,OAAC,EAAAI,QAAA,CAAc,KAAMP,EAAM,WAAYG,EAAY,KAAMF,EAAM,IAAKK,EAAK,KAEzE,OAAC,EAAAE,QAAA,CACC,KAAMR,EACN,KAAMC,EACN,QAASC,IAAiB,UAC1B,aAAcA,IAAiB,QAAUE,EAAe,OACxD,UAAWC,EACb,EAEJ,EACF,EAjBgB,KAqBpBR,EAAkB,YAAc,oBAEhC,IAAOP,EAAQO",
6
+ "names": ["RedeemCouponModal_exports", "__export", "RedeemCouponModal_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_CouponInit", "import_CouponSuccess", "RedeemCouponModal", "open", "onOpenChange", "item", "copy", "redeemStatus", "couponCode", "errorMessage", "onConfirm", "sku", "CouponSuccess", "CouponInit"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import type { CreditCouponRedeemProps } from './types.js';
2
+ declare const CreditCouponRedeem: {
3
+ ({ title, items, visibleCount, viewMoreLabel, redeemLabel, unLoginLabel, className, onModalOpenChange, onConfirm, modalCopy, iconUrl, }: CreditCouponRedeemProps): import("react/jsx-runtime").JSX.Element | null;
4
+ displayName: string;
5
+ };
6
+ export default CreditCouponRedeem;
7
+ export type { CreditCouponRedeemProps, CreditCouponRuleData, RedeemStatus } from './types.js';
@@ -0,0 +1,2 @@
1
+ "use strict";var F=Object.create;var s=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var t in o)s(e,t,{get:o[t],enumerable:!0})},C=(e,o,t,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of E(o))!S.call(e,r)&&r!==t&&s(e,r,{get:()=>o[r],enumerable:!(d=B(o,r))||d.enumerable});return e};var U=(e,o,t)=>(t=e!=null?F(O(e)):{},C(o||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),j=e=>C(s({},"__esModule",{value:!0}),e);var H={};T(H,{default:()=>z});module.exports=j(H);var n=require("react/jsx-runtime"),l=require("react"),p=require("../../../../../../components/index.js"),y=require("../../../../../../helpers/index.js"),R=require("../../../../BizProductProvider.js"),k=require("../../../../../../hooks/useIntersectionObserver.js"),b=U(require("./CreditCouponListItem.js")),i=require("./tracking.js");const x=({title:e,items:o,visibleCount:t,viewMoreLabel:d="View More",redeemLabel:r="Redeem",unLoginLabel:h,className:v,onModalOpenChange:L,onConfirm:g,modalCopy:I,iconUrl:M})=>{const{profile:N,variant:D}=(0,R.useBizProductContext)(),[m,P]=(0,l.useState)(!1),a=(0,l.useRef)(null),u=!!t&&o.length>t,w=m||!u?o:o.slice(0,t),c=D?.sku||"";return(0,k.useIntersectionObserverDelay)(a,{once:!0,threshold:.5,delay:0,callback:()=>{(0,i.trackModuleImpression)({sku:c},(0,i.resolveUserIdentity)(N))}}),o.length?(0,n.jsxs)("div",{ref:a,className:(0,y.cn)("credit-coupon-redeem-root",v),children:[e&&(0,n.jsx)(p.Text,{html:e,className:"text-[24px] font-bold md:text-[16px]"}),(0,n.jsx)("ul",{className:"border-lines-secondary mt-[12px] flex list-none flex-col overflow-hidden rounded-[16px] border bg-[#F5F5F7]",children:w.map(f=>(0,n.jsx)(b.default,{item:f,redeemLabel:r,unLoginLabel:h,iconUrl:M,copy:I,onConfirm:g,onModalOpenChange:L,sku:c},f.id))}),u&&!m&&(0,n.jsx)(p.Link,{onClick:()=>P(!0),className:"credit-coupon-redeem-view-more text-info-primary mt-3 inline-flex items-center gap-1 text-[16px] font-bold",children:d})]}):null};x.displayName="CreditCouponRedeem";var z=x;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.tsx"],
4
+ "sourcesContent": ["import { useRef, useState } from 'react'\nimport { Text, Link } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useIntersectionObserverDelay } from '../../../../../../hooks/useIntersectionObserver.js'\nimport CreditCouponListItem from './CreditCouponListItem.js'\nimport { trackModuleImpression, resolveUserIdentity } from './tracking.js'\nimport type { CreditCouponRuleData, CreditCouponRedeemProps } from './types.js'\n\nconst CreditCouponRedeem = ({\n title,\n items,\n visibleCount,\n viewMoreLabel = 'View More',\n redeemLabel = 'Redeem',\n unLoginLabel,\n className,\n onModalOpenChange,\n onConfirm,\n modalCopy,\n iconUrl,\n}: CreditCouponRedeemProps) => {\n const { profile, variant } = useBizProductContext()\n const [expanded, setExpanded] = useState(false)\n const rootRef = useRef<HTMLDivElement>(null)\n\n const hasMore = Boolean(visibleCount) && items.length > visibleCount!\n const visibleItems = expanded || !hasMore ? items : items.slice(0, visibleCount)\n\n const sku = variant?.sku || ''\n\n // 01 \u6A21\u5757\u66DD\u5149\uFF1A\u8FDB\u5165\u53EF\u89C6\u533A\uFF08\u226550%\uFF09\u5355\u6B21\u89E6\u53D1\n useIntersectionObserverDelay(rootRef, {\n once: true,\n threshold: 0.5,\n delay: 0,\n callback: () => {\n trackModuleImpression({ sku }, resolveUserIdentity(profile))\n },\n })\n\n if (!items.length) return null\n\n return (\n <div ref={rootRef} className={cn('credit-coupon-redeem-root', className)}>\n {title && <Text html={title} className=\"text-[24px] font-bold md:text-[16px]\" />}\n <ul className=\"border-lines-secondary mt-[12px] flex list-none flex-col overflow-hidden rounded-[16px] border bg-[#F5F5F7]\">\n {visibleItems.map(item => (\n <CreditCouponListItem\n key={item.id}\n item={item}\n redeemLabel={redeemLabel}\n unLoginLabel={unLoginLabel}\n iconUrl={iconUrl}\n copy={modalCopy}\n onConfirm={onConfirm}\n onModalOpenChange={onModalOpenChange}\n sku={sku}\n />\n ))}\n </ul>\n {hasMore && !expanded && (\n <Link\n onClick={() => setExpanded(true)}\n className=\"credit-coupon-redeem-view-more text-info-primary mt-3 inline-flex items-center gap-1 text-[16px] font-bold\"\n >\n {viewMoreLabel}\n </Link>\n )}\n </div>\n )\n}\n\nCreditCouponRedeem.displayName = 'CreditCouponRedeem'\n\nexport default CreditCouponRedeem\nexport type { CreditCouponRedeemProps, CreditCouponRuleData, RedeemStatus } from './types.js'\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4CI,IAAAI,EAAA,6BA5CJC,EAAiC,iBACjCC,EAA2B,iDAC3BC,EAAmB,8CACnBC,EAAqC,6CACrCC,EAA6C,8DAC7CC,EAAiC,wCACjCC,EAA2D,yBAG3D,MAAMC,EAAqB,CAAC,CAC1B,MAAAC,EACA,MAAAC,EACA,aAAAC,EACA,cAAAC,EAAgB,YAChB,YAAAC,EAAc,SACd,aAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,UAAAC,EACA,QAAAC,CACF,IAA+B,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,KAAI,wBAAqB,EAC5C,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxCC,KAAU,UAAuB,IAAI,EAErCC,EAAU,EAAQd,GAAiBD,EAAM,OAASC,EAClDe,EAAeJ,GAAY,CAACG,EAAUf,EAAQA,EAAM,MAAM,EAAGC,CAAY,EAEzEgB,EAAMN,GAAS,KAAO,GAY5B,SATA,gCAA6BG,EAAS,CACpC,KAAM,GACN,UAAW,GACX,MAAO,EACP,SAAU,IAAM,IACd,yBAAsB,CAAE,IAAAG,CAAI,KAAG,uBAAoBP,CAAO,CAAC,CAC7D,CACF,CAAC,EAEIV,EAAM,UAGT,QAAC,OAAI,IAAKc,EAAS,aAAW,MAAG,4BAA6BT,CAAS,EACpE,UAAAN,MAAS,OAAC,QAAK,KAAMA,EAAO,UAAU,uCAAuC,KAC9E,OAAC,MAAG,UAAU,8GACX,SAAAiB,EAAa,IAAIE,MAChB,OAAC,EAAAC,QAAA,CAEC,KAAMD,EACN,YAAaf,EACb,aAAcC,EACd,QAASK,EACT,KAAMD,EACN,UAAWD,EACX,kBAAmBD,EACnB,IAAKW,GARAC,EAAK,EASZ,CACD,EACH,EACCH,GAAW,CAACH,MACX,OAAC,QACC,QAAS,IAAMC,EAAY,EAAI,EAC/B,UAAU,6GAET,SAAAX,EACH,GAEJ,EA5BwB,IA8B5B,EAEAJ,EAAmB,YAAc,qBAEjC,IAAOV,EAAQU",
6
+ "names": ["CreditCouponRedeem_exports", "__export", "CreditCouponRedeem_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_helpers", "import_BizProductProvider", "import_useIntersectionObserver", "import_CreditCouponListItem", "import_tracking", "CreditCouponRedeem", "title", "items", "visibleCount", "viewMoreLabel", "redeemLabel", "unLoginLabel", "className", "onModalOpenChange", "onConfirm", "modalCopy", "iconUrl", "profile", "variant", "expanded", "setExpanded", "rootRef", "hasMore", "visibleItems", "sku", "item", "CreditCouponListItem"]
7
+ }
@@ -0,0 +1,33 @@
1
+ /** 用户身份 → 埋点枚举(component_title) */
2
+ export type UserIdentity = 'guest' | 'member' | 'plus_member';
3
+ /**
4
+ * 将 profile.memberType 映射为埋点用户身份枚举。
5
+ * 通过结构化局部类型读取(避免依赖 UserProfile 全局类型,该类型暂未声明 memberType)。
6
+ * - '0' / 空 → guest(未登录)
7
+ * - '1' → member(普通会员)
8
+ * - '2' → plus_member(付费会员)
9
+ */
10
+ export declare const resolveUserIdentity: (profile?: unknown) => UserIdentity;
11
+ interface TrackingEventBase {
12
+ sku: string;
13
+ }
14
+ /** 01 积分兑换折扣券模块曝光 */
15
+ export declare const trackModuleImpression: ({ sku }: TrackingEventBase, userIdentity: UserIdentity) => void;
16
+ /** 02 积分兑换折扣券模块 - 兑换入口点击 */
17
+ export declare const trackEntryClick: ({ sku }: TrackingEventBase, { entryType, userIdentity }: {
18
+ entryType: "members_only" | "get_discount";
19
+ userIdentity: UserIdentity;
20
+ }) => void;
21
+ /** 03 积分兑换折扣券模块 - 兑换弹窗曝光 */
22
+ export declare const trackPopupImpression: ({ sku }: TrackingEventBase, { popupSource }: {
23
+ popupSource: "direct" | "after_login";
24
+ }) => void;
25
+ /** 04 积分兑换折扣券模块 - 兑换成功(点击 Confirm) */
26
+ export declare const trackRedeemSuccess: ({ sku }: TrackingEventBase, { result }: {
27
+ result: "success" | "fail";
28
+ }) => void;
29
+ /** 05 积分兑换折扣券模块 - 折扣码复制 */
30
+ export declare const trackCodeCopy: ({ sku }: TrackingEventBase, { code }: {
31
+ code: string;
32
+ }) => void;
33
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=(e,n)=>{for(var t in n)c(e,t,{get:n[t],enumerable:!0})},u=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of _(n))!d.call(e,o)&&o!==t&&c(e,o,{get:()=>n[o],enumerable:!(r=a(n,o))||r.enumerable});return e};var y=e=>u(c({},"__esModule",{value:!0}),e);var I={};g(I,{resolveUserIdentity:()=>v,trackCodeCopy:()=>T,trackEntryClick:()=>k,trackModuleImpression:()=>l,trackPopupImpression:()=>b,trackRedeemSuccess:()=>E});module.exports=y(I);var s=require("../../../../../../shared/track.js");const p="Product Detail Page_",v=e=>{const n=e?.memberType;return n==="2"?"plus_member":n==="1"?"member":"guest"},m="member benefits",i=(e,n)=>{(0,s.gaTrack)({event:"ga4Event",event_name:e,event_parameters:n})},l=({sku:e},n)=>{i("component_impression",{page_group:`${p}${e}`,component_type:"copy",component_name:"points_redemption",position:m,creative_id:"",component_title:n,component_description:"",navigation:""})},k=({sku:e},{entryType:n,userIdentity:t})=>{i("component_click",{page_group:`${p}${e}`,component_type:"copy",component_name:"points_redemption",position:m,creative_id:"",button_name:n,component_title:t,component_description:"",SKU:e,navigation:""})},b=({sku:e},{popupSource:n})=>{i("component_impression",{page_group:`${p}${e}`,component_type:"copy",component_name:"redemption_popup",position:1,creative_id:"",component_title:"Redemption Popup",component_description:n,navigation:""})},E=({sku:e},{result:n})=>{i("component_click",{page_group:`${p}${e}`,component_type:"copy",component_name:"redemption_popup",position:1,creative_id:"",button_name:"confirm",component_title:"Redemption Popup",component_description:n,SKU:e,navigation:""})},T=({sku:e},{code:n})=>{i("component_click",{page_group:`${p}${e}`,component_type:"copy",component_name:"discount_code",position:1,creative_id:"",button_name:"copy_code",component_title:n,component_description:"",SKU:e,navigation:""})};
2
+ //# sourceMappingURL=tracking.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/tracking.ts"],
4
+ "sourcesContent": ["import { gaTrack } from '../../../../../../shared/track.js'\n\n/**\n * \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u57CB\u70B9\uFF08\u89C1\u9700\u6C42\u6587\u6863 5.4.2\uFF09\n *\n * \u7EDF\u4E00\u901A\u8FC7 window.dataLayer \u4E0A\u62A5\uFF0Cevent \u56FA\u5B9A\u4E3A ga4Event\u3002\n * - component_impression\uFF1A\u6A21\u5757\u66DD\u5149 / \u5151\u6362\u5F39\u7A97\u66DD\u5149\n * - component_click\uFF1A\u5165\u53E3\u70B9\u51FB / \u5151\u6362\u6210\u529F / \u6298\u6263\u7801\u590D\u5236\n *\n * page_group \u9075\u5FAA PDP \u89C4\u8303\uFF1A\"Product Detail Page_\" + SKU\u3002\n */\n\nconst PAGE_GROUP_PREFIX = 'Product Detail Page_'\n\n/** \u7528\u6237\u8EAB\u4EFD \u2192 \u57CB\u70B9\u679A\u4E3E\uFF08component_title\uFF09 */\nexport type UserIdentity = 'guest' | 'member' | 'plus_member'\n\n/**\n * \u5C06 profile.memberType \u6620\u5C04\u4E3A\u57CB\u70B9\u7528\u6237\u8EAB\u4EFD\u679A\u4E3E\u3002\n * \u901A\u8FC7\u7ED3\u6784\u5316\u5C40\u90E8\u7C7B\u578B\u8BFB\u53D6\uFF08\u907F\u514D\u4F9D\u8D56 UserProfile \u5168\u5C40\u7C7B\u578B\uFF0C\u8BE5\u7C7B\u578B\u6682\u672A\u58F0\u660E memberType\uFF09\u3002\n * - '0' / \u7A7A \u2192 guest\uFF08\u672A\u767B\u5F55\uFF09\n * - '1' \u2192 member\uFF08\u666E\u901A\u4F1A\u5458\uFF09\n * - '2' \u2192 plus_member\uFF08\u4ED8\u8D39\u4F1A\u5458\uFF09\n */\nexport const resolveUserIdentity = (profile?: unknown): UserIdentity => {\n const memberType = (profile as { memberType?: string } | null | undefined)?.memberType\n if (memberType === '2') return 'plus_member'\n if (memberType === '1') return 'member'\n return 'guest'\n}\n\ninterface TrackingEventBase {\n sku: string\n}\n\n/** \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757\u5728 listing \u9875\u7684\u57CB\u70B9\u4F4D\u7F6E\u6807\u8BC6\uFF08\u56FA\u5B9A\u503C\uFF09 */\nconst MODULE_POSITION = 'member benefits'\n\nconst pushEvent = (eventName: 'component_impression' | 'component_click', parameters: Record<string, any>) => {\n gaTrack({\n event: 'ga4Event',\n event_name: eventName,\n event_parameters: parameters,\n })\n}\n\n/** 01 \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757\u66DD\u5149 */\nexport const trackModuleImpression = ({ sku }: TrackingEventBase, userIdentity: UserIdentity) => {\n pushEvent('component_impression', {\n page_group: `${PAGE_GROUP_PREFIX}${sku}`,\n component_type: 'copy',\n component_name: 'points_redemption',\n position: MODULE_POSITION,\n creative_id: '',\n component_title: userIdentity,\n component_description: '',\n navigation: '',\n })\n}\n\n/** 02 \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757 - \u5151\u6362\u5165\u53E3\u70B9\u51FB */\nexport const trackEntryClick = (\n { sku }: TrackingEventBase,\n { entryType, userIdentity }: { entryType: 'members_only' | 'get_discount'; userIdentity: UserIdentity }\n) => {\n pushEvent('component_click', {\n page_group: `${PAGE_GROUP_PREFIX}${sku}`,\n component_type: 'copy',\n component_name: 'points_redemption',\n position: MODULE_POSITION,\n creative_id: '',\n button_name: entryType,\n component_title: userIdentity,\n component_description: '',\n SKU: sku,\n navigation: '',\n })\n}\n\n/** 03 \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757 - \u5151\u6362\u5F39\u7A97\u66DD\u5149 */\nexport const trackPopupImpression = (\n { sku }: TrackingEventBase,\n { popupSource }: { popupSource: 'direct' | 'after_login' }\n) => {\n pushEvent('component_impression', {\n page_group: `${PAGE_GROUP_PREFIX}${sku}`,\n component_type: 'copy',\n component_name: 'redemption_popup',\n position: 1,\n creative_id: '',\n component_title: 'Redemption Popup',\n component_description: popupSource,\n navigation: '',\n })\n}\n\n/** 04 \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757 - \u5151\u6362\u6210\u529F\uFF08\u70B9\u51FB Confirm\uFF09 */\nexport const trackRedeemSuccess = (\n { sku }: TrackingEventBase,\n { result }: { result: 'success' | 'fail' }\n) => {\n pushEvent('component_click', {\n page_group: `${PAGE_GROUP_PREFIX}${sku}`,\n component_type: 'copy',\n component_name: 'redemption_popup',\n position: 1,\n creative_id: '',\n button_name: 'confirm',\n component_title: 'Redemption Popup',\n component_description: result,\n SKU: sku,\n navigation: '',\n })\n}\n\n/** 05 \u79EF\u5206\u5151\u6362\u6298\u6263\u5238\u6A21\u5757 - \u6298\u6263\u7801\u590D\u5236 */\nexport const trackCodeCopy = ({ sku }: TrackingEventBase, { code }: { code: string }) => {\n pushEvent('component_click', {\n page_group: `${PAGE_GROUP_PREFIX}${sku}`,\n component_type: 'copy',\n component_name: 'discount_code',\n position: 1,\n creative_id: '',\n button_name: 'copy_code',\n component_title: code,\n component_description: '',\n SKU: sku,\n navigation: '',\n })\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,0BAAAC,EAAA,yBAAAC,EAAA,uBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAwB,6CAYxB,MAAMC,EAAoB,uBAYbR,EAAuBS,GAAoC,CACtE,MAAMC,EAAcD,GAAwD,WAC5E,OAAIC,IAAe,IAAY,cAC3BA,IAAe,IAAY,SACxB,OACT,EAOMC,EAAkB,kBAElBC,EAAY,CAACC,EAAuDC,IAAoC,IAC5G,WAAQ,CACN,MAAO,WACP,WAAYD,EACZ,iBAAkBC,CACpB,CAAC,CACH,EAGaX,EAAwB,CAAC,CAAE,IAAAY,CAAI,EAAsBC,IAA+B,CAC/FJ,EAAU,uBAAwB,CAChC,WAAY,GAAGJ,CAAiB,GAAGO,CAAG,GACtC,eAAgB,OAChB,eAAgB,oBAChB,SAAUJ,EACV,YAAa,GACb,gBAAiBK,EACjB,sBAAuB,GACvB,WAAY,EACd,CAAC,CACH,EAGad,EAAkB,CAC7B,CAAE,IAAAa,CAAI,EACN,CAAE,UAAAE,EAAW,aAAAD,CAAa,IACvB,CACHJ,EAAU,kBAAmB,CAC3B,WAAY,GAAGJ,CAAiB,GAAGO,CAAG,GACtC,eAAgB,OAChB,eAAgB,oBAChB,SAAUJ,EACV,YAAa,GACb,YAAaM,EACb,gBAAiBD,EACjB,sBAAuB,GACvB,IAAKD,EACL,WAAY,EACd,CAAC,CACH,EAGaX,EAAuB,CAClC,CAAE,IAAAW,CAAI,EACN,CAAE,YAAAG,CAAY,IACX,CACHN,EAAU,uBAAwB,CAChC,WAAY,GAAGJ,CAAiB,GAAGO,CAAG,GACtC,eAAgB,OAChB,eAAgB,mBAChB,SAAU,EACV,YAAa,GACb,gBAAiB,mBACjB,sBAAuBG,EACvB,WAAY,EACd,CAAC,CACH,EAGab,EAAqB,CAChC,CAAE,IAAAU,CAAI,EACN,CAAE,OAAAI,CAAO,IACN,CACHP,EAAU,kBAAmB,CAC3B,WAAY,GAAGJ,CAAiB,GAAGO,CAAG,GACtC,eAAgB,OAChB,eAAgB,mBAChB,SAAU,EACV,YAAa,GACb,YAAa,UACb,gBAAiB,mBACjB,sBAAuBI,EACvB,IAAKJ,EACL,WAAY,EACd,CAAC,CACH,EAGad,EAAgB,CAAC,CAAE,IAAAc,CAAI,EAAsB,CAAE,KAAAK,CAAK,IAAwB,CACvFR,EAAU,kBAAmB,CAC3B,WAAY,GAAGJ,CAAiB,GAAGO,CAAG,GACtC,eAAgB,OAChB,eAAgB,gBAChB,SAAU,EACV,YAAa,GACb,YAAa,YACb,gBAAiBK,EACjB,sBAAuB,GACvB,IAAKL,EACL,WAAY,EACd,CAAC,CACH",
6
+ "names": ["tracking_exports", "__export", "resolveUserIdentity", "trackCodeCopy", "trackEntryClick", "trackModuleImpression", "trackPopupImpression", "trackRedeemSuccess", "__toCommonJS", "import_track", "PAGE_GROUP_PREFIX", "profile", "memberType", "MODULE_POSITION", "pushEvent", "eventName", "parameters", "sku", "userIdentity", "entryType", "popupSource", "result", "code"]
7
+ }