@anker-in/headless-ui 1.0.20-alpha.1761293811592 → 1.0.20-alpha.1761300713135

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 (101) hide show
  1. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
  3. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  4. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +1 -1
  5. package/dist/cjs/biz-components/Listing/{ProductProvider.d.ts → BizProductProvider.d.ts} +8 -4
  6. package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
  7. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
  8. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  9. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -4
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +21 -3
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  31. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  32. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  33. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  34. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  36. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  37. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  38. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  39. package/dist/cjs/biz-components/Listing/index.d.ts +1 -1
  40. package/dist/cjs/biz-components/Listing/index.js +1 -1
  41. package/dist/cjs/biz-components/Listing/index.js.map +3 -3
  42. package/dist/cjs/biz-components/Listing/types.d.ts +7 -0
  43. package/dist/cjs/biz-components/Listing/types.js +1 -1
  44. package/dist/cjs/biz-components/Listing/types.js.map +1 -1
  45. package/dist/cjs/biz-components/Subscribe/index.js +2 -2
  46. package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
  47. package/dist/cjs/biz-components/index.d.ts +1 -1
  48. package/dist/cjs/biz-components/index.js +1 -1
  49. package/dist/cjs/biz-components/index.js.map +3 -3
  50. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  51. package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
  52. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  53. package/dist/esm/biz-components/HeaderNavigation/index.js.map +1 -1
  54. package/dist/esm/biz-components/Listing/{ProductProvider.d.ts → BizProductProvider.d.ts} +8 -4
  55. package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
  56. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
  57. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  58. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  59. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -4
  60. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +21 -3
  61. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  62. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  63. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  64. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  65. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  66. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  67. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  68. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  73. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  74. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  75. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  76. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  77. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  78. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  79. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  80. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  81. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  82. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  83. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  84. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  85. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  86. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  87. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  88. package/dist/esm/biz-components/Listing/index.d.ts +1 -1
  89. package/dist/esm/biz-components/Listing/index.js +1 -1
  90. package/dist/esm/biz-components/Listing/index.js.map +3 -3
  91. package/dist/esm/biz-components/Listing/types.d.ts +7 -0
  92. package/dist/esm/biz-components/Subscribe/index.js +2 -2
  93. package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
  94. package/dist/esm/biz-components/index.d.ts +1 -1
  95. package/dist/esm/biz-components/index.js +1 -1
  96. package/dist/esm/biz-components/index.js.map +2 -2
  97. package/package.json +1 -1
  98. package/dist/cjs/biz-components/Listing/ProductProvider.js +0 -2
  99. package/dist/cjs/biz-components/Listing/ProductProvider.js.map +0 -7
  100. package/dist/esm/biz-components/Listing/ProductProvider.js +0 -2
  101. package/dist/esm/biz-components/Listing/ProductProvider.js.map +0 -7
