@anker-in/headless-ui 1.3.80 → 1.3.82

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 (102) hide show
  1. package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +2 -0
  2. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  3. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -0
  4. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  5. package/dist/cjs/biz-components/ActiveShelf/styles.js +1 -1
  6. package/dist/cjs/biz-components/BuyOneGetOneShelf/DiscountBadge.d.ts +25 -0
  7. package/dist/cjs/biz-components/BuyOneGetOneShelf/DiscountBadge.js +1 -0
  8. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +4 -0
  9. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  10. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +4 -0
  11. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  12. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -2
  13. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  14. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +0 -3
  15. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  16. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductTags.d.ts +14 -0
  17. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductTags.js +1 -0
  18. package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +2 -1
  19. package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +1 -1
  20. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
  21. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  22. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +70 -3
  23. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js +1 -1
  24. package/dist/cjs/biz-components/Category/index.js +1 -1
  25. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  26. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  27. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  28. package/dist/cjs/biz-components/MediaShelf/ProductCard.d.ts +2 -0
  29. package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
  30. package/dist/cjs/biz-components/MediaShelf/index.js +1 -1
  31. package/dist/cjs/biz-components/MiniCart/CircleProgress.d.ts +22 -1
  32. package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -1
  33. package/dist/cjs/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
  34. package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
  35. package/dist/cjs/biz-components/MiniCart/index.d.ts +45 -0
  36. package/dist/cjs/biz-components/MiniCart/index.js +1 -1
  37. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  38. package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
  39. package/dist/cjs/biz-components/Title/index.js +1 -1
  40. package/dist/cjs/biz-components/index.d.ts +2 -2
  41. package/dist/cjs/biz-components/index.js +1 -1
  42. package/dist/cjs/helpers/ScrollLoadVideo.d.ts +9 -1
  43. package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
  44. package/dist/cjs/material/breakpoints.d.ts +97 -0
  45. package/dist/cjs/material/breakpoints.js +1 -0
  46. package/dist/cjs/material/contract.d.ts +72 -0
  47. package/dist/cjs/material/contract.js +1 -0
  48. package/dist/cjs/material/index.d.ts +17 -0
  49. package/dist/cjs/material/index.js +1 -0
  50. package/dist/cjs/material/material-meta.d.ts +76 -0
  51. package/dist/cjs/material/material-meta.js +1 -0
  52. package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +2 -0
  53. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  54. package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -0
  55. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  56. package/dist/esm/biz-components/ActiveShelf/styles.js +1 -1
  57. package/dist/esm/biz-components/BuyOneGetOneShelf/DiscountBadge.d.ts +25 -0
  58. package/dist/esm/biz-components/BuyOneGetOneShelf/DiscountBadge.js +1 -0
  59. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +4 -0
  60. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  61. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +4 -0
  62. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  63. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -2
  64. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  65. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +0 -3
  66. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  67. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductTags.d.ts +14 -0
  68. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductTags.js +1 -0
  69. package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +2 -1
  70. package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
  71. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  72. package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +70 -3
  73. package/dist/esm/biz-components/Category/index.js +1 -1
  74. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  75. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  76. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  77. package/dist/esm/biz-components/MediaShelf/ProductCard.d.ts +2 -0
  78. package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
  79. package/dist/esm/biz-components/MediaShelf/index.js +1 -1
  80. package/dist/esm/biz-components/MiniCart/CircleProgress.d.ts +22 -1
  81. package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -1
  82. package/dist/esm/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
  83. package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
  84. package/dist/esm/biz-components/MiniCart/index.d.ts +45 -0
  85. package/dist/esm/biz-components/MiniCart/index.js +1 -1
  86. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  87. package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
  88. package/dist/esm/biz-components/Title/index.js +1 -1
  89. package/dist/esm/biz-components/index.d.ts +2 -2
  90. package/dist/esm/biz-components/index.js +1 -1
  91. package/dist/esm/helpers/ScrollLoadVideo.d.ts +9 -1
  92. package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
  93. package/dist/esm/material/breakpoints.d.ts +97 -0
  94. package/dist/esm/material/breakpoints.js +1 -0
  95. package/dist/esm/material/contract.d.ts +72 -0
  96. package/dist/esm/material/contract.js +1 -0
  97. package/dist/esm/material/index.d.ts +17 -0
  98. package/dist/esm/material/index.js +1 -0
  99. package/dist/esm/material/material-meta.d.ts +76 -0
  100. package/dist/esm/material/material-meta.js +1 -0
  101. package/package.json +13 -2
  102. package/style.css +26 -2
