@anker-in/headless-ui 1.0.26-alpha.1762257871632 → 1.0.26-alpha.1762307207505

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 (53) hide show
  1. package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
  2. package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +3 -3
  3. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +19 -11
  4. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  5. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  6. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  7. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -0
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +8 -8
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  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 +2 -2
  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/ProductGallery/index.js +1 -1
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  25. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  26. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  27. package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
  28. package/dist/esm/biz-components/HeroBanner/Countdown.js.map +3 -3
  29. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +19 -11
  30. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  31. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  32. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  33. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  34. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -0
  35. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +8 -8
  36. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
  37. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  38. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  39. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  40. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  41. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  42. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  43. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  44. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  45. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  46. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  47. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  48. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  49. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  50. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  51. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  52. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  53. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var p=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var E=(e,s)=>{for(var n in s)p(e,n,{get:s[n],enumerable:!0})},H=(e,s,n,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of F(s))!z.call(e,o)&&o!==n&&p(e,o,{get:()=>s[o],enumerable:!(r=T(s,o))||r.enumerable});return e};var O=e=>H(p({},"__esModule",{value:!0}),e);var Z={};E(Z,{CountdownByEndDate:()=>w,default:()=>P});module.exports=O(Z);var t=require("react/jsx-runtime"),d=require("../../helpers/index.js"),i=require("react");const l=(e,s=2)=>String(Math.abs(e)).padStart(s,"0"),c="h-full text-center bg-info-white text-xs text-info-primary lg-desktop:p-1 p-0.5 font-semibold border-box",m="lg-desktop:text-2xl lg-desktop:h-7 text-xl h-6 lg-desktop:w-10 w-9 font-bold",w=({endDate:e,endDate_tz:s,locale:n,onExpire:r})=>{const o=(0,i.useRef)(Date.parse(e)),[M,v]=(0,i.useState)(()=>{const a=o.current;return isNaN(a)?0:Math.max(0,a-Date.now())});(0,i.useEffect)(()=>{o.current=Date.parse(e),v(isNaN(o.current)?0:Math.max(0,o.current-Date.now()))},[e]),(0,i.useEffect)(()=>{if(isNaN(o.current))return;let a=!1;const f=()=>{const R=Date.now(),b=Math.max(0,o.current-R);v(b),b<=0&&!a&&(a=!0,r?.())};f();const I=window.setInterval(f,1e3);return()=>clearInterval(I)},[r]);const x=Math.floor(M/1e3),D=x%60,g=Math.floor(x/60),y=g%60,h=Math.floor(g/60),S=h%24,k=Math.floor(h/24),C=s||Intl.DateTimeFormat().resolvedOptions().timeZone;let N="\u2014";const u=o.current;if(!isNaN(u))try{const a=new Date(u);N=new Intl.DateTimeFormat(n||navigator.language,{timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a)}catch{N=new Date(u).toISOString()}return(0,t.jsxs)("div",{className:"w-full flex gap-1 items-center","aria-live":"polite",children:[(0,t.jsxs)("div",{className:(0,d.cn)(c,"time-days-box"),children:[(0,t.jsx)("p",{className:m,children:l(k,2)}),(0,t.jsx)("div",{children:"Day"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(c,"time-hours-box"),children:[(0,t.jsx)("p",{className:m,children:l(S,2)}),(0,t.jsx)("div",{children:"Hours"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(c,"time-minutes-box"),children:[(0,t.jsx)("p",{className:m,children:l(y,2)}),(0,t.jsx)("div",{children:"Mins"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(c,"time-seconds-box"),children:[(0,t.jsx)("p",{className:m,children:l(D,2)}),(0,t.jsx)("div",{children:"Secs"})]})]})};var P=w;
1
+ "use strict";"use client";var v=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var O=(n,o)=>{for(var i in o)v(n,i,{get:o[i],enumerable:!0})},P=(n,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of z(o))!E.call(n,e)&&e!==i&&v(n,e,{get:()=>o[e],enumerable:!(r=H(o,e))||r.enumerable});return n};var Z=n=>P(v({},"__esModule",{value:!0}),n);var _={};O(_,{CountdownByEndDate:()=>M,default:()=>B});module.exports=Z(_);var t=require("react/jsx-runtime"),d=require("../../helpers/index.js"),a=require("react");const c=(n,o=2)=>String(Math.abs(n)).padStart(o,"0"),l="h-full text-center bg-info-white text-xs text-info-primary lg-desktop:p-1 p-0.5 font-semibold border-box",m="lg-desktop:text-2xl lg-desktop:h-7 text-xl h-6 lg-desktop:w-10 w-9 font-bold",M=({endDate:n,endDate_tz:o,locale:i,onExpire:r})=>{const e=(0,a.useRef)(Date.parse(n)),[y,x]=(0,a.useState)(()=>{const s=e.current;return isNaN(s)?0:Math.max(0,s-Date.now())}),[u,N]=(0,a.useState)(()=>{const s=e.current;return!isNaN(s)&&s<=Date.now()});(0,a.useEffect)(()=>{e.current=Date.parse(n),x(isNaN(e.current)?0:Math.max(0,e.current-Date.now()));const s=e.current;N(!isNaN(s)&&s<=Date.now())},[n]),(0,a.useEffect)(()=>{if(u||isNaN(e.current))return;let s=!1;const p=()=>{const F=Date.now(),D=Math.max(0,e.current-F);x(D),D<=0&&!s&&(s=!0,N(!0),r?.())};p();const T=window.setInterval(p,1e3);return()=>clearInterval(T)},[r,u]);const g=Math.floor(y/1e3),S=g%60,h=Math.floor(g/60),k=h%60,w=Math.floor(h/60),C=w%24,I=Math.floor(w/24),R=o||Intl.DateTimeFormat().resolvedOptions().timeZone;let b="\u2014";const f=e.current;if(!isNaN(f))try{const s=new Date(f);b=new Intl.DateTimeFormat(i||navigator.language,{timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(s)}catch{b=new Date(f).toISOString()}return u?null:(0,t.jsxs)("div",{className:"w-full flex gap-1 items-center","aria-live":"polite",children:[(0,t.jsxs)("div",{className:(0,d.cn)(l,"time-days-box"),children:[(0,t.jsx)("p",{className:m,children:c(I,2)}),(0,t.jsx)("div",{children:"Day"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(l,"time-hours-box"),children:[(0,t.jsx)("p",{className:m,children:c(C,2)}),(0,t.jsx)("div",{children:"Hours"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(l,"time-minutes-box"),children:[(0,t.jsx)("p",{className:m,children:c(k,2)}),(0,t.jsx)("div",{children:"Mins"})]}),(0,t.jsx)("div",{className:"text-2xl font-bold text-info-white",children:":"}),(0,t.jsxs)("div",{className:(0,d.cn)(l,"time-seconds-box"),children:[(0,t.jsx)("p",{className:m,children:c(S,2)}),(0,t.jsx)("div",{children:"Secs"})]})]})};var B=M;
2
2
  //# sourceMappingURL=Countdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeroBanner/Countdown.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/index.js'\nimport React, { useEffect, useRef, useState } from 'react'\n\ntype Props = {\n endDate: string // ISO UTC \u5B57\u7B26\u4E32\uFF0C\u4F8B\u5982 \"2025-11-02T07:42:00.000Z\"\n endDate_tz?: string // \u65F6\u533A\uFF0C\u4F8B\u5982 \"Asia/Dhaka\"\uFF08\u53EF\u9009\uFF09\n locale?: string // \u683C\u5F0F\u5316\u7528\u7684 locale\uFF0C\u9ED8\u8BA4 navigator.language\n onExpire?: () => void // \u5230\u671F\u56DE\u8C03\uFF08\u53EF\u9009\uFF09\n}\n\nconst pad = (n: number, len = 2) => String(Math.abs(n)).padStart(len, '0')\n\nconst baseClass =\n 'h-full text-center bg-info-white text-xs text-info-primary lg-desktop:p-1 p-0.5 font-semibold border-box'\n\nconst textClass = 'lg-desktop:text-2xl lg-desktop:h-7 text-xl h-6 lg-desktop:w-10 w-9 font-bold'\n\nexport const CountdownByEndDate: React.FC<Props> = ({ endDate, endDate_tz, locale, onExpire }) => {\n // \u89E3\u6790\u76EE\u6807\u65F6\u95F4\uFF08\u4F7F\u7528 provided ISO\uFF0C\u82E5\u975E\u6CD5\u5219\u4E3A NaN\uFF09\n const targetMsRef = useRef<number>(Date.parse(endDate))\n const [remainingMs, setRemainingMs] = useState<number>(() => {\n const t = targetMsRef.current\n return isNaN(t) ? 0 : Math.max(0, t - Date.now())\n })\n\n // \u82E5 props.endDate \u6539\u53D8\uFF0C\u66F4\u65B0 ref \u4E0E remaining\n useEffect(() => {\n targetMsRef.current = Date.parse(endDate)\n setRemainingMs(isNaN(targetMsRef.current) ? 0 : Math.max(0, targetMsRef.current - Date.now()))\n }, [endDate])\n\n // Tick \u6BCF\u79D2\u66F4\u65B0\u5269\u4F59\u65F6\u95F4\n useEffect(() => {\n if (isNaN(targetMsRef.current)) return // \u65E0\u6548\u65E5\u671F\u4E0D\u542F\u52A8\u8BA1\u65F6\u5668\n let expiredCalled = false\n const tick = () => {\n const now = Date.now()\n const rem = Math.max(0, targetMsRef.current - now)\n setRemainingMs(rem)\n if (rem <= 0 && !expiredCalled) {\n expiredCalled = true\n onExpire?.()\n }\n }\n tick() // \u7ACB\u5373\u540C\u6B65\u4E00\u6B21\n const id = window.setInterval(tick, 1000)\n return () => clearInterval(id)\n }, [onExpire])\n\n // \u8BA1\u7B97\u5929/\u65F6/\u5206/\u79D2\n const totalSeconds = Math.floor(remainingMs / 1000)\n const seconds = totalSeconds % 60\n const totalMinutes = Math.floor(totalSeconds / 60)\n const minutes = totalMinutes % 60\n const totalHours = Math.floor(totalMinutes / 60)\n const hours = totalHours % 24\n const days = Math.floor(totalHours / 24)\n\n // \u683C\u5F0F\u5316\u76EE\u6807\u65F6\u95F4\u5E76\u663E\u793A\u5176\u65F6\u533A\uFF08\u4F7F\u7528 endDate_tz \u6216\u8005\u6D4F\u89C8\u5668\u65F6\u533A\uFF09\n const displayTz = endDate_tz || Intl.DateTimeFormat().resolvedOptions().timeZone\n let formattedTarget = '\u2014'\n const tms = targetMsRef.current\n if (!isNaN(tms)) {\n try {\n const dt = new Date(tms)\n const fmt = new Intl.DateTimeFormat(locale || navigator.language, {\n timeZone: displayTz,\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n formattedTarget = fmt.format(dt)\n } catch (e) {\n // \u82E5\u4F20\u5165\u4E86\u975E\u6CD5\u65F6\u533A\uFF0CIntl \u53EF\u80FD\u629B\u9519\uFF1B\u56DE\u9000\u663E\u793A UTC \u65F6\u95F4\n formattedTarget = new Date(tms).toISOString()\n }\n }\n\n return (\n <div className=\"w-full flex gap-1 items-center\" aria-live=\"polite\">\n {/* \u5929 */}\n <div className={cn(baseClass, 'time-days-box')}>\n <p className={textClass}>{pad(days, 2)}</p>\n <div>Day</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u65F6 */}\n <div className={cn(baseClass, 'time-hours-box')}>\n <p className={textClass}>{pad(hours, 2)}</p>\n <div>Hours</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u5206 */}\n <div className={cn(baseClass, 'time-minutes-box')}>\n <p className={textClass}>{pad(minutes, 2)}</p>\n <div>Mins</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u79D2 */}\n <div className={cn(baseClass, 'time-seconds-box')}>\n <p className={textClass}>{pad(seconds, 2)}</p>\n <div>Secs</div>\n </div>\n </div>\n )\n}\n\nexport default C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WC,EAAY,SAAAJ,EAAImB,EAAS,CAAC,EAAE,KAC1C,OAAC,OAAI,gBAAI,GACX,GACF,CAEJ,EAEA,IAAOxB,EAAQD",
6
- "names": ["Countdown_exports", "__export", "CountdownByEndDate", "Countdown_default", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react", "pad", "n", "len", "baseClass", "textClass", "endDate", "endDate_tz", "locale", "onExpire", "targetMsRef", "remainingMs", "setRemainingMs", "t", "expiredCalled", "tick", "now", "rem", "id", "totalSeconds", "seconds", "totalMinutes", "minutes", "totalHours", "hours", "days", "displayTz", "formattedTarget", "tms", "dt"]
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/index.js'\nimport React, { useEffect, useRef, useState } from 'react'\n\ntype Props = {\n endDate: string // ISO UTC \u5B57\u7B26\u4E32\uFF0C\u4F8B\u5982 \"2025-11-02T07:42:00.000Z\"\n endDate_tz?: string // \u65F6\u533A\uFF0C\u4F8B\u5982 \"Asia/Dhaka\"\uFF08\u53EF\u9009\uFF09\n locale?: string // \u683C\u5F0F\u5316\u7528\u7684 locale\uFF0C\u9ED8\u8BA4 navigator.language\n onExpire?: () => void // \u5230\u671F\u56DE\u8C03\uFF08\u53EF\u9009\uFF09\n}\n\nconst pad = (n: number, len = 2) => String(Math.abs(n)).padStart(len, '0')\n\nconst baseClass =\n 'h-full text-center bg-info-white text-xs text-info-primary lg-desktop:p-1 p-0.5 font-semibold border-box'\n\nconst textClass = 'lg-desktop:text-2xl lg-desktop:h-7 text-xl h-6 lg-desktop:w-10 w-9 font-bold'\n\nexport const CountdownByEndDate: React.FC<Props> = ({ endDate, endDate_tz, locale, onExpire }) => {\n // \u89E3\u6790\u76EE\u6807\u65F6\u95F4\uFF08\u4F7F\u7528 provided ISO\uFF0C\u82E5\u975E\u6CD5\u5219\u4E3A NaN\uFF09\n const targetMsRef = useRef<number>(Date.parse(endDate))\n const [remainingMs, setRemainingMs] = useState<number>(() => {\n const t = targetMsRef.current\n return isNaN(t) ? 0 : Math.max(0, t - Date.now())\n })\n // \u4EC5\u5728\u521D\u59CB\u65F6\u5224\u65AD\u662F\u5426\u5DF2\u8FC7\u671F\uFF1A\u82E5\u5DF2\u8FC7\u671F\u5219\u9690\u85CF\u7EC4\u4EF6\u5E76\u4E0D\u7EE7\u7EED\u8BA1\u65F6\n const [hidden, setHidden] = useState<boolean>(() => {\n const t = targetMsRef.current\n return !isNaN(t) && t <= Date.now()\n })\n\n // \u82E5 props.endDate \u6539\u53D8\uFF0C\u66F4\u65B0 ref \u4E0E remaining\n useEffect(() => {\n targetMsRef.current = Date.parse(endDate)\n setRemainingMs(isNaN(targetMsRef.current) ? 0 : Math.max(0, targetMsRef.current - Date.now()))\n // \u5F53 endDate \u66F4\u65B0\u65F6\uFF0C\u4EC5\u8FDB\u884C\u4E00\u6B21\u662F\u5426\u8FC7\u671F\u7684\u5224\u65AD\uFF0C\u7528\u4E8E\u51B3\u5B9A\u662F\u5426\u9690\u85CF\n const t = targetMsRef.current\n setHidden(!isNaN(t) && t <= Date.now())\n }, [endDate])\n\n // Tick \u6BCF\u79D2\u66F4\u65B0\u5269\u4F59\u65F6\u95F4\n useEffect(() => {\n if (hidden) return // \u521D\u59CB\u5DF2\u8FC7\u671F\u5219\u4E0D\u542F\u52A8\u8BA1\u65F6\u5668\n if (isNaN(targetMsRef.current)) return // \u65E0\u6548\u65E5\u671F\u4E0D\u542F\u52A8\u8BA1\u65F6\u5668\n let expiredCalled = false\n const tick = () => {\n const now = Date.now()\n const rem = Math.max(0, targetMsRef.current - now)\n setRemainingMs(rem)\n if (rem <= 0 && !expiredCalled) {\n expiredCalled = true\n setHidden(true) // \u5230\u70B9\u540E\u9690\u85CF\u7EC4\u4EF6\n onExpire?.()\n }\n }\n tick() // \u7ACB\u5373\u540C\u6B65\u4E00\u6B21\n const id = window.setInterval(tick, 1000)\n return () => clearInterval(id)\n }, [onExpire, hidden])\n\n // \u8BA1\u7B97\u5929/\u65F6/\u5206/\u79D2\n const totalSeconds = Math.floor(remainingMs / 1000)\n const seconds = totalSeconds % 60\n const totalMinutes = Math.floor(totalSeconds / 60)\n const minutes = totalMinutes % 60\n const totalHours = Math.floor(totalMinutes / 60)\n const hours = totalHours % 24\n const days = Math.floor(totalHours / 24)\n\n // \u683C\u5F0F\u5316\u76EE\u6807\u65F6\u95F4\u5E76\u663E\u793A\u5176\u65F6\u533A\uFF08\u4F7F\u7528 endDate_tz \u6216\u8005\u6D4F\u89C8\u5668\u65F6\u533A\uFF09\n const displayTz = endDate_tz || Intl.DateTimeFormat().resolvedOptions().timeZone\n let formattedTarget = '\u2014'\n const tms = targetMsRef.current\n if (!isNaN(tms)) {\n try {\n const dt = new Date(tms)\n const fmt = new Intl.DateTimeFormat(locale || navigator.language, {\n timeZone: displayTz,\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n formattedTarget = fmt.format(dt)\n } catch (e) {\n // \u82E5\u4F20\u5165\u4E86\u975E\u6CD5\u65F6\u533A\uFF0CIntl \u53EF\u80FD\u629B\u9519\uFF1B\u56DE\u9000\u663E\u793A UTC \u65F6\u95F4\n formattedTarget = new Date(tms).toISOString()\n }\n }\n\n if (hidden) return null\n\n return (\n <div className=\"w-full flex gap-1 items-center\" aria-live=\"polite\">\n {/* \u5929 */}\n <div className={cn(baseClass, 'time-days-box')}>\n <p className={textClass}>{pad(days, 2)}</p>\n <div>Day</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u65F6 */}\n <div className={cn(baseClass, 'time-hours-box')}>\n <p className={textClass}>{pad(hours, 2)}</p>\n <div>Hours</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u5206 */}\n <div className={cn(baseClass, 'time-minutes-box')}>\n <p className={textClass}>{pad(minutes, 2)}</p>\n <div>Mins</div>\n </div>\n <div className=\"text-2xl font-bold text-info-white\">:</div>\n {/* \u79D2 */}\n <div className={cn(baseClass, 'time-seconds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Y,SAAAH,EAAIwB,EAAO,CAAC,EAAE,KACxC,OAAC,OAAI,iBAAK,GACZ,KACA,OAAC,OAAI,UAAU,qCAAqC,aAAC,KAErD,QAAC,OAAI,aAAW,MAAGtB,EAAW,kBAAkB,EAC9C,oBAAC,KAAE,UAAWC,EAAY,SAAAH,EAAIsB,EAAS,CAAC,EAAE,KAC1C,OAAC,OAAI,gBAAI,GACX,KACA,OAAC,OAAI,UAAU,qCAAqC,aAAC,KAErD,QAAC,OAAI,aAAW,MAAGpB,EAAW,kBAAkB,EAC9C,oBAAC,KAAE,UAAWC,EAAY,SAAAH,EAAIoB,EAAS,CAAC,EAAE,KAC1C,OAAC,OAAI,gBAAI,GACX,GACF,CAEJ,EAEA,IAAOzB,EAAQD",
6
+ "names": ["Countdown_exports", "__export", "CountdownByEndDate", "Countdown_default", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react", "pad", "len", "baseClass", "textClass", "endDate", "endDate_tz", "locale", "onExpire", "targetMsRef", "remainingMs", "setRemainingMs", "t", "hidden", "setHidden", "expiredCalled", "tick", "now", "rem", "id", "totalSeconds", "seconds", "totalMinutes", "minutes", "totalHours", "hours", "days", "displayTz", "formattedTarget", "tms", "dt"]
7
7
  }
@@ -58,6 +58,20 @@ export type ModalData = {
58
58
  content?: string;
59
59
  domContent?: React.ReactNode;
60
60
  };
61
+ export type JoinedRecommendBuyProducts = {
62
+ bundle?: {
63
+ value?: BundleListItem;
64
+ canOperate?: boolean;
65
+ };
66
+ gift?: {
67
+ value?: ProductVariant;
68
+ canOperate?: boolean;
69
+ };
70
+ exchange?: {
71
+ value?: ProductVariant;
72
+ canOperate?: boolean;
73
+ };
74
+ };
61
75
  export interface ProductContextType {
62
76
  isLogin?: boolean;
63
77
  isMobile?: boolean;
@@ -83,16 +97,8 @@ export interface ProductContextType {
83
97
  setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>;
84
98
  checkedBundle?: BundleListItem;
85
99
  setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>;
86
- joinedRecommendBuyProducts: {
87
- bundle?: BundleListItem;
88
- gift?: ProductVariant;
89
- exchange?: ProductVariant;
90
- };
91
- setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{
92
- bundle?: BundleListItem;
93
- gift?: ProductVariant;
94
- exchange?: ProductVariant;
95
- }>>;
100
+ joinedRecommendBuyProducts: JoinedRecommendBuyProducts;
101
+ setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>;
96
102
  checkedCareBundle?: ProductVariant;
97
103
  setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>;
98
104
  bundle?: Bundle;
@@ -111,8 +117,10 @@ export interface ProductContextType {
111
117
  onUseCouponChange?: (couponSaving: number) => void;
112
118
  onUseMemberDiscountChange?: (memberSaving: number) => void;
113
119
  discount?: DiscountData;
120
+ buyNowLoading?: boolean;
121
+ addToCartLoading?: boolean;
114
122
  }
115
123
  export declare const BizProductContext: React.Context<ProductContextType>;
116
124
  export declare const useBizProductContext: () => ProductContextType;
117
- declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemptionAmount, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderAffirm, renderKlarna, renderPaypal, onUseCouponChange, onUseMemberDiscountChange, discount, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts">>) => import("react/jsx-runtime").JSX.Element;
125
+ declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemptionAmount, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderAffirm, renderKlarna, renderPaypal, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts">>) => import("react/jsx-runtime").JSX.Element;
118
126
  export default ProductProvider;
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},Y=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of H(e))!Q.call(t,n)&&n!==r&&c(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var Z=t=>Y(c({},"__esModule",{value:!0}),t);var ne={};X(ne,{BizProductContext:()=>a,default:()=>te,useBizProductContext:()=>$});module.exports=Z(ne);var d=require("react/jsx-runtime"),o=require("react");const a=(0,o.createContext)({}),$=()=>{if(!(0,o.useContext)(a))throw new Error("useProductContext must be used in <ProductProvider>");return(0,o.useContext)(a)},ee=({product:t,isLogin:e,profile:r,isMobile:i,isDesktop:n,children:u,renderRating:s,freeGift:p,exchangePurchase:m,bundle:l,checkedBundle:P,checkedGift:b,setCheckedBundle:g,setCheckedGift:h,checkedExchangePurchase:C,setCheckedExchangePurchase:f,variant:v,selectedOptions:y,setSelectedOptions:S,compareData:x,coupon:D,finalPrice:B,comparePrice:R,totalSavings:V,savingDetail:_,setSavingDetail:k,selectedVariants:A,onAddToCart:M,onBuyNow:F,creditsRedemptionAmount:w,memberFunctionResult:G,openModal:I,openSignInPopup:L,openAuthCodePopup:N,openSignUpPopup:T,renderAffirm:O,renderKlarna:U,renderPaypal:W,onUseCouponChange:j,onUseMemberDiscountChange:z,discount:E})=>{const[J,K]=(0,o.useState)({bundle:void 0,gift:void 0});return(0,d.jsx)(a.Provider,{value:{product:t,variant:v,isMobile:i,isDesktop:n,isLogin:e,profile:r,coupon:D,renderRating:s,finalPrice:B,comparePrice:R,savingDetail:_,setSavingDetail:k,totalSavings:V,selectedOptions:y,setSelectedOptions:S,freeGift:p,exchangePurchase:m,checkedGift:b,setCheckedGift:h,checkedBundle:P,setCheckedBundle:g,bundle:l,compareData:x,selectedVariants:A,onAddToCart:M,onBuyNow:F,joinedRecommendBuyProducts:J,setJoinedRecommendBuyProducts:K,checkedExchangePurchase:C,setCheckedExchangePurchase:f,creditsRedemptionAmount:w,memberFunctionResult:G,openModal:I,openSignInPopup:L,openAuthCodePopup:N,openSignUpPopup:T,renderAffirm:O,renderKlarna:U,renderPaypal:W,onUseCouponChange:j,onUseMemberDiscountChange:z,discount:E},children:u})};var te=ee;
1
+ "use strict";var c=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},$=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of X(e))!Y.call(t,n)&&n!==r&&c(t,n,{get:()=>e[n],enumerable:!(a=Q(e,n))||a.enumerable});return t};var ee=t=>$(c({},"__esModule",{value:!0}),t);var re={};Z(re,{BizProductContext:()=>i,default:()=>oe,useBizProductContext:()=>te});module.exports=ee(re);var d=require("react/jsx-runtime"),o=require("react");const i=(0,o.createContext)({}),te=()=>{if(!(0,o.useContext)(i))throw new Error("useProductContext must be used in <ProductProvider>");return(0,o.useContext)(i)},ne=({product:t,isLogin:e,profile:r,isMobile:a,isDesktop:n,children:u,renderRating:s,freeGift:p,exchangePurchase:m,bundle:l,checkedBundle:P,checkedGift:b,setCheckedBundle:g,setCheckedGift:h,checkedExchangePurchase:v,setCheckedExchangePurchase:y,variant:C,selectedOptions:f,setSelectedOptions:S,compareData:x,coupon:R,finalPrice:B,comparePrice:D,totalSavings:_,savingDetail:k,setSavingDetail:A,selectedVariants:V,onAddToCart:O,onBuyNow:M,creditsRedemptionAmount:w,memberFunctionResult:F,openModal:N,openSignInPopup:T,openAuthCodePopup:G,openSignUpPopup:J,renderAffirm:L,renderKlarna:I,renderPaypal:U,onUseCouponChange:W,onUseMemberDiscountChange:j,discount:z,buyNowLoading:E,addToCartLoading:K})=>{const[q,H]=(0,o.useState)({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}});return(0,d.jsx)(i.Provider,{value:{product:t,variant:C,isMobile:a,isDesktop:n,isLogin:e,profile:r,coupon:R,renderRating:s,finalPrice:B,comparePrice:D,savingDetail:k,setSavingDetail:A,totalSavings:_,selectedOptions:f,setSelectedOptions:S,freeGift:p,exchangePurchase:m,checkedGift:b,setCheckedGift:h,checkedBundle:P,setCheckedBundle:g,bundle:l,compareData:x,selectedVariants:V,onAddToCart:O,onBuyNow:M,joinedRecommendBuyProducts:q,setJoinedRecommendBuyProducts:H,checkedExchangePurchase:v,setCheckedExchangePurchase:y,creditsRedemptionAmount:w,memberFunctionResult:F,openModal:N,openSignInPopup:T,openAuthCodePopup:G,openSignUpPopup:J,renderAffirm:L,renderKlarna:I,renderPaypal:U,onUseCouponChange:W,onUseMemberDiscountChange:j,discount:z,buyNowLoading:E,addToCartLoading:K},children:u})};var oe=ne;
2
2
  //# sourceMappingURL=BizProductProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
4
- "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = { coupon: number; bundle: number; member: number; freeGift: number; compare: number; exchangePurchase: number }\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: { bundle?: BundleListItem; gift?: ProductVariant; exchange?: ProductVariant }\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{ bundle?: BundleListItem; gift?: ProductVariant, exchange?: ProductVariant }>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderAffirm?: React.ReactNode\n renderKlarna?: React.ReactNode\n renderPaypal?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n}: PropsWithChildren<\n Omit<\n ProductContextType,\n | 'joinedRecommendBuyProducts'\n | 'setJoinedRecommendBuyProducts'\n >\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n }>({\n bundle: undefined,\n gift: undefined,\n })\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
- "mappings": "yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,EAAA,YAAAC,GAAA,yBAAAC,IAAA,eAAAC,EAAAL,IAiNI,IAAAM,EAAA,6BAjNJC,EAQO,iBAqIA,MAAML,KAAoB,iBAAkC,CAAC,CAAuB,EAE9EE,EAAuB,IAAM,CAExC,GAAI,IADY,cAAWF,CAAiB,EAE1C,MAAM,IAAI,MAAM,q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AAC,CACF,EAEC,SAAAnC,EACH,CAEJ,EAEA,IAAOX,GAAQK",
6
- "names": ["BizProductProvider_exports", "__export", "BizProductContext", "BizProductProvider_default", "useBizProductContext", "__toCommonJS", "import_jsx_runtime", "import_react", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts"]
4
+ "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderAffirm?: React.ReactNode\n renderKlarna?: React.ReactNode\n renderPaypal?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
+ "mappings": "0aAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,EAAA,YAAAC,GAAA,yBAAAC,KAAA,eAAAC,GAAAL,IA4OI,IAAAM,EAAA,6BA5OJC,EAQO,iBA6JA,MAAML,KAAoB,iBAAkC,CAAC,CAAuB,EAE9EE,GAAuB,IAAM,CAExC,GAAI,IADY,cAAWF,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,SAAO,cAAWA,CAAiB,CACrC,EAEMM,GAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,CACF,IAAmH,CACjH,KAAM,CAACC,EAA4BC,CAA6B,KAAI,YAAqC,CACvG,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EAED,SACE,OAACnD,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAO,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAe,EACA,8BAAAC,EACA,wBAAA9B,EACA,2BAAAC,EACA,wBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,CACF,EAEC,SAAArC,EACH,CAEJ,EAEA,IAAOX,GAAQK",
6
+ "names": ["BizProductProvider_exports", "__export", "BizProductContext", "BizProductProvider_default", "useBizProductContext", "__toCommonJS", "import_jsx_runtime", "import_react", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var L=Object.create;var y=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var B=(i,p)=>{for(var n in p)y(i,n,{get:p[n],enumerable:!0})},T=(i,p,n,d)=>{if(p&&typeof p=="object"||typeof p=="function")for(let l of W(p))!$.call(i,l)&&l!==n&&y(i,l,{get:()=>p[l],enumerable:!(d=V(p,l))||d.enumerable});return i};var P=(i,p,n)=>(n=i!=null?L(F(i)):{},T(p||!i||!i.__esModule?y(n,"default",{value:i,enumerable:!0}):n,i)),j=i=>T(y({},"__esModule",{value:!0}),i);var H={};B(H,{default:()=>G});module.exports=j(H);var r=require("react/jsx-runtime"),x=require("../../../../components/index.js"),o=require("react"),_=require("../../../../helpers"),w=P(require("./ShippingMethod")),C=require("./ShippingPolicyModal"),M=require("./utils"),k=P(require("./LearnMore")),N=require("../../BizProductProvider.js");const q=({metafields:i,productList:p,onShippingInfoChange:n,variant:d,className:l})=>{const{isLogin:A,openSignInPopup:O}=(0,N.useBizProductContext)(),[z,S]=(0,o.useState)(!1),[f,D]=(0,o.useState)(!1),[E,b]=(0,o.useState)(null),v=(0,o.useMemo)(()=>p.reduce((e,t)=>e+(t?.variant?.weight||0),0),[p]),c=(0,o.useCallback)((e,t,s)=>({id:`${e.__code}__${e.price}`,code:e.__code,mode:e.__mode,title:e.title,disabled:!(0,M.isWeightAvailable)(t,e),price:e.price,subtitle:e.subtitle,tag:s!==0?i?.memberOnly:"",error:(0,M.isWeightAvailable)(t,e)?"":i.overWeightError}),[i?.memberOnly,i.overWeightError]),h=(0,o.useMemo)(()=>{const e=i?.list?.map((t,s)=>c(t,v,s));return e?.reduce((t,s)=>{const m=e.filter(a=>a.code==s.code);let u;return m.every(a=>a.disabled)?u=m[m.length-1]:u=m.find(a=>!a.disabled),t.find(a=>u.id===a.id)?t:[...t,u]},[])},[c,i?.list,v]),g=(0,o.useCallback)(e=>{n({selected_delivery_code:e.code,selected_delivery_mode:e.mode})},[n]);(0,o.useEffect)(()=>{if(i?.list?.length>0&&!f){const e=c(i?.list[0],0,0);b(e),g(e),D(!0)}},[c,i?.list,g,f]);const I=(0,o.useCallback)(e=>{e.disabled||(b(e),g(e))},[A,h,d.sku,g,O]);return(0,r.jsxs)("div",{id:"ipc-product-paid-shipping",className:(0,_.cn)(" mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0",l),children:[(0,r.jsx)("div",{className:"flex flex-wrap justify-between space-x-2 md:space-x-1",children:(0,r.jsx)(x.Text,{className:"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]",html:i?.title})}),(0,r.jsxs)("div",{className:"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap",children:[h.map((e,t)=>(0,r.jsx)(w.default,{index:t,item:e,active:E?.code===e.code,toggleShipping:()=>I(e),currencyCode:d.price.currencyCode,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:flex-1"},t)),(0,r.jsx)(k.default,{setOpenShippingPolicyModal:S,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]"})]}),h.find(e=>e?.error)&&(0,r.jsx)(x.Text,{className:"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]",html:h.find(e=>e.error)?.error,as:"p"}),i?.seeAvailableArea&&(0,r.jsx)(x.Text,{as:"div",className:"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline",html:i?.seeAvailableArea}),i?.shippingPolicy&&(0,r.jsx)(C.ShippingPolicyModal,{data:i?.shippingPolicy,onClose:()=>S(!1),open:z})]})};var G=q;
1
+ "use strict";var L=Object.create;var y=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var B=(i,p)=>{for(var n in p)y(i,n,{get:p[n],enumerable:!0})},T=(i,p,n,d)=>{if(p&&typeof p=="object"||typeof p=="function")for(let l of W(p))!$.call(i,l)&&l!==n&&y(i,l,{get:()=>p[l],enumerable:!(d=V(p,l))||d.enumerable});return i};var P=(i,p,n)=>(n=i!=null?L(F(i)):{},T(p||!i||!i.__esModule?y(n,"default",{value:i,enumerable:!0}):n,i)),j=i=>T(y({},"__esModule",{value:!0}),i);var H={};B(H,{default:()=>G});module.exports=j(H);var r=require("react/jsx-runtime"),x=require("../../../../components/index.js"),o=require("react"),_=require("../../../../helpers"),w=P(require("./ShippingMethod")),k=require("./ShippingPolicyModal"),M=require("./utils"),C=P(require("./LearnMore")),N=require("../../BizProductProvider.js");const q=({metafields:i,productList:p,onShippingInfoChange:n,variant:d,className:l})=>{const{isLogin:A,openSignInPopup:O}=(0,N.useBizProductContext)(),[z,S]=(0,o.useState)(!1),[f,D]=(0,o.useState)(!1),[E,b]=(0,o.useState)(null),v=(0,o.useMemo)(()=>p.reduce((e,t)=>e+(t?.variant?.weight||0),0),[p]),c=(0,o.useCallback)((e,t,s)=>({id:`${e.__code}__${e.price}`,code:e.__code,mode:e.__mode,title:e.title,disabled:!(0,M.isWeightAvailable)(t,e),price:e.price,subtitle:e.subtitle,tag:s!==0?i?.memberOnly:"",error:(0,M.isWeightAvailable)(t,e)?"":i.overWeightError}),[i?.memberOnly,i.overWeightError]),h=(0,o.useMemo)(()=>{const e=i?.list?.map((t,s)=>c(t,v,s));return e?.reduce((t,s)=>{const m=e.filter(a=>a.code==s.code);let u;return m.every(a=>a.disabled)?u=m[m.length-1]:u=m.find(a=>!a.disabled),t.find(a=>u.id===a.id)?t:[...t,u]},[])},[c,i?.list,v]),g=(0,o.useCallback)(e=>{n({selected_delivery_code:e.code,selected_delivery_mode:e.mode})},[n]);(0,o.useEffect)(()=>{if(i?.list?.length>0&&!f){const e=c(i?.list[0],0,0);b(e),g(e),D(!0)}},[c,i?.list,g,f]);const I=(0,o.useCallback)(e=>{e.disabled||(b(e),g(e))},[A,h,d.sku,g,O]);return(0,r.jsxs)("div",{id:"ipc-product-paid-shipping",className:(0,_.cn)(" mt-16 desktop:mt-[96px] lg-desktop:mt-[128px] px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0",l),children:[(0,r.jsx)("div",{className:"flex flex-wrap justify-between space-x-2 md:space-x-1",children:(0,r.jsx)(x.Text,{className:"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]",html:i?.title})}),(0,r.jsxs)("div",{className:"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap",children:[h.map((e,t)=>(0,r.jsx)(w.default,{index:t,item:e,active:E?.code===e.code,toggleShipping:()=>I(e),currencyCode:d.price.currencyCode,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:flex-1"},t)),(0,r.jsx)(C.default,{setOpenShippingPolicyModal:S,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]"})]}),h.find(e=>e?.error)&&(0,r.jsx)(x.Text,{className:"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]",html:h.find(e=>e.error)?.error,as:"p"}),i?.seeAvailableArea&&(0,r.jsx)(x.Text,{as:"div",className:"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline",html:i?.seeAvailableArea}),i?.shippingPolicy&&(0,r.jsx)(k.ShippingPolicyModal,{data:i?.shippingPolicy,onClose:()=>S(!1),open:z})]})};var G=q;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/index.tsx"],
4
- "sourcesContent": ["import { Container, Text } from '../../../../components/index.js'\nimport type { Product, ProductVariant } from '../../types/product'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { cn } from '../../../../helpers'\n\nimport ShippingMethod from './ShippingMethod'\nimport { ShippingPolicyModal } from './ShippingPolicyModal'\nimport type { DeliveryCustom, shippingMetafields, ShippingMethodType } from './type'\nimport { isWeightAvailable } from './utils'\nimport LearnMore from './LearnMore'\nimport { useBizProductContext } from '../../BizProductProvider.js'\n\nconst PaidShipping = ({\n metafields,\n productList,\n onShippingInfoChange,\n variant,\n className,\n}: {\n metafields: any\n productList: Array<Product & { variant: ProductVariant }>\n variant: ProductVariant\n onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void\n className?: string\n}) => {\n const { isLogin, openSignInPopup } = useBizProductContext()\n const [openShippingPolicyModal, setOpenShippingPolicyModal] = useState(false)\n const [init, setInit] = useState(false)\n\n const [selectedMethod, setSelectedMethod] = useState<ShippingMethodType | null>(null)\n\n const weight = useMemo(() => {\n return productList.reduce((acc, product) => acc + (product?.variant?.weight || 0), 0)\n }, [productList])\n\n const normalizedMethod = useCallback(\n (method: shippingMetafields, weight: number, index: number) => {\n return {\n id: `${method.__code}__${method.price}`,\n code: method.__code,\n mode: method.__mode,\n title: method.title,\n disabled: !isWeightAvailable(weight, method),\n price: method.price,\n subtitle: method.subtitle,\n tag: index !== 0 ? metafields?.memberOnly : '',\n error: !isWeightAvailable(weight, method) ? metafields.overWeightError : '',\n }\n },\n [metafields?.memberOnly, metafields.overWeightError],\n )\n\n const list = useMemo(() => {\n const normalizedList: ShippingMethodType[] = metafields?.list?.map((method: shippingMetafields, index: number) => normalizedMethod(method, weight, index))\n\n return normalizedList?.reduce((prev: ShippingMethodType[], method: ShippingMethodType) => {\n // \u5982\u679C\u8D85\u91CD\uFF0C\u540C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\u7C7B\u578B\u4E0B\uFF0C\u5C55\u793A\u5176\u4E2D\u4E00\u4E2A\u4E14\u4E0D\u53EF\u9009\n const sameTypeMethod = normalizedList.filter((m: ShippingMethodType) => m.code == method.code)\n let availableMethod: ShippingMethodType\n // \u6240\u6709\u7269\u6D41\u9009\u9879\u90FD\u4E0D\u53EF\u9009\n if (sameTypeMethod.every((m: ShippingMethodType) => m.disabled)) {\n availableMethod = sameTypeMethod[sameTypeMethod.length - 1]\n } else {\n // \u53EF\u9009\u7269\u6D41\u9009\u9879\n availableMethod = sameTypeMethod.find((m: ShippingMethodType) => !m.disabled)!\n }\n // \u5F53\u524D\u7269\u6D41\u9009\u9879\u5DF2\u5B58\u5728\n const hasSameMethod = prev.find((m: ShippingMethodType) => availableMethod.id === m.id)\n if (!hasSameMethod) {\n return [...prev, availableMethod]\n } else {\n return prev\n }\n }, [] as ShippingMethodType[])\n }, [normalizedMethod, metafields?.list, weight])\n\n const handleChangeShippingInfo = useCallback(\n (selectedMethod: ShippingMethodType) => {\n onShippingInfoChange({\n selected_delivery_code: selectedMethod.code,\n selected_delivery_mode: selectedMethod.mode,\n })\n },\n [onShippingInfoChange],\n )\n\n useEffect(() => {\n // \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\n if (metafields?.list?.length > 0 && !init) {\n const standardShippingMethod = normalizedMethod(metafields?.list[0], 0, 0)\n setSelectedMethod(standardShippingMethod)\n handleChangeShippingInfo(standardShippingMethod)\n setInit(true)\n }\n }, [normalizedMethod, metafields?.list, handleChangeShippingInfo, init])\n\n const toggleShipping = useCallback(\n (method: ShippingMethodType) => {\n if (method.disabled) {\n return\n }\n setSelectedMethod(method)\n handleChangeShippingInfo(method)\n // gaTrack({\n // event: 'ga4Event',\n // event_name: 'lp_button',\n // member_active_status: isLogin ? 'active' : 'not active', //\u7528\u4E8E\u8F93\u5165code\u6FC0\u6D3B\u4F1A\u5458\u5F39'\u7A97\u7684\u6309\u94AE\uFF0C\u533A\u5206\u4F1A\u5458\u6FC0\u6D3B\u72B6\u6001\uFF0C\u4F20active\u6216not active\n // event_parameters: {\n // page_group: 'Product Detail Page' + variant.sku, //\u5982\u679C\u662F\u9996\u9875\uFF0C\u5219\u4F20\"Home Page\";\u5982\u679C\u662Flisting\u7684\u9996\u5C4F\u6309\u94AE\uFF0C\u4F20Product Detail Page+$SKU\n // position: 'masterbanner1', //\u4F4D\u7F6E\u6807\u8BB0\u3002\u9996\u9875\u9996\u5C4F\u8F6E\u64AD\u4F4D\u7F6E\u4F20masterbanner1\u3001masterbanner2\u3001masterbanner3\uFF0C\u7B2C\u4E8C\u5C4F\u4F202nd_banner\uFF0C\u7B2C\u4E09\u5C4F\u4F203rd_banner\uFF0C\u6216\u8005\u53D6\u8BE5\u6A21\u5757\u5C0F\u6807\u9898\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6A21\u5757\u4F4D\u7F6E\u7684\u6587\u6848\uFF0C\u5F39\u7A97\u4F20pop;\u5982\u679C\u662F\u8D2D\u7269\u8F66\u4FA7\u8FB9\u680F\uFF0C\u5219\u4F20\"Cart Pop Up\"\n // button_name: method.title, //\u53D6\u6309\u94AE\u6587\u6848\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6309\u94AE\u7684\u6587\u6848,\u6BD4\u5982\u53F3\u4E0A\u89D2\u5173\u95ED\u4F20close,\u793E\u5A92\u5206\u4EAB\u56FE\u6807\u4F20\u5BF9\u5E94\u5E73\u53F0\u540D\u5B57\u5982Facebook,\u56FE\u7247\u5207\u6362\u5219\u4F20\u5BF9\u5E94\u5C55\u793A\u56FE\u7247\u7684\u540D\u5B57\n // info: '', //\u9ED8\u8BA4\u7A7A\u503C\uFF0C\u4E00\u822C\u4F20\u590D\u9009\u6846\u7684\u6587\u6848\u5185\u5BB9\uFF0C\u7279\u6B8A\u60C5\u51B5\u53EF\u6307\u5B9Ainfo\u503C\n // },\n // })\n },\n\n [isLogin, list, variant.sku, handleChangeShippingInfo, openSignInPopup],\n )\n\n return (\n <div\n id=\"ipc-product-paid-shipping\"\n className={cn(' mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0', className)}\n >\n <div className=\"flex flex-wrap justify-between space-x-2 md:space-x-1\">\n <Text\n className=\"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]\"\n html={metafields?.title}\n ></Text>\n {/* <button\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n className='text-brand-color text-[16px] font-semibold text-[#595959] underline md:text-[14px]'\n >\n {metafields?.policy}\n </button> */}\n </div>\n <div className=\"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap\">\n {list.map((method: ShippingMethodType, index: number) => (\n <ShippingMethod\n key={index}\n index={index}\n item={method}\n active={selectedMethod?.code === method.code}\n toggleShipping={() => toggleShipping(method)}\n currencyCode={variant.price.currencyCode}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:flex-1\"\n />\n ))}\n {/* learn more \u5361\u7247 */}\n <LearnMore\n setOpenShippingPolicyModal={setOpenShippingPolicyModal}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]\"\n />\n </div>\n {list.find((method: ShippingMethodType) => method?.error) && (\n <Text\n className=\"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]\"\n html={list.find((method: ShippingMethodType) => method.error)?.error as string}\n as=\"p\"\n />\n )}\n\n {metafields?.seeAvailableArea && (\n <Text\n as=\"div\"\n className=\"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline\"\n html={metafields?.seeAvailableArea}\n />\n )}\n {metafields?.shippingPolicy && (\n <ShippingPolicyModal\n data={metafields?.shippingPolicy}\n onClose={() => setOpenShippingPolicyModal(false)}\n open={openShippingPolicyModal}\n />\n )}\n </div>\n )\n}\n\nexport default PaidShipping"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6HQ,IAAAI,EAAA,6BA7HRC,EAAgC,2CAEhCC,EAA0D,iBAC1DC,EAAmB,+BAEnBC,EAA2B,+BAC3BC,EAAoC,iCAEpCC,EAAkC,mBAClCC,EAAsB,0BACtBC,EAAqC,uCAErC,MAAMC,EAAe,CAAC,CACpB,WAAAC,EACA,YAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,UAAAC,CACF,IAMM,CACJ,KAAM,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,wBAAqB,EACpD,CAACC,EAAyBC,CAA0B,KAAI,YAAS,EAAK,EACtE,CAACC,EAAMC,CAAO,KAAI,YAAS,EAAK,EAEhC,CAACC,EAAgBC,CAAiB,KAAI,YAAoC,IAAI,EAE9EC,KAAS,WAAQ,IACdZ,EAAY,OAAO,CAACa,EAAKC,IAAYD,GAAOC,GAAS,SAAS,QAAU,GAAI,CAAC,EACnF,CAACd,CAAW,CAAC,EAEVe,KAAmB,eACvB,CAACC,EAA4BJ,EAAgBK,KACpC,CACL,GAAI,GAAGD,EAAO,MAAM,KAAKA,EAAO,KAAK,GACrC,KAAMA,EAAO,OACb,KAAMA,EAAO,OACb,MAAOA,EAAO,MACd,SAAU,IAAC,qBAAkBJ,EAAQI,CAAM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AGXL,EAAkBK,CAAM,EACxBQ,EAAyBR,CAAM,EAYjC,EAEA,CAACZ,EAASc,EAAMhB,EAAQ,IAAKsB,EAA0BnB,CAAe,CACxE,EAEA,SACE,QAAC,OACC,GAAG,4BACH,aAAW,MAAG,6EAA8EF,CAAS,EAErG,oBAAC,OAAI,UAAU,wDACb,mBAAC,QACC,UAAU,oEACV,KAAMJ,GAAY,MACnB,EASH,KACA,QAAC,OAAI,UAAU,uFACZ,UAAAmB,EAAK,IAAI,CAACF,EAA4BC,OACrC,OAAC,EAAAU,QAAA,CAEC,MAAOV,EACP,KAAMD,EACN,OAAQN,GAAgB,OAASM,EAAO,KACxC,eAAgB,IAAMU,EAAeV,CAAM,EAC3C,aAAcd,EAAQ,MAAM,aAC5B,WAAYH,EACZ,UAAU,kDAPLkB,CAQP,CACD,KAED,OAAC,EAAAW,QAAA,CACC,2BAA4BrB,EAC5B,WAAYR,EACZ,UAAU,iGACZ,GACF,EACCmB,EAAK,KAAMF,GAA+BA,GAAQ,KAAK,MACtD,OAAC,QACC,UAAU,gEACV,KAAME,EAAK,KAAMF,GAA+BA,EAAO,KAAK,GAAG,MAC/D,GAAG,IACL,EAGDjB,GAAY,qBACX,OAAC,QACC,GAAG,MACH,UAAU,wFACV,KAAMA,GAAY,iBACpB,EAEDA,GAAY,mBACX,OAAC,uBACC,KAAMA,GAAY,eAClB,QAAS,IAAMQ,EAA2B,EAAK,EAC/C,KAAMD,EACR,GAEJ,CAEJ,EAEA,IAAOnB,EAAQW",
4
+ "sourcesContent": ["import { Container, Text } from '../../../../components/index.js'\nimport type { Product, ProductVariant } from '../../types/product'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { cn } from '../../../../helpers'\n\nimport ShippingMethod from './ShippingMethod'\nimport { ShippingPolicyModal } from './ShippingPolicyModal'\nimport type { DeliveryCustom, shippingMetafields, ShippingMethodType } from './type'\nimport { isWeightAvailable } from './utils'\nimport LearnMore from './LearnMore'\nimport { useBizProductContext } from '../../BizProductProvider.js'\n\nconst PaidShipping = ({\n metafields,\n productList,\n onShippingInfoChange,\n variant,\n className,\n}: {\n metafields: any\n productList: Array<Product & { variant: ProductVariant }>\n variant: ProductVariant\n onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void\n className?: string\n}) => {\n const { isLogin, openSignInPopup } = useBizProductContext()\n const [openShippingPolicyModal, setOpenShippingPolicyModal] = useState(false)\n const [init, setInit] = useState(false)\n\n const [selectedMethod, setSelectedMethod] = useState<ShippingMethodType | null>(null)\n\n const weight = useMemo(() => {\n return productList.reduce((acc, product) => acc + (product?.variant?.weight || 0), 0)\n }, [productList])\n\n const normalizedMethod = useCallback(\n (method: shippingMetafields, weight: number, index: number) => {\n return {\n id: `${method.__code}__${method.price}`,\n code: method.__code,\n mode: method.__mode,\n title: method.title,\n disabled: !isWeightAvailable(weight, method),\n price: method.price,\n subtitle: method.subtitle,\n tag: index !== 0 ? metafields?.memberOnly : '',\n error: !isWeightAvailable(weight, method) ? metafields.overWeightError : '',\n }\n },\n [metafields?.memberOnly, metafields.overWeightError]\n )\n\n const list = useMemo(() => {\n const normalizedList: ShippingMethodType[] = metafields?.list?.map((method: shippingMetafields, index: number) =>\n normalizedMethod(method, weight, index)\n )\n\n return normalizedList?.reduce((prev: ShippingMethodType[], method: ShippingMethodType) => {\n // \u5982\u679C\u8D85\u91CD\uFF0C\u540C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\u7C7B\u578B\u4E0B\uFF0C\u5C55\u793A\u5176\u4E2D\u4E00\u4E2A\u4E14\u4E0D\u53EF\u9009\n const sameTypeMethod = normalizedList.filter((m: ShippingMethodType) => m.code == method.code)\n let availableMethod: ShippingMethodType\n // \u6240\u6709\u7269\u6D41\u9009\u9879\u90FD\u4E0D\u53EF\u9009\n if (sameTypeMethod.every((m: ShippingMethodType) => m.disabled)) {\n availableMethod = sameTypeMethod[sameTypeMethod.length - 1]\n } else {\n // \u53EF\u9009\u7269\u6D41\u9009\u9879\n availableMethod = sameTypeMethod.find((m: ShippingMethodType) => !m.disabled)!\n }\n // \u5F53\u524D\u7269\u6D41\u9009\u9879\u5DF2\u5B58\u5728\n const hasSameMethod = prev.find((m: ShippingMethodType) => availableMethod.id === m.id)\n if (!hasSameMethod) {\n return [...prev, availableMethod]\n } else {\n return prev\n }\n }, [] as ShippingMethodType[])\n }, [normalizedMethod, metafields?.list, weight])\n\n const handleChangeShippingInfo = useCallback(\n (selectedMethod: ShippingMethodType) => {\n onShippingInfoChange({\n selected_delivery_code: selectedMethod.code,\n selected_delivery_mode: selectedMethod.mode,\n })\n },\n [onShippingInfoChange]\n )\n\n useEffect(() => {\n // \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\n if (metafields?.list?.length > 0 && !init) {\n const standardShippingMethod = normalizedMethod(metafields?.list[0], 0, 0)\n setSelectedMethod(standardShippingMethod)\n handleChangeShippingInfo(standardShippingMethod)\n setInit(true)\n }\n }, [normalizedMethod, metafields?.list, handleChangeShippingInfo, init])\n\n const toggleShipping = useCallback(\n (method: ShippingMethodType) => {\n if (method.disabled) {\n return\n }\n setSelectedMethod(method)\n handleChangeShippingInfo(method)\n // gaTrack({\n // event: 'ga4Event',\n // event_name: 'lp_button',\n // member_active_status: isLogin ? 'active' : 'not active', //\u7528\u4E8E\u8F93\u5165code\u6FC0\u6D3B\u4F1A\u5458\u5F39'\u7A97\u7684\u6309\u94AE\uFF0C\u533A\u5206\u4F1A\u5458\u6FC0\u6D3B\u72B6\u6001\uFF0C\u4F20active\u6216not active\n // event_parameters: {\n // page_group: 'Product Detail Page' + variant.sku, //\u5982\u679C\u662F\u9996\u9875\uFF0C\u5219\u4F20\"Home Page\";\u5982\u679C\u662Flisting\u7684\u9996\u5C4F\u6309\u94AE\uFF0C\u4F20Product Detail Page+$SKU\n // position: 'masterbanner1', //\u4F4D\u7F6E\u6807\u8BB0\u3002\u9996\u9875\u9996\u5C4F\u8F6E\u64AD\u4F4D\u7F6E\u4F20masterbanner1\u3001masterbanner2\u3001masterbanner3\uFF0C\u7B2C\u4E8C\u5C4F\u4F202nd_banner\uFF0C\u7B2C\u4E09\u5C4F\u4F203rd_banner\uFF0C\u6216\u8005\u53D6\u8BE5\u6A21\u5757\u5C0F\u6807\u9898\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6A21\u5757\u4F4D\u7F6E\u7684\u6587\u6848\uFF0C\u5F39\u7A97\u4F20pop;\u5982\u679C\u662F\u8D2D\u7269\u8F66\u4FA7\u8FB9\u680F\uFF0C\u5219\u4F20\"Cart Pop Up\"\n // button_name: method.title, //\u53D6\u6309\u94AE\u6587\u6848\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6309\u94AE\u7684\u6587\u6848,\u6BD4\u5982\u53F3\u4E0A\u89D2\u5173\u95ED\u4F20close,\u793E\u5A92\u5206\u4EAB\u56FE\u6807\u4F20\u5BF9\u5E94\u5E73\u53F0\u540D\u5B57\u5982Facebook,\u56FE\u7247\u5207\u6362\u5219\u4F20\u5BF9\u5E94\u5C55\u793A\u56FE\u7247\u7684\u540D\u5B57\n // info: '', //\u9ED8\u8BA4\u7A7A\u503C\uFF0C\u4E00\u822C\u4F20\u590D\u9009\u6846\u7684\u6587\u6848\u5185\u5BB9\uFF0C\u7279\u6B8A\u60C5\u51B5\u53EF\u6307\u5B9Ainfo\u503C\n // },\n // })\n },\n\n [isLogin, list, variant.sku, handleChangeShippingInfo, openSignInPopup]\n )\n\n return (\n <div\n id=\"ipc-product-paid-shipping\"\n className={cn(\n ' mt-16 desktop:mt-[96px] lg-desktop:mt-[128px] px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0',\n className\n )}\n >\n <div className=\"flex flex-wrap justify-between space-x-2 md:space-x-1\">\n <Text\n className=\"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]\"\n html={metafields?.title}\n ></Text>\n {/* <button\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n className='text-brand-color text-[16px] font-semibold text-[#595959] underline md:text-[14px]'\n >\n {metafields?.policy}\n </button> */}\n </div>\n <div className=\"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap\">\n {list.map((method: ShippingMethodType, index: number) => (\n <ShippingMethod\n key={index}\n index={index}\n item={method}\n active={selectedMethod?.code === method.code}\n toggleShipping={() => toggleShipping(method)}\n currencyCode={variant.price.currencyCode}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:flex-1\"\n />\n ))}\n {/* learn more \u5361\u7247 */}\n <LearnMore\n setOpenShippingPolicyModal={setOpenShippingPolicyModal}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]\"\n />\n </div>\n {list.find((method: ShippingMethodType) => method?.error) && (\n <Text\n className=\"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]\"\n html={list.find((method: ShippingMethodType) => method.error)?.error as string}\n as=\"p\"\n />\n )}\n\n {metafields?.seeAvailableArea && (\n <Text\n as=\"div\"\n className=\"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline\"\n html={metafields?.seeAvailableArea}\n />\n )}\n {metafields?.shippingPolicy && (\n <ShippingPolicyModal\n data={metafields?.shippingPolicy}\n onClose={() => setOpenShippingPolicyModal(false)}\n open={openShippingPolicyModal}\n />\n )}\n </div>\n )\n}\n\nexport default PaidShipping\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkIQ,IAAAI,EAAA,6BAlIRC,EAAgC,2CAEhCC,EAA0D,iBAC1DC,EAAmB,+BAEnBC,EAA2B,+BAC3BC,EAAoC,iCAEpCC,EAAkC,mBAClCC,EAAsB,0BACtBC,EAAqC,uCAErC,MAAMC,EAAe,CAAC,C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AAU,gEACV,KAAME,EAAK,KAAMF,GAA+BA,EAAO,KAAK,GAAG,MAC/D,GAAG,IACL,EAGDjB,GAAY,qBACX,OAAC,QACC,GAAG,MACH,UAAU,wFACV,KAAMA,GAAY,iBACpB,EAEDA,GAAY,mBACX,OAAC,uBACC,KAAMA,GAAY,eAClB,QAAS,IAAMQ,EAA2B,EAAK,EAC/C,KAAMD,EACR,GAEJ,CAEJ,EAEA,IAAOnB,EAAQW",
6
6
  "names": ["PaidShipping_exports", "__export", "PaidShipping_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "import_helpers", "import_ShippingMethod", "import_ShippingPolicyModal", "import_utils", "import_LearnMore", "import_BizProductProvider", "PaidShipping", "metafields", "productList", "onShippingInfoChange", "variant", "className", "isLogin", "openSignInPopup", "openShippingPolicyModal", "setOpenShippingPolicyModal", "init", "setInit", "selectedMethod", "setSelectedMethod", "weight", "acc", "product", "normalizedMethod", "method", "index", "list", "normalizedList", "prev", "sameTypeMethod", "m", "availableMethod", "handleChangeShippingInfo", "standardShippingMethod", "toggleShipping", "ShippingMethod", "LearnMore"]
7
7
  }
@@ -16,6 +16,7 @@ interface BenefitsTabTextConfig {
16
16
  off?: string;
17
17
  memberBenefits?: string;
18
18
  memberBenefitsNotLogin?: string;
19
+ memberBenefitsNotLoginText?: string;
19
20
  installment?: string;
20
21
  forNewMember?: string;
21
22
  expressShipping?: string;
@@ -1,4 +1,4 @@
1
- "use strict";var oe=Object.create;var v=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var le=(t,o)=>{for(var r in o)v(t,r,{get:o[r],enumerable:!0})},E=(t,o,r,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of ie(o))!re.call(t,a)&&a!==r&&v(t,a,{get:()=>o[a],enumerable:!(l=ne(o,a))||l.enumerable});return t};var y=(t,o,r)=>(r=t!=null?oe(se(t)):{},E(o||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>E(v({},"__esModule",{value:!0}),t);var ge={};le(ge,{default:()=>fe});module.exports=ae(ge);var e=require("react/jsx-runtime"),s=require("../../../../../components/index.js"),d=y(require("./ProductBenefitsTabs/index.js")),_=require("../../../BizProductProvider.js"),z=require("../../../hooks/useBenefits"),g=require("../../../utils/index.js"),N=require("../../../utils/textFormat"),U=y(require("classnames")),w=require("react"),Z=require("../../../../AiuiProvider/index.js"),O=y(require("../../../../../hooks/useCountDown.js")),G=y(require("../../../hooks/useCopy")),T=require("../../../../../helpers/index.js");const ce={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 "},pe=({item:t,textConfig:o})=>{const{trackingData:r}=(0,Z.useAiuiContext)(),{copied:l,copy:a}=(0,G.default)(),c=r?.common?.coupon,{days:b,hours:B,minutes:k,seconds:L}=(0,O.default)({endTime:t?.ends_at||""}),{openModal:D,isLogin:R}=(0,_.useBizProductContext)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{jsx:!0,children:`
1
+ "use strict";var oe=Object.create;var v=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var le=(t,o)=>{for(var r in o)v(t,r,{get:o[r],enumerable:!0})},E=(t,o,r,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of se(o))!re.call(t,a)&&a!==r&&v(t,a,{get:()=>o[a],enumerable:!(l=ne(o,a))||l.enumerable});return t};var y=(t,o,r)=>(r=t!=null?oe(ie(t)):{},E(o||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>E(v({},"__esModule",{value:!0}),t);var ge={};le(ge,{default:()=>fe});module.exports=ae(ge);var e=require("react/jsx-runtime"),i=require("../../../../../components/index.js"),d=y(require("./ProductBenefitsTabs/index.js")),I=require("../../../BizProductProvider.js"),z=require("../../../hooks/useBenefits"),g=require("../../../utils/index.js"),N=require("../../../utils/textFormat"),_=y(require("classnames")),B=require("react"),U=require("../../../../AiuiProvider/index.js"),G=y(require("../../../../../hooks/useCountDown.js")),O=y(require("../../../hooks/useCopy")),T=require("../../../../../helpers/index.js");const ce={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.",memberBenefitsNotLoginText:"Sign Up to Get Benefits Below",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},pe=({item:t,textConfig:o})=>{const{trackingData:r}=(0,U.useAiuiContext)(),{copied:l,copy:a}=(0,O.default)(),c=r?.common?.coupon,{days:b,hours:w,minutes:k,seconds:L}=(0,G.default)({endTime:t?.ends_at||""}),{openModal:M,isLogin:Z}=(0,I.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,27 +14,27 @@
14
14
  bottom left;
15
15
  mask-repeat: no-repeat;
16
16
  }
17
- `}),(0,e.jsxs)("div",{style:{background:t.couponBgColor||"white"},className:(0,U.default)("relative h-[100px] overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(s.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)(s.Checkbox,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:C=>{t?.onUseChange?.(C)}}),(0,e.jsx)(s.Text,{html:t.title,className:"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),(0,e.jsx)(s.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:"last:mt-2 flex items-center gap-2",children:[(0,e.jsx)(s.Text,{html:`${o.couponCode}: ${t.code}`,className:"text-base font-bold text-[#3D3D3F]"}),(0,e.jsx)("button",{className:"text-base font-bold underline",onClick:()=>a(t.code??""),children:l?c?.copied||o.copied:c?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{c?.modal&&D(c?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(b)<Number(c?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:c?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${b} ${c?.days} ${B.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`})]}):c?.hurry?.label||o.expired})]})]})]})},de=({coupons:t,className:o,textConfig:r})=>(0,e.jsx)("div",{className:(0,U.default)("flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1",o),children:t?.map((l,a)=>(0,e.jsx)(pe,{item:l,textConfig:r},a))}),ue=({textConfig:t})=>{const{isLogin:o,profile:r,variant:l,renderAffirm:a,renderKlarna:c,renderPaypal:b,onUseCouponChange:B,onUseMemberDiscountChange:k,discount:L,savingDetail:D,openModal:R,openSignInPopup:C,openAuthCodePopup:j,openSignUpPopup:W}=(0,_.useBizProductContext)(),Y=(0,z.useBenefits)({variant:l}),[M,q]=(0,w.useState)("coupon"),{trackingData:$,locale:m="us",copyWriting:K}=(0,Z.useAiuiContext)(),S=(0,w.useRef)(null),n={...ce,...t},{activated:J=!1}=r||{},{memberDiscount:u,commonCoupon:f,creditsRedemption:x,freeGift:V,bundle:F,paidShipping:Q,fullGift:P,levelDiscount:H}=Y,X=$?.product?.support??{},{thirdParty:me={}}=$?.common||{},h=[f?.enable?{...f.config,isAutoUse:D?.coupon>0,useAble:!0,borderStyle:"rounded",code:f?.config?.title??"",description:f?.config?.desc??"",onUseChange:i=>{const p=i?L?.codeSavings??0:0;B?.(p)},title:(0,N.replaceTemplate)(n.offCoupon,{discount:f?.config?.value_type=="percentage"?Math.abs(Number(f?.config?.value||0))+"%":(0,g.formatPrice)({amount:Math.abs(Number(f?.config?.fixed_value||0)),currencyCode:l.price.currencyCode,locale:m})})}:null,u.enable?{useAble:!0,isAutoUse:o,title:(0,N.replaceTemplate)(n.offMemberOnly,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})}),description:(0,e.jsxs)(e.Fragment,{children:[o?u?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m}))??""," ",o?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>C?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:i=>{if(o){const p=i?u?.config?.amount??0:0;k?.(p)}else C?.()}}:null,H.enable?{title:H?.config?.title??"",description:H?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,V.enable?{title:V?.config?.title??"",description:n.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,F.enable?{title:`${n.bundleSaveUpTo} ${(0,g.formatPrice)({amount:Math.max(...F?.config?.bundleList?.map(i=>i.savings??0)??[]),currencyCode:l.price.currencyCode,locale:m})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",F?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,P.enable?{title:P?.config?.title??"",description:P?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}: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"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean),ee=()=>{j?.()};if(!d.default)return null;const A=i=>{if(S.current){const p=S.current,I=i.currentTarget;console.log("button",I.offsetLeft);const te=I.offsetLeft-p.offsetWidth/2+I.offsetWidth/2;p.scrollTo({left:te,behavior:"smooth"})}};return(0,e.jsxs)(d.default,{onValueChange:i=>q(i),defaultValue:h?.length?"coupon":"membership",children:[(0,e.jsxs)(d.default.List,{ref:S,children:[h?.length?(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="coupon"&&"text-[#1D1D1F]"),value:"coupon",onClick:A,children:n.yourBenefits}):null,(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="membership"&&"text-[#1D1D1F]"),value:"membership",onClick:A,children:n.memberBenefits}),(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="installment"&&"text-[#1D1D1F]"),value:"installment",onClick:A,children:n.installment})]}),(0,e.jsx)("style",{global:!0,jsx:!0,children:`
18
- .coupon-container::-webkit-scrollbar {
17
+ `}),(0,e.jsxs)("div",{style:{background:t.couponBgColor||"white"},className:(0,_.default)("relative h-[100px] overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",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,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:x=>{t?.onUseChange?.(x)}}),(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:"last:mt-2 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-base font-bold underline",onClick:()=>a(t.code??""),children:l?c?.copied||o.copied:c?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{c?.modal&&M(c?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(b)<Number(c?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:c?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${b} ${c?.days} ${w.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`})]}):c?.hurry?.label||o.expired})]})]})]})},de=({coupons:t,className:o,textConfig:r})=>(0,e.jsx)("div",{className:(0,_.default)("flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1",o),children:t?.map((l,a)=>(0,e.jsx)(pe,{item:l,textConfig:r},a))}),ue=({textConfig:t})=>{const{isLogin:o,profile:r,variant:l,renderAffirm:a,renderKlarna:c,renderPaypal:b,onUseCouponChange:w,onUseMemberDiscountChange:k,discount:L,savingDetail:M,openModal:Z,openSignInPopup:x,openAuthCodePopup:j,openSignUpPopup:W}=(0,I.useBizProductContext)(),Y=(0,z.useBenefits)({variant:l}),[S,q]=(0,B.useState)("coupon"),{trackingData:R,locale:m="us",copyWriting:K}=(0,U.useAiuiContext)(),D=(0,B.useRef)(null),n={...ce,...t},{activated:J=!1}=r||{},{memberDiscount:u,commonCoupon:f,creditsRedemption:C,freeGift:$,bundle:F,paidShipping:Q,fullGift:P,levelDiscount:H}=Y,X=R?.product?.support??{},{thirdParty:me={}}=R?.common||{},h=[f?.enable?{...f.config,isAutoUse:M?.coupon>0,useAble:!0,borderStyle:"rounded",code:f?.config?.title??"",description:f?.config?.desc??"",onUseChange:s=>{const p=s?L?.codeSavings??0:0;w?.(p)},title:(0,N.replaceTemplate)(n.offCoupon,{discount:f?.config?.value_type=="percentage"?Math.abs(Number(f?.config?.value||0))+"%":(0,g.formatPrice)({amount:Math.abs(Number(f?.config?.fixed_value||0)),currencyCode:l.price.currencyCode,locale:m})})}:null,u.enable?{useAble:!0,isAutoUse:o,title:(0,N.replaceTemplate)(n.offMemberOnly,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})}),description:(0,e.jsxs)(e.Fragment,{children:[o?u?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m}))??""," ",o?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>x?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:s=>{if(o){const p=s?u?.config?.amount??0:0;k?.(p)}else x?.()}}:null,H.enable?{title:H?.config?.title??"",description:H?.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"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,F.enable?{title:`${n.bundleSaveUpTo} ${(0,g.formatPrice)({amount:Math.max(...F?.config?.bundleList?.map(s=>s.savings??0)??[]),currencyCode:l.price.currencyCode,locale:m})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",F?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,P.enable?{title:P?.config?.title??"",description:P?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,C.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"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean),ee=()=>{j?.()};if(!d.default)return null;const A=s=>{if(D.current){const p=D.current,V=s.currentTarget,te=V.offsetLeft-p.offsetWidth/2+V.offsetWidth/2;p.scrollTo({left:te,behavior:"smooth"})}};return(0,e.jsxs)(d.default,{onValueChange:s=>q(s),defaultValue:h?.length?"coupon":"membership",children:[(0,e.jsxs)(d.default.List,{ref:D,children:[h?.length?(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(S==="coupon"&&"text-[#1D1D1F]"),value:"coupon",onClick:A,children:n.yourBenefits}):null,(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(S==="membership"&&"text-[#1D1D1F]"),value:"membership",onClick:A,children:n.memberBenefits}),(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(S==="installment"&&"text-[#1D1D1F]"),value:"installment",onClick:A,children:n.installment})]}),(0,e.jsx)("style",{global:!0,jsx:!0,children:`
18
+ .benefits-tabs-content::-webkit-scrollbar {
19
19
  width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */
20
20
  height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */
21
21
  }
22
22
 
23
- .coupon-container::-webkit-scrollbar-track {
23
+ .benefits-tabs-content::-webkit-scrollbar-track {
24
24
  background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */
25
25
  }
26
26
 
27
- .coupon-container::-webkit-scrollbar-thumb {
27
+ .benefits-tabs-content::-webkit-scrollbar-thumb {
28
28
  background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */
29
29
  border-radius: 9999px; /* \u5706\u89D2 */
30
30
  }
31
31
 
32
- .coupon-container::-webkit-scrollbar-thumb:hover {
32
+ .benefits-tabs-content::-webkit-scrollbar-thumb:hover {
33
33
  background-color: rgba(100, 100, 100, 0.6);
34
34
  }
35
- `}),h?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"",children:(0,e.jsx)("div",{className:"coupon-container h-[240px] overflow-y-auto p-3 lg-desktop:p-4",children:(0,e.jsx)(de,{coupons:h,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 ${o?"max-h-[240px]":"max-h-[160px]"}`,children:(0,e.jsxs)("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
35
+ `}),h?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]",children:(0,e.jsx)("div",{className:"p-3 lg-desktop:p-4",children:(0,e.jsx)(de,{coupons:h,className:"",textConfig:n})})}):null,(0,e.jsx)(d.default.Content,{value:"membership",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]",children:(0,e.jsxs)("div",{className:"p-3 lg-desktop:p-4 ",children:[!o&&(0,e.jsx)("h3",{className:"mx-4 mb-2 text-left text-lg font-bold",children:n.memberBenefitsNotLoginText}),(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]
36
36
  [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2
37
37
  [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4
38
38
  [&_li]:py-4
39
- [&_li]:text-left`,children:[u.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)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:(0,N.replaceTemplate)(n.forNewMember,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})})})]}),X.items?.map((i,p)=>i.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>R?.({title:i.text,content:i.modalText}),className:"flex",children:[(0,e.jsx)(s.Picture,{source:i.icon,alt:i.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(s.Text,{className:"text-left text-[16px] font-medium x:text-[14px]",children:i.text})]},p)},p):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(s.Picture,{source:i.icon,alt:i.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:i.text})]},p)),Q.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)(s.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)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:J?x?.config?.label?.replace("{{amount}}",(0,g.formatPrice)({amount:x?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>ee(),className:"underline",children:n.active})]})})]}):null]})}),!o&&(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(s.Button,{variant:"primary",className:"w-full",onClick:()=>W?.(),children:K?.signUp})})]}),(0,e.jsxs)(d.default.Content,{value:"installment",className:"px-4",children:[(0,e.jsx)(s.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:[a,c,b&&(0,e.jsx)("div",{className:"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0",children:b})]})]})]})};var fe=ue;
39
+ [&_li]:text-left`,children:[u.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-bold x:text-[14px]",children:(0,N.replaceTemplate)(n.forNewMember,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})})})]}),X.items?.map((s,p)=>s.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>Z?.({title:s.text,content:s.modalText}),className:"flex",children:[(0,e.jsx)(i.Picture,{source:s.icon,alt:s.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{className:"text-left text-[16px] font-bold x:text-[14px]",children:s.text})]},p)},p):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(i.Picture,{source:s.icon,alt:s.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-bold x:text-[14px]",children:s.text})]},p)),Q.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-bold x:text-[14px]",children:n.expressShipping})]}):null,C.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:J?C?.config?.label?.replace("{{amount}}",(0,g.formatPrice)({amount:C?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>ee(),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:()=>W?.(),children:K?.signUp})})]})}),(0,e.jsxs)(d.default.Content,{value:"installment",className:"benefits-tabs-content overflow-y-auto px-4 lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px] ",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:[a,c,b]})]})]})};var fe=ue;
40
40
  //# sourceMappingURL=BenefitsTab.js.map