@@ -1,4 +1,4 @@
1
- "use strict";var z=Object.create;var y=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var W=(t,o)=>{for(var s in o)y(t,s,{get:o[s],enumerable:!0})},I=(t,o,s,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Y(o))!q.call(t,a)&&a!==s&&y(t,a,{get:()=>o[a],enumerable:!(u=E(o,a))||u.enumerable});return t};var N=(t,o,s)=>(s=t!=null?z(j(t)):{},I(o||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),K=t=>I(y({},"__esModule",{value:!0}),t);var oe={};W(oe,{default:()=>te});module.exports=K(oe);var e=require("react/jsx-runtime"),i=require("../../../../../components/index.js"),d=N(require("./ProductBenefitsTabs/index.js")),D=require("../../../ProductProvider"),Z=require("../../../hooks/useBenefits"),f=require("../../../utils/index.js"),T=require("../../../utils/textFormat"),A=N(require("classnames")),se=require("react"),H=require("../../../../AiuiProvider/index.js"),$=N(require("../../../../../hooks/useCountDown.js")),F=N(require("../../../hooks/useCopy"));const J={couponCode:"Code",copyCode:"Copy Code",copied:"Copied",expired:"Expired",offCoupon:"{discount} off coupon",offMemberOnly:"{amount} off Member Only",loginNow:"Login now",selectFreeGift:"You can select the free gift below.",bundleSaveUpTo:"Bundle purchases save extra up to",bundleOffer:"We offer {count} bundle for you",creditsTitle:"Soundcore credits for cash",creditsDesc:"100 Soundcore credits=$1",yourBenefits:"Your Benefits",off:" off",memberBenefits:"Member Benefits",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},Q=({item:t,textConfig:o})=>{const{trackingData:s}=(0,H.useAiuiContext)(),{copied:u,copy:a}=(0,F.default)(),r=s?.common?.coupon,{days:x,hours:p,minutes:w,seconds:B}=(0,$.default)({endTime:t?.ends_at||""}),{openModal:C}=(0,D.useProductContext)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{jsx:!0,children:`
1
+ "use strict";var q=Object.create;var h=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var X=(t,o)=>{for(var a in o)h(t,a,{get:o[a],enumerable:!0})},U=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of K(o))!Q.call(t,l)&&l!==a&&h(t,l,{get:()=>o[l],enumerable:!(s=W(o,l))||s.enumerable});return t};var v=(t,o,a)=>(a=t!=null?q(J(t)):{},U(o||!t||!t.__esModule?h(a,"default",{value:t,enumerable:!0}):a,t)),ee=t=>U(h({},"__esModule",{value:!0}),t);var re={};X(re,{default:()=>se});module.exports=ee(re);var e=require("react/jsx-runtime"),i=require("../../../../../components/index.js"),c=v(require("./ProductBenefitsTabs/index.js")),P=require("../../../BizProductProvider.js"),Z=require("../../../hooks/useBenefits"),u=require("../../../utils/index.js"),y=require("../../../utils/textFormat"),A=v(require("classnames")),ce=require("react"),H=require("../../../../AiuiProvider/index.js"),$=v(require("../../../../../hooks/useCountDown.js")),F=v(require("../../../hooks/useCopy"));const te={couponCode:"Code",copyCode:"Copy Code",copied:"Copied",expired:"Expired",offCoupon:"{discount} off coupon",offMemberOnly:"{amount} off Member Only",loginNow:"Login now",selectFreeGift:"You can select the free gift below.",bundleSaveUpTo:"Bundle purchases save extra up to",bundleOffer:"We offer {count} bundle for you",creditsTitle:"Soundcore credits for cash",creditsDesc:"100 Soundcore credits=$1",yourBenefits:"Your Benefits",off:" off",memberBenefits:"Member Benefits",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},oe=({item:t,textConfig:o})=>{const{trackingData:a}=(0,H.useAiuiContext)(),{copied:s,copy:l}=(0,F.default)(),d=a?.common?.coupon,{days:b,hours:N,minutes:w,seconds:T}=(0,$.default)({endTime:t?.ends_at||""}),{openModal:B}=(0,P.useBizProductContext)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{jsx:!0,children:`
2
2
  .coupon-card {
3
3
  /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */
4
4
  mask:
@@ -14,9 +14,27 @@
14
14
  bottom left;
15
15
  mask-repeat: no-repeat;
16
16
  }
17
- `}),(0,e.jsxs)("div",{className:(0,A.default)("relative h-[130px] overflow-hidden bg-white",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(i.Picture,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),(0,e.jsxs)("div",{className:"relative z-1 p-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-start",children:[t.useAble&&(0,e.jsx)(i.Checkbox,{className:"mr-2",defaultChecked:t.isAutoUse,onCheckedChange:M=>{t?.onUseChange?.(M)}}),(0,e.jsx)(i.Text,{html:t.title,className:"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),(0,e.jsx)(i.Text,{...typeof t.description=="string"?{html:t.description}:{},as:"p",className:"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]",children:t.description}),t.code&&(0,e.jsxs)("div",{className:"mt-6 flex items-center gap-2",children:[(0,e.jsx)(i.Text,{html:`${o.couponCode}: ${t.code}`,className:"text-base font-bold text-[#3D3D3F]"}),(0,e.jsx)("button",{className:"text-brand-0 text-base font-bold underline",onClick:()=>a(t.code??""),children:u?r?.copied||o.copied:r?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{r?.modal&&C(r?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(x)<Number(r?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:r?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${x} ${r?.days} ${p.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${B.toString().padStart(2,"0")}`})]}):r?.hurry?.label||o.expired})]})]})]})},X=({coupons:t,className:o,textConfig:s})=>(0,e.jsx)("div",{className:(0,A.default)("flex flex-col gap-3",o),children:t?.map((u,a)=>(0,e.jsx)(Q,{item:u,textConfig:s},a))}),ee=({textConfig:t,openModal:o,openSignInPopup:s,openAuthCodePopup:u})=>{const{setSavingDetail:a,isLogin:r,profile:x,variant:p,renderAffirm:w,renderKlarna:B,renderPaypal:C}=(0,D.useProductContext)(),M=(0,Z.useBenefits)({variant:p}),{trackingData:P,locale:m="us",copyWriting:U}=(0,H.useAiuiContext)(),n={...J,...t},{activated:R=!1}=x||{},{memberDiscount:g,commonCoupon:c,creditsRedemption:h,freeGift:_,bundle:L,paidShipping:O,fullGift:S,levelDiscount:k}=M,G=P?.product?.support??{},{thirdParty:ne={}}=P?.common||{},v=[c?.enable?{...c.config,isAutoUse:!0,useAble:!0,borderStyle:"rounded",code:c?.config?.title??"",description:c?.config?.desc??"",title:(0,T.replaceTemplate)(n.offCoupon,{discount:c?.config?.value_type=="percentage"?Math.abs(Number(c?.config?.value||0))+"%":(0,f.formatPrice)({amount:Math.abs(Number(c?.config?.fixed_value||0)),currencyCode:p.price.currencyCode,locale:m})})}:null,g.enable?{useAble:!0,isAutoUse:r,title:(0,T.replaceTemplate)(n.offMemberOnly,{amount:(0,f.formatPrice)({amount:g?.config?.amount??0,currencyCode:p.price.currencyCode,locale:m})}),description:(0,e.jsxs)(e.Fragment,{children:[r?g?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,f.formatPrice)({amount:g?.config?.amount??0,currencyCode:p.price.currencyCode,locale:m}))??""," ",r?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>s?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:l=>{r?a(b=>({...b,member:l?g?.config?.amount??0:0})):s?.()}}:null,k.enable?{title:k?.config?.title??"",description:k?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,_.enable?{title:_?.config?.title??"",description:n.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"}}:null,L.enable?{title:`${n.bundleSaveUpTo} ${(0,f.formatPrice)({amount:Math.max(...L?.config?.bundleList?.map(l=>l.savings??0)??[]),currencyCode:p.price.currencyCode,locale:m})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",L?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"}}:null,S.enable?{title:S?.config?.title??"",description:S?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"}}:null,h.enable?{title:n.creditsTitle,description:n.creditsDesc,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534"}}:null].filter(Boolean),V=()=>{u?.()};return d.default?(0,e.jsxs)(d.default,{defaultValue:v?.length?"coupon":"membership",children:[(0,e.jsxs)(d.default.List,{children:[v?.length?(0,e.jsxs)(d.default.Trigger,{value:"coupon",children:[n.yourBenefits,c?.enable&&(0,e.jsxs)(d.default.Badge,{children:[c?.config?.value_type=="percentage"?Math.abs(Number(c?.config?.value||0))+"%":(0,f.formatPrice)({amount:Math.abs(Number(c?.config?.fixed_value||0)),currencyCode:p.price.currencyCode,locale:m}),n.off]})]}):null,(0,e.jsx)(d.default.Trigger,{value:"membership",children:n.memberBenefits}),(0,e.jsx)(d.default.Trigger,{value:"installment",children:n.installment})]}),v?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"",children:(0,e.jsx)("div",{className:"h-[240px] overflow-y-auto px-4",children:(0,e.jsx)(X,{coupons:v,className:"",textConfig:n})})}):null,(0,e.jsxs)(d.default.Content,{value:"membership",className:"",children:[(0,e.jsx)("h3",{className:"mx-4 mb-2 text-left text-lg font-bold",children:n.memberBenefits}),(0,e.jsx)("div",{className:`overflow-y-auto rounded-[16px] px-4 ${r?"max-h-[240px]":"max-h-[160px]"}`,children:(0,e.jsxs)("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
17
+ `}),(0,e.jsxs)("div",{className:(0,A.default)("relative h-[130px] overflow-hidden bg-white",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(i.Picture,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),(0,e.jsxs)("div",{className:"relative z-1 p-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-start",children:[t.useAble&&(0,e.jsx)(i.Checkbox,{className:"mr-2",defaultChecked:t.isAutoUse,onCheckedChange:k=>{t?.onUseChange?.(k)}}),(0,e.jsx)(i.Text,{html:t.title,className:"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),(0,e.jsx)(i.Text,{...typeof t.description=="string"?{html:t.description}:{},as:"p",className:"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]",children:t.description}),t.code&&(0,e.jsxs)("div",{className:"mt-6 flex items-center gap-2",children:[(0,e.jsx)(i.Text,{html:`${o.couponCode}: ${t.code}`,className:"text-base font-bold text-[#3D3D3F]"}),(0,e.jsx)("button",{className:"text-brand-0 text-base font-bold underline",onClick:()=>l(t.code??""),children:s?d?.copied||o.copied:d?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{d?.modal&&B(d?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(b)<Number(d?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:d?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${b} ${d?.days} ${N.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${T.toString().padStart(2,"0")}`})]}):d?.hurry?.label||o.expired})]})]})]})},ne=({coupons:t,className:o,textConfig:a})=>(0,e.jsx)("div",{className:(0,A.default)("flex flex-col gap-3",o),children:t?.map((s,l)=>(0,e.jsx)(oe,{item:s,textConfig:a},l))}),ie=({textConfig:t})=>{const{isLogin:o,profile:a,variant:s,renderAffirm:l,renderKlarna:d,renderPaypal:b,onUseCouponChange:N,onUseMemberDiscountChange:w,discount:T,savingDetail:B,openModal:k,openSignInPopup:M,openAuthCodePopup:R,openSignUpPopup:O}=(0,P.useBizProductContext)(),z=(0,Z.useBenefits)({variant:s}),{trackingData:_,locale:f="us",copyWriting:G}=(0,H.useAiuiContext)(),n={...te,...t},{activated:V=!1}=a||{},{memberDiscount:m,commonCoupon:p,creditsRedemption:x,freeGift:I,bundle:S,paidShipping:E,fullGift:L,levelDiscount:D}=z,j=_?.product?.support??{},{thirdParty:ae={}}=_?.common||{},C=[p?.enable?{...p.config,isAutoUse:!0,useAble:!0,borderStyle:"rounded",code:p?.config?.title??"",description:p?.config?.desc??"",onUseChange:r=>{const g=r?T?.codeSavings??0:0;N?.(g)},title:(0,y.replaceTemplate)(n.offCoupon,{discount:p?.config?.value_type=="percentage"?Math.abs(Number(p?.config?.value||0))+"%":(0,u.formatPrice)({amount:Math.abs(Number(p?.config?.fixed_value||0)),currencyCode:s.price.currencyCode,locale:f})})}:null,m.enable?{useAble:!0,isAutoUse:o,title:(0,y.replaceTemplate)(n.offMemberOnly,{amount:(0,u.formatPrice)({amount:m?.config?.amount??0,currencyCode:s.price.currencyCode,locale:f})}),description:(0,e.jsxs)(e.Fragment,{children:[o?m?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,u.formatPrice)({amount:m?.config?.amount??0,currencyCode:s.price.currencyCode,locale:f}))??""," ",o?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>M?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:r=>{if(console.log("memberDiscount?.config?.amount",o,M),o){const g=r?m?.config?.amount??0:0;w?.(g)}else M?.()}}:null,D.enable?{title:D?.config?.title??"",description:D?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,I.enable?{title:I?.config?.title??"",description:n.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"}}:null,S.enable?{title:`${n.bundleSaveUpTo} ${(0,u.formatPrice)({amount:Math.max(...S?.config?.bundleList?.map(r=>r.savings??0)??[]),currencyCode:s.price.currencyCode,locale:f})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",S?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"}}:null,L.enable?{title:L?.config?.title??"",description:L?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"}}:null,x.enable?{title:n.creditsTitle,description:n.creditsDesc,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534"}}:null].filter(Boolean),Y=()=>{R?.()};return c.default?(0,e.jsxs)(c.default,{defaultValue:C?.length?"coupon":"membership",children:[(0,e.jsxs)(c.default.List,{children:[C?.length?(0,e.jsxs)(c.default.Trigger,{value:"coupon",children:[n.yourBenefits,(B.coupon||0)>0&&(0,e.jsxs)(c.default.Badge,{children:[p?.config?.value_type=="percentage"?Math.abs(Number(p?.config?.value||0))+"%":(0,u.formatPrice)({amount:Math.abs(Number(p?.config?.fixed_value||0)),currencyCode:s.price.currencyCode,locale:f}),n.off]})]}):null,(0,e.jsx)(c.default.Trigger,{value:"membership",children:n.memberBenefits}),(0,e.jsx)(c.default.Trigger,{value:"installment",children:n.installment})]}),(0,e.jsx)("style",{global:!0,jsx:!0,children:`
18
+ .coupon-container::-webkit-scrollbar {
19
+ width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */
20
+ height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */
21
+ }
22
+
23
+ .coupon-container::-webkit-scrollbar-track {
24
+ background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */
25
+ }
26
+
27
+ .coupon-container::-webkit-scrollbar-thumb {
28
+ background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */
29
+ border-radius: 9999px; /* \u5706\u89D2 */
30
+ }
31
+
32
+ .coupon-container::-webkit-scrollbar-thumb:hover {
33
+ background-color: rgba(100, 100, 100, 0.6);
34
+ }
35
+ `}),C?.length?(0,e.jsx)(c.default.Content,{value:"coupon",className:"",children:(0,e.jsx)("div",{className:"coupon-container h-[240px] overflow-y-auto px-4",children:(0,e.jsx)(ne,{coupons:C,className:"",textConfig:n})})}):null,(0,e.jsxs)(c.default.Content,{value:"membership",className:"",children:[(0,e.jsx)("h3",{className:"mx-4 mb-2 text-left text-lg font-bold",children:n.memberBenefits}),(0,e.jsx)("div",{className:`overflow-y-auto rounded-[16px] px-4 ${o?"max-h-[240px]":"max-h-[160px]"}`,children:(0,e.jsxs)("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
18
36
  [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2
19
37
  [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4
20
38
  [&_li]:py-4
21
- [&_li]:text-left`,children:[g.enable&&(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:(0,T.replaceTemplate)(n.forNewMember,{amount:(0,f.formatPrice)({amount:g?.config?.amount??0,currencyCode:p.price.currencyCode,locale:m})})})]}),G.items?.map((l,b)=>l.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>o?.({title:l.text,content:l.modalText}),className:"flex",children:[(0,e.jsx)(i.Picture,{source:l.icon,alt:l.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{className:"text-left text-[16px] font-medium x:text-[14px]",children:l.text})]},b)},b):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(i.Picture,{source:l.icon,alt:l.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:l.text})]},b)),O.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:n.expressShipping})]}):null,h.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:R?h?.config?.label?.replace("{{amount}}",(0,f.formatPrice)({amount:h?.config?.amount??0,currencyCode:p.price.currencyCode,locale:m})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>V(),className:"underline",children:n.active})]})})]}):null]})}),!r&&(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(i.Button,{variant:"primary",className:"w-full",onClick:()=>s?.(),children:U?.signIn})})]}),(0,e.jsxs)(d.default.Content,{value:"installment",className:"px-4",children:[(0,e.jsx)(i.Heading,{size:2,className:"mb-2 text-left text-lg font-bold",children:n.flexibleInstallment}),(0,e.jsxs)("div",{className:"overflow-hidden rounded-[16px] bg-white",children:[w,B,C&&(0,e.jsx)("div",{className:"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0",children:C})]})]})]}):null};var te=ee;
39
+ [&_li]:text-left`,children:[m.enable&&(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:(0,y.replaceTemplate)(n.forNewMember,{amount:(0,u.formatPrice)({amount:m?.config?.amount??0,currencyCode:s.price.currencyCode,locale:f})})})]}),j.items?.map((r,g)=>r.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>k?.({title:r.text,content:r.modalText}),className:"flex",children:[(0,e.jsx)(i.Picture,{source:r.icon,alt:r.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{className:"text-left text-[16px] font-medium x:text-[14px]",children:r.text})]},g)},g):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(i.Picture,{source:r.icon,alt:r.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:r.text})]},g)),E.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:n.expressShipping})]}):null,x.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{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",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:V?x?.config?.label?.replace("{{amount}}",(0,u.formatPrice)({amount:x?.config?.amount??0,currencyCode:s.price.currencyCode,locale:f})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>Y(),className:"underline",children:n.active})]})})]}):null]})}),!o&&(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(i.Button,{variant:"primary",className:"w-full",onClick:()=>O?.(),children:G?.signUp})})]}),(0,e.jsxs)(c.default.Content,{value:"installment",className:"px-4",children:[(0,e.jsx)(i.Heading,{size:2,className:"mb-2 text-left text-lg font-bold",children:n.flexibleInstallment}),(0,e.jsxs)("div",{className:"overflow-hidden rounded-[16px] bg-white",children:[l,d,b&&(0,e.jsx)("div",{className:"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0",children:b})]})]})]}):null};var se=ie;
22
40
  //# sourceMappingURL=BenefitsTab.js.map
@@ -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 jsx-a11y/click-events-have-key-events */\nimport { Button, Checkbox, Text, Picture, Heading } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useProductContext } from '../../../ProductProvider'\nimport { useBenefits } from '../../../hooks/useBenefits'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\nimport classNames from 'classnames'\nimport React from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy'\n\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 yourBenefits?: string // \"Your Benefits\"\n off?: string // \"off\"\n memberBenefits?: string // \"Member Benefits\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n installment?: string // \"Installment\"\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 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 openModal?: (modal: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\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 yourBenefits: 'Your Benefits',\n off: ' off',\n memberBenefits: 'Member Benefits',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n installment: 'Installment',\n forNewMember: '{amount} for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => void\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal } = useProductContext()\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 className={classNames(\n 'relative h-[130px] overflow-hidden bg-white',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\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=\"relative z-1 p-3\">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n className=\"mr-2\"\n defaultChecked={item.isAutoUse}\n onCheckedChange={(e: boolean) => {\n item?.onUseChange?.(e)\n }}\n />\n )}\n <Text html={item.title} className=\"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]\" />\n </div>\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]\"\n >\n {item.description}\n </Text>\n {item.code && (\n <div className=\"mt-6 flex items-center gap-2\">\n <Text html={`${textConfig.couponCode}: ${item.code}`} className=\"text-base font-bold text-[#3D3D3F]\" />\n <button className=\"text-brand-0 text-base font-bold underline\" onClick={() => copyToClipboard(item.code ?? '')}>\n {isCopied ? couponCopy?.copied || textConfig.copied : couponCopy?.copy || textConfig.copyCode}\n </button>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${couponCopy?.days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || textConfig.expired\n )}\n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig> }) => {\n return (\n <div className={classNames('flex flex-col gap-3', className)}>\n {coupons?.map((item, index) => <CouponItem key={index} item={item} textConfig={textConfig} />)}\n </div>\n )\n}\n\nconst BenefitsTab = ({\n textConfig,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n}: BenefitsTabProps) => {\n const { setSavingDetail, isLogin, profile, variant, renderAffirm, renderKlarna, renderPaypal } = useProductContext()\n const benefits = useBenefits({ variant })\n const { trackingData, locale = 'us', copyWriting } = useAiuiContext()\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const productsBenefits = trackingData?.product?.support ?? {}\n const { thirdParty = {} } = trackingData?.common || {}\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: true,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n title: replaceTemplate(mergedTextConfig.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: isLogin,\n\n title: replaceTemplate(mergedTextConfig.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {isLogin\n ? memberDiscount?.config?.description ?? ''\n : (mergedTextConfig.memberBenefitsNotLogin.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {isLogin ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {mergedTextConfig.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (isLogin) {\n setSavingDetail(prev => ({\n ...prev,\n member: value ? memberDiscount?.config?.amount ?? 0 : 0,\n }))\n } else {\n openSignInPopup?.()\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: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385',\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: mergedTextConfig.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534',\n },\n }\n : null,\n bundle.enable\n ? {\n title: `${mergedTextConfig.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? []),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: mergedTextConfig.bundleOffer.replace('{count}', bundle?.config?.bundleList?.length?.toString() ?? ''),\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534',\n },\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790',\n },\n }\n : null,\n creditsRedemption.enable\n ? {\n title: mergedTextConfig.creditsTitle,\n description: mergedTextConfig.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534',\n },\n }\n : null,\n ].filter(Boolean)\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n return (\n <ProductBenefitsTabs defaultValue={coupons?.length ? 'coupon' : 'membership'}>\n <ProductBenefitsTabs.List>\n {coupons?.length ? (\n <ProductBenefitsTabs.Trigger value=\"coupon\">\n {mergedTextConfig.yourBenefits}\n {commonCoupon?.enable && (\n <ProductBenefitsTabs.Badge>\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 {mergedTextConfig.off}\n </ProductBenefitsTabs.Badge>\n )}\n </ProductBenefitsTabs.Trigger>\n ) : null}\n <ProductBenefitsTabs.Trigger value=\"membership\">{mergedTextConfig.memberBenefits}</ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger value=\"installment\">{mergedTextConfig.installment}</ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content value=\"coupon\" className=\"\">\n <div className=\"h-[240px] overflow-y-auto px-4\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n className=\"\"\n textConfig={mergedTextConfig}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n\n <ProductBenefitsTabs.Content value=\"membership\" className=\"\">\n <h3 className=\"mx-4 mb-2 text-left text-lg font-bold\">{mergedTextConfig.memberBenefits}</h3>\n <div className={`overflow-y-auto rounded-[16px] px-4 ${isLogin ? 'max-h-[240px]' : 'max-h-[160px]'}`}>\n <ul\n className={`list-none [&_li:first-child]:rounded-t-[16px] \n [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2\n [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4\n [&_li]:py-4 \n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {replaceTemplate(mergedTextConfig.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </li>\n )}\n {productsBenefits.items?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index}>\n <button\n onClick={() => openModal?.({ title: item.text, content: item.modalText })}\n key={index}\n className=\"flex\"\n >\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text className=\"text-left text-[16px] font-medium x:text-[14px]\">{item.text}</Text>\n </button>\n </li>\n ) : (\n <li key={index} className=\"flex\">\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {item.text}\n </Text>\n </li>\n )\n )}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {mergedTextConfig.expressShipping}\n </Text>\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {activated ? (\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 <>\n {mergedTextConfig.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {mergedTextConfig.active}\n </span>\n </>\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!isLogin && (\n <div className=\"px-4 pt-4\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignInPopup?.()}>\n {copyWriting?.signIn}\n </Button>\n </div>\n )}\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content value=\"installment\" className=\"px-4\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {mergedTextConfig.flexibleInstallment}\n </Heading>\n <div className=\"overflow-hidden rounded-[16px] bg-white\">\n {renderAffirm}\n {renderKlarna}\n {renderPaypal && (\n <div className=\"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0\">{renderPaypal}</div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nexport default BenefitsTab\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAsHM,IAAAI,EAAA,6BArHNC,EAAyD,8CACzDC,EAAgC,6CAChCC,EAAkC,oCAClCC,EAA4B,sCAC5BC,EAA4B,mCAC5BC,EAAgC,qCAChCC,EAAuB,yBACvBC,GAAkB,iBAClBC,EAA+B,6CAC/BC,EAAyB,mDACzBC,EAAoB,qCAmDpB,MAAMC,EAAqD,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,aAAc,gBACd,IAAK,OACL,eAAgB,kBAChB,uBAAwB,8DACxB,YAAa,cACb,aAAc,0BACd,gBAAiB,0BACjB,uBAAwB,mDACxB,OAAQ,SACR,oBAAqB,+BACvB,EAmBMC,EAAa,CAAC,CAClB,KAAAC,EACA,WAAAC,CACF,IAGM,CACJ,KAAM,CAAE,aAAAC,CAAa,KAAI,kBAAe,EAClC,CAAE,OAAQC,EAAU,KAAMC,CAAgB,KAAI,EAAAC,SAAQ,EACtDC,EAAaJ,GAAc,QAAQ,OACnC,CAAE,KAAAK,EAAM,MAAAC,EAAO,QAAAC,EAAS,QAAAC,CAAQ,KAAI,EAAAC,SAAa,CAAE,QAASX,GAAM,SAAW,EAAG,CAAC,EACjF,CAAE,UAAAY,CAAU,KAAI,qBAAkB,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names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_ProductProvider", "import_useBenefits", "import_utils", "import_textFormat", "import_classnames", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "defaultTextConfig", "CouponItem", "item", "textConfig", "trackingData", "isCopied", "copyToClipboard", "useCopy", "couponCopy", "days", "hours", "minutes", "seconds", "useCountDown", "openModal", "classNames", "e", "CouponContent", "coupons", "className", "index", "BenefitsTab", "openSignInPopup", "openAuthCodePopup", "setSavingDetail", "isLogin", "profile", "variant", "renderAffirm", "renderKlarna", "renderPaypal", "benefits", "locale", "copyWriting", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "productsBenefits", "thirdParty", "value", "prev", "handleActivate", "ProductBenefitsTabs"]
4
+ "sourcesContent": ["/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { Button, Checkbox, Text, Picture, Heading } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\nimport classNames from 'classnames'\nimport React from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy'\n\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 yourBenefits?: string // \"Your Benefits\"\n off?: string // \"off\"\n memberBenefits?: string // \"Member Benefits\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n installment?: string // \"Installment\"\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 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 yourBenefits: 'Your Benefits',\n off: ' off',\n memberBenefits: 'Member Benefits',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n installment: 'Installment',\n forNewMember: '{amount} for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => void\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n className={classNames(\n 'relative h-[130px] overflow-hidden bg-white',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\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=\"relative z-1 p-3\">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n className=\"mr-2\"\n defaultChecked={item.isAutoUse}\n onCheckedChange={(e: boolean) => {\n item?.onUseChange?.(e)\n }}\n />\n )}\n <Text html={item.title} className=\"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]\" />\n </div>\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]\"\n >\n {item.description}\n </Text>\n {item.code && (\n <div className=\"mt-6 flex items-center gap-2\">\n <Text html={`${textConfig.couponCode}: ${item.code}`} className=\"text-base font-bold text-[#3D3D3F]\" />\n <button\n className=\"text-brand-0 text-base font-bold underline\"\n onClick={() => copyToClipboard(item.code ?? '')}\n >\n {isCopied ? couponCopy?.copied || textConfig.copied : couponCopy?.copy || textConfig.copyCode}\n </button>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${couponCopy?.days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || textConfig.expired\n )}\n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig> }) => {\n return (\n <div className={classNames('flex flex-col gap-3', className)}>\n {coupons?.map((item, index) => <CouponItem key={index} item={item} textConfig={textConfig} />)}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n isLogin,\n profile,\n variant,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const { trackingData, locale = 'us', copyWriting } = useAiuiContext()\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const productsBenefits = trackingData?.product?.support ?? {}\n const { thirdParty = {} } = trackingData?.common || {}\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: true,\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(mergedTextConfig.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: isLogin,\n title: replaceTemplate(mergedTextConfig.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {isLogin\n ? (memberDiscount?.config?.description ?? '')\n : (mergedTextConfig.memberBenefitsNotLogin.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {isLogin ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {mergedTextConfig.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n console.log('memberDiscount?.config?.amount', isLogin, openSignInPopup)\n if (isLogin) {\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 } else {\n openSignInPopup?.()\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: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385',\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: mergedTextConfig.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534',\n },\n }\n : null,\n bundle.enable\n ? {\n title: `${mergedTextConfig.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: mergedTextConfig.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534',\n },\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790',\n },\n }\n : null,\n creditsRedemption.enable\n ? {\n title: mergedTextConfig.creditsTitle,\n description: mergedTextConfig.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534',\n },\n }\n : null,\n ].filter(Boolean)\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n return (\n <ProductBenefitsTabs defaultValue={coupons?.length ? 'coupon' : 'membership'}>\n <ProductBenefitsTabs.List>\n {coupons?.length ? (\n <ProductBenefitsTabs.Trigger value=\"coupon\">\n {mergedTextConfig.yourBenefits}\n {(savingDetail.coupon || 0) > 0 && (\n <ProductBenefitsTabs.Badge>\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 {mergedTextConfig.off}\n </ProductBenefitsTabs.Badge>\n )}\n </ProductBenefitsTabs.Trigger>\n ) : null}\n <ProductBenefitsTabs.Trigger value=\"membership\">{mergedTextConfig.memberBenefits}</ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger value=\"installment\">{mergedTextConfig.installment}</ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .coupon-container::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .coupon-container::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .coupon-container::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .coupon-container::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content value=\"coupon\" className=\"\">\n <div className=\"coupon-container h-[240px] overflow-y-auto px-4\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n className=\"\"\n textConfig={mergedTextConfig}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n\n <ProductBenefitsTabs.Content value=\"membership\" className=\"\">\n <h3 className=\"mx-4 mb-2 text-left text-lg font-bold\">{mergedTextConfig.memberBenefits}</h3>\n <div className={`overflow-y-auto rounded-[16px] px-4 ${isLogin ? 'max-h-[240px]' : 'max-h-[160px]'}`}>\n <ul\n className={`list-none [&_li:first-child]:rounded-t-[16px] \n [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2\n [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4\n [&_li]:py-4 \n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {replaceTemplate(mergedTextConfig.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </li>\n )}\n {productsBenefits.items?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index}>\n <button\n onClick={() => openModal?.({ title: item.text, content: item.modalText })}\n key={index}\n className=\"flex\"\n >\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text className=\"text-left text-[16px] font-medium x:text-[14px]\">{item.text}</Text>\n </button>\n </li>\n ) : (\n <li key={index} className=\"flex\">\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {item.text}\n </Text>\n </li>\n )\n )}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {mergedTextConfig.expressShipping}\n </Text>\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\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=\"text-left text-[16px] font-medium x:text-[14px]\">\n {activated ? (\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 <>\n {mergedTextConfig.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {mergedTextConfig.active}\n </span>\n </>\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!isLogin && (\n <div className=\"px-4 pt-4\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content value=\"installment\" className=\"px-4\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {mergedTextConfig.flexibleInstallment}\n </Heading>\n <div className=\"overflow-hidden rounded-[16px] bg-white\">\n {renderAffirm}\n {renderKlarna}\n {renderPaypal && (\n <div className=\"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0\">{renderPaypal}</div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nexport default BenefitsTab\n"],
5
+ "mappings": "2jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAmHM,IAAAI,EAAA,6BAlHNC,EAAyD,8CACzDC,EAAgC,6CAChCC,EAAqC,0CACrCC,EAA4B,sCAC5BC,EAA4B,mCAC5BC,EAAgC,qCAChCC,EAAuB,yBACvBC,GAAkB,iBAClBC,EAA+B,6CAC/BC,EAAyB,mDACzBC,EAAoB,qCAgDpB,MAAMC,GAAqD,CACzD,WAAY,OACZ,SAAU,YACV,O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AAG,IAAI,UAAU,kDACpB,SAAAP,EAAiB,gBACpB,GACF,EACE,KAEHI,EAAkB,UACjB,QAAC,MACC,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,mBAAC,QACC,EAAE,+wBACF,KAAK,UACP,EACF,KACA,OAAC,QAAK,GAAG,IAAI,UAAU,kDACpB,SAAAH,EACCG,GAAmB,QAAQ,OAAO,QAChC,gBACA,eAAY,CACV,OAAQA,GAAmB,QAAQ,QAAU,EAC7C,aAAclB,EAAQ,MAAM,aAC5B,OAAAY,CACF,CAAC,CACH,KAEA,oBACG,UAAAE,EAAiB,0BAClB,OAAC,QAAK,KAAK,SAAS,SAAU,EAAG,QAAS,IAAMe,EAAe,EAAG,UAAU,YACzE,SAAAf,EAAiB,OACpB,GACF,EAEJ,GACF,EACE,MACN,EACF,EACC,CAAChB,MACA,OAAC,OAAI,UAAU,YACb,mBAAC,UAAO,QAAQ,UAAU,UAAU,SAAS,QAAS,IAAMY,IAAkB,EAC3E,SAAAG,GAAa,OAChB,EACF,GAEJ,KAEA,QAAC,EAAAiB,QAAoB,QAApB,CAA4B,MAAM,cAAc,UAAU,OACzD,oBAAC,WAAQ,KAAM,EAAG,UAAU,mCACzB,SAAAhB,EAAiB,oBACpB,KACA,QAAC,OAAI,UAAU,0CACZ,UAAAb,EACAC,EACAC,MACC,OAAC,OAAI,UAAU,+DAAgE,SAAAA,EAAa,GAEhG,GACF,GACF,EAjL+B,IAmLnC,EAEA,IAAOzC,GAAQmC",
6
+ "names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_BizProductProvider", "import_useBenefits", "import_utils", "import_textFormat", "import_classnames", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "defaultTextConfig", "CouponItem", "item", "textConfig", "trackingData", "isCopied", "copyToClipboard", "useCopy", "couponCopy", "days", "hours", "minutes", "seconds", "useCountDown", "openModal", "classNames", "e", "CouponContent", "coupons", "className", "index", "BenefitsTab", "isLogin", "profile", "variant", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "benefits", "locale", "copyWriting", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "productsBenefits", "thirdParty", "value", "couponSaving", "memberSaving", "handleActivate", "ProductBenefitsTabs"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of x(t))!L.call(e,i)&&i!==n&&f(e,i,{get:()=>t[i],enumerable:!(a=v(t,i))||a.enumerable});return e};var h=e=>P(f({},"__esModule",{value:!0}),e);var E={};C(E,{default:()=>y});module.exports=h(E);var s=require("react/jsx-runtime"),u=require("../../../../../../components/index.js"),c=require("react"),o=require("../../../../../../helpers/index.js"),r=require("@radix-ui/react-tabs");const g=(0,c.createContext)(void 0),N=()=>{const e=(0,c.useContext)(g);if(!e)throw new Error("ProductBenefitsTabs components must be used within ProductBenefitsTabs");return e},l=({defaultValue:e,value:t,onValueChange:n,children:a,className:i,...d})=>{const[B,m]=(0,c.useState)(e),T=t??B,b=p=>{t===void 0&&m(p),n?.(p)};return(0,s.jsx)(g.Provider,{value:{activeValue:T,setActiveValue:b},children:(0,s.jsx)("div",{id:"ipc-product-detail-benefits-tabs",className:(0,o.cn)("bg-[#EAEAEC] rounded-xl py-4",i),...d,children:(0,s.jsx)(r.Root,{value:T,onValueChange:b,children:a})})})},w=({children:e,className:t,...n})=>(0,s.jsx)(r.List,{className:(0,o.cn)("flex space-x-6 overflow-x-auto px-4",t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...n,children:e}),A=({value:e,children:t,className:n,...a})=>{const{activeValue:i}=N(),d=i===e;return(0,s.jsxs)(r.Trigger,{value:e,className:(0,o.cn)("text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]",n),...a,children:[(0,s.jsx)(u.Text,{className:(0,o.cn)("absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300",d&&"w-full")}),t]})},H=({children:e,className:t,...n})=>(0,s.jsx)(u.Text,{size:1,className:(0,o.cn)("font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-[#FF5900]",t),...n,children:e}),M=({value:e,children:t,className:n,...a})=>(0,s.jsx)(r.Content,{value:e,className:(0,o.cn)("mt-4",n),...a,children:t});l.displayName="ProductBenefitsTabs",l.List=w,l.Trigger=A,l.Badge=H,l.Content=M;var y=l;
1
+ "use strict";var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of x(t))!L.call(e,i)&&i!==n&&f(e,i,{get:()=>t[i],enumerable:!(a=v(t,i))||a.enumerable});return e};var h=e=>P(f({},"__esModule",{value:!0}),e);var E={};C(E,{default:()=>y});module.exports=h(E);var s=require("react/jsx-runtime"),u=require("../../../../../../components/index.js"),c=require("react"),o=require("../../../../../../helpers/index.js"),r=require("@radix-ui/react-tabs");const g=(0,c.createContext)(void 0),N=()=>{const e=(0,c.useContext)(g);if(!e)throw new Error("ProductBenefitsTabs components must be used within ProductBenefitsTabs");return e},l=({defaultValue:e,value:t,onValueChange:n,children:a,className:i,...d})=>{const[B,m]=(0,c.useState)(e),T=t??B,b=p=>{t===void 0&&m(p),n?.(p)};return(0,s.jsx)(g.Provider,{value:{activeValue:T,setActiveValue:b},children:(0,s.jsx)("div",{id:"ipc-product-detail-benefits-tabs",className:(0,o.cn)("bg-[#EAEAEC] rounded-xl py-4",i),...d,children:(0,s.jsx)(r.Root,{value:T,onValueChange:b,children:a})})})},w=({children:e,className:t,...n})=>(0,s.jsx)(r.List,{className:(0,o.cn)("flex space-x-6 overflow-x-auto px-4",t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...n,children:e}),A=({value:e,children:t,className:n,...a})=>{const{activeValue:i}=N(),d=i===e;return(0,s.jsxs)(r.Trigger,{value:e,className:(0,o.cn)("text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]",n),...a,children:[(0,s.jsx)(u.Text,{className:(0,o.cn)("absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300",d&&"w-full")}),t]})},H=({children:e,className:t,...n})=>(0,s.jsx)(u.Text,{size:1,className:(0,o.cn)("font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-brand",t),...n,children:e}),M=({value:e,children:t,className:n,...a})=>(0,s.jsx)(r.Content,{value:e,className:(0,o.cn)("mt-4",n),...a,children:t});l.displayName="ProductBenefitsTabs",l.List=w,l.Trigger=A,l.Badge=H,l.Content=M;var y=l;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.tsx"],
4
- "sourcesContent": ["import { Text } from '../../../../../../components/index.js'\nimport { createContext, useContext, useState, type ReactNode, type HTMLAttributes } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\n\n\n// Context for sharing state between components\ninterface BenefitsTabsContextType {\n activeValue: string | undefined\n setActiveValue: (value: string) => void\n}\n\nconst BenefitsTabsContext = createContext<BenefitsTabsContextType | undefined>(undefined)\n\nconst useBenefitsTabsContext = () => {\n const context = useContext(BenefitsTabsContext)\n if (!context) {\n throw new Error('ProductBenefitsTabs components must be used within ProductBenefitsTabs')\n }\n return context\n}\n\n// Main container component\ninterface BenefitsTabsProps extends HTMLAttributes<HTMLDivElement> {\n defaultValue?: string\n value?: string\n onValueChange?: (value: string) => void\n children: ReactNode\n}\n\nconst ProductBenefitsTabs = ({ \n defaultValue, \n value, \n onValueChange, \n children, \n className,\n ...props \n}: BenefitsTabsProps) => {\n const [internalValue, setInternalValue] = useState(defaultValue)\n \n const activeValue = value ?? internalValue\n const setActiveValue = (newValue: string) => {\n if (value === undefined) {\n setInternalValue(newValue)\n }\n onValueChange?.(newValue)\n }\n\n return (\n <BenefitsTabsContext.Provider value={{ activeValue, setActiveValue }}>\n <div \n id=\"ipc-product-detail-benefits-tabs\" \n className={cn(\"bg-[#EAEAEC] rounded-xl py-4\", className)}\n {...props}\n >\n <Root value={activeValue} onValueChange={setActiveValue}>\n {children}\n </Root>\n </div>\n </BenefitsTabsContext.Provider>\n )\n}\n\n// List component for triggers\ninterface BenefitsTabsListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsList = ({ children, className, ...props }: BenefitsTabsListProps) => {\n return (\n <List\n className={cn(\"flex space-x-6 overflow-x-auto px-4\", className)}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n >\n {children}\n </List>\n )\n}\n\n// Trigger component\ninterface BenefitsTabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsTrigger = ({ value, children, className, ...props }: BenefitsTabsTriggerProps) => {\n const { activeValue } = useBenefitsTabsContext()\n const isActive = activeValue === value\n\n return (\n <Trigger\n value={value}\n className={cn(\n 'text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]',\n className\n )}\n {...props}\n >\n <Text\n className={cn(\n 'absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300',\n isActive && 'w-full'\n )}\n />\n {children}\n </Trigger>\n )\n}\n\n// Badge component for trigger\ninterface BenefitsTabsBadgeProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsBadge = ({ children, className, ...props }: BenefitsTabsBadgeProps) => {\n return (\n <Text\n size={1}\n className={cn(\n \"font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-[#FF5900]\",\n className\n )}\n {...props}\n >\n {children}\n </Text>\n )\n}\n\n// Content component\ninterface BenefitsTabsContentProps extends HTMLAttributes<HTMLDivElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsContent = ({ value, children, className, ...props }: BenefitsTabsContentProps) => {\n return (\n <Content \n value={value} \n className={cn(\"mt-4\", className)}\n {...props}\n >\n {children}\n </Content>\n )\n}\n\n\nProductBenefitsTabs.displayName = 'ProductBenefitsTabs'\n\n// Attach sub-components to main component\nProductBenefitsTabs.List = BenefitsTabsList\nProductBenefitsTabs.Trigger = BenefitsTabsTrigger\nProductBenefitsTabs.Badge = BenefitsTabsBadge\nProductBenefitsTabs.Content = BenefitsTabsContent\n\nexport default ProductBenefitsTabs\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuDQ,IAAAI,EAAA,6BAvDRC,EAAqB,iDACrBC,EAAyF,iBACzFC,EAAmB,8CACnBC,EAA6C,gCAS7C,MAAMC,KAAsB,iBAAmD,MAAS,EAElFC,EAAyB,IAAM,CACnC,MAAMC,KAAU,cAAWF,CAAmB,EAC9C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,wEAAwE,EAE1F,OAAOA,CACT,EAUMC,EAAsB,CAAC,CAC3B,aAAAC,EACA,MAAAC,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IAAyB,CACvB,KAAM,CAACC,EAAeC,CAAgB,KAAI,YAASP,CAAY,EAEzDQ,EAAcP,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QAAUgB,EAE9B,IAAO1B,EAAQU",
4
+ "sourcesContent": ["import { Text } from '../../../../../../components/index.js'\nimport { createContext, useContext, useState, type ReactNode, type HTMLAttributes, useEffect } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\n\n\n// Context for sharing state between components\ninterface BenefitsTabsContextType {\n activeValue: string | undefined\n setActiveValue: (value: string) => void\n}\n\nconst BenefitsTabsContext = createContext<BenefitsTabsContextType | undefined>(undefined)\n\nconst useBenefitsTabsContext = () => {\n const context = useContext(BenefitsTabsContext)\n if (!context) {\n throw new Error('ProductBenefitsTabs components must be used within ProductBenefitsTabs')\n }\n return context\n}\n\n// Main container component\ninterface BenefitsTabsProps extends HTMLAttributes<HTMLDivElement> {\n defaultValue?: string\n value?: string\n onValueChange?: (value: string) => void\n children: ReactNode\n}\n\nconst ProductBenefitsTabs = ({ \n defaultValue, \n value, \n onValueChange, \n children, \n className,\n ...props \n}: BenefitsTabsProps) => {\n const [internalValue, setInternalValue] = useState(defaultValue)\n \n const activeValue = value ?? internalValue\n const setActiveValue = (newValue: string) => {\n if (value === undefined) {\n setInternalValue(newValue)\n }\n onValueChange?.(newValue)\n }\n\n return (\n <BenefitsTabsContext.Provider value={{ activeValue, setActiveValue }}>\n <div \n id=\"ipc-product-detail-benefits-tabs\" \n className={cn(\"bg-[#EAEAEC] rounded-xl py-4\", className)}\n {...props}\n >\n <Root value={activeValue} onValueChange={setActiveValue}>\n {children}\n </Root>\n </div>\n </BenefitsTabsContext.Provider>\n )\n}\n\n// List component for triggers\ninterface BenefitsTabsListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsList = ({ children, className, ...props }: BenefitsTabsListProps) => {\n return (\n <List\n className={cn(\"flex space-x-6 overflow-x-auto px-4\", className)}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n >\n {children}\n </List>\n )\n}\n\n// Trigger component\ninterface BenefitsTabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsTrigger = ({ value, children, className, ...props }: BenefitsTabsTriggerProps) => {\n const { activeValue } = useBenefitsTabsContext()\n const isActive = activeValue === value\n\n return (\n <Trigger\n value={value}\n className={cn(\n 'text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]',\n className\n )}\n {...props}\n >\n <Text\n className={cn(\n 'absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300',\n isActive && 'w-full'\n )}\n />\n {children}\n </Trigger>\n )\n}\n\n// Badge component for trigger\ninterface BenefitsTabsBadgeProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsBadge = ({ children, className, ...props }: BenefitsTabsBadgeProps) => {\n return (\n <Text\n size={1}\n className={cn(\n \"font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-brand\",\n className\n )}\n {...props}\n >\n {children}\n </Text>\n )\n}\n\n// Content component\ninterface BenefitsTabsContentProps extends HTMLAttributes<HTMLDivElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsContent = ({ value, children, className, ...props }: BenefitsTabsContentProps) => {\n return (\n <Content \n value={value} \n className={cn(\"mt-4\", className)}\n {...props}\n >\n {children}\n </Content>\n )\n}\n\n\nProductBenefitsTabs.displayName = 'ProductBenefitsTabs'\n\n// Attach sub-components to main component\nProductBenefitsTabs.List = BenefitsTabsList\nProductBenefitsTabs.Trigger = BenefitsTabsTrigger\nProductBenefitsTabs.Badge = BenefitsTabsBadge\nProductBenefitsTabs.Content = BenefitsTabsContent\n\nexport default ProductBenefitsTabs\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuDQ,IAAAI,EAAA,6BAvDRC,EAAqB,iDACrBC,EAAoG,iBACpGC,EAAmB,8CACnBC,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KAAM,EACN,aAAW,MACT,+EACAD,CACF,EACC,GAAGC,EAEH,SAAAF,EACH,EAUEY,EAAsB,CAAC,CAAE,MAAAd,EAAO,SAAAE,EAAU,UAAAC,EAAW,GAAGC,CAAM,OAEhE,OAAC,WACC,MAAOJ,EACP,aAAW,MAAG,OAAQG,CAAS,EAC9B,GAAGC,EAEH,SAAAF,EACH,EAKJJ,EAAoB,YAAc,sBAGlCA,EAAoB,KAAOY,EAC3BZ,EAAoB,QAAUa,EAC9Bb,EAAoB,MAAQe,EAC5Bf,EAAoB,QAAUgB,EAE9B,IAAO1B,EAAQU",
6
6
  "names": ["ProductBenefitsTabs_exports", "__export", "ProductBenefitsTabs_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "import_helpers", "import_react_tabs", "BenefitsTabsContext", "useBenefitsTabsContext", "context", "ProductBenefitsTabs", "defaultValue", "value", "onValueChange", "children", "className", "props", "internalValue", "setInternalValue", "activeValue", "setActiveValue", "newValue", "BenefitsTabsList", "BenefitsTabsTrigger", "isActive", "BenefitsTabsBadge", "BenefitsTabsContent"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var P=(r,i)=>{for(var l in i)n(r,l,{get:i[l],enumerable:!0})},L=(r,i,l,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of B(i))!b.call(r,a)&&a!==l&&n(r,a,{get:()=>i[a],enumerable:!(d=N(i,a))||d.enumerable});return r};var z=r=>L(n({},"__esModule",{value:!0}),r);var F={};P(F,{default:()=>E});module.exports=z(F);var t=require("react/jsx-runtime"),s=require("../../../../../../components"),f=require("../../../../../../helpers/index.js"),x=require("../../../../../AiuiProvider"),v=require("../../../../ProductProvider"),p=require("../../../../utils");const w=()=>{const{locale:r="us"}=(0,x.useAiuiContext)(),{variant:i,bundle:l,checkedBundle:d,setCheckedBundle:a,setCheckedGift:h,setJoinedRecommendBuyProducts:m,joinedRecommendBuyProducts:j}=(0,v.useProductContext)(),{title:k,bundleList:y,showAtListing:g}=l||{},u=y?.filter(e=>e.variants.slice(1,e.variants.length).every(c=>c.variant.availableForSale));if(!u?.length&&g)return null;const C=e=>{d?.id===e.id?(a?.(void 0),m?.({bundle:void 0})):(h?.(void 0),a?.(e),m?.({bundle:e}))};return(0,t.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,t.jsx)(s.Text,{size:3,className:"font-bold",html:k}),u?.map(e=>{const c=e.variants.filter(o=>o.variant.sku!==i.sku);return(0,t.jsx)("div",{className:"flex flex-col gap-4 mt-3 desktop:mt-4",children:(0,t.jsxs)("div",{className:(0,f.cn)("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border",{"border-brand outline outline-1 outline-brand":d?.id===e.id}),children:[(0,t.jsx)(s.Checkbox,{onCheckedChange:()=>C(e),size:"lg",id:e.id,value:e.id,checked:d?.id===e.id}),(0,t.jsx)("label",{htmlFor:e.id,className:"size-full cursor-pointer",children:c?.map(o=>(0,t.jsxs)("div",{className:"flex justify-between items-center gap-6 ",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Picture,{source:o?.variant?.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(s.Text,{className:"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold",html:o.variant.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0",children:[(0,t.jsx)(s.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:(0,p.formatPrice)({amount:o.price,locale:r,currencyCode:o.variant.price.currencyCode})}),o.price<o.variant.price.amount&&(0,t.jsx)(s.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:o.variant.price.amount,locale:r,currencyCode:o.variant.price.currencyCode})})]})]},o.variant.id))})]})},e.id)})]})};var E=w;