@@ -1 +1 @@
1
- "use strict";"use client";var B=Object.create;var S=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of R(t))!H.call(e,i)&&i!==n&&S(e,i,{get:()=>t[i],enumerable:!(o=P(t,i))||o.enumerable});return e};var q=(e,t,n)=>(n=e!=null?B(z(e)):{},y(t||!e||!e.__esModule?S(n,"default",{value:e,enumerable:!0}):n,e)),G=e=>y(S({},"__esModule",{value:!0}),e);var Y={};j(Y,{default:()=>X});module.exports=G(Y);var s=require("react/jsx-runtime"),l=q(require("react")),u=require("../../helpers/index.js"),F=require("../../shared/Styles.js"),m=require("../../components/index.js"),f=require("swiper/react"),v=require("class-variance-authority");const k=(e,t)=>{const n=Date.now(),o=new Date(e).getTime(),i=new Date(t).getTime();return n>i?"completed":n<o?"not-started":"in-progress"},J=(0,v.cva)("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),K=(0,v.cva)("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),T=(0,v.cva)("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),O=(0,v.cva)("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),Q=({timeStatus:e,theme:t="light",className:n,index:o,nodeLength:i})=>{const p=`${e}-${t}`,a=o===0,d=o===i-1;return(0,s.jsxs)("div",{className:(0,u.cn)(`event-schedule-timeline-node event-schedule-timeline-node--${e} relative my-2 flex h-1 w-full items-center justify-center`,n),children:[(0,s.jsx)("div",{className:(0,u.cn)(`event-schedule-timeline-progress event-schedule-timeline-progress--${e}`,J({state:p}),a&&"rounded-l-full",d&&"rounded-r-full")}),(0,s.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,s.jsx)("div",{className:(0,u.cn)(`event-schedule-timeline-dot event-schedule-timeline-dot--${e}`,K({state:p}))})})]})},U=(e,t)=>{if(e)return t==="in-progress"?e.active:t==="completed"&&e.completed||e.inactive},W=({timeStatus:e,item:t,theme:n="light",className:o,scheduleCount:i})=>{const p=l.useMemo(()=>U(t.icon,e),[t.icon,e]),a=`${e}-${n}`;return(0,s.jsxs)("div",{className:(0,u.cn)(`event-schedule-card event-schedule-card--${e}`,O({state:a}),o),children:[p&&(0,s.jsx)("div",{className:`event-schedule-card__background-icon event-schedule-card__background-icon--${e} laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]`,children:(0,s.jsx)(m.Picture,{source:p.url,alt:p.alt,className:"aspect-square"})}),(0,s.jsxs)("div",{className:`event-schedule-card__content event-schedule-card__content--${e} tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8`,children:[(0,s.jsx)(m.Heading,{html:t.title,className:(0,u.cn)(`event-schedule-card__title event-schedule-card__title--${e}`,i>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",T({state:a}))}),(0,s.jsx)("div",{className:`event-schedule-card__details event-schedule-card__details--${e} flex flex-col gap-0.5`,children:t.items.map((d,c)=>(0,s.jsxs)("div",{className:`event-schedule-card__detail-item event-schedule-card__detail-item--${e} flex items-center gap-2`,children:[d.icon&&(0,s.jsx)(m.Text,{className:(0,u.cn)(`event-schedule-card__detail-icon event-schedule-card__detail-icon--${e} desktop:size-6 size-5 shrink-0`,T({state:a})),html:d.icon}),(0,s.jsx)(m.Text,{html:d.label,className:(0,u.cn)(`event-schedule-card__detail-text event-schedule-card__detail-text--${e} lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]`,T({state:a}))})]},c))})]})]})},L=l.forwardRef(({classNames:e={},data:t,className:n,...o},i)=>{const p=t.theme||"light",a=l.useRef(null),d=l.useRef(null),c=l.useRef(!1),w=l.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),b=l.useMemo(()=>t.scheduleList.findIndex(r=>k(r.startDate,r.endDate)==="in-progress"),[t.scheduleList]),x=l.useCallback((r,g=!1)=>{const h=A=>{switch(A){case"mobile":return{slidesPerView:1.17};case"tablet":return r===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2}:{slidesPerView:r};case"desktop":return r===2?{slidesPerView:2}:{slidesPerView:r}}},C=h("mobile"),N=h("tablet"),_=h("laptop"),D=h("desktop");return g?{0:{...C,spaceBetween:12},768:{...N,spaceBetween:12},1024:{..._,spaceBetween:16},1440:{...D,spaceBetween:16}}:{0:C,768:N,1024:_,1440:D}},[]),V=l.useMemo(()=>x(w,!0),[w,x]),$=l.useMemo(()=>x(w,!1),[w,x]),E=t.showTimeline!==!1,I=l.useCallback(r=>{c.current||!d.current||(c.current=!0,d.current.slideTo(r.activeIndex,r.params.speed),setTimeout(()=>{c.current=!1},50))},[]),M=l.useCallback(r=>{c.current||!a.current||(c.current=!0,a.current.slideTo(r.activeIndex,r.params.speed),setTimeout(()=>{c.current=!1},50))},[]);return l.useEffect(()=>{a.current&&d.current&&b>=0&&setTimeout(()=>{c.current=!0,a.current?.slideTo(b,500),d.current?.slideTo(b,500),setTimeout(()=>{c.current=!1},600)},100)},[b]),(0,s.jsxs)(m.Container,{...o,ref:i,className:(0,u.cn)("event-schedule-root overflow-hidden",e?.root,n),children:[E&&(0,s.jsx)(f.Swiper,{breakpoints:$,className:"event-schedule-timeline h-4 w-full !overflow-visible",onSwiper:r=>{d.current=r},onSlideChange:M,children:t.scheduleList.map((r,g)=>{const h=k(r.startDate,r.endDate);return(0,s.jsx)(f.SwiperSlide,{className:"",children:(0,s.jsx)(Q,{className:e?.timeline,timeStatus:h,theme:p,index:g,nodeLength:t.scheduleList.length})},"timelineNode"+g)})}),(0,s.jsx)(f.Swiper,{breakpoints:V,className:"event-schedule-cards w-full !overflow-visible",onSwiper:r=>{a.current=r},onSlideChange:I,children:t.scheduleList.map((r,g)=>{const h=k(r.startDate,r.endDate);return(0,s.jsx)(f.SwiperSlide,{children:(0,s.jsx)(W,{timeStatus:h,className:(0,u.cn)(E?"laptop:mt-4 mt-2":"",e?.eventScheduleCard),item:r,theme:p,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+g)})})]})});L.displayName="EventSchedule";var X=(0,F.withLayout)(L);
1
+ "use strict";"use client";var W=Object.create;var x=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},B=(e,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Z(t))!J.call(e,l)&&l!==n&&x(e,l,{get:()=>t[l],enumerable:!(d=q(t,l))||d.enumerable});return e};var O=(e,t,n)=>(n=e!=null?W(G(e)):{},B(t||!e||!e.__esModule?x(n,"default",{value:e,enumerable:!0}):n,e)),Q=e=>B(x({},"__esModule",{value:!0}),e);var ne={};K(ne,{default:()=>re});module.exports=Q(ne);var r=require("react/jsx-runtime"),i=O(require("react")),o=require("../../helpers/index.js"),H=require("../../shared/Styles.js"),g=require("../../components/index.js"),f=require("swiper/react"),v=require("class-variance-authority"),L=require("../SwiperBox/buildSsrSlideCss.js");const D=(e,t)=>{const n=Date.now(),d=new Date(e).getTime(),l=new Date(t).getTime();return n>l?"completed":n<d?"not-started":"in-progress"},U=(0,v.cva)("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),X=(0,v.cva)("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),$=(0,v.cva)("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),Y=(0,v.cva)("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),ee=({timeStatus:e,theme:t="light",className:n,index:d,nodeLength:l})=>{const p=`${e}-${t}`,a=d===0,c=d===l-1;return(0,r.jsxs)("div",{className:(0,o.cn)(`event-schedule-timeline-node event-schedule-timeline-node--${e} relative my-2 flex h-1 w-full items-center justify-center`,n),children:[(0,r.jsx)("div",{className:(0,o.cn)(`event-schedule-timeline-progress event-schedule-timeline-progress--${e}`,U({state:p}),a&&"rounded-l-full",c&&"rounded-r-full")}),(0,r.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,r.jsx)("div",{className:(0,o.cn)(`event-schedule-timeline-dot event-schedule-timeline-dot--${e}`,X({state:p}))})})]})},te=(e,t)=>{if(e)return t==="in-progress"?e.active:t==="completed"&&e.completed||e.inactive},se=({timeStatus:e,item:t,theme:n="light",className:d,scheduleCount:l})=>{const p=i.useMemo(()=>te(t.icon,e),[t.icon,e]),a=`${e}-${n}`;return(0,r.jsxs)("div",{className:(0,o.cn)(`event-schedule-card event-schedule-card--${e}`,Y({state:a}),d),children:[p&&(0,r.jsx)("div",{className:`event-schedule-card__background-icon event-schedule-card__background-icon--${e} laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]`,children:(0,r.jsx)(g.Picture,{source:p.url,alt:p.alt,className:"aspect-square"})}),(0,r.jsxs)("div",{className:`event-schedule-card__content event-schedule-card__content--${e} tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8`,children:[(0,r.jsx)(g.Heading,{html:t.title,className:(0,o.cn)(`event-schedule-card__title event-schedule-card__title--${e}`,l>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",$({state:a}))}),(0,r.jsx)("div",{className:`event-schedule-card__details event-schedule-card__details--${e} flex flex-col gap-0.5`,children:t.items.map((c,u)=>(0,r.jsxs)("div",{className:`event-schedule-card__detail-item event-schedule-card__detail-item--${e} flex items-center gap-2`,children:[c.icon&&(0,r.jsx)(g.Text,{className:(0,o.cn)(`event-schedule-card__detail-icon event-schedule-card__detail-icon--${e} desktop:size-6 size-5 shrink-0`,$({state:a})),html:c.icon}),(0,r.jsx)(g.Text,{html:c.label,className:(0,o.cn)(`event-schedule-card__detail-text event-schedule-card__detail-text--${e} lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]`,$({state:a}))})]},u))})]})]})},P=i.forwardRef(({classNames:e={},data:t,className:n,...d},l)=>{const p=t.theme||"light",a=i.useRef(null),c=i.useRef(null),u=i.useRef(!1),S=i.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),w=i.useMemo(()=>t.scheduleList.findIndex(s=>D(s.startDate,s.endDate)==="in-progress"),[t.scheduleList]),b=i.useCallback((s,h=!1)=>{const m=j=>{switch(j){case"mobile":return{slidesPerView:1.17};case"tablet":return s===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return s===2?{}:s===4?{slidesPerView:3.2}:{slidesPerView:s};case"desktop":return s===2?{slidesPerView:2}:{slidesPerView:s}}},M=m("mobile"),F=m("tablet"),V=m("laptop"),A=m("desktop");return h?{0:{...M,spaceBetween:12},768:{...F,spaceBetween:12},1024:{...V,spaceBetween:16},1440:{...A,spaceBetween:16}}:{0:M,768:F,1024:V,1440:A}},[]),k=i.useMemo(()=>b(S,!0),[S,b]),T=i.useMemo(()=>b(S,!1),[S,b]),I=i.useId().replace(/[^a-zA-Z0-9_-]/g,""),C=`swiper-ssr-timeline-${I}`,E=`swiper-ssr-cards-${I}`,_=i.useMemo(()=>(0,L.buildSsrSlideCss)(`.${C}`,T),[C,T]),N=i.useMemo(()=>(0,L.buildSsrSlideCss)(`.${E}`,k),[E,k]),y=t.showTimeline!==!1,z=i.useCallback(s=>{u.current||!c.current||(u.current=!0,c.current.slideTo(s.activeIndex,s.params.speed),setTimeout(()=>{u.current=!1},50))},[]),R=i.useCallback(s=>{u.current||!a.current||(u.current=!0,a.current.slideTo(s.activeIndex,s.params.speed),setTimeout(()=>{u.current=!1},50))},[]);return i.useEffect(()=>{a.current&&c.current&&w>=0&&setTimeout(()=>{u.current=!0,a.current?.slideTo(w,500),c.current?.slideTo(w,500),setTimeout(()=>{u.current=!1},600)},100)},[w]),(0,r.jsxs)("div",{...d,ref:l,className:(0,o.cn)("event-schedule-root overflow-hidden",e?.root,n),children:[y&&_&&(0,r.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:_}}),N&&(0,r.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:N}}),y&&(0,r.jsx)(f.Swiper,{breakpoints:T,className:(0,o.cn)("event-schedule-timeline h-4 w-full !overflow-visible",_&&C),onSwiper:s=>{c.current=s},onSlideChange:R,children:t.scheduleList.map((s,h)=>{const m=D(s.startDate,s.endDate);return(0,r.jsx)(f.SwiperSlide,{className:"",children:(0,r.jsx)(ee,{className:e?.timeline,timeStatus:m,theme:p,index:h,nodeLength:t.scheduleList.length})},"timelineNode"+h)})}),(0,r.jsx)(f.Swiper,{breakpoints:k,className:(0,o.cn)("event-schedule-cards w-full !overflow-visible",N&&E),onSwiper:s=>{a.current=s},onSlideChange:z,children:t.scheduleList.map((s,h)=>{const m=D(s.startDate,s.endDate);return(0,r.jsx)(f.SwiperSlide,{children:(0,r.jsx)(se,{timeStatus:m,className:(0,o.cn)(y?"laptop:mt-4 mt-2":"",e?.eventScheduleCard),item:s,theme:p,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+h)})})]})});P.displayName="EventSchedule";var re=(0,H.withLayout)(P);
@@ -1 +1 @@
1
- "use strict";"use client";var Oe=Object.create;var M=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var qe=(t,p)=>{for(var o in p)M(t,o,{get:p[o],enumerable:!0})},se=(t,p,o,T)=>{if(p&&typeof p=="object"||typeof p=="function")for(let g of Ge(p))!_e.call(t,g)&&g!==o&&M(t,g,{get:()=>p[g],enumerable:!(T=Ue(p,g))||T.enumerable});return t};var H=(t,p,o)=>(o=t!=null?Oe(Je(t)):{},se(p||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),Fe=t=>se(M({},"__esModule",{value:!0}),t);var $e={};qe($e,{default:()=>Xe});module.exports=Fe($e);var e=require("react/jsx-runtime"),u=H(require("react")),V=H(require("gsap")),z=require("gsap/dist/ScrollTrigger"),R=H(require("jump.js")),f=require("./mediaResolver.js"),pe=require("react-intersection-observer"),ce=H(require("../../helpers/ScrollLoadVideo.js")),l=require("../../components/index.js"),m=require("../../helpers/index.js"),I=require("class-variance-authority"),ue=require("../../shared/Styles.js"),me=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),de=require("../../helpers/utils.js"),fe=require("../AiuiProvider/index.js"),ge=require("../../components/button.js"),be=require("../VideoModal/index.js"),ve=H(require("./HeroBannerCarousel.js"));const y="hero_banner",We=(0,I.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ye=(0,I.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ze=(0,I.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Ke=(0,I.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=({size:t="base"})=>{const{width:p,height:o}=ge.sizeMap[t];return(0,e.jsx)("svg",{width:p,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},le=u.default.forwardRef(({data:t,className:p,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ye,...q},F)=>{const{locale:W,pageHandle:ke}=(0,fe.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,E={...{duration:500,offset:0},...xe},L=r=>!r||!W?r:(0,de.getLocalizedPath)(r,W),{label:Z,title:c,subtitle:a,endDate:K,endDate_tz:he,dateFormat:Te,pcImage:D,isShowVideo:Q,isVideoLoop:we=!0,primaryButton:i,secondaryButton:n,tertiaryButton:s,theme:Be="light",size:j="default",titleSize:A,caption:X=[],blockLink:S,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,u.useState)(!1),{ref:He,inView:ae}=(0,pe.useInView)(),U=(0,u.useRef)(null),G=(0,u.useRef)(null),J=(0,u.useRef)(null),B=(0,u.useRef)(null),x=(0,u.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),P=(0,k.buildTrackingRef)(ke??"",b,y),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=c?.trim()||a?.trim()||D?.alt?.trim()||void 0,ze=c!==void 0?c?.trim()||a?.trim()||D?.alt?.trim()||void 0:a&&a.trim()||"",Ie=a&&a.trim()||"";(0,me.useExposure)(x,{componentType:b,componentName:y,componentTitle:ze,componentDescription:Ie,creativeId:h,position:1});const Le=S?(0,k.trackUrlRef)(L(S),P):void 0,Se=n?.link?(0,k.trackUrlRef)(L(n.link),P):void 0,Pe=i?.link?(0,k.trackUrlRef)(L(i.link),P):void 0,Me=s?.link?(0,k.trackUrlRef)(L(s.link),P):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!S,componentType:b,componentName:y,title:c,description:a,position:1,creativeId:h}),Ee=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:y,title:c,description:a,buttonName:"video play",position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:n?.text,position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(i?.link||i?.isCustomPrimaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:i?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomTertiaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:s?.text,position:1,creativeId:h});return(0,u.useImperativeHandle)(F,()=>x.current),(0,u.useEffect)(()=>{if(Y||!ee)return;V.default.registerPlugin(z.ScrollTrigger);function r(){if(!B.current)return;const d=x.current?.clientHeight||100;window.innerHeight<=d?U.current=z.ScrollTrigger.create({trigger:x.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:N=>{const C=N.progress*40-20;V.default.set(B.current,{yPercent:C})}}):(J.current=z.ScrollTrigger.create({trigger:x.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:N=>{const C=N.progress*20-20;V.default.set(B.current,{yPercent:C})}}),G.current=z.ScrollTrigger.create({trigger:x.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:N=>{const C=N.progress*20;V.default.set(B.current,{yPercent:C})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ve.default,{data:t,className:p,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ye,ref:F,...q}):(0,e.jsx)("div",{...q,ref:He,"data-ui-component-id":"HeroBanner",className:(0,m.cn)(o.root),children:(0,e.jsxs)("div",{ref:x,className:(0,m.cn)(Be==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},p),children:[S&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Le,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,m.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ce.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full",videoClassName:"h-full object-cover",muted:!0,loop:we,playsInline:!0,onPlaying:r=>{r.currentTarget.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(l.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(l.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:We({align:w}),children:[(0,e.jsxs)("div",{className:Ye({align:w}),children:[Z&&(0,e.jsx)(l.Text,{size:2,as:"p",className:(0,m.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),c&&(0,e.jsx)(l.Heading,{as:A==="4"?"h1":"h2",html:c,className:(0,m.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),a&&(0,e.jsx)(l.Text,{as:"p",size:2,className:(0,m.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:a}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(l.Countdown,{endDate:K,endDate_tz:he,dateFormat:Te,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,m.cn)(Ze({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(l.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...Ee,children:[n?.playVideoButtonText," ",(0,e.jsx)(Qe,{size:"lg"})]}):n?.text?(0,e.jsxs)(l.Button,{"aria-label":c??a,size:"lg",variant:"secondary",className:(0,m.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Se,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(n.link);d&&(0,R.default)(d,E)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...De,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:c??a})]}):null,i&&i.text&&(0,e.jsx)(l.Button,{"aria-label":c??a,size:"lg",variant:"primary",className:(0,m.cn)("hero-banner-primary-button",o.primaryButton),as:i?.isCustomPrimaryButton?"button":"a",href:Pe,target:i?.target,rel:i?.target==="_blank"?i?.rel??"noopener noreferrer":i?.rel,onClick:r=>{if(i.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(i.link);d&&(0,R.default)(d,E)}i?.isCustomPrimaryButton&&g?.(t,r,i?.customPrimaryEventId)},...je,children:i.text})]}),s&&s.text&&(0,e.jsxs)(l.Button,{"aria-label":c??a,size:"lg",variant:"link",className:(0,m.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:s?.isCustomTertiaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(s.link);d&&(0,R.default)(d,E)}s?.isCustomTertiaryButton&&_?.(t,r,s?.customTertiaryEventId)},...Ae,children:[s.text,(0,e.jsx)("span",{className:"sr-only",children:c??a})]})]}),(0,e.jsx)("div",{className:Ke({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(l.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,m.cn)("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",o.captionGroup),children:O.map((r,d)=>(0,e.jsxs)(u.default.Fragment,{children:[(0,e.jsx)(l.Text,{size:2,className:(0,m.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),d<O.length-1&&(0,e.jsx)("div",{className:(0,m.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(be.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});le.displayName="HeroBanner";var Xe=(0,ue.withLayout)(le);
1
+ "use strict";"use client";var Ue=Object.create;var M=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Fe=(t,c)=>{for(var o in c)M(t,o,{get:c[o],enumerable:!0})},le=(t,c,o,T)=>{if(c&&typeof c=="object"||typeof c=="function")for(let g of Je(c))!qe.call(t,g)&&g!==o&&M(t,g,{get:()=>c[g],enumerable:!(T=Ge(c,g))||T.enumerable});return t};var C=(t,c,o)=>(o=t!=null?Ue(_e(t)):{},le(c||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),We=t=>le(M({},"__esModule",{value:!0}),t);var et={};Fe(et,{default:()=>$e});module.exports=We(et);var e=require("react/jsx-runtime"),m=C(require("react")),L=C(require("gsap")),V=require("gsap/dist/ScrollTrigger"),P=C(require("jump.js")),f=require("./mediaResolver.js"),ce=require("react-intersection-observer"),ue=C(require("../../helpers/ScrollLoadVideo.js")),p=require("../../components/index.js"),d=require("../../helpers/index.js"),S=require("class-variance-authority"),me=require("../../shared/Styles.js"),de=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),fe=require("../../helpers/utils.js"),ge=require("../AiuiProvider/index.js"),be=require("../../components/button.js"),ve=require("../VideoModal/index.js"),ye=C(require("./HeroBannerCarousel.js"));const x="hero_banner",Ye=(0,S.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ze=(0,S.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ke=(0,S.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=(0,S.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Xe=({size:t="base"})=>{const{width:c,height:o}=be.sizeMap[t];return(0,e.jsx)("svg",{width:c,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},pe=m.default.forwardRef(({data:t,className:c,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ke,...q},F)=>{const{locale:W,pageHandle:he}=(0,ge.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,R={...{duration:500,offset:0},...xe},z=r=>!r||!W?r:(0,fe.getLocalizedPath)(r,W),{label:Z,title:u,subtitle:i,endDate:K,endDate_tz:Te,dateFormat:we,pcImage:D,isShowVideo:Q,isVideoLoop:Be=!0,primaryButton:s,secondaryButton:n,tertiaryButton:l,theme:He="light",size:j="default",titleSize:A,caption:X=[],blockLink:I,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,m.useState)(!1),{ref:Le,inView:ae}=(0,ce.useInView)(),U=(0,m.useRef)(null),G=(0,m.useRef)(null),J=(0,m.useRef)(null),B=(0,m.useRef)(null),y=(0,m.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),E=(0,k.buildTrackingRef)(he??"",b,x),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=u?.trim()||i?.trim()||D?.alt?.trim()||void 0,Se=u!==void 0?u?.trim()||i?.trim()||D?.alt?.trim()||void 0:i&&i.trim()||"",ze=i&&i.trim()||"";(0,de.useExposure)(y,{componentType:b,componentName:x,componentTitle:Se,componentDescription:ze,creativeId:h,position:1});const Ie=I?(0,k.trackUrlRef)(z(I),E):void 0,Ee=n?.link?(0,k.trackUrlRef)(z(n.link),E):void 0,Me=s?.link?(0,k.trackUrlRef)(z(s.link),E):void 0,Pe=l?.link?(0,k.trackUrlRef)(z(l.link),E):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!I,componentType:b,componentName:x,title:u,description:i,position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:x,title:u,description:i,buttonName:"video play",position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:n?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomPrimaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:s?.text,position:1,creativeId:h}),Oe=(0,v.buildClickTrackingProps)({interactive:!!(l?.link||l?.isCustomTertiaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:l?.text,position:1,creativeId:h});return(0,m.useImperativeHandle)(F,()=>y.current),(0,m.useEffect)(()=>{if(Y||!ee)return;L.default.registerPlugin(V.ScrollTrigger);function r(){if(!B.current)return;const a=y.current?.clientHeight||100;window.innerHeight<=a?U.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*40-20;L.default.set(B.current,{yPercent:N})}}):(J.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:H=>{const N=H.progress*20-20;L.default.set(B.current,{yPercent:N})}}),G.current=V.ScrollTrigger.create({trigger:y.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*20;L.default.set(B.current,{yPercent:N})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ye.default,{data:t,className:c,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ke,ref:F,...q}):(0,e.jsx)("div",{...q,ref:Le,"data-ui-component-id":"HeroBanner",className:(0,d.cn)(o.root),children:(0,e.jsxs)("div",{ref:y,className:(0,d.cn)(He==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},c),children:[I&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Ie,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,d.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ue.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full transition-opacity duration-500",videoLayerClassName:"opacity-0",videoClassName:"h-full object-cover",muted:!0,loop:Be,playsInline:!0,onPlaying:r=>{const a=r.currentTarget;a.parentElement?.classList.remove("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:r=>{const a=r.currentTarget;if(a.currentTime>=.5)return;a.parentElement?.classList.add("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full bg-container-primary pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(p.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:Ye({align:w}),children:[(0,e.jsxs)("div",{className:Ze({align:w}),children:[Z&&(0,e.jsx)(p.Text,{size:2,as:"p",className:(0,d.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),u&&(0,e.jsx)(p.Heading,{as:A==="4"?"h1":"h2",html:u,className:(0,d.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),i&&(0,e.jsx)(p.Text,{as:"p",size:2,className:(0,d.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:i}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(p.Countdown,{endDate:K,endDate_tz:Te,dateFormat:we,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,d.cn)(Ke({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(p.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...De,children:[n?.playVideoButtonText," ",(0,e.jsx)(Xe,{size:"lg"})]}):n?.text?(0,e.jsxs)(p.Button,{"aria-label":u??i,size:"lg",variant:"secondary",className:(0,d.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Ee,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(n.link);a&&(0,P.default)(a,R)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...je,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]}):null,s&&s.text&&(0,e.jsx)(p.Button,{"aria-label":u??i,size:"lg",variant:"primary",className:(0,d.cn)("hero-banner-primary-button",o.primaryButton),as:s?.isCustomPrimaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(s.link);a&&(0,P.default)(a,R)}s?.isCustomPrimaryButton&&g?.(t,r,s?.customPrimaryEventId)},...Ae,children:s.text})]}),l&&l.text&&(0,e.jsxs)(p.Button,{"aria-label":u??i,size:"lg",variant:"link",className:(0,d.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:l?.isCustomTertiaryButton?"button":"a",href:Pe,target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:r=>{if(l.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(l.link);a&&(0,P.default)(a,R)}l?.isCustomTertiaryButton&&_?.(t,r,l?.customTertiaryEventId)},...Oe,children:[l.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]})]}),(0,e.jsx)("div",{className:Qe({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(p.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,d.cn)("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",o.captionGroup),children:O.map((r,a)=>(0,e.jsxs)(m.default.Fragment,{children:[(0,e.jsx)(p.Text,{size:2,className:(0,d.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),a<O.length-1&&(0,e.jsx)("div",{className:(0,d.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(ve.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});pe.displayName="HeroBanner";var $e=(0,me.withLayout)(pe);
@@ -1 +1 @@
1
- "use strict";"use client";var et=Object.create;var re=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(o,c)=>{for(var f in c)re(o,f,{get:c[f],enumerable:!0})},Le=(o,c,f,H)=>{if(c&&typeof c=="object"||typeof c=="function")for(let T of nt(c))!at.call(o,T)&&T!==f&&re(o,T,{get:()=>c[T],enumerable:!(H=tt(c,T))||H.enumerable});return o};var Ve=(o,c,f)=>(f=o!=null?et(ot(o)):{},Le(c||!o||!o.__esModule?re(f,"default",{value:o,enumerable:!0}):f,o)),it=o=>Le(re({},"__esModule",{value:!0}),o);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var n=require("react/jsx-runtime"),i=Ve(require("react")),se=require("swiper/react"),Be=Ve(require("../../helpers/ScrollLoadVideo.js")),C=require("../../helpers/index.js"),S=require("./mediaResolver.js"),p=require("../../components/index.js"),Pe=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),Ne=require("../../hooks/useExposure.js"),_e=require("../AiuiProvider/index.js"),He=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:o="base"})=>{const c=o==="lg"?"20":o==="sm"?"16":"18";return(0,n.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ie="hero_banner",lt=({data:o,isActive:c,videoRef:f,slideIndex:H,containerSize:T="default",theme:le="light",slideLabel:de,position:J,locale:B,pageHandle:d,onPlayVideo:$,onPrimaryClick:K,onSecondaryClick:y,onTertiaryClick:ce})=>{const{pcImage:O,isVideoLoop:ue=!0,isShowVideo:A,title:w,subtitle:P,label:z,endDate:G,endDate_tz:Q,dateFormat:X,iconArray:k,caption:I,blockLink:L,primaryButton:u,secondaryButton:s,tertiaryButton:m,align:R="left",titleSize:F}=o,U=(0,S.useMediaTier)(),N=(0,S.buildPictureSource)(o),b=(0,S.resolveTierMedia)(o,"lgDesktop","image")?.alt||O?.alt||"",pe=(0,S.resolveTierMedia)(o,U,"video")?.url||"",x=!!N&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(N),V=(0,E.resolveComponentMediaType)(A),me=(0,S.resolveTierMedia)(o,U,A?"video":"image")?.id||O?.id||"",ge=`${(0,q.buildTrackingRef)(d??"",V,ie)}_${J}`,ee=a=>a&&B?(0,C.getLocalizedPath)(a,B):a,D=a=>a?(0,q.trackUrlRef)(ee(a),ge):void 0,M=(a,l)=>(0,E.buildClickTrackingProps)({interactive:a,componentType:V,componentName:ie,title:w,description:P,buttonName:l,position:J,creativeId:me});return(0,n.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":de,className:(0,C.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",le==="dark"&&"aiui-dark",T==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[L&&(0,n.jsx)("a",{className:"absolute inset-0 z-10",href:D(L),tabIndex:-1,"aria-hidden":"true","aria-label":w?.trim()||P?.trim()||b||void 0,...M(!0)}),A?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Be.default,{videoRef:f,src:pe,poster:void 0,className:"absolute inset-0 size-full",videoClassName:"size-full object-cover",muted:!0,loop:ue,playsInline:!0,onPlaying:a=>{a.currentTarget.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:a=>{const l=a.currentTarget;if(l.currentTime>=.5)return;l.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),x&&(0,n.jsx)("div",{"data-video-poster":"true",className:"pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,n.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:H===0?"eager":"lazy",fetchPriority:H===0?"high":"auto",alt:b,source:N})})]}):(0,n.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:b,source:N}),(0,n.jsxs)("div",{className:(0,C.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",R==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[(0,n.jsxs)("div",{className:(0,C.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",R==="center"?"text-center":"laptop:text-left"),children:[z&&(0,n.jsx)(p.Text,{size:2,as:"p",className:(0,C.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:z}),w&&(0,n.jsx)(p.Heading,{as:F==="4"?"h1":"h2",html:w,size:F?Number(F||"5"):T==="sm"?4:5}),P&&(0,n.jsx)(p.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:P}),G&&(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)(p.Countdown,{endDate:G,endDate_tz:Q,dateFormat:X,variant:"spacious",align:R})})]}),(u?.text||s?.text||m?.text)&&(0,n.jsxs)("div",{className:(0,C.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",R==="center"?"justify-center":"laptop:justify-start"),children:[s?.isShowPlayVideoButton&&s?.playVideoButtonText?(0,n.jsxs)(p.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>$?.(),...M(!0,"video play"),children:[s.playVideoButtonText," ",(0,n.jsx)(st,{size:"lg"})]}):s?.text?(0,n.jsxs)(p.Button,{size:"lg",variant:"secondary",as:s?.isCustomSecondaryButton?"button":"a",href:D(s.link),target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:a=>s?.isCustomSecondaryButton&&y?.(o,a,s?.customSecondaryEventId),...M(!!(s.link||s.isCustomSecondaryButton),s.text),children:[s.text,(0,n.jsx)("span",{className:"sr-only",children:w??P})]}):null,u?.text&&(0,n.jsx)(p.Button,{size:"lg",variant:"primary",as:u?.isCustomPrimaryButton?"button":"a",href:D(u.link),target:u?.target,rel:u?.target==="_blank"?u?.rel??"noopener noreferrer":u?.rel,onClick:a=>u?.isCustomPrimaryButton&&K?.(o,a,u?.customPrimaryEventId),...M(!!(u.link||u.isCustomPrimaryButton),u.text),children:u.text}),m?.text&&(0,n.jsxs)(p.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:m?.isCustomTertiaryButton?"button":"a",href:D(m.link),target:m?.target,rel:m?.target==="_blank"?m?.rel??"noopener noreferrer":m?.rel,onClick:a=>m?.isCustomTertiaryButton&&ce?.(o,a,m?.customTertiaryEventId),...M(!!(m.link||m.isCustomTertiaryButton),m.text),children:[m.text,(0,n.jsx)("span",{className:"sr-only",children:w??P})]})]}),k&&k.length>0&&(0,n.jsx)("div",{className:(0,C.cn)("flex items-center gap-2",R==="center"?"justify-center":"justify-start"),children:k.map(a=>(0,n.jsx)("div",{className:"h-12",children:(0,n.jsx)(p.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:a?.pcImage?.alt||"",source:a?.pcImage?.url})},a?.pcImage?.url||a?.pcImage?.alt))})]}),I&&I.length>0&&(0,n.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:I.map((a,l)=>(0,n.jsxs)(i.default.Fragment,{children:[(0,n.jsx)(p.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:a.title}),l<I.length-1&&(0,n.jsx)("div",{className:"bg-info-primary w-px"})]},a.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Ee=i.default.forwardRef(({data:o,className:c,classNames:f={},a11yLabels:H,onPrimaryClick:T,onSecondaryClick:le,onTertiaryClick:de,...J},B)=>{const d=o.items||[],$=o.carousel,K=$?.size??o.size??"default",y={...dt,...H},{locale:ce,pageHandle:O,trackingData:ue}=(0,_e.useAiuiContext)(),A=(0,S.useMediaTier)(),w=(0,q.buildPageGroup)({pageHandle:O,pageGroup:ue?.pageGroup}),P=(0,i.useRef)(null),[z,G]=(0,i.useState)(null),[Q,X]=(0,i.useState)(null),[k,I]=(0,i.useState)(null),[L,u]=(0,i.useState)(null),s=(0,i.useRef)(d);(0,i.useEffect)(()=>{s.current=d});const m=e=>e!==void 0&&e!==999&&e>=5,R=e=>e!==void 0&&e!==999&&e>=1&&e<=30,F=$?.autoplaySeconds,U=e=>{const t=e?.autoplaySeconds;return R(t)?t:m(F)?F:void 0},N=d.length>1&&d.some(e=>U(e)!==void 0),b=(0,i.useRef)(d.map(()=>i.default.createRef())),pe=($?.showArrows??!0)&&d.length>1,x=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),V=(0,i.useCallback)(e=>s.current[e]?.isShowVideo?"video":"image",[]),me=(0,i.useCallback)((e,t)=>{t==="swipe"&&x("hero_banner_swipe",{to_index:e}),x("hero_banner_slide_view",{index:e,total:s.current.length,media_type:V(e),trigger:t})},[x,V]),ge=(0,i.useCallback)((e,t,r,v="arrow")=>{x("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:v})},[x]),ee=(0,i.useCallback)((e,t)=>{x(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:V(t)})},[x,V]),D=(0,i.useCallback)((e,t)=>{const r=s.current[t];r&&(0,E.trackComponentClick)({pageGroup:w,componentType:"video",componentName:ie,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,S.resolveTierMedia)(r,A,"video")?.id||r.pcImage?.id||""})},[w,A]),M=(0,i.useCallback)(e=>{b.current.forEach((r,v)=>{v!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=b.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:a,activeIndex:l,playbackState:be,resetNonce:Ae,announcement:Ie,activeFrameIntervalSec:he,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:xe,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:Se,handleFocus:$e,handleBlur:Oe}=(0,Pe.useCarouselPlayback)({frameCount:d.length,resolveFrameIntervalSec:e=>U(d[e]),isAutoplayEnabled:N,swiperRef:P,slideStatusLabel:y.slideStatus,onSlideMediaSync:M,onSlideChange:me,onArrowNavigate:ge,delaysCountdownForVideo:e=>!!s.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ee(e,t);const r=b.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{a.current=e,typeof B=="function"?B(e):B&&(B.current=e)},[B,a]),h=d[l]??d[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,S.resolveTierMedia)(h,A,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,Ne.useExposure)(a,{componentType:Ue,componentName:ie,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),X(null);const e=s.current[l],t=b.current[l]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),v=()=>X(Number.isFinite(t.duration)?t.duration:null),te=()=>{r(),Se(l)};return r(),v(),t.addEventListener("playing",te),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",v),()=>{t.removeEventListener("playing",te),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",v)}},[l,Se]),(0,i.useEffect)(()=>{const e=s.current[l];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=b.current[l]?.current;if(!t)return;const r=(g,_,ae,ye)=>{if(!(!g||typeof _!="number"||typeof ae!="number"||typeof ye!="number"))return ye>=_&&ye<ae?g:void 0};let v=null;const te=g=>{v=g,I(_=>_&&_.index===l&&_.theme===g?_:{index:l,theme:g})},Ce=g=>{te(r(e.theme_1,e.star_time_1,e.end_time_1,g)??r(e.theme_2,e.star_time_2,e.end_time_2,g)??e.theme??"light")},ne=t;let W=0,Z=0;const ve=typeof ne.requestVideoFrameCallback=="function",Xe=()=>ve?Z!==0:W!==0,fe=()=>{if(!Xe())if(ve){const g=(_,ae)=>{Ce(ae.mediaTime),Z=ne.requestVideoFrameCallback(g)};Z=ne.requestVideoFrameCallback(g)}else{const g=()=>{Ce(t.currentTime),W=requestAnimationFrame(g)};W=requestAnimationFrame(g)}},oe=()=>{ve?(ne.cancelVideoFrameCallback?.(Z),Z=0):(cancelAnimationFrame(W),W=0)},we=()=>{oe(),v&&I({index:l,theme:v})};return t.addEventListener("play",fe),t.addEventListener("pause",oe),t.addEventListener("ended",we),!t.paused&&!t.ended&&fe(),()=>{oe(),t.removeEventListener("play",fe),t.removeEventListener("pause",oe),t.removeEventListener("ended",we)}},[l]),(0,i.useEffect)(()=>{b.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{s.current.length!==0&&x("hero_banner_slide_view",{index:0,total:s.current.length,media_type:V(0),trigger:"initial"})},[x,V]);const Ze=!!d[l]?.isShowVideo,Te=he!==void 0,Y=!Te&&Ze&&Q!==null&&Q>5&&z!=="ended"&&z!==null,Je=Te||Y,Ke=Y?z==="paused":be==="STOPPED",Qe=()=>{if(!Y){qe();return}const e=b.current[l]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ee(t,l),D(t,l)},ke=k&&k.index===l?k.theme:d[l]?.theme;return(0,n.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,C.cn)("hero-banner-carousel group relative w-full overflow-hidden",K==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...J,children:[(0,n.jsx)(se.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:d.map((e,t)=>{const r=k&&k.index===t?k.theme:e.theme??"light";return(0,n.jsx)(se.SwiperSlide,{children:({isActive:v})=>(0,n.jsx)(lt,{data:e,isActive:v,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${d.length}`,videoRef:b.current[t],containerSize:K,theme:r,position:t+1,locale:ce,pageHandle:O,onPlayVideo:()=>u(t),onPrimaryClick:T,onSecondaryClick:le,onTertiaryClick:de})},t)})}),pe&&(0,n.jsx)(j.CarouselArrows,{onPrev:()=>xe("prev"),onNext:()=>xe("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),N&&(0,n.jsx)(j.CarouselProgressControls,{frameCount:d.length,activeIndex:l,resetNonce:Ae,activeFrameIntervalSec:he,isAutoplayEnabled:N,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${d.length}`,classPrefix:"hero-banner",theme:ke}),Je&&(0,n.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Y?y.playVideo:y.playAutoplay,playingLabel:Y?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:ke}),(0,n.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),L!==null&&d[L]?.secondaryButton&&(0,n.jsx)(He.VideoModal,{visible:!0,videoUrl:d[L].secondaryButton?.isYoutubeVideo?void 0:d[L].secondaryButton?.videoUrl?.url,youTubeId:d[L].secondaryButton?.isYoutubeVideo?d[L].secondaryButton?.youtubeId:void 0,onCloseModal:()=>u(null)})]})});Ee.displayName="HeroBannerCarousel";var ct=Ee;
1
+ "use strict";"use client";var et=Object.create;var de=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(a,c)=>{for(var f in c)de(a,f,{get:c[f],enumerable:!0})},Ee=(a,c,f,A)=>{if(c&&typeof c=="object"||typeof c=="function")for(let k of nt(c))!at.call(a,k)&&k!==f&&de(a,k,{get:()=>c[k],enumerable:!(A=tt(c,k))||A.enumerable});return a};var Ve=(a,c,f)=>(f=a!=null?et(ot(a)):{},Ee(c||!a||!a.__esModule?de(f,"default",{value:a,enumerable:!0}):f,a)),it=a=>Ee(de({},"__esModule",{value:!0}),a);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var o=require("react/jsx-runtime"),i=Ve(require("react")),ue=require("swiper/react"),Pe=Ve(require("../../helpers/ScrollLoadVideo.js")),w=require("../../helpers/index.js"),T=require("./mediaResolver.js"),u=require("../../components/index.js"),Ne=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),_e=require("../../hooks/useExposure.js"),He=require("../AiuiProvider/index.js"),Ae=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:a="base"})=>{const c=a==="lg"?"20":a==="sm"?"16":"18";return(0,o.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce="hero_banner",lt=({data:a,isActive:c,isAdjacent:f=!1,videoRef:A,slideIndex:k,containerSize:Q="default",theme:pe="light",slideLabel:me,position:V,locale:s,pageHandle:$,onPlayVideo:X,onPrimaryClick:y,onSecondaryClick:ge,onTertiaryClick:ee})=>{const{pcImage:te,isVideoLoop:O=!0,isShowVideo:I,title:B,subtitle:C,label:G,endDate:U,endDate_tz:ne,dateFormat:P,iconArray:R,caption:x,blockLink:Y,primaryButton:l,secondaryButton:d,tertiaryButton:p,align:N="left",titleSize:M}=a,z=(0,T.useMediaTier)(),v=(0,T.buildPictureSource)(a),W=(0,T.resolveTierMedia)(a,"lgDesktop","image")?.alt||te?.alt||"",S=(0,T.resolveTierMedia)(a,z,"video")?.url||"",_=!!v&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(v),oe=(0,E.resolveComponentMediaType)(I),ve=(0,T.resolveTierMedia)(a,z,I?"video":"image")?.id||te?.id||"",ae=`${(0,q.buildTrackingRef)($??"",oe,ce)}_${V}`,fe=n=>n&&s?(0,w.getLocalizedPath)(n,s):n,F=n=>n?(0,q.trackUrlRef)(fe(n),ae):void 0,L=(n,b)=>(0,E.buildClickTrackingProps)({interactive:n,componentType:oe,componentName:ce,title:B,description:C,buttonName:b,position:V,creativeId:ve});return(0,o.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":me,className:(0,w.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",pe==="dark"&&"aiui-dark",Q==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[Y&&(0,o.jsx)("a",{className:"absolute inset-0 z-10",href:F(Y),tabIndex:-1,"aria-hidden":"true","aria-label":B?.trim()||C?.trim()||W||void 0,...L(!0)}),I?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Pe.default,{videoRef:A,src:S,poster:void 0,className:"absolute inset-0 size-full transition-opacity duration-500",videoClassName:"size-full object-cover",videoLayerClassName:"opacity-0",muted:!0,loop:O,playsInline:!0,onPlaying:n=>{const b=n.currentTarget;b.parentElement?.classList.remove("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const b=n.currentTarget;if(b.currentTime>=.5)return;b.parentElement?.classList.add("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),_&&(0,o.jsx)("div",{"data-video-poster":"true",className:"bg-container-primary pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:k===0||f?"eager":"lazy",fetchPriority:k===0?"high":"auto",alt:W,source:v})})]}):(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:W,source:v}),(0,o.jsxs)("div",{className:(0,w.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",N==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[(0,o.jsxs)("div",{className:(0,w.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",N==="center"?"text-center":"laptop:text-left"),children:[G&&(0,o.jsx)(u.Text,{size:2,as:"p",className:(0,w.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:G}),B&&(0,o.jsx)(u.Heading,{as:M==="4"?"h1":"h2",html:B,size:M?Number(M||"5"):Q==="sm"?4:5}),C&&(0,o.jsx)(u.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:C}),U&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)(u.Countdown,{endDate:U,endDate_tz:ne,dateFormat:P,variant:"spacious",align:N})})]}),(l?.text||d?.text||p?.text)&&(0,o.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",N==="center"?"justify-center":"laptop:justify-start"),children:[d?.isShowPlayVideoButton&&d?.playVideoButtonText?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>X?.(),...L(!0,"video play"),children:[d.playVideoButtonText," ",(0,o.jsx)(st,{size:"lg"})]}):d?.text?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",as:d?.isCustomSecondaryButton?"button":"a",href:F(d.link),target:d?.target,rel:d?.target==="_blank"?d?.rel??"noopener noreferrer":d?.rel,onClick:n=>d?.isCustomSecondaryButton&&ge?.(a,n,d?.customSecondaryEventId),...L(!!(d.link||d.isCustomSecondaryButton),d.text),children:[d.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]}):null,l?.text&&(0,o.jsx)(u.Button,{size:"lg",variant:"primary",as:l?.isCustomPrimaryButton?"button":"a",href:F(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomPrimaryButton&&y?.(a,n,l?.customPrimaryEventId),...L(!!(l.link||l.isCustomPrimaryButton),l.text),children:l.text}),p?.text&&(0,o.jsxs)(u.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:p?.isCustomTertiaryButton?"button":"a",href:F(p.link),target:p?.target,rel:p?.target==="_blank"?p?.rel??"noopener noreferrer":p?.rel,onClick:n=>p?.isCustomTertiaryButton&&ee?.(a,n,p?.customTertiaryEventId),...L(!!(p.link||p.isCustomTertiaryButton),p.text),children:[p.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]})]}),R&&R.length>0&&(0,o.jsx)("div",{className:(0,w.cn)("flex items-center gap-2",N==="center"?"justify-center":"justify-start"),children:R.map(n=>(0,o.jsx)("div",{className:"h-12",children:(0,o.jsx)(u.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),x&&x.length>0&&(0,o.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:x.map((n,b)=>(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(u.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),b<x.length-1&&(0,o.jsx)("div",{className:"bg-info-primary w-px"})]},n.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Be=i.default.forwardRef(({data:a,className:c,classNames:f={},a11yLabels:A,onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe,...me},V)=>{const s=a.items||[],$=a.carousel,X=$?.size??a.size??"default",y={...dt,...A},{locale:ge,pageHandle:ee,trackingData:te}=(0,He.useAiuiContext)(),O=(0,T.useMediaTier)(),I=(0,q.buildPageGroup)({pageHandle:ee,pageGroup:te?.pageGroup}),B=(0,i.useRef)(null),[C,G]=(0,i.useState)(null),[U,ne]=(0,i.useState)(null),[P,R]=(0,i.useState)(null),[x,Y]=(0,i.useState)(null),l=(0,i.useRef)(s);(0,i.useEffect)(()=>{l.current=s});const d=e=>e!==void 0&&e!==999&&e>=5,p=e=>e!==void 0&&e!==999&&e>=1&&e<=30,N=$?.autoplaySeconds,M=e=>{const t=e?.autoplaySeconds;return p(t)?t:d(N)?N:void 0},z=s.length>1&&s.some(e=>M(e)!==void 0),v=(0,i.useRef)(s.map(()=>i.default.createRef())),W=($?.showArrows??!0)&&s.length>1,S=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),_=(0,i.useCallback)(e=>l.current[e]?.isShowVideo?"video":"image",[]),oe=(0,i.useCallback)((e,t)=>{t==="swipe"&&S("hero_banner_swipe",{to_index:e}),S("hero_banner_slide_view",{index:e,total:l.current.length,media_type:_(e),trigger:t})},[S,_]),ve=(0,i.useCallback)((e,t,r,g="arrow")=>{S("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:g})},[S]),ae=(0,i.useCallback)((e,t)=>{S(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:_(t)})},[S,_]),fe=(0,i.useCallback)((e,t)=>{const r=l.current[t];r&&(0,E.trackComponentClick)({pageGroup:I,componentType:"video",componentName:ce,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,T.resolveTierMedia)(r,O,"video")?.id||r.pcImage?.id||""})},[I,O]),F=(0,i.useCallback)(e=>{v.current.forEach((r,g)=>{g!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=v.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:L,activeIndex:n,playbackState:b,resetNonce:ye,announcement:Ie,activeFrameIntervalSec:Se,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:Te,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:ke,handleFocus:$e,handleBlur:Oe}=(0,Ne.useCarouselPlayback)({frameCount:s.length,resolveFrameIntervalSec:e=>M(s[e]),isAutoplayEnabled:z,swiperRef:B,slideStatusLabel:y.slideStatus,onSlideMediaSync:F,onSlideChange:oe,onArrowNavigate:ve,delaysCountdownForVideo:e=>!!l.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ae(e,t);const r=v.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{L.current=e,typeof V=="function"?V(e):V&&(V.current=e)},[V,L]),h=s[n]??s[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,T.resolveTierMedia)(h,O,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,_e.useExposure)(L,{componentType:Ue,componentName:ce,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),ne(null);const e=l.current[n],t=v.current[n]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),g=()=>ne(Number.isFinite(t.duration)?t.duration:null),D=()=>{r(),ke(n)};return r(),g(),t.addEventListener("playing",D),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",g),()=>{t.removeEventListener("playing",D),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",g)}},[n,ke]),(0,i.useEffect)(()=>{const e=l.current[n];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=v.current[n]?.current;if(!t)return;const r=(m,H,le,xe)=>{if(!(!m||typeof H!="number"||typeof le!="number"||typeof xe!="number"))return xe>=H&&xe<le?m:void 0};let g=null;const D=m=>{g=m,R(H=>H&&H.index===n&&H.theme===m?H:{index:n,theme:m})},re=m=>{D(r(e.theme_1,e.star_time_1,e.end_time_1,m)??r(e.theme_2,e.star_time_2,e.end_time_2,m)??e.theme??"light")},ie=t;let J=0,K=0;const be=typeof ie.requestVideoFrameCallback=="function",Xe=()=>be?K!==0:J!==0,he=()=>{if(!Xe())if(be){const m=(H,le)=>{re(le.mediaTime),K=ie.requestVideoFrameCallback(m)};K=ie.requestVideoFrameCallback(m)}else{const m=()=>{re(t.currentTime),J=requestAnimationFrame(m)};J=requestAnimationFrame(m)}},se=()=>{be?(ie.cancelVideoFrameCallback?.(K),K=0):(cancelAnimationFrame(J),J=0)},Le=()=>{se(),g&&R({index:n,theme:g})};return t.addEventListener("play",he),t.addEventListener("pause",se),t.addEventListener("ended",Le),!t.paused&&!t.ended&&he(),()=>{se(),t.removeEventListener("play",he),t.removeEventListener("pause",se),t.removeEventListener("ended",Le)}},[n]),(0,i.useEffect)(()=>{v.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{l.current.length!==0&&S("hero_banner_slide_view",{index:0,total:l.current.length,media_type:_(0),trigger:"initial"})},[S,_]);const Ze=!!s[n]?.isShowVideo,Ce=Se!==void 0,Z=!Ce&&Ze&&U!==null&&U>5&&C!=="ended"&&C!==null,Je=Ce||Z,Ke=Z?C==="paused":b==="STOPPED",Qe=()=>{if(!Z){qe();return}const e=v.current[n]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ae(t,n),fe(t,n)},we=P&&P.index===n?P.theme:s[n]?.theme;return(0,o.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,w.cn)("hero-banner-carousel group relative w-full overflow-hidden",X==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...me,children:[(0,o.jsx)(ue.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:s.map((e,t)=>{const r=P&&P.index===t?P.theme:e.theme??"light";return(0,o.jsx)(ue.SwiperSlide,{children:({isActive:g,isPrev:D,isNext:re})=>(0,o.jsx)(lt,{data:e,isActive:g,isAdjacent:D||re,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${s.length}`,videoRef:v.current[t],containerSize:X,theme:r,position:t+1,locale:ge,pageHandle:ee,onPlayVideo:()=>Y(t),onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe})},t)})}),W&&(0,o.jsx)(j.CarouselArrows,{onPrev:()=>Te("prev"),onNext:()=>Te("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),z&&(0,o.jsx)(j.CarouselProgressControls,{frameCount:s.length,activeIndex:n,resetNonce:ye,activeFrameIntervalSec:Se,isAutoplayEnabled:z,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${s.length}`,classPrefix:"hero-banner",theme:we}),Je&&(0,o.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Z?y.playVideo:y.playAutoplay,playingLabel:Z?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:we}),(0,o.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),x!==null&&s[x]?.secondaryButton&&(0,o.jsx)(Ae.VideoModal,{visible:!0,videoUrl:s[x].secondaryButton?.isYoutubeVideo?void 0:s[x].secondaryButton?.videoUrl?.url,youTubeId:s[x].secondaryButton?.isYoutubeVideo?s[x].secondaryButton?.youtubeId:void 0,onCloseModal:()=>Y(null)})]})});Be.displayName="HeroBannerCarousel";var ct=Be;
@@ -36,6 +36,8 @@ export interface MediaShelfProductCardProps {
36
36
  onProductImageClick?: (product: ProductCardData) => void;
37
37
  /** 是否展示标签 */
38
38
  showTags?: boolean;
39
+ /** 是否展示会员价格标签(价格下方的 priceLabel),默认 true */
40
+ showMemberPrice?: boolean;
39
41
  }
40
42
  /**
41
43
  * MediaShelf 产品卡片组件
@@ -1 +1 @@
1
- "use strict";"use client";var _=Object.create;var b=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var H=(e,i)=>{for(var l in i)b(e,l,{get:i[l],enumerable:!0})},k=(e,i,l,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of q(i))!E.call(e,o)&&o!==l&&b(e,o,{get:()=>i[o],enumerable:!(d=A(i,o))||d.enumerable});return e};var R=(e,i,l)=>(l=e!=null?_($(e)):{},k(i||!e||!e.__esModule?b(l,"default",{value:e,enumerable:!0}):l,e)),I=e=>k(b({},"__esModule",{value:!0}),e);var K={};H(K,{ProductCard:()=>u,default:()=>j});module.exports=I(K);var a=require("react/jsx-runtime"),c=R(require("react")),n=require("../../helpers/index.js"),t=require("../../components/index.js");const O=5;function G(e,i,l,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return i===void 0?!0:l<=i;case"below-percentage":return i===void 0?!0:l/d*100<=i;default:return!0}}const u=c.forwardRef(({product:e,className:i,stockDisplayMode:l,stockThresholdValue:d,onLearnMore:o,onShopNow:C,onAddToCart:S,classNames:r,secondaryButtonText:p,secondaryButtonFun:v,primaryButtonText:y,primaryButtonFun:h,showOriginalPrice:P,copy:g,onProductImageClick:m,showTags:N=!0},M)=>{const[F,L]=c.useState(!1),[B,D]=c.useState(!1),T=c.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?O:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),x=async(s,f)=>{if(!s)return;const w=f==="primary"?L:D;w(!0);try{switch(s){case"buyNow":await C?.(e);break;case"addCart":await S?.(e);break;case"learnMore":await o?.(e);break;default:break}}finally{w(!1)}},z=e.availableForSale&&e.quantityAvailable<=0;return(0,a.jsxs)(t.Card,{ref:M,className:(0,n.cn)("tablet:min-w-[auto] hover:bg-container-secondary-0 flex h-full min-w-[296px] flex-col overflow-hidden border-none",e.custom_link?"cursor-pointer":"",i,r?.productCard),children:[(0,a.jsxs)("div",{className:(0,n.cn)("media-shelf-product-card-image-wrapper desktop:h-[240px] relative h-[200px] shrink-0 overflow-hidden",r?.productCardImageWrapper),children:[(0,a.jsx)("div",{className:(0,n.cn)("media-shelf-product-card-image-bg absolute inset-0 ",r?.productCardImageBg),children:(0,a.jsx)("a",{onClick:()=>m?.(e),...!m&&{href:e.custom_link||e.listingLink},className:"cursor-pointer",children:(0,a.jsx)(t.Picture,{source:e.custom_image||e.image,alt:e.name,className:(0,n.cn)("h-full",r?.productCardImage),imgClassName:"h-full object-contain"})})}),N&&e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"lg-desktop:h-[28px] absolute left-4 top-4 flex h-[24px]",children:e.tags.map((s,f)=>s.label?(0,a.jsx)(t.Badge,{size:"sm",variant:s.variant||"outline",className:(0,n.cn)("mr-1"),promotionalType:s.promotionalType,children:s.label},f):(0,a.jsx)(c.Fragment,{children:s},f))})]}),(0,a.jsxs)(t.CardContent,{className:"desktop:p-6 bg-container-primary laptop:gap-6 flex h-[calc(100%-240px)] grow flex-col justify-between gap-4 p-4",children:[(0,a.jsxs)("div",{className:"flex-0",children:[(0,a.jsx)(t.Heading,{as:"h3",size:2,className:(0,n.cn)("text-info-primary mb-1 line-clamp-2 tracking-tight",m?"cursor-pointer":"",r?.productTitle),onClick:m?()=>m(e):void 0,children:e.custom_name||e.name}),(e.custom_description||e?.description)&&(0,a.jsx)(t.Text,{size:2,className:(0,n.cn)("text-info-primary line-clamp-1",r?.productDescription),html:e.custom_description||e.description})]}),G(l,d,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,a.jsxs)("div",{"data-total":e?.totalInventory??0,"data-available":e?.quantityAvailable??0,className:"space-y-2",children:[(0,a.jsx)(t.Progress,{value:T,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{progressBar:"transition-all duration-300 ease-in-out"}}),(0,a.jsx)(t.Text,{size:3,className:"text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[12px]",children:z?g?.limitedStock:g?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,n.cn)("mb-2",r?.productPrice),children:(0,a.jsx)("div",{className:"flex items-baseline gap-2",children:e.availableForSale?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Heading,{size:2,className:"text-info-primary",as:"h6",children:e.price}),P&&e.originalPrice&&(0,a.jsx)(t.Heading,{size:2,className:(0,n.cn)("text-info-tertiary line-through",r?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,a.jsx)(t.Heading,{size:2,className:"text-info-tertiary",children:g?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&e?.availableForSale&&(0,a.jsx)(t.Text,{size:4,className:(0,n.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[12px]",r?.productPriceLabel),children:e.priceLabel}),(0,a.jsxs)("div",{className:(0,n.cn)("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",r?.buttonGroup),children:[p&&(0,a.jsx)(t.Button,{variant:"secondary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.secondaryButton),onClick:()=>x(v,"secondary"),disabled:!e.availableForSale&&v!=="learnMore",loading:B,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${p}`,"data-headless-sku":e.sku,children:p}),y&&(0,a.jsx)(t.Button,{variant:"primary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.primaryButton),onClick:()=>x(h,"primary"),disabled:!e.availableForSale&&h!=="learnMore",loading:F,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${y}`,"data-headless-sku":e.sku,children:y})]})]})]})]})});u.displayName="MediaShelf.ProductCard";var j=u;
1
+ "use strict";"use client";var A=Object.create;var b=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var R=(e,i)=>{for(var r in i)b(e,r,{get:i[r],enumerable:!0})},k=(e,i,r,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of $(i))!H.call(e,s)&&s!==r&&b(e,s,{get:()=>i[s],enumerable:!(d=q(i,s))||d.enumerable});return e};var I=(e,i,r)=>(r=e!=null?A(E(e)):{},k(i||!e||!e.__esModule?b(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>k(b({},"__esModule",{value:!0}),e);var W={};R(W,{ProductCard:()=>u,default:()=>K});module.exports=O(W);var a=require("react/jsx-runtime"),c=I(require("react")),n=require("../../helpers/index.js"),t=require("../../components/index.js");const G=5;function j(e,i,r,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return i===void 0?!0:r<=i;case"below-percentage":return i===void 0?!0:r/d*100<=i;default:return!0}}const u=c.forwardRef(({product:e,className:i,stockDisplayMode:r,stockThresholdValue:d,onLearnMore:s,onShopNow:C,onAddToCart:S,classNames:l,secondaryButtonText:p,secondaryButtonFun:v,primaryButtonText:y,primaryButtonFun:h,showOriginalPrice:P,copy:g,onProductImageClick:m,showTags:N=!0,showMemberPrice:M=!0},F)=>{const[L,B]=c.useState(!1),[D,T]=c.useState(!1),z=c.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?G:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),x=async(o,f)=>{if(!o)return;const w=f==="primary"?B:T;w(!0);try{switch(o){case"buyNow":await C?.(e);break;case"addCart":await S?.(e);break;case"learnMore":await s?.(e);break;default:break}}finally{w(!1)}},_=e.availableForSale&&e.quantityAvailable<=0;return(0,a.jsxs)(t.Card,{ref:F,className:(0,n.cn)("tablet:min-w-[auto] hover:bg-container-secondary-0 flex h-full min-w-[296px] flex-col overflow-hidden border-none",e.custom_link?"cursor-pointer":"",i,l?.productCard),children:[(0,a.jsxs)("div",{className:(0,n.cn)("media-shelf-product-card-image-wrapper desktop:h-[240px] relative h-[200px] shrink-0 overflow-hidden",l?.productCardImageWrapper),children:[(0,a.jsx)("div",{className:(0,n.cn)("media-shelf-product-card-image-bg absolute inset-0 ",l?.productCardImageBg),children:(0,a.jsx)("a",{onClick:()=>m?.(e),...!m&&{href:e.custom_link||e.listingLink},className:"cursor-pointer",children:(0,a.jsx)(t.Picture,{source:e.custom_image||e.image,alt:e.name,className:(0,n.cn)("h-full",l?.productCardImage),imgClassName:"h-full object-contain"})})}),N&&e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"lg-desktop:h-[28px] absolute left-4 top-4 flex h-[24px]",children:e.tags.map((o,f)=>o.label?(0,a.jsx)(t.Badge,{size:"sm",variant:o.variant||"outline",className:(0,n.cn)("mr-1"),promotionalType:o.promotionalType,children:o.label},f):(0,a.jsx)(c.Fragment,{children:o},f))})]}),(0,a.jsxs)(t.CardContent,{className:"desktop:p-6 bg-container-primary laptop:gap-6 flex h-[calc(100%-240px)] grow flex-col justify-between gap-4 p-4",children:[(0,a.jsxs)("div",{className:"flex-0",children:[(0,a.jsx)(t.Heading,{as:"h3",size:2,className:(0,n.cn)("text-info-primary mb-1 line-clamp-2 tracking-tight",m?"cursor-pointer":"",l?.productTitle),onClick:m?()=>m(e):void 0,children:e.custom_name||e.name}),(e.custom_description||e?.description)&&(0,a.jsx)(t.Text,{size:2,className:(0,n.cn)("text-info-primary line-clamp-1",l?.productDescription),html:e.custom_description||e.description})]}),j(r,d,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,a.jsxs)("div",{"data-total":e?.totalInventory??0,"data-available":e?.quantityAvailable??0,className:"space-y-2",children:[(0,a.jsx)(t.Progress,{value:z,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{progressBar:"transition-all duration-300 ease-in-out"}}),(0,a.jsx)(t.Text,{size:3,className:"text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[12px]",children:_?g?.limitedStock:g?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,n.cn)("mb-2",l?.productPrice),children:(0,a.jsx)("div",{className:"flex items-baseline gap-2",children:e.availableForSale?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Heading,{size:2,className:"text-info-primary",as:"h6",children:e.price}),P&&e.originalPrice&&(0,a.jsx)(t.Heading,{size:2,className:(0,n.cn)("text-info-tertiary line-through",l?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,a.jsx)(t.Heading,{size:2,className:"text-info-tertiary",children:g?.outOfStockLabel??"Sold Out"})})}),M&&e?.priceLabel&&e?.availableForSale&&(0,a.jsx)(t.Text,{size:4,className:(0,n.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[12px]",l?.productPriceLabel),children:e.priceLabel}),(0,a.jsxs)("div",{className:(0,n.cn)("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",l?.buttonGroup),children:[p&&(0,a.jsx)(t.Button,{variant:"secondary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",l?.secondaryButton),onClick:()=>x(v,"secondary"),disabled:!e.availableForSale&&v!=="learnMore",loading:D,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${p}`,"data-headless-sku":e.sku,children:p}),y&&(0,a.jsx)(t.Button,{variant:"primary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",l?.primaryButton),onClick:()=>x(h,"primary"),disabled:!e.availableForSale&&h!=="learnMore",loading:L,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${y}`,"data-headless-sku":e.sku,children:y})]})]})]})]})});u.displayName="MediaShelf.ProductCard";var K=u;
@@ -1 +1 @@
1
- "use strict";"use client";var _=Object.create;var M=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var i in t)M(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of J(t))!Q.call(e,s)&&s!==i&&M(e,s,{get:()=>t[s],enumerable:!(l=G(t,s))||l.enumerable});return e};var A=(e,t,i)=>(i=e!=null?_(K(e)):{},z(t||!e||!e.__esModule?M(i,"default",{value:e,enumerable:!0}):i,e)),X=e=>z(M({},"__esModule",{value:!0}),e);var ae={};U(ae,{default:()=>ie,useMediaShelfContext:()=>Z});module.exports=X(ae);var o=require("react/jsx-runtime"),r=A(require("react")),h=require("../../helpers/index.js"),W=require("../../shared/Styles.js"),a=require("../../components/index.js"),S=require("swiper/react"),j=require("swiper/modules"),se=require("swiper/css"),le=require("swiper/css/navigation"),V=A(require("./ProductCard.js")),q=require("../../hooks/useExposure.js");const Y="shelf",ee="media_shelf",te=({disabled:e})=>(0,o.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,o.jsx)("path",{d:"M0 28C0 43.464 12.536 56 28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28Z",fill:"currentColor",fillOpacity:e?"0.2":"0.6"}),(0,o.jsx)("path",{d:"M31 22L25 28L31 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),oe=({disabled:e})=>(0,o.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,o.jsx)("path",{d:"M0 28C0 12.536 12.536 0 28 0C43.464 0 56 12.536 56 28C56 43.464 43.464 56 28 56C12.536 56 0 43.464 0 28Z",fill:"currentColor",fillOpacity:e?"0.2":"0.6"}),(0,o.jsx)("path",{d:"M25 22L31 28L25 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),I=r.createContext(null),Z=()=>{const e=r.useContext(I);if(!e)throw new Error("useMediaShelfContext must be used within an MediaShelfProvider");return e},R=r.forwardRef(({products:e,className:t},i)=>{const{copy:l,stockDisplayMode:s,stockThresholdValue:v,onLearnMore:u,onShopNow:P,onAddToCart:k,onProductImageClick:m,classNames:B,secondaryButtonText:D,primaryButtonText:L,secondaryButtonFun:N,primaryButtonFun:E,showOriginalPrice:F,showTags:H}=Z(),C=r.useId().replace(/:/g,""),b=`swiper-button-next-custom-${C}`,w=`swiper-button-prev-custom-${C}`,[p,y]=r.useState({isBeginning:!0,isEnd:!1}),T=r.useRef(null),f=r.useCallback(()=>{const n=T.current;if(!n?.slides||n.slides.length===0)return;n.slides.forEach(d=>{d.style.height="auto"});const g=Array.from(n.slides).map(d=>d.scrollHeight),x=Math.max(...g);x>0&&n.slides.forEach(d=>{d.style.height=`${x}px`})},[]);return r.useEffect(()=>{const n=()=>{requestAnimationFrame(f)};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[f]),e?.length===0?null:(0,o.jsx)("div",{ref:i,className:t,children:(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(S.Swiper,{modules:[j.Navigation],spaceBetween:16,slidesPerView:"auto",navigation:{nextEl:`.${b}`,prevEl:`.${w}`},onSwiper:n=>{T.current=n,y({isBeginning:n.isBeginning,isEnd:n.isEnd}),setTimeout(f,100)},onSlideChange:n=>{y({isBeginning:n.isBeginning,isEnd:n.isEnd})},className:"!overflow-visible",breakpoints:{0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:12,slidesPerView:e.length<=2?2:2.3},1024:{spaceBetween:16,slidesPerView:Math.min(3,e.length)}},children:e.map((n,g)=>(0,o.jsx)(S.SwiperSlide,{className:"tablet:!max-w-[50%] overflow-hidden",children:(0,o.jsx)(V.default,{product:n,className:"box-border w-full max-w-full",stockDisplayMode:s,stockThresholdValue:v,onLearnMore:u,onShopNow:P,onAddToCart:k,onProductImageClick:m,classNames:B,secondaryButtonText:D,primaryButtonText:L,secondaryButtonFun:N,primaryButtonFun:E,showOriginalPrice:F,copy:l,showTags:H})},n.shopify_id+"-"+n.sku||g))}),(0,o.jsx)("button",{className:(0,h.cn)(`${w} tablet:block absolute left-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":e.length<=2,"laptop:hidden":e.length<=3}),"aria-label":l?.previousSlideLabel,disabled:p.isBeginning,children:(0,o.jsx)(te,{disabled:p.isBeginning})}),(0,o.jsx)("button",{className:(0,h.cn)(`${b} tablet:block absolute right-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":e.length<=2,"laptop:hidden":e.length<=3}),"aria-label":l?.nextSlideLabel,disabled:p.isEnd,children:(0,o.jsx)(oe,{disabled:p.isEnd})})]})})});R.displayName="ProductsList";const O=r.forwardRef(({className:e,data:t,onLearnMore:i,onShopNow:l,onAddToCart:s,onProductImageClick:v,classNames:u,...P},k)=>{const m=r.useRef(null);(0,q.useExposure)(m,{componentType:Y,componentName:ee,componentTitle:t.title,componentDescription:t.description}),r.useImperativeHandle(k,()=>m.current);const{theme:B="light",codeChannel:D,showMemberPrice:L=!0,showDiscount:N=!0,showTags:E=!0,stockDisplayMode:F,stockThresholdValue:H,showOriginalPrice:C=!0,secondaryButtonText:b,primaryButtonText:w,secondaryButtonFun:p,primaryButtonFun:y,isShowTab:T=!0,copy:f}=t,g={codeChannel:D,showMemberPrice:L,showDiscount:N,showTags:E,stockDisplayMode:F,stockThresholdValue:H,showOriginalPrice:C,onLearnMore:i,onShopNow:l,onAddToCart:s,onProductImageClick:v,classNames:u,secondaryButtonText:b,secondaryButtonFun:p,primaryButtonText:w,primaryButtonFun:y,copy:f||{}},x=t.productsTab&&t.productsTab.length>0,d=T&&x;return(0,o.jsx)(I.Provider,{value:g,children:(0,o.jsxs)("div",{ref:m,className:(0,h.cn)("w-full",{"aiui-dark":B==="dark"},e,u?.root),...P,children:[t.title&&(0,o.jsx)(a.Heading,{as:"h2",html:t.title,size:4,className:(0,h.cn)("text-info-primary mb-4",u?.title)}),t.description&&(0,o.jsx)(a.Text,{size:3,as:"p",html:t.description,className:(0,h.cn)("text-info-primary mb-6",u?.description)}),(0,o.jsxs)(a.Tabs,{defaultValue:t.productsTab?.[0]?.id,className:"w-full",children:[d&&(0,o.jsx)(a.TabsList,{className:"mb-6",children:t.productsTab?.map(c=>(0,o.jsx)(a.TabsTrigger,{value:c.id,children:c.tab},"tab-"+c.id))}),d?t.productsTab?.map(c=>(0,o.jsx)(a.TabsContent,{value:c.id,children:(0,o.jsx)(R,{products:c.data})},"tab-content-"+c.id)):(0,o.jsx)(R,{products:t.productsCard})]})]})})});O.displayName="MediaShelf";const $=O;$.ProductCard=V.default;const ne=(0,W.withLayout)($);var ie=ne;
1
+ "use strict";"use client";var _=Object.create;var x=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var a in t)x(e,a,{get:t[a],enumerable:!0})},z=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of J(t))!Q.call(e,l)&&l!==a&&x(e,l,{get:()=>t[l],enumerable:!(d=G(t,l))||d.enumerable});return e};var A=(e,t,a)=>(a=e!=null?_(K(e)):{},z(t||!e||!e.__esModule?x(a,"default",{value:e,enumerable:!0}):a,e)),X=e=>z(x({},"__esModule",{value:!0}),e);var ae={};U(ae,{default:()=>ie,useMediaShelfContext:()=>Z});module.exports=X(ae);var o=require("react/jsx-runtime"),s=A(require("react")),p=require("../../helpers/index.js"),W=require("../../shared/Styles.js"),r=require("../../components/index.js"),M=require("swiper/react"),j=require("swiper/modules"),se=require("swiper/css"),le=require("swiper/css/navigation"),V=A(require("./ProductCard.js")),q=require("../../hooks/useExposure.js");const Y="shelf",ee="media_shelf",te=({disabled:e})=>(0,o.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,o.jsx)("path",{d:"M0 28C0 43.464 12.536 56 28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28Z",fill:"currentColor",fillOpacity:e?"0.2":"0.6"}),(0,o.jsx)("path",{d:"M31 22L25 28L31 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),oe=({disabled:e})=>(0,o.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,o.jsx)("path",{d:"M0 28C0 12.536 12.536 0 28 0C43.464 0 56 12.536 56 28C56 43.464 43.464 56 28 56C12.536 56 0 43.464 0 28Z",fill:"currentColor",fillOpacity:e?"0.2":"0.6"}),(0,o.jsx)("path",{d:"M25 22L31 28L25 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),I=s.createContext(null),Z=()=>{const e=s.useContext(I);if(!e)throw new Error("useMediaShelfContext must be used within an MediaShelfProvider");return e},R=s.forwardRef(({products:e,className:t},a)=>{const{copy:d,stockDisplayMode:l,stockThresholdValue:S,onLearnMore:c,onShopNow:v,onAddToCart:P,onProductImageClick:h,classNames:k,secondaryButtonText:B,primaryButtonText:D,secondaryButtonFun:L,primaryButtonFun:N,showOriginalPrice:E,showTags:F,showMemberPrice:H}=Z(),g=s.useId().replace(/:/g,""),C=`swiper-button-next-custom-${g}`,b=`swiper-button-prev-custom-${g}`,[u,w]=s.useState({isBeginning:!0,isEnd:!1}),y=s.useRef(null),T=s.useCallback(()=>{const n=y.current;if(!n?.slides||n.slides.length===0)return;n.slides.forEach(i=>{i.style.height="auto"});const m=Array.from(n.slides).map(i=>i.scrollHeight),f=Math.max(...m);f>0&&n.slides.forEach(i=>{i.style.height=`${f}px`})},[]);return s.useEffect(()=>{const n=()=>{requestAnimationFrame(T)};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[T]),e?.length===0?null:(0,o.jsx)("div",{ref:a,className:t,children:(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(M.Swiper,{modules:[j.Navigation],spaceBetween:16,slidesPerView:"auto",navigation:{nextEl:`.${C}`,prevEl:`.${b}`},onSwiper:n=>{y.current=n,w({isBeginning:n.isBeginning,isEnd:n.isEnd}),setTimeout(T,100)},onSlideChange:n=>{w({isBeginning:n.isBeginning,isEnd:n.isEnd})},className:"!overflow-visible",breakpoints:{0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:12,slidesPerView:e.length<=2?2:2.3},1024:{spaceBetween:16,slidesPerView:Math.min(3,e.length)}},children:e.map((n,m)=>(0,o.jsx)(M.SwiperSlide,{className:"tablet:!max-w-[50%] overflow-hidden",children:(0,o.jsx)(V.default,{product:n,className:"box-border w-full max-w-full",stockDisplayMode:l,stockThresholdValue:S,onLearnMore:c,onShopNow:v,onAddToCart:P,onProductImageClick:h,classNames:k,secondaryButtonText:B,primaryButtonText:D,secondaryButtonFun:L,primaryButtonFun:N,showOriginalPrice:E,copy:d,showTags:F,showMemberPrice:H})},n.shopify_id+"-"+n.sku||m))}),(0,o.jsx)("button",{className:(0,p.cn)(`${b} tablet:block absolute left-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":e.length<=2,"laptop:hidden":e.length<=3}),"aria-label":d?.previousSlideLabel,disabled:u.isBeginning,children:(0,o.jsx)(te,{disabled:u.isBeginning})}),(0,o.jsx)("button",{className:(0,p.cn)(`${C} tablet:block absolute right-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":e.length<=2,"laptop:hidden":e.length<=3}),"aria-label":d?.nextSlideLabel,disabled:u.isEnd,children:(0,o.jsx)(oe,{disabled:u.isEnd})})]})})});R.displayName="ProductsList";const O=s.forwardRef(({className:e,data:t,onLearnMore:a,onShopNow:d,onAddToCart:l,onProductImageClick:S,classNames:c,...v},P)=>{const h=s.useRef(null);(0,q.useExposure)(h,{componentType:Y,componentName:ee,componentTitle:t.title,componentDescription:t.description}),s.useImperativeHandle(P,()=>h.current);const{theme:k="light",codeChannel:B,showMemberPrice:D=!0,showDiscount:L=!0,showTags:N=!0,stockDisplayMode:E,stockThresholdValue:F,showOriginalPrice:H=!0,secondaryButtonText:g,primaryButtonText:C,secondaryButtonFun:b,primaryButtonFun:u,isShowTab:w=!0,copy:y}=t,n={codeChannel:B,showMemberPrice:D,showDiscount:L,showTags:N,stockDisplayMode:E,stockThresholdValue:F,showOriginalPrice:H,onLearnMore:a,onShopNow:d,onAddToCart:l,onProductImageClick:S,classNames:c,secondaryButtonText:g,secondaryButtonFun:b,primaryButtonText:C,primaryButtonFun:u,copy:y||{}},m=t.productsTab&&t.productsTab.length>0,f=w&&m;return(0,o.jsx)(I.Provider,{value:n,children:(0,o.jsxs)("div",{ref:h,className:(0,p.cn)("w-full",{"aiui-dark":k==="dark"},e,c?.root),...v,children:[t.title&&(0,o.jsx)(r.Heading,{as:"h2",html:t.title,size:4,className:(0,p.cn)("text-info-primary mb-4",c?.title)}),t.description&&(0,o.jsx)(r.Text,{size:3,as:"p",html:t.description,className:(0,p.cn)("text-info-primary mb-6",c?.description)}),(0,o.jsxs)(r.Tabs,{defaultValue:t.productsTab?.[0]?.id,className:"w-full",children:[f&&(0,o.jsx)(r.TabsList,{className:"mb-6",children:t.productsTab?.map(i=>(0,o.jsx)(r.TabsTrigger,{value:i.id,children:i.tab},"tab-"+i.id))}),f?t.productsTab?.map(i=>(0,o.jsx)(r.TabsContent,{value:i.id,children:(0,o.jsx)(R,{products:i.data})},"tab-content-"+i.id)):(0,o.jsx)(R,{products:t.productsCard})]})]})})});O.displayName="MediaShelf";const $=O;$.ProductCard=V.default;const ne=(0,W.withLayout)($);var ie=ne;
@@ -1,4 +1,5 @@
1
1
  import type { Img } from '../../types/props.js';
2
+ export type CircleProgressSemanticName = 'root' | 'ring' | 'inner' | 'image' | 'centerText' | 'centerTextMain' | 'centerTextSub' | 'badge' | 'label';
2
3
  export interface CircleProgressProps {
3
4
  /** 总阶段数 (1-4) */
4
5
  totalSteps?: 1 | 2 | 3 | 4;
@@ -22,8 +23,28 @@ export interface CircleProgressProps {
22
23
  laptopSize?: number;
23
24
  /** 段之间的间隙(像素),默认 3 */
24
25
  gap?: number;
26
+ /**
27
+ * 圆环中间显示的文字(如满减档位优惠 "-£10" / "10% OFF")
28
+ * 与 image 互斥使用:传入 image 时不渲染 centerText
29
+ * 含换行符时按第一行(主文案,大字)和其余行(副文案,小字)分两行展示,如 "£10\nOFF"
30
+ * 字号随断点变化:移动端 12px、tablet 起 16px、desktop 起 18px(副文案比主文案小一档)
31
+ * 可选,默认不渲染(非破坏性:不传时与旧版行为一致)
32
+ */
33
+ centerText?: string;
34
+ /**
35
+ * 中间图片置灰(未达当前档时赠品图变灰)
36
+ * 可选,默认 false
37
+ */
38
+ dimmed?: boolean;
39
+ /**
40
+ * 中间图片上的售罄角标文案(如 "Sold Out")
41
+ * 可选,默认不渲染
42
+ */
43
+ dimmedBadge?: string;
25
44
  /** 自定义类名 */
26
45
  className?: string;
46
+ /** 各部分的自定义样式类名,用于覆盖默认样式 */
47
+ classNames?: Partial<Record<CircleProgressSemanticName, string>>;
27
48
  }
28
49
  /**
29
50
  * 分段式圆形进度条组件
@@ -32,7 +53,7 @@ export interface CircleProgressProps {
32
53
  * 移动端默认 64px,laptop 以上默认 80px
33
54
  */
34
55
  declare const CircleProgress: {
35
- ({ totalSteps, currentStep, image, label, progressColor, labelColor, trackColor, backgroundColor, size, laptopSize, gap, className, }: CircleProgressProps): import("react/jsx-runtime").JSX.Element;
56
+ ({ totalSteps, currentStep, image, label, progressColor, labelColor, trackColor, backgroundColor, size, laptopSize, gap, centerText, dimmed, dimmedBadge, className, classNames, }: CircleProgressProps): import("react/jsx-runtime").JSX.Element;
36
57
  displayName: string;
37
58
  };
38
59
  export default CircleProgress;
@@ -1 +1,2 @@
1
- "use strict";"use client";var Y=Object.create;var x=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var s in t)x(e,s,{get:t[s],enumerable:!0})},P=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of F(t))!T.call(e,a)&&a!==s&&x(e,a,{get:()=>t[a],enumerable:!(o=B(t,a))||o.enumerable});return e};var H=(e,t,s)=>(s=e!=null?Y(L(e)):{},P(t||!e||!e.__esModule?x(s,"default",{value:e,enumerable:!0}):s,e)),J=e=>P(x({},"__esModule",{value:!0}),e);var U={};q(U,{default:()=>Q});module.exports=J(U);var r=require("react/jsx-runtime"),K=H(require("react")),y=require("../../components/index.js"),v=require("../../helpers/index.js");const M=({totalSteps:e=4,currentStep:t=0,image:s,label:o,progressColor:a="var(--brand-color-0)",labelColor:z="var(--marketing-color-1)",trackColor:j="#DADCE0",backgroundColor:A="#EAEAEC",size:m=64,laptopSize:u=96,gap:$=3,className:w})=>{const d=Math.max(m,u),C=6,l=(d-C)/2,c=d/2,E=K.useMemo(()=>{const b=($+C)/l*(180/Math.PI),G=(360-b*e)/e,f=n=>n*Math.PI/180,I=(n,i)=>{const p=n-90,h=i-90,R=c+l*Math.cos(f(p)),D=c+l*Math.sin(f(p)),O=c+l*Math.cos(f(h)),W=c+l*Math.sin(f(h)),X=i-n>180?1:0;return`M ${R} ${D} A ${l} ${l} 0 ${X} 1 ${O} ${W}`},k=[];let N=e===2?-45:0;for(let n=0;n<e;n++){const i=N+b/2,p=i+G,h=n<t;k.push({path:I(i,p),isCompleted:h,index:n}),N=p+b/2}return k},[e,t,$,l,c]);return(0,r.jsxs)("div",{className:(0,v.cn)("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",w),style:{"--circle-size":`${m}px`,"--circle-laptop-size":`${u}px`,"--circle-height":`${o?m+8:m}px`,"--circle-laptop-height":`${o?u+8:u}px`},children:[(0,r.jsxs)("div",{className:"laptop:size-[--circle-laptop-size] relative size-[--circle-size]",children:[(0,r.jsxs)("svg",{viewBox:`0 0 ${d} ${d}`,className:(0,v.cn)("absolute inset-0 size-full",o?"translate-y-[-8px]":""),children:[(0,r.jsx)("circle",{cx:c,cy:c,r:l,fill:A,stroke:"none"}),E.map(g=>(0,r.jsx)("path",{d:g.path,fill:"none",stroke:g.isCompleted?a:j,strokeWidth:C,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},g.index))]}),(0,r.jsx)("div",{className:(0,v.cn)("absolute inset-[10px] flex items-center justify-center",o?"translate-y-[-8px]":""),children:(0,r.jsx)("div",{className:"flex size-full items-center justify-center overflow-hidden rounded-full",style:{backgroundColor:A},children:s?.url&&(0,r.jsx)(y.Picture,{className:"size-full",imgClassName:"object-contain",source:s.url,alt:s.alt||""})})})]}),o&&(0,r.jsx)("div",{className:"absolute bottom-0 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",style:{backgroundColor:z},children:(0,r.jsx)(y.Text,{className:"text-xs font-medium text-white",html:o})})]})};M.displayName="CircleProgress";var Q=M;
1
+ "use strict";"use client";var H=Object.create;var C=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,r)=>{for(var s in r)C(e,s,{get:r[s],enumerable:!0})},z=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of K(r))!U.call(e,c)&&c!==s&&C(e,c,{get:()=>r[c],enumerable:!(i=J(r,c))||i.enumerable});return e};var Z=(e,r,s)=>(s=e!=null?H(Q(e)):{},z(r||!e||!e.__esModule?C(s,"default",{value:e,enumerable:!0}):s,e)),_=e=>z(C({},"__esModule",{value:!0}),e);var re={};V(re,{default:()=>te});module.exports=_(re);var t=require("react/jsx-runtime"),ee=Z(require("react")),m=require("../../components/index.js"),n=require("../../helpers/index.js");const T=({totalSteps:e=4,currentStep:r=0,image:s,label:i,progressColor:c="var(--brand-color-0)",labelColor:E="var(--marketing-color-1)",trackColor:R="#DADCE0",backgroundColor:$="#EAEAEC",size:d=64,laptopSize:g=96,gap:M=3,centerText:N,dimmed:G=!1,dimmedBadge:P,className:I,classNames:o})=>{const f=Math.max(d,g),k=6,a=(f-k)/2,p=f/2,S=ee.useMemo(()=>{const A=(M+k)/a*(180/Math.PI),W=(360-A*e)/e,v=l=>l*Math.PI/180,X=(l,u)=>{const x=l-90,y=u-90,Y=p+a*Math.cos(v(x)),F=p+a*Math.sin(v(x)),L=p+a*Math.cos(v(y)),q=p+a*Math.sin(v(y)),B=u-l>180?1:0;return`M ${Y} ${F} A ${a} ${a} 0 ${B} 1 ${L} ${q}`},w=[];let j=e===2?-45:0;for(let l=0;l<e;l++){const u=j+A/2,x=u+W,y=l<r;w.push({path:X(u,x),isCompleted:y,index:l}),j=x+A/2}return w},[e,r,M,a,p]),[D,...O]=(N||"").split(`
2
+ `),h=O.join(" ");return(0,t.jsxs)("div",{className:(0,n.cn)("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",I,o?.root),style:{"--circle-size":`${d}px`,"--circle-laptop-size":`${g}px`,"--circle-height":`${i?d+8:d}px`,"--circle-laptop-height":`${i?g+8:g}px`},children:[(0,t.jsxs)("div",{className:(0,n.cn)("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",o?.ring),children:[(0,t.jsxs)("svg",{viewBox:`0 0 ${f} ${f}`,className:(0,n.cn)("absolute inset-0 size-full",i?"translate-y-[-8px]":""),children:[(0,t.jsx)("circle",{cx:p,cy:p,r:a,fill:$,stroke:"none"}),S.map(b=>(0,t.jsx)("path",{d:b.path,fill:"none",stroke:b.isCompleted?c:R,strokeWidth:k,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},b.index))]}),(0,t.jsx)("div",{className:(0,n.cn)("absolute inset-[10px] flex items-center justify-center",i?"translate-y-[-8px]":"",o?.inner),children:(0,t.jsxs)("div",{className:(0,n.cn)("flex size-full items-center justify-center overflow-hidden rounded-full",P&&"relative"),style:{backgroundColor:$},children:[s?.url&&(0,t.jsx)(m.Picture,{className:(0,n.cn)("size-full",G&&"opacity-40 grayscale",o?.image),imgClassName:"h-full object-contain",source:s.url,alt:s.alt||""}),!s?.url&&N&&(0,t.jsxs)("div",{className:(0,n.cn)("text-info-primary flex flex-col items-center justify-center text-center",h?"gap-0.5":"",o?.centerText),children:[(0,t.jsx)(m.Text,{className:(0,n.cn)("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",h&&"font-bold",o?.centerTextMain),html:D}),h&&(0,t.jsx)(m.Text,{className:(0,n.cn)("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",o?.centerTextSub),html:h})]}),P&&(0,t.jsx)("span",{className:(0,n.cn)("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",o?.badge),children:(0,t.jsx)(m.Text,{size:1,className:"text-center text-white",html:P})})]})})]}),i&&(0,t.jsx)("div",{className:(0,n.cn)("absolute bottom-0 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",o?.label),style:{backgroundColor:E},children:(0,t.jsx)(m.Text,{className:"text-xs font-medium text-white",html:i})})]})};T.displayName="CircleProgress";var te=T;
@@ -1,4 +1,4 @@
1
- import type { CartLineItem, Cart } from './index.js';
1
+ import type { CartLineItem, Cart, MiniCartLabelStyles } from './index.js';
2
2
  /**
3
3
  * 购物车数据类型 - 复用 MiniCart 的类型定义
4
4
  */
@@ -29,6 +29,8 @@ export interface MiniCartDialogProps {
29
29
  copy?: MiniCartDialogCopy;
30
30
  /** 各部分的自定义样式类名 */
31
31
  classNames?: Partial<Record<MiniCartDialogSemanticName, string>>;
32
+ /** 商品行标签(赠品 / 不参与活动)颜色,与 MiniCart 的 labelStyles 同一结构;不传用默认色 */
33
+ labelStyles?: MiniCartLabelStyles;
32
34
  /**
33
35
  * 增加商品数量回调
34
36
  * @param lineItemId 商品行ID
@@ -54,7 +56,7 @@ export interface MiniCartDialogProps {
54
56
  * @description 用于展示购物车商品列表,支持调整商品数量
55
57
  */
56
58
  declare const MiniCartDialog: {
57
- ({ open, onOpenChange, cart, copy, classNames, onIncreaseQuantity, onDecreaseQuantity, onQuantityChange, }: MiniCartDialogProps): import("react/jsx-runtime").JSX.Element;
59
+ ({ open, onOpenChange, cart, copy, classNames, labelStyles, onIncreaseQuantity, onDecreaseQuantity, onQuantityChange, }: MiniCartDialogProps): import("react/jsx-runtime").JSX.Element;
58
60
  displayName: string;
59
61
  };
60
62
  export default MiniCartDialog;
@@ -1 +1 @@
1
- "use strict";"use client";var h=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var N=(a,e)=>{for(var l in e)h(a,l,{get:e[l],enumerable:!0})},z=(a,e,l,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of D(e))!I.call(a,o)&&o!==l&&h(a,o,{get:()=>e[o],enumerable:!(p=w(e,o))||p.enumerable});return a};var P=a=>z(h({},"__esModule",{value:!0}),a);var L={};N(L,{MiniCartDialog:()=>f,default:()=>M});module.exports=P(L);var t=require("react/jsx-runtime"),i=require("../../helpers/index.js"),n=require("../../components/index.js");const T=({className:a})=>(0,t.jsx)("svg",{className:a,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),k=({className:a})=>(0,t.jsx)("svg",{className:a,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),q=({item:a,classNames:e,onIncrease:l,onDecrease:p})=>{const{merchandise:o,quantity:u,cost:y}=a,{image:c,title:b}=o,{totalAmount:d,subtotalAmount:m}=y,x=b||o.sku||"Product",g=d?.formattedPrice||"",v=m&&d&&parseFloat(m.amount)>parseFloat(d.amount);return(0,t.jsxs)("div",{className:(0,i.cn)("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",e?.item),children:[(0,t.jsx)("div",{className:(0,i.cn)("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",e?.itemImage),children:c?.url&&(0,t.jsx)("img",{src:c.url,alt:c.altText||x,className:"size-full object-cover"})}),(0,t.jsxs)("div",{className:(0,i.cn)("laptop:gap-4 flex flex-1 flex-col gap-2",e?.itemInfo),children:[(0,t.jsx)(n.Text,{as:"p",size:3,className:(0,i.cn)("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",e?.itemTitle),children:x}),(0,t.jsxs)("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center gap-1",e?.itemPrice),children:[g&&(0,t.jsx)(n.Text,{size:4,className:(0,i.cn)("text-info-primary laptop:text-[18px] text-[16px]",e?.itemCurrentPrice),children:g}),v&&m?.formattedPrice&&(0,t.jsx)(n.Text,{size:4,className:(0,i.cn)("text-info-tertiary laptop:text-[18px] text-[16px] line-through",e?.itemOriginalPrice),children:m.formattedPrice})]}),(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center",e?.quantityControl),children:[(0,t.jsx)("button",{type:"button",onClick:p,disabled:u<=0,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",e?.quantityButton),"aria-label":"Decrease quantity",children:(0,t.jsx)(T,{className:"laptop:size-3 size-[10.67px]"})}),(0,t.jsx)("div",{className:(0,i.cn)("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",e?.quantityValue),children:u}),(0,t.jsx)("button",{type:"button",onClick:l,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",e?.quantityButton),"aria-label":"Increase quantity",children:(0,t.jsx)(k,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},f=({open:a,onOpenChange:e,cart:l,copy:p,classNames:o={},onIncreaseQuantity:u,onDecreaseQuantity:y,onQuantityChange:c})=>{const b=p?.title||"Selected ({count})",d=p?.emptyText||"Your cart is empty",m=l?.lineItems?.reduce((r,s)=>r+(s?.quantity||0),0)||0,x=l?.lineItems||[],g=x.length===0,v=(r,s)=>{u?.(r,s),c?.(r,s+1)},C=(r,s)=>{s>0&&(y?.(r,s),c?.(r,s-1))};return(0,t.jsx)(n.Dialog,{open:a,onOpenChange:e,children:(0,t.jsxs)(n.DialogContent,{className:(0,i.cn)("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",o?.root),children:[(0,t.jsx)(n.DialogHeader,{className:(0,i.cn)("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",o?.header),children:(0,t.jsx)(n.DialogTitle,{asChild:!0,children:(0,t.jsx)(n.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary font-bold",o?.title),children:b.replace("{count}",m.toString())})})}),(0,t.jsx)("div",{className:(0,i.cn)("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",o?.content),children:g?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(n.Text,{size:2,className:"text-info-tertiary",children:d})}):(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col gap-2",o?.itemList),children:x.map(r=>(0,t.jsx)(q,{item:r,classNames:o,onIncrease:()=>v(r.id,r.quantity),onDecrease:()=>C(r.id,r.quantity)},r.id))})}),(0,t.jsx)("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};f.displayName="MiniCartDialog";var M=f;
1
+ "use strict";"use client";var w=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var P=(n,e)=>{for(var s in e)w(n,s,{get:e[s],enumerable:!0})},L=(n,e,s,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!z.call(n,r)&&r!==s&&w(n,r,{get:()=>e[r],enumerable:!(p=I(e,r))||p.enumerable});return n};var M=n=>L(w({},"__esModule",{value:!0}),n);var j={};P(j,{MiniCartDialog:()=>v,default:()=>S});module.exports=M(j);var t=require("react/jsx-runtime"),i=require("../../helpers/index.js"),o=require("../../components/index.js"),D=require("./index.js");const k=({className:n})=>(0,t.jsx)("svg",{className:n,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),q=({className:n})=>(0,t.jsx)("svg",{className:n,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),T=({item:n,classNames:e,labelStyles:s,onIncrease:p,onDecrease:r})=>{const{merchandise:u,quantity:m,cost:C,readonly:y,productLabel:g,labelVariant:h}=n,{image:d,title:f}=u,{totalAmount:x,subtotalAmount:c}=C,b=f||u.sku||"Product",a=x?.formattedPrice||"",l=c&&x&&parseFloat(c.amount)>parseFloat(x.amount);return(0,t.jsxs)("div",{className:(0,i.cn)("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",e?.item),children:[(0,t.jsxs)("div",{className:(0,i.cn)("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",e?.itemImage),children:[d?.url&&(0,t.jsx)("img",{src:d.url,alt:d.altText||b,className:"size-full object-cover"}),g&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center px-1 py-px backdrop-blur-sm",style:(0,D.resolveCartLineLabelStyle)(h,s),children:(0,t.jsx)(o.Text,{size:1,className:"text-center text-white",html:g})})]}),(0,t.jsxs)("div",{className:(0,i.cn)("laptop:gap-4 flex flex-1 flex-col gap-2",e?.itemInfo),children:[(0,t.jsx)(o.Text,{as:"p",size:3,className:(0,i.cn)("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",e?.itemTitle),children:b}),(0,t.jsxs)("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center gap-1",e?.itemPrice),children:[a&&(0,t.jsx)(o.Text,{size:4,className:(0,i.cn)("text-info-primary laptop:text-[18px] text-[16px]",e?.itemCurrentPrice),children:a}),l&&c?.formattedPrice&&(0,t.jsx)(o.Text,{size:4,className:(0,i.cn)("text-info-tertiary laptop:text-[18px] text-[16px] line-through",e?.itemOriginalPrice),children:c.formattedPrice})]}),y?(0,t.jsx)("div",{className:(0,i.cn)("flex items-center",e?.quantityControl),children:(0,t.jsxs)("span",{className:"text-info-primary text-sm font-semibold",children:["x",m]})}):(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center",e?.quantityControl),children:[(0,t.jsx)("button",{type:"button",onClick:r,disabled:m<=0,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",e?.quantityButton),"aria-label":"Decrease quantity",children:(0,t.jsx)(k,{className:"laptop:size-3 size-[10.67px]"})}),(0,t.jsx)("div",{className:(0,i.cn)("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",e?.quantityValue),children:m}),(0,t.jsx)("button",{type:"button",onClick:p,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",e?.quantityButton),"aria-label":"Increase quantity",children:(0,t.jsx)(q,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},v=({open:n,onOpenChange:e,cart:s,copy:p,classNames:r={},labelStyles:u,onIncreaseQuantity:m,onDecreaseQuantity:C,onQuantityChange:y})=>{const g=p?.title||"Selected ({count})",h=p?.emptyText||"Your cart is empty",d=s?.lineItems?.reduce((a,l)=>a+(l?.quantity||0),0)||0,f=s?.lineItems||[],x=f.length===0,c=(a,l)=>{m?.(a,l),y?.(a,l+1)},b=(a,l)=>{l>0&&(C?.(a,l),y?.(a,l-1))};return(0,t.jsx)(o.Dialog,{open:n,onOpenChange:e,children:(0,t.jsxs)(o.DialogContent,{className:(0,i.cn)("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",r?.root),children:[(0,t.jsx)(o.DialogHeader,{className:(0,i.cn)("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",r?.header),children:(0,t.jsx)(o.DialogTitle,{asChild:!0,children:(0,t.jsx)(o.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary font-bold",r?.title),children:g.replace("{count}",d.toString())})})}),(0,t.jsx)("div",{className:(0,i.cn)("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",r?.content),children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(o.Text,{size:2,className:"text-info-tertiary",children:h})}):(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col gap-2",r?.itemList),children:f.map(a=>(0,t.jsx)(T,{item:a,classNames:r,labelStyles:u,onIncrease:()=>c(a.id,a.quantity),onDecrease:()=>b(a.id,a.quantity)},a.id))})}),(0,t.jsx)("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};v.displayName="MiniCartDialog";var S=v;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Img } from '../../types/props.js';
3
+ import type { CircleProgressSemanticName } from './CircleProgress.js';
3
4
  export type MiniCartSemanticName = 'root' | 'content' | 'cartInfo' | 'cartTitle' | 'cartDescription' | 'priceSection' | 'totalPrice' | 'originalPrice' | 'saveAmount' | 'actionButton' | 'itemsGrid' | 'itemGridContainer' | 'gridItem' | 'gridItemOverlay' | 'expandButton' | 'circleProgress' | 'mobileViewMoreButton';
4
5
  /**
5
6
  * 圆形进度条配置
@@ -23,7 +24,34 @@ export interface CircleProgressConfig {
23
24
  size?: number;
24
25
  /** laptop 以上组件尺寸,默认 80 */
25
26
  laptopSize?: number;
27
+ /** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
28
+ centerText?: string;
29
+ /** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
30
+ dimmed?: boolean;
31
+ /** 中间图片上的售罄角标文案(如 "Sold Out") */
32
+ dimmedBadge?: string;
33
+ /** 未完成阶段的颜色 */
34
+ trackColor?: string;
35
+ /** 圆环各部分的自定义样式类名(root / ring / inner / image / centerText / centerTextMain / centerTextSub / badge / label) */
36
+ classNames?: Partial<Record<CircleProgressSemanticName, string>>;
26
37
  }
38
+ /**
39
+ * 商品行标签变体(满赠/满减场景)
40
+ * 不传时沿用旧版橙色内联背景(非破坏性)
41
+ */
42
+ export type CartLineLabelVariant = 'gift' | 'notEligible';
43
+ /**
44
+ * 商品格子标签颜色配置(直接覆盖内联背景色)
45
+ * 不传时保持旧版颜色
46
+ */
47
+ export interface MiniCartLabelStyles {
48
+ /** 赠品(Free)标签背景色,默认 rgba(251, 148, 63, 0.6) */
49
+ giftLabelColor?: string;
50
+ /** 不参与活动商品(Not Eligible)标签背景色,默认 rgba(118, 120, 128, 0.6) */
51
+ notEligibleLabelColor?: string;
52
+ }
53
+ /** 商品行标签背景样式:MiniCart 缩略图与 MiniCartDialog 共用,保证两处赠品/不参与标识颜色一致 */
54
+ export declare const resolveCartLineLabelStyle: (variant: CartLineLabelVariant | undefined, labelStyles?: MiniCartLabelStyles) => React.CSSProperties;
27
55
  /**
28
56
  * 文案配置
29
57
  */
@@ -48,6 +76,13 @@ export interface MiniCartData {
48
76
  locale?: string;
49
77
  /** 是否显示手机端查看更多按钮,默认 true */
50
78
  showMobileViewMore?: boolean;
79
+ /**
80
+ * 数量角标显示上限:quantity 超过该值显示 "{max}+"(如 99+)
81
+ * 不传时显示完整数字(旧行为)
82
+ */
83
+ maxQuantityDisplay?: number;
84
+ /** 标签颜色配置,通过 CSS 变量注入;不传保持旧版颜色 */
85
+ labelStyles?: MiniCartLabelStyles;
51
86
  }
52
87
  /**
53
88
  * 购物车商品项类型
@@ -57,6 +92,16 @@ export type CartLineItem = {
57
92
  quantity: number;
58
93
  /** 商品标签,如 "Free"、"Gift" 等,显示在商品图片底部 */
59
94
  productLabel?: string;
95
+ /**
96
+ * 标签变体:'gift' 赠品(橙色)、'notEligible' 不参与活动商品(灰色)
97
+ * 不传时沿用旧版橙色背景
98
+ */
99
+ labelVariant?: CartLineLabelVariant;
100
+ /**
101
+ * 只读行:MiniCartDialog 中隐藏数量增减控件(如满赠赠品行数量由后端计算)
102
+ * 默认可调
103
+ */
104
+ readonly?: boolean;
60
105
  cost: {
61
106
  totalAmount: {
62
107
  amount: string;
@@ -1 +1 @@
1
- "use strict";"use client";var Lt=Object.create;var v=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var St=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Pt=(i,e)=>{for(var c in e)v(i,c,{get:e[c],enumerable:!0})},G=(i,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Nt(e))!It.call(i,a)&&a!==c&&v(i,a,{get:()=>e[a],enumerable:!(s=Mt(e,a))||s.enumerable});return i};var U=(i,e,c)=>(c=i!=null?Lt(St(i)):{},G(e||!i||!i.__esModule?v(c,"default",{value:i,enumerable:!0}):c,i)),zt=i=>G(v({},"__esModule",{value:!0}),i);var Dt={};Pt(Dt,{default:()=>Bt});module.exports=zt(Dt);var t=require("react/jsx-runtime"),l=U(require("react")),o=require("../../helpers/index.js"),F=require("../../components/index.js"),x=require("../../components/index.js"),g=require("../../components/index.js"),O=U(require("./CircleProgress.js")),Y=require("../../hooks/useExposure.js");const Tt="cart",At="mini_cart",X=l.forwardRef(({className:i,classNames:e={},data:c,cart:s,progressConfig:a,onRemoveItem:Z,onCheckout:_,onClickToView:M,...$},J)=>{const w=l.useRef(null),{copy:p,theme:N="light",locale:jt="us",showMobileViewMore:K=!0}=c||{};(0,Y.useExposure)(w,{componentType:Tt,componentName:At,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),l.useImperativeHandle(J,()=>w.current);const Q=p?.emptyCart||"Your Cart is Empty",S=p?.description||"",tt=p?.itemsInCart||"You have selected {count} items",et=p?.total||"Total {total}",Rt=p?.totalWithCoupon||"total: {total} ({subtotal})",I=p?.clickToView||"Click to view cart",ot=p?.buyNowText||"Buy Now",rt=p?.savingText||"Saving {amount}",u=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),P=u.reduce((r,n)=>r+(n?.quantity||0),0),nt=P===0,at=parseFloat(s?.cost?.totalAmount?.amount||"0"),it=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),lt=parseFloat(s?.cost?.savingAmount?.amount||"0"),st=s?.cost?.totalAmount?.formattedPrice||"",z=it>at?s?.cost?.subtotalAmount?.formattedPrice:null,T=lt>0?s?.cost?.savingAmount?.formattedPrice:null,d=l.useRef(null),[y,ct]=l.useState(!1),[A,B]=l.useState(!1),[D,j]=l.useState(null),R=async r=>{if(!D){j(r);try{await Z?.(r,s)}finally{j(null)}}},[E,C]=l.useState(!1),[pt,dt]=l.useState(0),[ut,mt]=l.useState(0),[H,gt]=l.useState(!1),[V,ft]=l.useState(!0),h=l.useCallback(()=>{const r=d.current;if(!r)return;const{scrollLeft:n,scrollWidth:m,clientWidth:b}=r;gt(n>0),ft(n<m-b-1)},[]),xt=l.useCallback(()=>{h()},[h]);l.useEffect(()=>{h()},[u.length,h]);const ht=r=>{d.current&&(C(!0),dt(r.pageX-d.current.offsetLeft),mt(d.current.scrollLeft))},bt=r=>{if(!E||!d.current)return;r.preventDefault();const m=(r.pageX-d.current.offsetLeft-pt)*1.5;d.current.scrollLeft=ut-m},vt=()=>{C(!1)},wt=()=>{C(!1)},W=r=>{if(d.current){const n=d.current,m=100;n.scrollBy({left:r==="right"?m:-m,behavior:"smooth"})}},k=({className:r})=>(0,t.jsx)("svg",{className:r,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),yt=({className:r})=>(0,t.jsx)("svg",{className:r,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Ct=r=>u.length?(0,t.jsxs)("div",{className:(0,o.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[u.length>=5&&(0,t.jsx)("button",{onClick:()=>W("left"),className:(0,o.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":r==="dark","laptop:bg-container-primary":r==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(k,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:d,onMouseDown:ht,onMouseMove:bt,onMouseUp:vt,onMouseLeave:wt,onScroll:xt,className:(0,o.cn)("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",E?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[u.filter(n=>n&&n.id).map(n=>{const b=(n.merchandise||{}).image||{},q=b.url,kt=b.altText||"Product image",L=D===n.id;return(0,t.jsxs)("div",{className:(0,o.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[q&&(0,t.jsx)("img",{src:q,alt:kt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>R(n.id),className:(0,o.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),n.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:{backgroundColor:"rgba(251, 148, 63, 0.60)"},children:(0,t.jsx)(x.Text,{size:1,className:"relative text-center text-white",html:n.productLabel})})}),n.quantity>1&&!n.productLabel&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full text-white",children:(0,t.jsx)(x.Text,{className:"text-sm",html:String(n.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>R(n.id),className:(0,o.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(yt,{className:"pointer-events-none size-[20px] text-white"})})]},n.id)}),K&&(0,t.jsx)("button",{onClick:()=>M?.(s),className:(0,o.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.length>=5&&(0,t.jsx)("button",{onClick:()=>W("right"),className:(0,o.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":r==="dark","laptop:bg-container-primary":r==="dark"&&!V}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(k,{className:"laptop:size-4 size-5"})})]}):null,f=!nt&&u.length>0;return(0,t.jsx)("div",{ref:w,className:(0,o.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":N==="dark"}),...$,children:(0,t.jsxs)("div",{className:(0,o.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,o.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",a&&"laptop:pl-[104px] pl-[72px]"),children:[a&&(0,t.jsx)(O.default,{totalSteps:a.totalSteps,currentStep:a.currentStep,image:a.image,label:a.label,progressColor:a.progressColor,labelColor:a.labelColor,backgroundColor:a.backgroundColor,size:a.size,laptopSize:a.laptopSize,className:(0,o.cn)("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,o.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:f?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,o.cn)("",e?.cartTitle),html:tt.replace("{count}",`<span class="text-brand-0">${P||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?ct(!y):M?.(s)},className:(0,o.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(x.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(k,{className:(0,o.cn)("size-4 transition-transform",y?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,o.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:Q})}),S&&(0,t.jsx)(x.Text,{size:2,className:(0,o.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:S})]})]}),f&&(0,t.jsx)("div",{className:(0,o.cn)("laptop:block laptop:shrink",y?"block":"hidden"),children:Ct(N)}),f&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,o.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,o.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:et.replace("{total}",st)}),z&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,o.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:z})]}),T&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,o.cn)("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:rt.replace("{amount}",T)})]}),(0,t.jsx)(F.Button,{disabled:!f,loading:A,onClick:async()=>{if(!A){B(!0);try{await _?.(s)}finally{B(!1)}}},className:(0,o.cn)("whitespace-nowrap",e?.actionButton),children:ot})]})]})})});X.displayName="MiniCart";var Bt=X;
1
+ "use strict";"use client";var Pt=Object.create;var v=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var At=(i,e)=>{for(var c in e)v(i,c,{get:e[c],enumerable:!0})},U=(i,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Tt(e))!Bt.call(i,a)&&a!==c&&v(i,a,{get:()=>e[a],enumerable:!(s=It(e,a))||s.enumerable});return i};var X=(i,e,c)=>(c=i!=null?Pt(zt(i)):{},U(e||!i||!i.__esModule?v(c,"default",{value:i,enumerable:!0}):c,i)),Dt=i=>U(v({},"__esModule",{value:!0}),i);var Vt={};At(Vt,{default:()=>Rt,resolveCartLineLabelStyle:()=>$});module.exports=Dt(Vt);var t=require("react/jsx-runtime"),l=X(require("react")),r=require("../../helpers/index.js"),Q=require("../../components/index.js"),f=require("../../components/index.js"),g=require("../../components/index.js"),O=X(require("./CircleProgress.js")),Y=require("../../hooks/useExposure.js");const Et="cart",jt="mini_cart",$=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:c,cart:s,progressConfig:a,onRemoveItem:Z,onCheckout:_,onClickToView:S,...J},K)=>{const y=l.useRef(null),{copy:p,theme:N="light",locale:Ht="us",showMobileViewMore:tt=!0,maxQuantityDisplay:C,labelStyles:et}=c||{};(0,Y.useExposure)(y,{componentType:Et,componentName:jt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),l.useImperativeHandle(K,()=>y.current);const ot=p?.emptyCart||"Your Cart is Empty",P=p?.description||"",rt=p?.itemsInCart||"You have selected {count} items",at=p?.total||"Total {total}",Wt=p?.totalWithCoupon||"total: {total} ({subtotal})",I=p?.clickToView||"Click to view cart",nt=p?.buyNowText||"Buy Now",it=p?.savingText||"Saving {amount}",m=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((o,n)=>o+(n?.quantity||0),0),lt=T===0,st=parseFloat(s?.cost?.totalAmount?.amount||"0"),ct=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),pt=parseFloat(s?.cost?.savingAmount?.amount||"0"),dt=s?.cost?.totalAmount?.formattedPrice||"",z=ct>st?s?.cost?.subtotalAmount?.formattedPrice:null,B=pt>0?s?.cost?.savingAmount?.formattedPrice:null,d=l.useRef(null),[w,mt]=l.useState(!1),[A,D]=l.useState(!1),[E,j]=l.useState(null),R=async o=>{if(!E){j(o);try{await Z?.(o,s)}finally{j(null)}}},[V,k]=l.useState(!1),[ut,gt]=l.useState(0),[bt,ft]=l.useState(0),[H,xt]=l.useState(!1),[W,ht]=l.useState(!0),x=l.useCallback(()=>{const o=d.current;if(!o)return;const{scrollLeft:n,scrollWidth:u,clientWidth:h}=o;xt(n>0),ht(n<u-h-1)},[]),vt=l.useCallback(()=>{x()},[x]);l.useEffect(()=>{x()},[m.length,x]);const yt=o=>{d.current&&(k(!0),gt(o.pageX-d.current.offsetLeft),ft(d.current.scrollLeft))},Ct=o=>{if(!V||!d.current)return;o.preventDefault();const u=(o.pageX-d.current.offsetLeft-ut)*1.5;d.current.scrollLeft=bt-u},wt=()=>{k(!1)},kt=()=>{k(!1)},q=o=>{if(d.current){const n=d.current,u=100;n.scrollBy({left:o==="right"?u:-u,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),Lt=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Mt=o=>m.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:d,onMouseDown:yt,onMouseMove:Ct,onMouseUp:wt,onMouseLeave:kt,onScroll:vt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[m.filter(n=>n&&n.id).map(n=>{const h=(n.merchandise||{}).image||{},G=h.url,Nt=h.altText||"Product image",M=E===n.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[G&&(0,t.jsx)("img",{src:G,alt:Nt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),n.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:$(n.labelVariant,et),children:(0,t.jsx)(f.Text,{size:1,className:"relative text-center text-white",html:n.productLabel})})}),n.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:(0,t.jsx)(f.Text,{className:"text-sm",html:St(n.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(Lt,{className:"pointer-events-none size-[20px] text-white"})})]},n.id)}),tt&&(0,t.jsx)("button",{onClick:()=>S?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,b=!lt&&m.length>0,St=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:y,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":N==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",a&&"laptop:pl-[104px] pl-[72px]"),children:[a&&(0,t.jsx)(O.default,{totalSteps:a.totalSteps,currentStep:a.currentStep,image:a.image,label:a.label,progressColor:a.progressColor,labelColor:a.labelColor,backgroundColor:a.backgroundColor,size:a.size,laptopSize:a.laptopSize,centerText:a.centerText,dimmed:a.dimmed,dimmedBadge:a.dimmedBadge,trackColor:a.trackColor,classNames:a.classNames,className:(0,r.cn)("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:b?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:rt.replace("{count}",`<span class="text-brand-0">${T||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?mt(!w):S?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(f.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",w?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:ot})}),P&&(0,t.jsx)(f.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:P})]})]}),b&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",w?"block":"hidden"),children:Mt(N)}),b&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:at.replace("{total}",dt)}),z&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:z})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:it.replace("{amount}",B)})]}),(0,t.jsx)(Q.Button,{disabled:!b,loading:A,onClick:async()=>{if(!A){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("whitespace-nowrap",e?.actionButton),children:nt})]})]})})});F.displayName="MiniCart";var Rt=F;