1
+ "use strict";var n=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var P=(r,i)=>{for(var l in i)n(r,l,{get:i[l],enumerable:!0})},z=(r,i,l,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of B(i))!b.call(r,a)&&a!==l&&n(r,a,{get:()=>i[a],enumerable:!(d=N(i,a))||d.enumerable});return r};var L=r=>z(n({},"__esModule",{value:!0}),r);var F={};P(F,{default:()=>E});module.exports=L(F);var t=require("react/jsx-runtime"),s=require("../../../../../../components"),f=require("../../../../../../helpers/index.js"),x=require("../../../../../AiuiProvider"),v=require("../../../../BizProductProvider.js"),p=require("../../../../utils");const w=()=>{const{locale:r="us"}=(0,x.useAiuiContext)(),{variant:i,bundle:l,checkedBundle:d,setCheckedBundle:a,setCheckedGift:h,setJoinedRecommendBuyProducts:m,joinedRecommendBuyProducts:j}=(0,v.useBizProductContext)(),{title:k,bundleList:y,showAtListing:g}=l||{},u=y?.filter(e=>e.variants.slice(1,e.variants.length).every(c=>c.variant.availableForSale));if(!u?.length&&g)return null;const C=e=>{d?.id===e.id?(a?.(void 0),m?.({bundle:void 0})):(h?.(void 0),a?.(e),m?.({bundle:e}))};return(0,t.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,t.jsx)(s.Text,{size:3,className:"font-bold",html:k}),u?.map(e=>{const c=e.variants.filter(o=>o.variant.sku!==i.sku);return(0,t.jsx)("div",{className:"flex flex-col gap-4 mt-3 desktop:mt-4",children:(0,t.jsxs)("div",{className:(0,f.cn)("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border",{"border-brand outline outline-1 outline-brand":d?.id===e.id}),children:[(0,t.jsx)(s.Checkbox,{onCheckedChange:()=>C(e),size:"lg",id:e.id,value:e.id,checked:d?.id===e.id}),(0,t.jsx)("label",{htmlFor:e.id,className:"size-full cursor-pointer",children:c?.map(o=>(0,t.jsxs)("div",{className:"flex justify-between items-center gap-6 ",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Picture,{source:o?.variant?.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(s.Text,{className:"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold",html:o.variant.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0",children:[(0,t.jsx)(s.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:(0,p.formatPrice)({amount:o.price,locale:r,currencyCode:o.variant.price.currencyCode})}),o.price<o.variant.price.amount&&(0,t.jsx)(s.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:o.variant.price.amount,locale:r,currencyCode:o.variant.price.currencyCode})})]})]},o.variant.id))})]})},e.id)})]})};var E=w;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Button, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport { useProductContext } from '../../../../ProductProvider'\nimport { formatPrice } from '../../../../utils'\nimport type { BundleListItem } from '../../../../types/product'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({ bundle: undefined })\n } else {\n setCheckedGift?.(undefined)\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({ bundle: bundleItem })\n }\n }\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text size={3} className=\"font-bold\" html={title} />\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id} className=\"flex flex-col gap-4 mt-3 desktop:mt-4\">\n <div\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border',\n {\n ['border-brand outline outline-1 outline-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full cursor-pointer\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex justify-between items-center gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n <div className=\"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0\">\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price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ACjF,CACF,EAEA,oBAAC,YACC,gBAAiB,IAAMW,EAAqBX,CAAM,EAClD,KAAK,KACL,GAAIA,EAAO,GACX,MAAOA,EAAO,GACd,QAASC,GAAe,KAAOD,EAAO,GACxC,KACA,OAAC,SAAM,QAASA,EAAO,GAAI,UAAU,2BAClC,SAAAa,GAAgB,IAAIC,MAEjB,QAAC,OAAI,UAAU,2CACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,GAAe,SAAS,OAAO,IAAK,UAAU,wBAAwB,KACvF,OAAC,QACC,UAAU,8EACV,KAAMA,EAAc,QAAQ,QAAQ,MACtC,GACF,KACA,QAAC,OAAI,UAAU,yEACb,oBAAC,QACC,UAAU,0DACV,QAAM,eAAY,CAChB,OAAQA,EAAc,MACtB,OAAAhB,EACA,aAAcgB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,EACCA,EAAc,MAAQA,EAAc,QAAQ,MAAM,WACjD,OAAC,QACC,UAAU,sFACV,QAAM,eAAY,CAChB,OAAQA,EAAc,QAAQ,MAAM,OACpC,OAAAhB,EACA,aAAcgB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,GAEJ,IA3B6DA,EAAc,QAAQ,EA4BrF,CAEH,EACH,GACF,GAnDQd,EAAO,EAoDjB,CAEJ,CAAC,GACH,CAEJ,EAEA,IAAOX,EAAQQ",
6
- "names": ["ProductBundle_exports", "__export", "ProductBundle_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_AiuiProvider", "import_ProductProvider", "import_utils", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "bundleVariants", "bundleVariant"]
4
+ "sourcesContent": ["import { Text, Picture, Button, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport type { BundleListItem } from '../../../../types/product'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({ bundle: undefined })\n } else {\n setCheckedGift?.(undefined)\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({ bundle: bundleItem })\n }\n }\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text size={3} className=\"font-bold\" html={title} />\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id} className=\"flex flex-col gap-4 mt-3 desktop:mt-4\">\n <div\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border',\n {\n ['border-brand outline outline-1 outline-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full cursor-pointer\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex justify-between items-center gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n <div className=\"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0\">\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>\n )\n })}\n </label>\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nexport default ProductBundle\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwCM,IAAAI,EAAA,6BAxCNC,EAAgD,wCAChDC,EAAmB,8CACnBC,EAA+B,uCAC/BC,EAAqC,6CACrCC,EAA4B,6BAG5B,MAAMC,EAAgB,IAAM,CAC1B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,QAAAC,EACA,OAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,8BAAAC,EACA,2BAAAC,CACF,KAAI,wBAAqB,EAEnB,CAAE,MAAAC,EAAO,WAAAC,EAAY,cAAAC,CAAc,EAAIR,GAAU,CAAC,EAElDS,EAAsBF,GAAY,OAAOP,GAC7CA,EAAO,SAAS,MAAM,EAAGA,EAAO,SAAS,MAAM,EAAE,MAAMU,GAAKA,EAAE,QAAQ,gBAAgB,CACxF,EAEA,GAAI,CAACD,GAAqB,QAAUD,EAAe,OAAO,KAE1D,MAAMG,EAAwBC,GAA+B,CACvDX,GAAe,KAAOW,EAAW,IACnCV,IAAmB,MAAS,EAC5BE,IAAgC,CA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EJ,EAEA,IAAOX,EAAQQ",
6
+ "names": ["ProductBundle_exports", "__export", "ProductBundle_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_AiuiProvider", "import_BizProductProvider", "import_utils", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "bundleVariants", "bundleVariant"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var P=(l,o)=>{for(var i in o)s(l,i,{get:o[i],enumerable:!0})},G=(l,o,i,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of N(o))!y.call(l,r)&&r!==i&&s(l,r,{get:()=>o[r],enumerable:!(a=v(o,r))||a.enumerable});return l};var g=l=>G(s({},"__esModule",{value:!0}),l);var w={};P(w,{default:()=>R});module.exports=g(w);var t=require("react/jsx-runtime"),d=require("../../../../../../components"),p=require("../../../../../../helpers/index.js"),u=require("react"),f=require("../../../../ProductProvider"),x=require("../../../../utils"),b=require("../../../../../AiuiProvider");const B=()=>{const{locale:l="us"}=(0,b.useAiuiContext)(),{freeGift:o,checkedGift:i,setCheckedGift:a,setCheckedBundle:r,setJoinedRecommendBuyProducts:c,joinedRecommendBuyProducts:z}=(0,f.useProductContext)(),{title:h,giftList:n=[],freeLabel:k}=o||{},m=(0,u.useMemo)(()=>n?.filter(e=>e.availableForSale),[n]),C=e=>{i?.id===e.id?(a?.(void 0),c?.({gift:void 0})):(r?.(void 0),a?.(e),c?.({gift:e}))};return m?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(d.Text,{size:3,className:"font-bold",html:h}),(0,t.jsx)("div",{className:"mt-3 flex flex-col gap-4 desktop:mt-4",children:m.map(e=>(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":i?.id===e.id}),children:[(0,t.jsx)(d.Checkbox,{onCheckedChange:()=>C(e),size:"lg",id:e.id,checked:i?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex justify-between items-center gap-4 laptop:gap-0 w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Picture,{source:e.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(d.Text,{className:"text-sm laptop:text-[16px] desktop:text-[18px] font-bold",html:e.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 tablet:flex-row flex-col shrink-0",children:[(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:k}),(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through",html:(0,x.formatPrice)({amount:e.price.amount,locale:l,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var R=B;
1
+ "use strict";var s=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var P=(l,o)=>{for(var i in o)s(l,i,{get:o[i],enumerable:!0})},G=(l,o,i,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of N(o))!y.call(l,r)&&r!==i&&s(l,r,{get:()=>o[r],enumerable:!(a=v(o,r))||a.enumerable});return l};var g=l=>G(s({},"__esModule",{value:!0}),l);var R={};P(R,{default:()=>z});module.exports=g(R);var t=require("react/jsx-runtime"),d=require("../../../../../../components"),p=require("../../../../../../helpers/index.js"),u=require("react"),f=require("../../../../BizProductProvider.js"),x=require("../../../../utils"),b=require("../../../../../AiuiProvider");const B=()=>{const{locale:l="us"}=(0,b.useAiuiContext)(),{freeGift:o,checkedGift:i,setCheckedGift:a,setCheckedBundle:r,setJoinedRecommendBuyProducts:c,joinedRecommendBuyProducts:w}=(0,f.useBizProductContext)(),{title:h,giftList:n=[],freeLabel:k}=o||{},m=(0,u.useMemo)(()=>n?.filter(e=>e.availableForSale),[n]),C=e=>{i?.id===e.id?(a?.(void 0),c?.({gift:void 0})):(r?.(void 0),a?.(e),c?.({gift:e}))};return m?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(d.Text,{size:3,className:"font-bold",html:h}),(0,t.jsx)("div",{className:"mt-3 flex flex-col gap-4 desktop:mt-4",children:m.map(e=>(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":i?.id===e.id}),children:[(0,t.jsx)(d.Checkbox,{onCheckedChange:()=>C(e),size:"lg",id:e.id,checked:i?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex justify-between items-center gap-4 laptop:gap-0 w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Picture,{source:e.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(d.Text,{className:"text-sm laptop:text-[16px] desktop:text-[18px] font-bold",html:e.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 tablet:flex-row flex-col shrink-0",children:[(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:k}),(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through",html:(0,x.formatPrice)({amount:e.price.amount,locale:l,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var z=B;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useProductContext } from '../../../../ProductProvider'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant } from '../../../../types/product'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, checkedGift, setCheckedGift, setCheckedBundle, setJoinedRecommendBuyProducts, joinedRecommendBuyProducts } = useProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({ gift: undefined })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({ gift: value })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"mt-3 flex flex-col gap-4 desktop:mt-4\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label htmlFor={gift.id} className=\"flex justify-between items-center gap-4 laptop:gap-0 w-full\">\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text className=\"text-sm laptop:text-[16px] desktop:text-[18px] font-bold\" html={gift.product.title} />\n </div>\n <div className=\"flex items-center gap-1 tablet:flex-row flex-col shrink-0\">\n <Text className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ProductFreeGift\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6BM,IAAAI,EAAA,6BA7BNC,EAA4E,wCAC5EC,EAAmB,8CACnBC,EAAwB,iBACxBC,EAAkC,uCAClCC,EAA4B,6BAC5BC,EAA+B,uCAG/B,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,SAAAC,EAAU,YAAAC,EAAa,eAAAC,EAAgB,iBAAAC,EAAkB,8BAAAC,EAA+B,2BAAAC,CAA2B,KAAI,qBAAkB,EAC3I,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIR,GAAY,CAAC,EACnDS,KAAiB,WAAQ,IAAMF,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDX,GAAa,KAAOW,EAAM,IAC5BV,IAAiB,MAAS,EAC1BE,IAAgC,CAAE,KAAM,MAAU,CAAC,IAEnDD,IAAmB,MAAS,EAC5BD,IAAiBU,CAAK,EACtBR,IAAgC,CAAE,KAAMQ,CAAM,CAAC,EAEnD,EAEA,OAAKH,GAAgB,UAGnB,QAAC,OAAI,UAAU,+BACb,oBAAC,QAAK,KAAM,EAAG,UAAU,YAAY,KAAMH,EAAO,KAClD,OAAC,OAAI,UAAU,wCACZ,SAAAG,EAAe,IAAII,MAClB,QAAC,OAEC,aAAW,MACT,8FACA,CACG,eAAiBZ,GAAa,KAAOY,EAAK,EAC7C,CACF,EAEA,oBAAC,YACC,gBAAiB,IAAMF,EAAoBE,CAAI,EAC/C,KAAK,KACL,GAAIA,EAAK,GACT,QAASZ,GAAa,KAAOY,EAAK,GAClC,MAAOA,EAAK,GACb,KACD,QAAC,SAAM,QAASA,EAAK,GAAI,UAAU,8DACjC,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,wBAAwB,KACpE,OAAC,QAAK,UAAU,2DAA2D,KAAMA,EAAK,QAAQ,MAAO,GACvG,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QAAK,UAAU,0DAA0D,KAAML,EAAW,KAC3F,OAAC,QACC,UAAU,uEACV,QAAM,eAAY,CAChB,OAAQK,EAAK,MAAM,OACnB,OAAAd,EACA,aAAcc,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA/BKA,EAAK,EAgCZ,CACD,EACH,GACF,EA3CkC,IA6CtC,EAEA,IAAOxB,EAAQS",
6
- "names": ["ProductFreeGift_exports", "__export", "ProductFreeGift_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_ProductProvider", "import_utils", "import_AiuiProvider", "ProductFreeGift", "locale", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "gift"]
4
+ "sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant } from '../../../../types/product'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, checkedGift, setCheckedGift, setCheckedBundle, setJoinedRecommendBuyProducts, joinedRecommendBuyProducts } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({ gift: undefined })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({ gift: value })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"mt-3 flex flex-col gap-4 desktop:mt-4\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label htmlFor={gift.id} className=\"flex justify-between items-center gap-4 laptop:gap-0 w-full\">\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text className=\"text-sm laptop:text-[16px] desktop:text-[18px] font-bold\" html={gift.product.title} />\n </div>\n <div className=\"flex items-center gap-1 tablet:flex-row flex-col shrink-0\">\n <Text className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ProductFreeGift\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6BM,IAAAI,EAAA,6BA7BNC,EAA4E,wCAC5EC,EAAmB,8CACnBC,EAAwB,iBACxBC,EA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,EAAW,KAC3F,OAAC,QACC,UAAU,uEACV,QAAM,eAAY,CAChB,OAAQK,EAAK,MAAM,OACnB,OAAAd,EACA,aAAcc,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA/BKA,EAAK,EAgCZ,CACD,EACH,GACF,EA3CkC,IA6CtC,EAEA,IAAOxB,EAAQS",
6
+ "names": ["ProductFreeGift_exports", "__export", "ProductFreeGift_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_utils", "import_AiuiProvider", "ProductFreeGift", "locale", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "gift"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var p in o)u(e,p,{get:o[p],enumerable:!0})},N=(e,o,p,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of k(o))!w.call(e,n)&&n!==p&&u(e,n,{get:()=>o[n],enumerable:!(c=b(o,n))||c.enumerable});return e};var C=e=>N(u({},"__esModule",{value:!0}),e);var L={};y(L,{default:()=>H});module.exports=C(L);var t=require("react/jsx-runtime"),s=require("../../../../../../components"),d=require("@radix-ui/react-tabs"),a=require("react"),g=require("../../../../../../helpers"),v=require("../../../../ProductProvider");const D=()=>{const{product:e,variant:o,isMobile:p}=(0,v.useProductContext)(),[c,n]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>{const r=o.metafields?.component?.ksp||e.metafields?.component?.ksp;return(p?r?.mobileList:r?.list)?.filter(h=>!!h?.text)},[o.metafields?.component?.ksp,p]),[l,f]=(0,a.useState)(m?.[0]),i=(0,a.useMemo)(()=>e?.payload?.components?.find(r=>r.componentKey==="ProductHighlight")?.data||{},[e?.payload]);return m?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-highlight",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[i?.title&&(0,t.jsx)(s.Text,{size:3,className:"font-bold",html:i?.title}),(0,t.jsxs)(s.Dialog,{open:c,onOpenChange:n,children:[(0,t.jsx)(s.DialogTrigger,{asChild:!0,children:(0,t.jsx)(s.Button,{variant:"link",className:"font-bold !p-0 text-base",children:i?.view})}),(0,t.jsx)(T,{ksp:m,clickActiveKspItem:l})]})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-4 mt-3 desktop:mt-4",children:m.map(r=>(0,t.jsx)("div",{className:"px-4 py-2 lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]",children:(0,t.jsx)(s.Text,{size:3,onClick:()=>{f(r),n(!0)},className:"font-bold cursor-pointer text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden",html:r?.text},r?.text)}))})]}):null},T=({ksp:e,clickActiveKspItem:o})=>{const p=(0,a.useRef)([]),c=(0,a.useRef)(null),[n,m]=(0,a.useState)(null);return(0,a.useEffect)(()=>{o&&(m(o),setTimeout(()=>{const l=e.findIndex(i=>i.text===o?.text),f=p.current[l];if(f&&c.current){const i=c.current,r=f,x=r.offsetLeft-i.offsetWidth/2+r.offsetWidth/2;i.scrollTo({left:x,behavior:"smooth"})}},100))},[o,e]),(0,t.jsx)(s.DialogContent,{overlayClassName:"z-[70]",className:"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0",children:(0,t.jsxs)(d.Root,{defaultValue:n?.text,className:"w-full overflow-hidden",children:[e.map(l=>(0,t.jsx)(d.Content,{value:l.text,children:(0,t.jsx)(s.Picture,{source:l.img,className:"w-full h-[304px] desktop:h-[480px]",alt:l.img.alt,imgClassName:"object-cover h-full"})},l.text)),(0,t.jsx)("div",{className:"py-4 desktop:py-6 w-full overflow-visible",children:(0,t.jsxs)("div",{ref:c,className:"px-4 desktop:px-6 overflow-x-auto",children:[(0,t.jsx)("div",{className:"w-fit rounded-full bg-[#EAEAEC]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,t.jsx)(d.List,{className:"flex p-1 w-max",children:e.map((l,f)=>(0,t.jsx)(d.Trigger,{ref:i=>{i&&(p.current[f]=i)},className:(0,g.cn)("lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]",l.text===n?.text&&"bg-white"),onClick:()=>{m(l)},value:l.text,children:(0,t.jsx)(s.Text,{html:l.text,className:"font-bold text-[14px] leading-tight"})},f))})}),(0,t.jsx)("div",{className:"mt-4",children:e.map(l=>(0,t.jsx)(d.Content,{value:l.label,className:"font-bold text-base desktop:text-[18px]",children:l.description}))})]})})]})})};var H=D;
1
+ "use strict";var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var p in o)u(e,p,{get:o[p],enumerable:!0})},N=(e,o,p,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of k(o))!w.call(e,n)&&n!==p&&u(e,n,{get:()=>o[n],enumerable:!(c=b(o,n))||c.enumerable});return e};var C=e=>N(u({},"__esModule",{value:!0}),e);var H={};y(H,{default:()=>T});module.exports=C(H);var t=require("react/jsx-runtime"),s=require("../../../../../../components"),d=require("@radix-ui/react-tabs"),a=require("react"),g=require("../../../../../../helpers"),v=require("../../../../BizProductProvider.js");const D=()=>{const{product:e,variant:o,isMobile:p}=(0,v.useBizProductContext)(),[c,n]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>{const r=o.metafields?.component?.ksp||e.metafields?.component?.ksp;return(p?r?.mobileList:r?.list)?.filter(h=>!!h?.text)},[o.metafields?.component?.ksp,p]),[l,f]=(0,a.useState)(m?.[0]),i=(0,a.useMemo)(()=>e?.payload?.components?.find(r=>r.componentKey==="ProductHighlight")?.data||{},[e?.payload]);return m?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-highlight",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[i?.title&&(0,t.jsx)(s.Text,{size:3,className:"font-bold",html:i?.title}),(0,t.jsxs)(s.Dialog,{open:c,onOpenChange:n,children:[(0,t.jsx)(s.DialogTrigger,{asChild:!0,children:(0,t.jsx)(s.Button,{variant:"link",className:"font-bold !p-0 text-base",children:i?.view})}),(0,t.jsx)(E,{ksp:m,clickActiveKspItem:l})]})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-4 mt-3 desktop:mt-4",children:m.map(r=>(0,t.jsx)("div",{className:"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]",children:(0,t.jsx)(s.Text,{size:3,onClick:()=>{f(r),n(!0)},className:"font-bold text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden",html:r?.text},r?.text)}))})]}):null},E=({ksp:e,clickActiveKspItem:o})=>{const p=(0,a.useRef)([]),c=(0,a.useRef)(null),[n,m]=(0,a.useState)(null);return(0,a.useEffect)(()=>{o&&(m(o),setTimeout(()=>{const l=e.findIndex(i=>i.text===o?.text),f=p.current[l];if(f&&c.current){const i=c.current,r=f,x=r.offsetLeft-i.offsetWidth/2+r.offsetWidth/2;i.scrollTo({left:x,behavior:"smooth"})}},100))},[o,e]),(0,t.jsx)(s.DialogContent,{overlayClassName:"z-[70]",className:"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0",children:(0,t.jsxs)(d.Root,{defaultValue:n?.text,className:"w-full overflow-hidden",children:[e.map(l=>(0,t.jsx)(d.Content,{value:l.text,children:(0,t.jsx)(s.Picture,{source:l.img,className:"w-full h-[304px] desktop:h-[480px]",alt:l.img.alt,imgClassName:"object-cover h-full"})},l.text)),(0,t.jsx)("div",{className:"py-4 desktop:py-6 w-full overflow-visible",children:(0,t.jsxs)("div",{ref:c,className:"px-4 desktop:px-6 overflow-x-auto",children:[(0,t.jsx)("div",{className:"w-fit rounded-full bg-[#EAEAEC]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,t.jsx)(d.List,{className:"flex p-1 w-max",children:e.map((l,f)=>(0,t.jsx)(d.Trigger,{ref:i=>{i&&(p.current[f]=i)},className:(0,g.cn)("lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]",l.text===n?.text&&"bg-white"),onClick:()=>{m(l)},value:l.text,children:(0,t.jsx)(s.Text,{html:l.text,className:"font-bold text-[14px] leading-tight"})},f))})}),(0,t.jsx)("div",{className:"mt-4",children:e.map(l=>(0,t.jsx)(d.Content,{value:l.label,className:"font-bold text-base desktop:text-[18px]",children:l.description}))})]})})]})})};var T=D;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.tsx"],
4
- "sourcesContent": ["import type { HighlightProps } from '../types'\nimport { Text, Picture, Button, Heading, Dialog, DialogContent, DialogTrigger } from '../../../../../../components'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers'\nimport { useProductContext } from '../../../../ProductProvider'\n\nconst ProductHighlight = () => {\n const { product, variant, isMobile } = useProductContext()\n const [open, setOpen] = useState(false)\n\n const ksp = useMemo(() => {\n const ksp_value = variant.metafields?.component?.ksp || product.metafields?.component?.ksp\n const result = isMobile ? ksp_value?.mobileList : ksp_value?.list\n return result?.filter((item: any) => !!item?.text)\n }, [variant.metafields?.component?.ksp, isMobile])\n\n const [activeKspItem, setActiveKspItem] = useState(ksp?.[0])\n\n const ProductHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n if (!ksp?.length) return null\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {ProductHighlightData?.title && <Text size={3} className=\"font-bold\" html={ProductHighlightData?.title} />}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"font-bold !p-0 text-base\">\n {ProductHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal ksp={ksp} clickActiveKspItem={activeKspItem} />\n </Dialog>\n </div>\n <div className=\"flex flex-wrap gap-4 mt-3 desktop:mt-4\">\n {ksp.map((item: any) => (\n <div className=\"px-4 py-2 lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]\">\n <Text\n size={3}\n key={item?.text}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n }}\n className=\"font-bold cursor-pointer text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden\"\n html={item?.text}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({ ksp, clickActiveKspItem }: { ksp: any[]; clickActiveKspItem: any }) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n const curIndex = ksp.findIndex(item => item.text === clickActiveKspItem?.text)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, 100)\n }, [clickActiveKspItem, ksp])\n\n return (\n <DialogContent\n overlayClassName=\"z-[70]\"\n className=\"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0\"\n >\n <Root defaultValue={activeKspItem?.text} className=\"w-full overflow-hidden\">\n {ksp.map(item => (\n <Content value={item.text} key={item.text}>\n <Picture\n source={item.img}\n className=\"w-full h-[304px] desktop:h-[480px]\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"py-4 desktop:py-6 w-full overflow-visible\">\n <div ref={scrollContainerRef} className=\"px-4 desktop:px-6 overflow-x-auto\">\n <div\n className=\"w-fit rounded-full bg-[#EAEAEC]\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <List className=\"flex p-1 w-max\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]',\n item.text === activeKspItem?.text && 'bg-white'\n )}\n onClick={() => {\n setActiveKspItem(item)\n }}\n key={index}\n value={item.text}\n >\n <Text html={item.text} className=\"font-bold text-[14px] leading-tight\" />\n </Trigger>\n ))}\n </List>\n </div>\n <div className=\"mt-4\">\n {ksp.map(item => (\n <Content value={item.label} className=\"font-bold text-base desktop:text-[18px]\">\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default ProductHighlight\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4BwC,IAAAI,EAAA,6BA3BxCC,EAAqF,wCACr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EZ,mBAAC,QAAK,KAAMA,EAAK,KAAM,UAAU,sCAAsC,GAHlEa,CAIP,CACD,EACH,EACF,KACA,OAAC,OAAI,UAAU,OACZ,SAAAf,EAAI,IAAIE,MACP,OAAC,WAAQ,MAAOA,EAAK,MAAO,UAAU,0CACnC,SAAAA,EAAK,YACR,CACD,EACH,GACF,EACF,GACF,EACF,CAEJ,EAEA,IAAOhB,EAAQQ",
6
- "names": ["ProductHighlight_exports", "__export", "ProductHighlight_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react_tabs", "import_react", "import_helpers", "import_ProductProvider", "ProductHighlight", "product", "variant", "isMobile", "open", "setOpen", "ksp", "ksp_value", "item", "activeKspItem", "setActiveKspItem", "ProductHighlightData", "ProductHighlightModal", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el"]
4
+ "sourcesContent": ["import type { HighlightProps } from '../types'\nimport { Text, Picture, Button, Heading, Dialog, DialogContent, DialogTrigger } from '../../../../../../components'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nconst ProductHighlight = () => {\n const { product, variant, isMobile } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const ksp = useMemo(() => {\n const ksp_value = variant.metafields?.component?.ksp || product.metafields?.component?.ksp\n const result = isMobile ? ksp_value?.mobileList : ksp_value?.list\n return result?.filter((item: any) => !!item?.text)\n }, [variant.metafields?.component?.ksp, isMobile])\n\n const [activeKspItem, setActiveKspItem] = useState(ksp?.[0])\n\n const ProductHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n if (!ksp?.length) return null\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {ProductHighlightData?.title && <Text size={3} className=\"font-bold\" html={ProductHighlightData?.title} />}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"font-bold !p-0 text-base\">\n {ProductHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal ksp={ksp} clickActiveKspItem={activeKspItem} />\n </Dialog>\n </div>\n <div className=\"flex flex-wrap gap-4 mt-3 desktop:mt-4\">\n {ksp.map((item: any) => (\n <div className=\"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]\">\n <Text\n size={3}\n key={item?.text}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n }}\n className=\"font-bold text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden\"\n html={item?.text}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({ ksp, clickActiveKspItem }: { ksp: any[]; clickActiveKspItem: any }) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n const curIndex = ksp.findIndex(item => item.text === clickActiveKspItem?.text)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, 100)\n }, [clickActiveKspItem, ksp])\n\n return (\n <DialogContent\n overlayClassName=\"z-[70]\"\n className=\"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0\"\n >\n <Root defaultValue={activeKspItem?.text} className=\"w-full overflow-hidden\">\n {ksp.map(item => (\n <Content value={item.text} key={item.text}>\n <Picture\n source={item.img}\n className=\"w-full h-[304px] desktop:h-[480px]\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"py-4 desktop:py-6 w-full overflow-visible\">\n <div ref={scrollContainerRef} className=\"px-4 desktop:px-6 overflow-x-auto\">\n <div\n className=\"w-fit rounded-full bg-[#EAEAEC]\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <List className=\"flex p-1 w-max\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]',\n item.text === activeKspItem?.text && 'bg-white'\n )}\n onClick={() => {\n setActiveKspItem(item)\n }}\n key={index}\n value={item.text}\n >\n <Text html={item.text} className=\"font-bold text-[14px] leading-tight\" />\n </Trigger>\n ))}\n </List>\n </div>\n <div className=\"mt-4\">\n {ksp.map(item => (\n <Content value={item.label} className=\"font-bold text-base desktop:text-[18px]\">\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default ProductHighlight\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4BwC,IAAAI,EAAA,6BA3BxCC,EAAqF,wCACrFC,EAA6C,gCAC7CC,EAAqD,iBACrDC,EAAmB,qCACnBC,EAAqC,6CAErC,MAAMC,EAAmB,IAAM,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,EAAS,SAAAC,CAAS,KAAI,wBAAqB,EACtD,CAACC,EAAMC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C,SAAAA,EAAK,YACR,CACD,EACH,GACF,EACF,GACF,EACF,CAEJ,EAEA,IAAOhB,EAAQQ",
6
+ "names": ["ProductHighlight_exports", "__export", "ProductHighlight_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react_tabs", "import_react", "import_helpers", "import_BizProductProvider", "ProductHighlight", "product", "variant", "isMobile", "open", "setOpen", "ksp", "ksp_value", "item", "activeKspItem", "setActiveKspItem", "ProductHighlightData", "ProductHighlightModal", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var E=(s,o)=>{for(var n in o)u(s,n,{get:o[n],enumerable:!0})},P=(s,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of _(o))!k.call(s,i)&&i!==n&&u(s,i,{get:()=>o[i],enumerable:!(a=b(o,i))||a.enumerable});return s};var C=s=>P(u({},"__esModule",{value:!0}),s);var S={};E(S,{default:()=>O});module.exports=C(S);var e=require("react/jsx-runtime"),d=require("../../../../../../components"),l=require("../../../../../../helpers/index.js"),p=require("react"),f=require("../../../../ProductProvider.js"),v=require("../../../../../AiuiProvider/index.js"),x=require("../../../../utils/helper.js");const L=()=>{const{product:s,selectedOptions:o,setSelectedOptions:n,setJoinedRecommendBuyProducts:a}=(0,f.useProductContext)(),{storeDomain:i}=(0,v.useAiuiContext)(),[g,y]=(0,p.useState)({});return s.options.length?(0,e.jsx)("div",{className:"flex flex-col gap-12",children:s.options.map(r=>{const N=r.name.toLowerCase();return["color","colour","couleur"].some(t=>N.includes(t))?(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:"Select Color: "+o[r.name]}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t},c)=>{const h=`https://${i}/cdn/shop/files/${(0,x.handle)(t)}.png`;return(0,e.jsxs)("div",{className:"relative ipc-product-detail-options-value",children:[(0,e.jsx)("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{n(m=>({...m,[r.name]:t})),a?.({gift:void 0,bundle:void 0})},className:(0,l.cn)("flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":o[r.name]===t}),children:!g[t]&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(d.Picture,{className:"w-full",source:h,onError:({currentTarget:m})=>{m.onerror=null,y(w=>({...w,[t]:!0}))}})})}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+c)})})]},r.id):(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:r.name}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t})=>(0,e.jsx)("button",{onClick:()=>{n(c=>({...c,[r.name]:t}))},className:(0,l.cn)("w-1/2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":o[r.name]===t}),children:t},t))})]},r.id)})}):null};var O=L;
1
+ "use strict";var u=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var E=(s,o)=>{for(var n in o)u(s,n,{get:o[n],enumerable:!0})},P=(s,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of _(o))!k.call(s,i)&&i!==n&&u(s,i,{get:()=>o[i],enumerable:!(a=w(o,i))||a.enumerable});return s};var C=s=>P(u({},"__esModule",{value:!0}),s);var O={};E(O,{default:()=>L});module.exports=C(O);var e=require("react/jsx-runtime"),d=require("../../../../../../components"),l=require("../../../../../../helpers/index.js"),p=require("react"),f=require("../../../../BizProductProvider.js"),v=require("../../../../../AiuiProvider/index.js"),x=require("../../../../utils/helper.js");const z=()=>{const{product:s,selectedOptions:o,setSelectedOptions:n,setJoinedRecommendBuyProducts:a}=(0,f.useBizProductContext)(),{storeDomain:i}=(0,v.useAiuiContext)(),[g,y]=(0,p.useState)({});return s.options.length?(0,e.jsx)("div",{className:"flex flex-col gap-12",children:s.options.map(r=>{const N=r.name.toLowerCase();return["color","colour","couleur"].some(t=>N.includes(t))?(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:"Select Color: "+o[r.name]}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t},c)=>{const h=`https://${i}/cdn/shop/files/${(0,x.handle)(t)}.png`;return(0,e.jsxs)("div",{className:"relative ipc-product-detail-options-value",children:[(0,e.jsx)("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{n(m=>({...m,[r.name]:t})),a?.({gift:void 0,bundle:void 0})},className:(0,l.cn)("flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":o[r.name]===t}),children:!g[t]&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(d.Picture,{className:"w-full",source:h,onError:({currentTarget:m})=>{m.onerror=null,y(b=>({...b,[t]:!0}))}})})}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+c)})})]},r.id):(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:r.name}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t})=>(0,e.jsx)("button",{onClick:()=>{n(c=>({...c,[r.name]:t}))},className:(0,l.cn)("w-1/2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":o[r.name]===t}),children:t},t))})]},r.id)})}):null};var L=z;
2
2
  //# sourceMappingURL=index.js.map