@anker-in/headless-ui 1.3.24 → 1.3.25

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 (89) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  3. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  4. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +2 -2
  5. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  6. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  7. package/dist/cjs/biz-components/Category/index.js +1 -1
  8. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  9. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  10. package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
  11. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  12. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  13. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  14. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  15. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js +1 -1
  16. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js.map +2 -2
  17. package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
  18. package/dist/cjs/biz-components/GraphicMore/index.js.map +2 -2
  19. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  20. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  21. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  22. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
  23. package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
  24. package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +2 -2
  25. package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
  26. package/dist/cjs/biz-components/MediaEndorsement/index.js.map +2 -2
  27. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  28. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
  29. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  30. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
  31. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  32. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  33. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  34. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  35. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  36. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  37. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  38. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +2 -2
  39. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  40. package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
  41. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  42. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  43. package/dist/cjs/biz-components/Specs/index.js +1 -1
  44. package/dist/cjs/biz-components/Specs/index.js.map +3 -3
  45. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  46. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  47. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  48. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +2 -2
  49. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  50. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  51. package/dist/esm/biz-components/Category/index.js +1 -1
  52. package/dist/esm/biz-components/Category/index.js.map +2 -2
  53. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  54. package/dist/esm/biz-components/CreativeModule/index.js.map +2 -2
  55. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  56. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  57. package/dist/esm/biz-components/Graphic/index.js +1 -1
  58. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  59. package/dist/esm/biz-components/GraphicAttractionBlock/index.js +1 -1
  60. package/dist/esm/biz-components/GraphicAttractionBlock/index.js.map +2 -2
  61. package/dist/esm/biz-components/GraphicMore/index.js +1 -1
  62. package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
  63. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  64. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  65. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  66. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
  67. package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
  68. package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +2 -2
  69. package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
  70. package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
  71. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  72. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
  73. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  74. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
  75. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  76. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
  77. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  78. package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
  79. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  80. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  81. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  82. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +2 -2
  83. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  84. package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
  85. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  86. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  87. package/dist/esm/biz-components/Specs/index.js +1 -1
  88. package/dist/esm/biz-components/Specs/index.js.map +3 -3
  89. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import{Fragment as m,jsx as a,jsxs as t}from"react/jsx-runtime";import{useRef as c}from"react";import{Container as u,Text as s,Link as p,Picture as f,Button as b}from"../../components/index.js";import h from"./CompanyStatsBanner/index.js";import{cn as n,getLocalizedPath as i}from"../../helpers/utils.js";import{useAiuiContext as v}from"../AiuiProvider/index.js";const D=({multicolMetadata:e,showStatsBanner:r,statsBannerData:o})=>{const l=c(null);return a("div",{ref:l,className:"bg-white py-4",children:a(u,{childClassName:"bg-white",className:"h-full",children:t("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[r&&a(h,{data:o}),a("div",{className:"flex gap-4",children:e?.map((d,x)=>a("div",{className:"w-1/4",children:a(g,{item:d})},`multicolItem-${d?.label}-${x}`))})]})})})},g=({item:e,allPicture:r})=>{const{locale:o="us"}=v();return t(m,{children:[e?.columns&&t(m,{children:[a(s,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"mt-2 flex flex-col",children:e.columns?.map(l=>t("div",{className:"flex items-center gap-1 py-2",children:[a(p,{href:`${i(l.url,o)}?ref=navMenu`,asChild:!l.url,className:"text-sm font-bold leading-[1.4] no-underline",children:l.label}),l?.badge&&a(s,{as:"p",html:l?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},l.label))})]}),e?.imageUrl&&a("div",{className:n("rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":r}),children:t(p,{href:`${i(e.url,o)}?ref=navMenu`,asChild:!e.url,children:[a(f,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),t("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[a(s,{html:e.title,className:n("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&a(s,{html:e.subtitle,className:n("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&a(b,{as:"a",href:i(e?.primary?.url,o),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:n("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})]})};export{D as MulticolDropdown,g as MulticolItem};
1
+ import{Fragment as m,jsx as a,jsxs as t}from"react/jsx-runtime";import{useRef as c}from"react";import{Container as u,Text as s,Link as p,Picture as f,Button as b}from"../../components/index.js";import h from"./CompanyStatsBanner/index.js";import{cn as n,getLocalizedPath as i}from"../../helpers/utils.js";import{useAiuiContext as v}from"../AiuiProvider/index.js";const D=({multicolMetadata:e,showStatsBanner:r,statsBannerData:o})=>{const l=c(null);return a("div",{ref:l,className:"bg-white py-4",children:a(u,{childClassName:"bg-white",className:"h-full",children:t("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[r&&a(h,{data:o}),a("div",{className:"flex gap-4",children:e?.map((d,x)=>a("div",{className:"w-1/4",children:a(g,{item:d})},`multicolItem-${d?.label}-${x}`))})]})})})},g=({item:e,allPicture:r})=>{const{locale:o="us"}=v();return t(m,{children:[e?.columns&&t(m,{children:[a(s,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"mt-2 flex flex-col",children:e.columns?.map(l=>t("div",{className:"flex items-center gap-1 py-2",children:[a(p,{href:`${i(l.url,o)}?ref=navMenu`,asChild:!l.url,className:"text-sm font-bold leading-[1.4] no-underline",children:l.label}),l?.badge&&a(s,{as:"p",html:l?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},l.label))})]}),e?.imageUrl&&a("div",{className:n("rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":r}),children:a(p,{href:`${i(e.url,o)}?ref=navMenu`,asChild:!e.url,children:t("div",{className:"size-full",children:[a(f,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),t("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[a(s,{html:e.title,className:n("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&a(s,{html:e.subtitle,className:n("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&a(b,{as:"a",href:i(e?.primary?.url,o),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:n("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};export{D as MulticolDropdown,g as MulticolItem};
2
2
  //# sourceMappingURL=MulticolDropdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MulticolDropdown.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button } from '../../components/index.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef} className=\"bg-white py-4\">\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"laptop:gap-4 flex flex-col gap-3\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n <div className=\"flex gap-4\">\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`} className=\"w-1/4\">\n <MulticolItem item={item} />\n </div>\n ))}\n </div>\n </div>\n </Container>\n </div>\n )\n}\n\n/**\n * \u591A\u5217\u4E0B\u62C9\u9879\n * @param item \u591A\u5217\u4E0B\u62C9\u9879\n */\nexport const MulticolItem = ({ item, allPicture }: { item: any; allPicture?: boolean }) => {\n const { locale = 'us' } = useAiuiContext()\n return (\n <>\n {item?.columns && (\n <>\n <Text html={item.label} as=\"div\" className=\"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2 flex flex-col\">\n {item.columns?.map((columnItem: any) => (\n <div key={columnItem.label} className=\"flex items-center gap-1 py-2\">\n <Link\n href={`${getLocalizedPath(columnItem.url, locale)}?ref=navMenu`}\n asChild={!columnItem.url}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {columnItem.label}\n </Link>\n {columnItem?.badge && (\n <Text\n as=\"p\"\n html={columnItem?.badge || 'badge'}\n className=\"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {item?.imageUrl && (\n <div\n className={cn(\n 'rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden',\n {\n ['tablet:max-w-none laptop:max-w-none']: allPicture,\n }\n )}\n >\n <Link href={`${getLocalizedPath(item.url, locale)}?ref=navMenu`} asChild={!item.url}>\n <Picture\n source={item.imageUrl}\n width={404}\n height={280}\n className=\"size-full\"\n imgClassName=\"object-cover h-full hover:scale-105 transition-all duration-300\"\n />\n <div className=\"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline\">\n <Text\n html={item.title}\n className={cn('lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n {item.subtitle && (\n <Text\n html={item.subtitle}\n className={cn('text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n )}\n {item?.primary?.label && (\n <Button\n as=\"a\"\n href={getLocalizedPath(item?.primary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4 lg-desktop:size-5\"\n className={cn('mr-auto !p-0 text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n >\n {item?.primary?.label || 'more'}\n </Button>\n )}\n </div>\n </Link>\n </div>\n )}\n </>\n )\n}\n"],
5
- "mappings": "AAwBQ,OAwBA,YAAAA,EAvBsB,OAAAC,EADtB,QAAAC,MAAA,oBAxBR,OAAgB,UAAAC,MAAc,QAC9B,OAAS,aAAAC,EAAW,QAAAC,EAAM,QAAAC,EAAM,WAAAC,EAAS,UAAAC,MAAc,4BACvD,OAAOC,MAAwB,gCAC/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,uLACA,CACG,sCAAwCW,CAC3C,CACF,EAEA,SAAAnB,EAACI,EAAA,CAAK,KAAM,GAAGK,EAAiBO,EAAK,IAAKI,CAAM,CAAC,eAAgB,QAAS,CAACJ,EAAK,IAC9E,UAAAjB,EAACM,EAAA,CACC,OAAQW,EAAK,SACb,MAAO,IACP,OAAQ,IACR,UAAU,YACV,aAAa,kEACf,EACAhB,EAAC,OAAI,UAAU,uEACb,UAAAD,EAACI,EAAA,CACC,KAAMa,EAAK,MACX,UAAWR,EAAG,iEAAkE,CAC9E,aAAcQ,GAAM,QAAU,MAChC,CAAC,EACH,EACCA,EAAK,UACJjB,EAACI,EAAA,CACC,KAAMa,EAAK,SACX,UAAWR,EAAG,6CAA8C,CAC1D,aAAcQ,GAAM,QAAU,MAChC,CAAC,EACH,EAEDA,GAAM,SAAS,OACdjB,EAACO,EAAA,CACC,GAAG,IACH,KAAMG,EAAiBO,GAAM,SAAS,IAAKI,CAAM,EACjD,QAAQ,OACR,KAAK,KACL,cAAc,2BACd,UAAWZ,EAAG,0DAA2D,CACvE,aAAcQ,GAAM,QAAU,MAChC,CAAC,EAEA,SAAAA,GAAM,SAAS,OAAS,OAC3B,GAEJ,GACF,EACF,GAEJ,CAEJ",
4
+ "sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button } from '../../components/index.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef} className=\"bg-white py-4\">\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"laptop:gap-4 flex flex-col gap-3\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n <div className=\"flex gap-4\">\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`} className=\"w-1/4\">\n <MulticolItem item={item} />\n </div>\n ))}\n </div>\n </div>\n </Container>\n </div>\n )\n}\n\n/**\n * \u591A\u5217\u4E0B\u62C9\u9879\n * @param item \u591A\u5217\u4E0B\u62C9\u9879\n */\nexport const MulticolItem = ({ item, allPicture }: { item: any; allPicture?: boolean }) => {\n const { locale = 'us' } = useAiuiContext()\n return (\n <>\n {item?.columns && (\n <>\n <Text html={item.label} as=\"div\" className=\"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2 flex flex-col\">\n {item.columns?.map((columnItem: any) => (\n <div key={columnItem.label} className=\"flex items-center gap-1 py-2\">\n <Link\n href={`${getLocalizedPath(columnItem.url, locale)}?ref=navMenu`}\n asChild={!columnItem.url}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {columnItem.label}\n </Link>\n {columnItem?.badge && (\n <Text\n as=\"p\"\n html={columnItem?.badge || 'badge'}\n className=\"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {item?.imageUrl && (\n <div\n className={cn(\n 'rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden',\n {\n ['tablet:max-w-none laptop:max-w-none']: allPicture,\n }\n )}\n >\n <Link href={`${getLocalizedPath(item.url, locale)}?ref=navMenu`} asChild={!item.url}>\n <div className=\"size-full\">\n <Picture\n source={item.imageUrl}\n width={404}\n height={280}\n className=\"size-full\"\n imgClassName=\"object-cover h-full hover:scale-105 transition-all duration-300\"\n />\n <div className=\"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline\">\n <Text\n html={item.title}\n className={cn('lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n {item.subtitle && (\n <Text\n html={item.subtitle}\n className={cn('text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n )}\n {item?.primary?.label && (\n <Button\n as=\"a\"\n href={getLocalizedPath(item?.primary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4 lg-desktop:size-5\"\n className={cn('mr-auto !p-0 text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n >\n {item?.primary?.label || 'more'}\n </Button>\n )}\n </div>\n </div>\n </Link>\n </div>\n )}\n </>\n )\n}\n"],
5
+ "mappings": "AAwBQ,OAwBA,YAAAA,EAvBsB,OAAAC,EADtB,QAAAC,MAAA,oBAxBR,OAAgB,UAAAC,MAAc,QAC9B,OAAS,aAAAC,EAAW,QAAAC,EAAM,QAAAC,EAAM,WAAAC,EAAS,UAAAC,MAAc,4BACvD,OAAOC,MAAwB,gCAC/B,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,kBAAAC,MAAsB,2BAMxB,MAAMC,EAAmB,CAAC,CAC/B,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,CACF,IAIM,CACJ,MAAMC,EAAsBd,EAAuB,IAAI,EAEvD,OACEF,EAAC,OAAI,IAAKgB,EAAqB,UAAU,gBACvC,SAAAhB,EAACG,EAAA,CAAU,eAAe,WAAW,UAAU,SAC7C,SAAAF,EAAC,OAAI,UAAU,mCACZ,UAAAa,GAAmBd,EAACQ,EAAA,CAAmB,KAAMO,EAAiB,EAC/Df,EAAC,OAAI,UAAU,aACZ,SAAAa,GAAkB,IAAI,CAACI,EAAWC,IACjClB,EAAC,OAAiD,UAAU,QAC1D,SAAAA,EAACmB,EAAA,CAAa,KAAMF,EAAM,GADlB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AC,EACH,EAEDA,GAAM,SAAS,OACdjB,EAACO,EAAA,CACC,GAAG,IACH,KAAMG,EAAiBO,GAAM,SAAS,IAAKI,CAAM,EACjD,QAAQ,OACR,KAAK,KACL,cAAc,2BACd,UAAWZ,EAAG,0DAA2D,CACvE,aAAcQ,GAAM,QAAU,MAChC,CAAC,EAEA,SAAAA,GAAM,SAAS,OAAS,OAC3B,GAEJ,GACF,EACF,EACF,GAEJ,CAEJ",
6
6
  "names": ["Fragment", "jsx", "jsxs", "useRef", "Container", "Text", "Link", "Picture", "Button", "CompanyStatsBanner", "cn", "getLocalizedPath", "useAiuiContext", "MulticolDropdown", "multicolMetadata", "showStatsBanner", "statsBannerData", "multicolDropdownRef", "item", "index", "MulticolItem", "allPicture", "locale", "columnItem"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as r,jsxs as Y}from"react/jsx-runtime";import*as d from"react";import{cn as c}from"../../helpers/utils.js";import{withLayout as V}from"../../shared/Styles.js";import{Swiper as A,SwiperSlide as q}from"swiper/react";import"swiper/css";import{Text as j}from"../../components/text.js";import{Heading as z}from"../../components/heading.js";import{forwardRef as W}from"react";import l from"./ProductCard.js";import{useExposure as _}from"../../hooks/useExposure.js";import{Tabs as G,TabsList as J,TabsTrigger as K}from"../../components/tabs.js";const Q="shelf",U="image_overlay_shelf",m=W(({data:o,onLearnMore:g,onShopNow:y,onAddToCart:h,onProductImageClick:P,classNames:a,copy:b,breakpoints:T,className:S="",...C},v)=>{const p=d.useRef(null);_(p,{componentType:Q,componentName:U,componentTitle:o.title,componentDescription:o.description}),d.useImperativeHandle(v,()=>p.current);const{productsCard:w=[],isShowTab:n=!1,productsTab:t=[],tabShape:x="square",tabAlign:B="left",isShowTag:I=!0,showOriginalPrice:O=!0,secondaryButtonText:D,secondaryButtonFun:L,primaryButtonText:M,primaryButtonFun:N}=o,[u,R]=d.useState(()=>n&&t.length>0?t[0].tab:""),[i,k]=d.useState(()=>n&&t.length>0?t[0].data??[]:w),F={showTags:I,showOriginalPrice:O,secondaryButtonText:D,secondaryButtonFun:L,primaryButtonText:M,primaryButtonFun:N,onLearnMore:g,onShopNow:y,onAddToCart:h,onProductImageClick:P,classNames:a,copy:b},H={0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:16,slidesPerView:i.length<=2?2:2.2},1024:{spaceBetween:16,slidesPerView:i.length<=2?2:3},1440:{spaceBetween:16,slidesPerView:Math.max(2,Math.min(4,i.length))}};return Y("div",{ref:p,className:c("collection-shelves-wrap w-full",S,a?.root),...C,children:[o.title&&r(z,{as:"h2",size:4,className:c("text-info-primary mb-4",a?.title),children:o.title}),o.description&&r(j,{size:3,as:"p",className:c("text-info-primary mb-6",a?.description),children:o.description}),n&&t.length>0&&r(G,{value:u,onValueChange:e=>{const s=t.find(E=>E.tab===e);s&&(R(e),k(s.data??[]))},align:B,shape:x==="rounded"?"rounded":"square",children:r(J,{children:t.map(e=>r(K,{value:e.tab,children:e.tab},e.id??e.tab))})}),r(A,{spaceBetween:16,slidesPerView:"auto",className:c("!overflow-visible",n&&t.length>0?"mt-6":""),breakpoints:T||H,children:i.map((e,s)=>r(q,{children:r(l,{product:e,...F})},e.sku||s))},u||"default")]})});m.displayName="ImageOverlayShelf";const f=m;f.ProductCard=l;const X=V(f);var de=X;export{l as ProductCard,de as default};
1
+ "use client";import{jsx as r,jsxs as X}from"react/jsx-runtime";import*as d from"react";import{cn as c}from"../../helpers/utils.js";import{withLayout as E}from"../../shared/Styles.js";import{Swiper as V,SwiperSlide as A}from"swiper/react";import"swiper/css";import{Text as j}from"../../components/text.js";import{Heading as q}from"../../components/heading.js";import{forwardRef as z}from"react";import l from"./ProductCard.js";import{useExposure as W}from"../../hooks/useExposure.js";import{Tabs as _,TabsList as G,TabsTrigger as J}from"../../components/tabs.js";const K="shelf",Q="image_overlay_shelf",m=z(({data:o,onLearnMore:g,onShopNow:y,onAddToCart:h,onProductImageClick:P,classNames:a,copy:b,breakpoints:T,className:S="",...C},v)=>{const p=d.useRef(null);W(p,{componentType:K,componentName:Q,componentTitle:o.title,componentDescription:o.description}),d.useImperativeHandle(v,()=>p.current);const{productsCard:w=[],isShowTab:n=!1,productsTab:t=[],tabShape:Y="square",tabAlign:x="left",isShowTag:B=!0,showOriginalPrice:I=!0,secondaryButtonText:O,secondaryButtonFun:D,primaryButtonText:L,primaryButtonFun:M}=o,[u,N]=d.useState(()=>n&&t.length>0?t[0].tab:""),[i,R]=d.useState(()=>n&&t.length>0?t[0].data??[]:w),k={showTags:B,showOriginalPrice:I,secondaryButtonText:O,secondaryButtonFun:D,primaryButtonText:L,primaryButtonFun:M,onLearnMore:g,onShopNow:y,onAddToCart:h,onProductImageClick:P,classNames:a,copy:b},F={0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:16,slidesPerView:i.length<=2?2:2.2},1024:{spaceBetween:16,slidesPerView:i.length<=2?2:3},1440:{spaceBetween:16,slidesPerView:Math.max(2,Math.min(4,i.length))}};return X("div",{ref:p,className:c("collection-shelves-wrap w-full",S,a?.root),...C,children:[o.title&&r(q,{as:"h2",size:4,className:c("text-info-primary mb-4",a?.title),children:o.title}),o.description&&r(j,{size:3,as:"p",className:c("text-info-primary mb-6",a?.description),children:o.description}),n&&t.length>0&&r(_,{value:u,onValueChange:e=>{const s=t.find(H=>H.tab===e);s&&(N(e),R(s.data??[]))},align:x,shape:"rounded",children:r(G,{children:t.map(e=>r(J,{value:e.tab,children:e.tab},e.id??e.tab))})}),r(V,{spaceBetween:16,slidesPerView:"auto",className:c("!overflow-visible",n&&t.length>0?"mt-6":""),breakpoints:T||F,children:i.map((e,s)=>r(A,{children:r(l,{product:e,...k})},e.sku||s))},u||"default")]})});m.displayName="ImageOverlayShelf";const f=m;f.ProductCard=l;const U=E(f);var de=U;export{l as ProductCard,de as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ImageOverlayShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport 'swiper/css'\n\nimport { Text } from '../../components/text.js'\nimport { Heading } from '../../components/heading.js'\nimport { forwardRef } from 'react'\n\nimport ProductCard from './ProductCard.js'\nimport type {\n ProductCardData,\n ProductCardProps,\n ButtonFunctionType,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ProductsTab,\n} from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\n\nconst componentType = 'shelf'\nconst componentName = 'image_overlay_shelf'\n\n// Re-export types for external use\nexport type {\n ButtonFunctionType,\n ProductCardData,\n ProductCardProps,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ImageObjectPosition,\n ProductsTab,\n} from './types.js'\n\n/**\n * ImageOverlayShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface ImageOverlayShelfData {\n /** \u7EC4\u4EF6\u6807\u9898 */\n title?: string\n /** \u7EC4\u4EF6\u63CF\u8FF0 */\n description?: string\n /** \u4EA7\u54C1\u5217\u8868\uFF08\u975E Tab \u6A21\u5F0F\uFF09 */\n productsCard: ProductCardData[]\n /** \u662F\u5426\u663E\u793A Tab \u5207\u6362\uFF0C\u9ED8\u8BA4 false */\n isShowTab?: boolean\n /** Tab \u6570\u636E\u5217\u8868\uFF08isShowTab=true \u65F6\u4F7F\u7528\uFF09 */\n productsTab?: ProductsTab[]\n /** Tab \u5F62\u72B6\uFF0C\u9ED8\u8BA4 square */\n tabShape?: 'square' | 'rounded'\n /** Tab \u5BF9\u9F50\u65B9\u5F0F\uFF0C\u9ED8\u8BA4 left */\n tabAlign?: 'left' | 'center' | 'right'\n /** \u662F\u5426\u663E\u793A\u6807\u7B7E */\n isShowTag?: boolean\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n}\n\n/**\n * ImageOverlayShelf Props \u63A5\u53E3\n */\nexport interface ImageOverlayShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: ImageOverlayShelfData\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u4EA7\u54C1\u56FE\u7247\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ImageOverlayShelfSemanticName, string>>\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u65AD\u70B9\u914D\u7F6E */\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n}\n\n/**\n * ImageOverlayShelf \u590D\u5408\u7EC4\u4EF6\u7C7B\u578B\u5B9A\u4E49\n */\nexport interface ImageOverlayShelfComponent extends React.ForwardRefExoticComponent<\n ImageOverlayShelfProps & React.RefAttributes<HTMLDivElement>\n> {\n /** \u72EC\u7ACB\u7684 ProductCard \u7EC4\u4EF6 */\n ProductCard: typeof ProductCard\n}\n\n/**\n * \u5171\u4EAB Props \u7C7B\u578B\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n */\ntype SharedProductCardProps = Omit<ProductCardProps, 'product' | 'className'>\n\nconst ImageOverlayShelf = forwardRef<HTMLDivElement, ImageOverlayShelfProps>(\n (\n {\n data,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n breakpoints,\n className = '',\n ...props\n },\n ref\n ) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: data.title,\n componentDescription: data.description,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const {\n productsCard = [],\n isShowTab = false,\n productsTab = [],\n tabShape = 'square',\n tabAlign = 'left',\n isShowTag = true,\n showOriginalPrice = true,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n } = data\n\n // Tab \u72B6\u6001\n const [tabId, setTabId] = React.useState<string>(() => {\n if (isShowTab && productsTab.length > 0) {\n return productsTab[0].tab\n }\n return ''\n })\n\n // \u5F53\u524D\u5C55\u793A\u7684\u4EA7\u54C1\u5217\u8868\n const [currentProducts, setCurrentProducts] = React.useState<ProductCardData[]>(() => {\n if (isShowTab && productsTab.length > 0) {\n return productsTab[0].data ?? []\n }\n return productsCard\n })\n\n // \u6784\u5EFA\u5171\u4EAB props\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n const sharedProps: SharedProductCardProps = {\n showTags: isShowTag,\n showOriginalPrice,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n }\n\n // \u9ED8\u8BA4\u65AD\u70B9\u914D\u7F6E\uFF08\u57FA\u4E8E currentProducts \u52A8\u6001\u8BA1\u7B97\uFF09\n const defaultBreakpoints = {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: currentProducts.length <= 2 ? 2 : 2.2,\n },\n 1024: {\n spaceBetween: 16,\n slidesPerView: currentProducts.length <= 2 ? 2 : 3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: Math.max(2, Math.min(4, currentProducts.length)),\n },\n }\n\n return (\n <div ref={boxRef} className={cn('collection-shelves-wrap w-full', className, classNames?.root)} {...props}>\n {/* \u6807\u9898\u533A\u57DF */}\n {data.title && (\n <Heading as=\"h2\" size={4} className={cn('text-info-primary mb-4', classNames?.title)}>\n {data.title}\n </Heading>\n )}\n {data.description && (\n <Text size={3} as=\"p\" className={cn('text-info-primary mb-6', classNames?.description)}>\n {data.description}\n </Text>\n )}\n\n {/* Tab \u5207\u6362 */}\n {isShowTab && productsTab.length > 0 && (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab.find(item => item.tab === value)\n if (currentTab) {\n setTabId(value)\n setCurrentProducts(currentTab.data ?? [])\n }\n }}\n align={tabAlign}\n shape={tabShape === 'rounded' ? 'rounded' : 'square'}\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item.id ?? item.tab} value={item.tab}>\n {item.tab}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n )}\n\n {/* Swiper \u6A2A\u5411\u6ED1\u52A8\u5E03\u5C40 */}\n <Swiper\n key={tabId || 'default'}\n spaceBetween={16}\n slidesPerView=\"auto\"\n className={cn('!overflow-visible', isShowTab && productsTab.length > 0 ? 'mt-6' : '')}\n breakpoints={breakpoints || defaultBreakpoints}\n >\n {currentProducts.map((product, index) => (\n <SwiperSlide key={product.sku || index}>\n <ProductCard product={product} {...sharedProps} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n )\n }\n)\n\nImageOverlayShelf.displayName = 'ImageOverlayShelf'\n\n// \u521B\u5EFA\u590D\u5408\u7EC4\u4EF6\nconst ImageOverlayShelfWithProductCard = ImageOverlayShelf as ImageOverlayShelfComponent\nImageOverlayShelfWithProductCard.ProductCard = ProductCard\n\nexport { ProductCard }\nconst ImageOverlayShelfWrapped = withLayout(ImageOverlayShelfWithProductCard)\nexport default ImageOverlayShelfWrapped\n"],
5
- "mappings": "aAiNM,OAGI,OAAAA,EAHJ,QAAAC,MAAA,oBAhNN,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,MAAO,aAEP,OAAS,QAAAC,MAAY,2BACrB,OAAS,WAAAC,MAAe,8BACxB,OAAS,cAAAC,MAAkB,QAE3B,OAAOC,MAAiB,mBASxB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,2BAE5C,MAAMC,EAAgB,QAChBC,EAAgB,sBA0FhBC,EAAoBR,EACxB,CACE,CACE,KAAAS,EACA,YAAAC,EACA,UAAAC,EACA,YAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,KAAAC,EACA,YAAAC,EACA,UAAAC,EAAY,GACZ,GAAGC,CACL,EACAC,IACG,CACH,MAAMC,EAAS3B,EAAM,OAAuB,IAAI,EAEhDS,EAAYkB,EAAQ,CAClB,cAAAd,EACA,cAAAC,EACA,eAAgBE,EAAK,MACrB,qBAAsBA,EAAK,WAC7B,CAAC,EAEDhB,EAAM,oBAAoB0B,EAAK,IAAMC,EAAO,OAAyB,EAErE,KAAM,CACJ,aAAAC,EAAe,CAAC,EAChB,UAAAC,EAAY,GACZ,YAAAC,EAAc,CAAC,EACf,SAAAC,EAAW,SACX,SAAAC,EAAW,OACX,UAAAC,EAAY,GACZ,kBAAAC,EAAoB,GACpB,oBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,iBAAAC,CACF,EAAItB,EAGE,CAACuB,EAAOC,CAAQ,EAAIxC,EAAM,SAAiB,IAC3C6B,GAAaC,EA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AAa,UAAY,UAAY,SAE5C,SAAAjC,EAACa,EAAA,CACE,SAAAmB,EAAY,IAAIiB,GACfjD,EAACc,EAAA,CAAsC,MAAOmC,EAAK,IAChD,SAAAA,EAAK,KADUA,EAAK,IAAMA,EAAK,GAElC,CACD,EACH,EACF,EAIFjD,EAACK,EAAA,CAEC,aAAc,GACd,cAAc,OACd,UAAWF,EAAG,oBAAqB4B,GAAaC,EAAY,OAAS,EAAI,OAAS,EAAE,EACpF,YAAaP,GAAeqB,EAE3B,SAAAH,EAAgB,IAAI,CAACO,EAASC,IAC7BnD,EAACM,EAAA,CACC,SAAAN,EAACU,EAAA,CAAY,QAASwC,EAAU,GAAGL,EAAa,GADhCK,EAAQ,KAAOC,CAEjC,CACD,GAVIV,GAAS,SAWhB,GACF,CAEJ,CACF,EAEAxB,EAAkB,YAAc,oBAGhC,MAAMmC,EAAmCnC,EACzCmC,EAAiC,YAAc1C,EAG/C,MAAM2C,EAA2BjD,EAAWgD,CAAgC,EAC5E,IAAOE,GAAQD",
4
+ "sourcesContent": ["'use client'\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport 'swiper/css'\n\nimport { Text } from '../../components/text.js'\nimport { Heading } from '../../components/heading.js'\nimport { forwardRef } from 'react'\n\nimport ProductCard from './ProductCard.js'\nimport type {\n ProductCardData,\n ProductCardProps,\n ButtonFunctionType,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ProductsTab,\n} from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\n\nconst componentType = 'shelf'\nconst componentName = 'image_overlay_shelf'\n\n// Re-export types for external use\nexport type {\n ButtonFunctionType,\n ProductCardData,\n ProductCardProps,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ImageObjectPosition,\n ProductsTab,\n} from './types.js'\n\n/**\n * ImageOverlayShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface ImageOverlayShelfData {\n /** \u7EC4\u4EF6\u6807\u9898 */\n title?: string\n /** \u7EC4\u4EF6\u63CF\u8FF0 */\n description?: string\n /** \u4EA7\u54C1\u5217\u8868\uFF08\u975E Tab \u6A21\u5F0F\uFF09 */\n productsCard: ProductCardData[]\n /** \u662F\u5426\u663E\u793A Tab \u5207\u6362\uFF0C\u9ED8\u8BA4 false */\n isShowTab?: boolean\n /** Tab \u6570\u636E\u5217\u8868\uFF08isShowTab=true \u65F6\u4F7F\u7528\uFF09 */\n productsTab?: ProductsTab[]\n /** Tab \u5F62\u72B6\uFF0C\u9ED8\u8BA4 square */\n tabShape?: 'square' | 'rounded'\n /** Tab \u5BF9\u9F50\u65B9\u5F0F\uFF0C\u9ED8\u8BA4 left */\n tabAlign?: 'left' | 'center' | 'right'\n /** \u662F\u5426\u663E\u793A\u6807\u7B7E */\n isShowTag?: boolean\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n}\n\n/**\n * ImageOverlayShelf Props \u63A5\u53E3\n */\nexport interface ImageOverlayShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: ImageOverlayShelfData\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u4EA7\u54C1\u56FE\u7247\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ImageOverlayShelfSemanticName, string>>\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u65AD\u70B9\u914D\u7F6E */\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n}\n\n/**\n * ImageOverlayShelf \u590D\u5408\u7EC4\u4EF6\u7C7B\u578B\u5B9A\u4E49\n */\nexport interface ImageOverlayShelfComponent extends React.ForwardRefExoticComponent<\n ImageOverlayShelfProps & React.RefAttributes<HTMLDivElement>\n> {\n /** \u72EC\u7ACB\u7684 ProductCard \u7EC4\u4EF6 */\n ProductCard: typeof ProductCard\n}\n\n/**\n * \u5171\u4EAB Props \u7C7B\u578B\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n */\ntype SharedProductCardProps = Omit<ProductCardProps, 'product' | 'className'>\n\nconst ImageOverlayShelf = forwardRef<HTMLDivElement, ImageOverlayShelfProps>(\n (\n {\n data,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n breakpoints,\n className = '',\n ...props\n },\n ref\n ) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: data.title,\n componentDescription: data.description,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const {\n productsCard = [],\n isShowTab = false,\n productsTab = [],\n tabShape = 'square',\n tabAlign = 'left',\n isShowTag = true,\n showOriginalPrice = true,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n } = data\n\n // Tab \u72B6\u6001\n const [tabId, setTabId] = React.useState<string>(() => {\n if (isShowTab && productsTab.length > 0) {\n return productsTab[0].tab\n }\n return ''\n })\n\n // \u5F53\u524D\u5C55\u793A\u7684\u4EA7\u54C1\u5217\u8868\n const [currentProducts, setCurrentProducts] = React.useState<ProductCardData[]>(() => {\n if (isShowTab && productsTab.length > 0) {\n return productsTab[0].data ?? []\n }\n return productsCard\n })\n\n // \u6784\u5EFA\u5171\u4EAB props\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n const sharedProps: SharedProductCardProps = {\n showTags: isShowTag,\n showOriginalPrice,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n }\n\n // \u9ED8\u8BA4\u65AD\u70B9\u914D\u7F6E\uFF08\u57FA\u4E8E currentProducts \u52A8\u6001\u8BA1\u7B97\uFF09\n const defaultBreakpoints = {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: currentProducts.length <= 2 ? 2 : 2.2,\n },\n 1024: {\n spaceBetween: 16,\n slidesPerView: currentProducts.length <= 2 ? 2 : 3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: Math.max(2, Math.min(4, currentProducts.length)),\n },\n }\n\n return (\n <div ref={boxRef} className={cn('collection-shelves-wrap w-full', className, classNames?.root)} {...props}>\n {/* \u6807\u9898\u533A\u57DF */}\n {data.title && (\n <Heading as=\"h2\" size={4} className={cn('text-info-primary mb-4', classNames?.title)}>\n {data.title}\n </Heading>\n )}\n {data.description && (\n <Text size={3} as=\"p\" className={cn('text-info-primary mb-6', classNames?.description)}>\n {data.description}\n </Text>\n )}\n\n {/* Tab \u5207\u6362 */}\n {isShowTab && productsTab.length > 0 && (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab.find(item => item.tab === value)\n if (currentTab) {\n setTabId(value)\n setCurrentProducts(currentTab.data ?? [])\n }\n }}\n align={tabAlign}\n shape=\"rounded\"\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item.id ?? item.tab} value={item.tab}>\n {item.tab}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n )}\n\n {/* Swiper \u6A2A\u5411\u6ED1\u52A8\u5E03\u5C40 */}\n <Swiper\n key={tabId || 'default'}\n spaceBetween={16}\n slidesPerView=\"auto\"\n className={cn('!overflow-visible', isShowTab && productsTab.length > 0 ? 'mt-6' : '')}\n breakpoints={breakpoints || defaultBreakpoints}\n >\n {currentProducts.map((product, index) => (\n <SwiperSlide key={product.sku || index}>\n <ProductCard product={product} {...sharedProps} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n )\n }\n)\n\nImageOverlayShelf.displayName = 'ImageOverlayShelf'\n\n// \u521B\u5EFA\u590D\u5408\u7EC4\u4EF6\nconst ImageOverlayShelfWithProductCard = ImageOverlayShelf as ImageOverlayShelfComponent\nImageOverlayShelfWithProductCard.ProductCard = ProductCard\n\nexport { ProductCard }\nconst ImageOverlayShelfWrapped = withLayout(ImageOverlayShelfWithProductCard)\nexport default ImageOverlayShelfWrapped\n"],
5
+ "mappings": "aAiNM,OAGI,OAAAA,EAHJ,QAAAC,MAAA,oBAhNN,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,MAAO,aAEP,OAAS,QAAAC,MAAY,2BACrB,OAAS,WAAAC,MAAe,8BACxB,OAAS,cAAAC,MAAkB,QAE3B,OAAOC,MAAiB,mBASxB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,2BAE5C,MAAMC,EAAgB,QAChBC,EAAgB,sBA0FhBC,EAAoBR,EACxB,CACE,CACE,KAAAS,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
6
6
  "names": ["jsx", "jsxs", "React", "cn", "withLayout", "Swiper", "SwiperSlide", "Text", "Heading", "forwardRef", "ProductCard", "useExposure", "Tabs", "TabsList", "TabsTrigger", "componentType", "componentName", "ImageOverlayShelf", "data", "onLearnMore", "onShopNow", "onAddToCart", "onProductImageClick", "classNames", "copy", "breakpoints", "className", "props", "ref", "boxRef", "productsCard", "isShowTab", "productsTab", "tabShape", "tabAlign", "isShowTag", "showOriginalPrice", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "tabId", "setTabId", "currentProducts", "setCurrentProducts", "sharedProps", "defaultBreakpoints", "value", "currentTab", "item", "product", "index", "ImageOverlayShelfWithProductCard", "ImageOverlayShelfWrapped", "ImageOverlayShelf_default"]
7
7
  }
@@ -1,4 +1,4 @@
1
- "use client";import{jsx as o,jsxs as E}from"react/jsx-runtime";import*as p from"react";import{cva as _}from"class-variance-authority";import{Swiper as g,SwiperSlide as h}from"swiper/react";import{FreeMode as A,Mousewheel as R,Pagination as O}from"swiper/modules";import{useMediaQuery as L}from"react-responsive";import"swiper/css/pagination";import{cn as a}from"../../helpers/index.js";import{Heading as M,Text as H}from"../../index.js";import{withLayout as B}from"../../shared/Styles.js";import{useExposure as V}from"../../hooks/useExposure.js";const j="image",z="Media Endorsement",w=3;function q(n,t){const d=[];for(let i=0;i<n.length;i+=t)d.push(n.slice(i,i+t));return d}const Q=_("rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4",{variants:{theme:{light:"",dark:""},rounded:{true:"rounded-card",false:""}},defaultVariants:{theme:"light",rounded:!1}}),v=p.forwardRef(({className:n,classNames:t={},data:d,onItemClick:i,...x},k)=>{const{title:s,subtitle:l,items:c,theme:b="light",rounded:y=!1,layout:N="grid"}=d,T=L({query:"(max-width: 767px)"}),u=p.useRef(null);p.useImperativeHandle(k,()=>u.current),V(u,{componentType:j,componentName:z,componentTitle:s,componentDescription:l});const S=p.useCallback((e,r)=>m=>{i?.(e,r,m)},[i]),f=(e,r)=>E("div",{className:a("media-endorsement-card text-info-primary",Q({theme:b,rounded:y}),t.card),onClick:S(e,r),"aria-label":e.mediaName?`${e.mediaName} endorsement`:void 0,children:[o("div",{className:a("media-endorsement-card-icon","lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden",t.cardIcon),children:o("img",{src:e.icon.url,alt:e.icon.alt||e.mediaName||"Media logo",className:"lg-desktop:h-16 h-12 w-auto object-contain",loading:"lazy"})}),o(M,{size:2,as:"h6",html:e.text,className:a("media-endorsement-card-quote line-clamp-4",t.cardQuote)})]},r),D=()=>{const e=q(c,w);return o(g,{className:a("media-endorsement-mobile-swiper","w-full !overflow-visible pb-8",t.carousel),modules:[O],slidesPerView:1,spaceBetween:12,pagination:{clickable:!0,bulletClass:"media-endorsement-bullet",bulletActiveClass:"media-endorsement-bullet-active"},children:e.map((r,m)=>o(h,{className:"!h-auto",children:o("div",{className:"flex flex-col gap-3",children:r.map((I,P)=>{const C=m*w+P;return f(I,C)})})},m))})};return E("div",{ref:u,className:a("media-endorsement-root text-info-primary","w-full",n,t.root,{"aiui-dark":b==="dark"}),...x,children:[o("style",{children:`
1
+ "use client";import{jsx as o,jsxs as E}from"react/jsx-runtime";import*as p from"react";import{cva as C}from"class-variance-authority";import{Swiper as g,SwiperSlide as h}from"swiper/react";import{FreeMode as _,Mousewheel as A,Pagination as R}from"swiper/modules";import{useMediaQuery as O}from"react-responsive";import"swiper/css/pagination";import{cn as i}from"../../helpers/index.js";import{Heading as M,Text as L}from"../../index.js";import{withLayout as H}from"../../shared/Styles.js";import{useExposure as B}from"../../hooks/useExposure.js";const V="image",j="Media Endorsement",w=3;function z(n,t){const d=[];for(let a=0;a<n.length;a+=t)d.push(n.slice(a,a+t));return d}const q=C("rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4",{variants:{theme:{light:"",dark:""}},defaultVariants:{theme:"light"}}),v=p.forwardRef(({className:n,classNames:t={},data:d,onItemClick:a,...x},k)=>{const{title:s,subtitle:l,items:c,theme:b="light",rounded:Q=!1,layout:y="grid"}=d,N=O({query:"(max-width: 767px)"}),u=p.useRef(null);p.useImperativeHandle(k,()=>u.current),B(u,{componentType:V,componentName:j,componentTitle:s,componentDescription:l});const T=p.useCallback((e,r)=>m=>{a?.(e,r,m)},[a]),f=(e,r)=>E("div",{className:i("media-endorsement-card text-info-primary",q({theme:b}),t.card),onClick:T(e,r),"aria-label":e.mediaName?`${e.mediaName} endorsement`:void 0,children:[o("div",{className:i("media-endorsement-card-icon","lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden",t.cardIcon),children:o("img",{src:e.icon.url,alt:e.icon.alt||e.mediaName||"Media logo",className:"lg-desktop:h-16 h-12 w-auto object-contain",loading:"lazy"})}),o(M,{size:2,as:"h6",html:e.text,className:i("media-endorsement-card-quote line-clamp-4",t.cardQuote)})]},r),S=()=>{const e=z(c,w);return o(g,{className:i("media-endorsement-mobile-swiper","w-full !overflow-visible pb-8",t.carousel),modules:[R],slidesPerView:1,spaceBetween:12,pagination:{clickable:!0,bulletClass:"media-endorsement-bullet",bulletActiveClass:"media-endorsement-bullet-active"},children:e.map((r,m)=>o(h,{className:"!h-auto",children:o("div",{className:"flex flex-col gap-3",children:r.map((D,I)=>{const P=m*w+I;return f(D,P)})})},m))})};return E("div",{ref:u,className:i("media-endorsement-root text-info-primary","w-full",n,t.root,{"aiui-dark":b==="dark"}),...x,children:[o("style",{children:`
2
2
  .media-endorsement-bullet {
3
3
  display: inline-block;
4
4
  width: 8px;
@@ -19,5 +19,5 @@
19
19
  right: 0;
20
20
  text-align: center;
21
21
  }
22
- `}),(s||l)&&E("div",{className:a("media-endorsement-header mb-6",t.header),children:[s&&o(M,{as:"h2",size:4,html:s,className:a("media-endorsement-title",t.title)}),l&&o(H,{as:"p",size:3,className:a("",t?.subtitle),html:l})]}),N==="carousel"?o(g,{className:a("media-endorsement-carousel","w-full !overflow-visible",t.carousel),modules:[A,R],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:12,breakpoints:{768:{spaceBetween:16}},children:c.map((e,r)=>o(h,{className:"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]",children:f(e,r)},r))}):T?D():o("div",{className:a("media-endorsement-grid","laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3",t.grid),children:c.map((e,r)=>f(e,r))})]})});v.displayName="MediaEndorsement";var Z=B(v);export{Z as default};
22
+ `}),(s||l)&&E("div",{className:i("media-endorsement-header mb-6",t.header),children:[s&&o(M,{as:"h2",size:4,html:s,className:i("media-endorsement-title",t.title)}),l&&o(L,{as:"p",size:3,className:i("",t?.subtitle),html:l})]}),y==="carousel"?o(g,{className:i("media-endorsement-carousel","w-full !overflow-visible",t.carousel),modules:[_,A],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:12,breakpoints:{768:{spaceBetween:16}},children:c.map((e,r)=>o(h,{className:"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]",children:f(e,r)},r))}):N?S():o("div",{className:i("media-endorsement-grid","laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3",t.grid),children:c.map((e,r)=>f(e,r))})]})});v.displayName="MediaEndorsement";var Z=H(v);export{Z as default};
23
23
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaEndorsement/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel, Pagination } from 'swiper/modules'\nimport { useMediaQuery } from 'react-responsive'\nimport 'swiper/css/pagination'\nimport { cn } from '../../helpers/index.js'\nimport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './types.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst MEDIA_ENDORSEMENT_COMPONENT_TYPE = 'image'\nconst MEDIA_ENDORSEMENT_COMPONENT_NAME = 'Media Endorsement'\n\nconst MOBILE_ITEMS_PER_SLIDE = 3\n\n// Helper to chunk array into groups\nfunction chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\n/**\n * \u5361\u7247\u5BB9\u5668\u53D8\u4F53\n */\nconst cardVariants = cva(\n 'rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4',\n {\n variants: {\n theme: {\n light: '',\n dark: '',\n },\n rounded: {\n true: 'rounded-card',\n false: '',\n },\n },\n defaultVariants: {\n theme: 'light',\n rounded: false,\n },\n }\n)\n\n/**\n * MediaEndorsement - \u5A92\u4F53\u80CC\u4E66\n *\n * @description \u5A92\u4F53\u80CC\u4E66\u7EC4\u4EF6\u7684\u4F5C\u7528\u662F\u901A\u8FC7\u5C55\u793A\u7B2C\u4E09\u65B9\u5A92\u4F53\u7684\u8BC4\u4EF7\u6216\u62A5\u9053\uFF0C\u63D0\u5347\u54C1\u724C\u6216\u4EA7\u54C1\u7684\u53EF\u4FE1\u5EA6\u548C\u5F71\u54CD\u529B\n */\nconst MediaEndorsement = React.forwardRef<HTMLDivElement, MediaEndorsementProps>(\n ({ className, classNames = {}, data, onItemClick, ...props }, ref) => {\n const { title, subtitle, items, theme = 'light', rounded = false, layout = 'grid' } = data\n const isMobile = useMediaQuery({ query: '(max-width: 767px)' })\n\n const innerRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType: MEDIA_ENDORSEMENT_COMPONENT_TYPE,\n componentName: MEDIA_ENDORSEMENT_COMPONENT_NAME,\n componentTitle: title,\n componentDescription: subtitle,\n })\n const handleCardClick = React.useCallback(\n (item: MediaEndorsementItem, index: number) => (event: React.MouseEvent) => {\n onItemClick?.(item, index, event)\n },\n [onItemClick]\n )\n\n const renderCard = (item: MediaEndorsementItem, index: number) => (\n <div\n key={index}\n className={cn('media-endorsement-card text-info-primary', cardVariants({ theme, rounded }), classNames.card)}\n onClick={handleCardClick(item, index)}\n aria-label={item.mediaName ? `${item.mediaName} endorsement` : undefined}\n >\n {/* \u5A92\u4F53 Logo */}\n <div\n className={cn(\n 'media-endorsement-card-icon',\n 'lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden',\n classNames.cardIcon\n )}\n >\n <img\n src={item.icon.url}\n alt={item.icon.alt || item.mediaName || 'Media logo'}\n className=\"lg-desktop:h-16 h-12 w-auto object-contain\"\n loading=\"lazy\"\n />\n </div>\n\n {/* \u5F15\u7528\u6587\u6848 */}\n <Heading\n size={2}\n as={'h6'}\n html={item.text}\n className={cn('media-endorsement-card-quote line-clamp-4', classNames.cardQuote)}\n />\n </div>\n )\n\n // Mobile swiper for grid layout\n const renderMobileGridSwiper = () => {\n const chunkedItems = chunkArray(items, MOBILE_ITEMS_PER_SLIDE)\n return (\n <Swiper\n className={cn('media-endorsement-mobile-swiper', 'w-full !overflow-visible pb-8', classNames.carousel)}\n modules={[Pagination]}\n slidesPerView={1}\n spaceBetween={12}\n pagination={{\n clickable: true,\n bulletClass: 'media-endorsement-bullet',\n bulletActiveClass: 'media-endorsement-bullet-active',\n }}\n >\n {chunkedItems.map((group, slideIndex) => (\n <SwiperSlide key={slideIndex} className=\"!h-auto\">\n <div className=\"flex flex-col gap-3\">\n {group.map((item, itemIndex) => {\n const globalIndex = slideIndex * MOBILE_ITEMS_PER_SLIDE + itemIndex\n return renderCard(item, globalIndex)\n })}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n )\n }\n\n return (\n <div\n ref={innerRef}\n className={cn('media-endorsement-root text-info-primary', 'w-full', className, classNames.root, {\n 'aiui-dark': theme === 'dark',\n })}\n {...props}\n >\n <style>{`\n .media-endorsement-bullet {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #D9D9D9;\n margin: 0 4px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n }\n .media-endorsement-bullet-active {\n background: var(--info-primary-color);\n }\n .media-endorsement-mobile-swiper .swiper-pagination {\n position: absolute;\n bottom: -28px;\n left: 0;\n right: 0;\n text-align: center;\n }\n `}</style>\n {/* \u6807\u9898\u533A\u57DF */}\n {(title || subtitle) && (\n <div className={cn('media-endorsement-header mb-6', classNames.header)}>\n {title && (\n <Heading as=\"h2\" size={4} html={title} className={cn('media-endorsement-title', classNames.title)} />\n )}\n {subtitle && <Text as=\"p\" size={3} className={cn('', classNames?.subtitle)} html={subtitle} />}\n </div>\n )}\n {layout === 'carousel' ? (\n <Swiper\n className={cn('media-endorsement-carousel', 'w-full !overflow-visible', classNames.carousel)}\n modules={[FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{ forceToAxis: true }}\n slidesPerView=\"auto\"\n spaceBetween={12}\n breakpoints={{\n 768: { spaceBetween: 16 },\n }}\n >\n {items.map((item, index) => (\n <SwiperSlide key={index} className=\"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]\">\n {renderCard(item, index)}\n </SwiperSlide>\n ))}\n </Swiper>\n ) : isMobile ? (\n renderMobileGridSwiper()\n ) : (\n <div\n className={cn(\n 'media-endorsement-grid',\n 'laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3',\n classNames.grid\n )}\n >\n {items.map((item, index) => renderCard(item, index))}\n </div>\n )}\n </div>\n )\n }\n)\n\nMediaEndorsement.displayName = 'MediaEndorsement'\n\nexport default withLayout(MediaEndorsement)\n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EAAWU,CAAgB",
6
- "names": ["jsx", "jsxs", "React", "cva", "Swiper", "SwiperSlide", "FreeMode", "Mousewheel", "Pagination", "useMediaQuery", "cn", "Heading", "Text", "withLayout", "useExposure", "MEDIA_ENDORSEMENT_COMPONENT_TYPE", "MEDIA_ENDORSEMENT_COMPONENT_NAME", "MOBILE_ITEMS_PER_SLIDE", "chunkArray", "array", "size", "result", "cardVariants", "MediaEndorsement", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "theme", "rounded", "layout", "isMobile", "innerRef", "handleCardClick", "item", "index", "event", "renderCard", "renderMobileGridSwiper", "chunkedItems", "group", "slideIndex", "itemIndex", "globalIndex", "MediaEndorsement_default"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel, Pagination } from 'swiper/modules'\nimport { useMediaQuery } from 'react-responsive'\nimport 'swiper/css/pagination'\nimport { cn } from '../../helpers/index.js'\nimport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './types.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst MEDIA_ENDORSEMENT_COMPONENT_TYPE = 'image'\nconst MEDIA_ENDORSEMENT_COMPONENT_NAME = 'Media Endorsement'\n\nconst MOBILE_ITEMS_PER_SLIDE = 3\n\n// Helper to chunk array into groups\nfunction chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\n/**\n * \u5361\u7247\u5BB9\u5668\u53D8\u4F53\n */\nconst cardVariants = cva(\n 'rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4',\n {\n variants: {\n theme: {\n light: '',\n dark: '',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\n/**\n * MediaEndorsement - \u5A92\u4F53\u80CC\u4E66\n *\n * @description \u5A92\u4F53\u80CC\u4E66\u7EC4\u4EF6\u7684\u4F5C\u7528\u662F\u901A\u8FC7\u5C55\u793A\u7B2C\u4E09\u65B9\u5A92\u4F53\u7684\u8BC4\u4EF7\u6216\u62A5\u9053\uFF0C\u63D0\u5347\u54C1\u724C\u6216\u4EA7\u54C1\u7684\u53EF\u4FE1\u5EA6\u548C\u5F71\u54CD\u529B\n */\nconst MediaEndorsement = React.forwardRef<HTMLDivElement, MediaEndorsementProps>(\n ({ className, classNames = {}, data, onItemClick, ...props }, ref) => {\n const { title, subtitle, items, theme = 'light', rounded = false, layout = 'grid' } = data\n const isMobile = useMediaQuery({ query: '(max-width: 767px)' })\n\n const innerRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType: MEDIA_ENDORSEMENT_COMPONENT_TYPE,\n componentName: MEDIA_ENDORSEMENT_COMPONENT_NAME,\n componentTitle: title,\n componentDescription: subtitle,\n })\n const handleCardClick = React.useCallback(\n (item: MediaEndorsementItem, index: number) => (event: React.MouseEvent) => {\n onItemClick?.(item, index, event)\n },\n [onItemClick]\n )\n\n const renderCard = (item: MediaEndorsementItem, index: number) => (\n <div\n key={index}\n className={cn('media-endorsement-card text-info-primary', cardVariants({ theme }), classNames.card)}\n onClick={handleCardClick(item, index)}\n aria-label={item.mediaName ? `${item.mediaName} endorsement` : undefined}\n >\n {/* \u5A92\u4F53 Logo */}\n <div\n className={cn(\n 'media-endorsement-card-icon',\n 'lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden',\n classNames.cardIcon\n )}\n >\n <img\n src={item.icon.url}\n alt={item.icon.alt || item.mediaName || 'Media logo'}\n className=\"lg-desktop:h-16 h-12 w-auto object-contain\"\n loading=\"lazy\"\n />\n </div>\n\n {/* \u5F15\u7528\u6587\u6848 */}\n <Heading\n size={2}\n as={'h6'}\n html={item.text}\n className={cn('media-endorsement-card-quote line-clamp-4', classNames.cardQuote)}\n />\n </div>\n )\n\n // Mobile swiper for grid layout\n const renderMobileGridSwiper = () => {\n const chunkedItems = chunkArray(items, MOBILE_ITEMS_PER_SLIDE)\n return (\n <Swiper\n className={cn('media-endorsement-mobile-swiper', 'w-full !overflow-visible pb-8', classNames.carousel)}\n modules={[Pagination]}\n slidesPerView={1}\n spaceBetween={12}\n pagination={{\n clickable: true,\n bulletClass: 'media-endorsement-bullet',\n bulletActiveClass: 'media-endorsement-bullet-active',\n }}\n >\n {chunkedItems.map((group, slideIndex) => (\n <SwiperSlide key={slideIndex} className=\"!h-auto\">\n <div className=\"flex flex-col gap-3\">\n {group.map((item, itemIndex) => {\n const globalIndex = slideIndex * MOBILE_ITEMS_PER_SLIDE + itemIndex\n return renderCard(item, globalIndex)\n })}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n )\n }\n\n return (\n <div\n ref={innerRef}\n className={cn('media-endorsement-root text-info-primary', 'w-full', className, classNames.root, {\n 'aiui-dark': theme === 'dark',\n })}\n {...props}\n >\n <style>{`\n .media-endorsement-bullet {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #D9D9D9;\n margin: 0 4px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n }\n .media-endorsement-bullet-active {\n background: var(--info-primary-color);\n }\n .media-endorsement-mobile-swiper .swiper-pagination {\n position: absolute;\n bottom: -28px;\n left: 0;\n right: 0;\n text-align: center;\n }\n `}</style>\n {/* \u6807\u9898\u533A\u57DF */}\n {(title || subtitle) && (\n <div className={cn('media-endorsement-header mb-6', classNames.header)}>\n {title && (\n <Heading as=\"h2\" size={4} html={title} className={cn('media-endorsement-title', classNames.title)} />\n )}\n {subtitle && <Text as=\"p\" size={3} className={cn('', classNames?.subtitle)} html={subtitle} />}\n </div>\n )}\n {layout === 'carousel' ? (\n <Swiper\n className={cn('media-endorsement-carousel', 'w-full !overflow-visible', classNames.carousel)}\n modules={[FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{ forceToAxis: true }}\n slidesPerView=\"auto\"\n spaceBetween={12}\n breakpoints={{\n 768: { spaceBetween: 16 },\n }}\n >\n {items.map((item, index) => (\n <SwiperSlide key={index} className=\"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]\">\n {renderCard(item, index)}\n </SwiperSlide>\n ))}\n </Swiper>\n ) : isMobile ? (\n renderMobileGridSwiper()\n ) : (\n <div\n className={cn(\n 'media-endorsement-grid',\n 'laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3',\n classNames.grid\n )}\n >\n {items.map((item, index) => renderCard(item, index))}\n </div>\n )}\n </div>\n )\n }\n)\n\nMediaEndorsement.displayName = 'MediaEndorsement'\n\nexport default withLayout(MediaEndorsement)\nexport type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName }\n"],
5
+ "mappings": "aA6EM,OAcI,OAAAA,EAdJ,QAAAC,MAAA,oBA3EN,UAAYC,MAAW,QACvB,OAAS,OAAAC,MAAW,2BACpB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,YAAAC,EAAU,cAAAC,EAAY,cAAAC,MAAkB,iBACjD,OAAS,iBAAAC,MAAqB,mBAC9B,MAAO,wBACP,OAAS,MAAAC,MAAU,yBAOnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,iBAC9B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAE5B,MAAMC,EAAmC,QACnCC,EAAmC,oBAEnCC,EAAyB,EAG/B,SAASC,EAAcC,EAAYC,EAAqB,CACtD,MAAMC,EAAgB,CAAC,EACvB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG,EAAGA,EAAIF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EAAG,6BAA8B,2BAA4BgB,EAAW,QAAQ,EAC3F,QAAS,CAACpB,EAAUC,CAAU,EAC9B,SAAU,GACV,WAAY,CAAE,YAAa,EAAK,EAChC,cAAc,OACd,aAAc,GACd,YAAa,CACX,IAAK,CAAE,aAAc,EAAG,CAC1B,EAEC,SAAA0B,EAAM,IAAI,CAACO,EAAMC,IAChBzC,EAACK,EAAA,CAAwB,UAAU,oEAChC,SAAAsC,EAAWH,EAAMC,CAAK,GADPA,CAElB,CACD,EACH,EACEJ,EACFO,EAAuB,EAEvB5C,EAAC,OACC,UAAWU,EACT,yBACA,gGACAgB,EAAW,IACb,EAEC,SAAAO,EAAM,IAAI,CAACO,EAAMC,IAAUE,EAAWH,EAAMC,CAAK,CAAC,EACrD,GAEJ,CAEJ,CACF,EAEAjB,EAAiB,YAAc,mBAE/B,IAAO0B,EAAQrC,EAAWW,CAAgB",
6
+ "names": ["jsx", "jsxs", "React", "cva", "Swiper", "SwiperSlide", "FreeMode", "Mousewheel", "Pagination", "useMediaQuery", "cn", "Heading", "Text", "withLayout", "useExposure", "MEDIA_ENDORSEMENT_COMPONENT_TYPE", "MEDIA_ENDORSEMENT_COMPONENT_NAME", "MOBILE_ITEMS_PER_SLIDE", "chunkArray", "array", "size", "result", "i", "cardVariants", "MediaEndorsement", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "theme", "rounded", "layout", "isMobile", "innerRef", "handleCardClick", "item", "index", "event", "renderCard", "renderMobileGridSwiper", "chunkedItems", "group", "slideIndex", "itemIndex", "globalIndex", "MediaEndorsement_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as Se,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as y,useRef as n,useMemo as ke,useEffect as F,forwardRef as Ne,useImperativeHandle as He}from"react";import{debounce as Te}from"lodash";import{cn as o}from"../../helpers/utils.js";import{withLayout as ze}from"../../shared/Styles.js";import le from"../../components/button.js";import{Heading as Me,Text as se}from"../../components/index.js";import{VideoModal as Le}from"../VideoModal/index.js";import{convertLexicalToHTML as ae}from"@payloadcms/richtext-lexical/html";import{useInView as Re}from"react-intersection-observer";import{useExposure as Ie}from"../../hooks/useExposure.js";import L from"../../helpers/ScrollLoadVideo.js";import{gsap as m}from"gsap";import{SplitText as re}from"gsap/dist/SplitText";import{ScrollTrigger as q}from"gsap/dist/ScrollTrigger";const Ee="media_player_base",Pe="video";m.registerPlugin(q,re);const ne=({defaultConverters:f})=>({...f,text:R=>{const{node:s}=R;return s.$&&s.$.color?`<span class="lexical-${s.$.color}">${s.text}</span>`:s.text}}),ie=Ne(({className:f="",id:R,onBtnClick:s,data:{title:b,videoTitle:h,btnText:w,youtubeId:U,video:k,mobileVideo:Y,theme:I,img:N,shape:E,titleAnimation:H="fade-in",variant:ce,headline:O,paragraphs:P,metrics:S,...pe},..._},de)=>{const{sticky:i}=pe,[G,J]=y(!1),[K,ue]=y(0),[me,fe]=y(0),[T,ge]=y(0),[Q,$]=y(!1),d=n(null),W=n(null),r=n(null),z=n(null),X=n(null),M=n(null),g=n(null),B=n(null),C=n(null),{ref:Z,inView:c}=Re();He(de,()=>r.current);const x=typeof b=="string"?b:b&&ae({data:b,converters:ne}),A=typeof h=="string"?h:h&&ae({data:h,converters:ne});F(()=>{c?(d.current?.play(),J(!0)):(d.current?.pause(),J(!1))},[c]);const V=Te(()=>{if(r.current){const t=r.current.getBoundingClientRect(),a=window.innerHeight,v=window.scrollY||window.pageYOffset,p=t.bottom+v,u=document.documentElement.scrollHeight-p;ue(u>a?a:u)}if(r.current){const t=r.current.clientHeight,a=window.innerHeight;fe(t+a)}},600);F(()=>(V(),window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}),[]),F(()=>{function t(){if(!z.current||H!=="fade-in")return;const v=z.current?.clientHeight||80;M.current=new re(z.current,{type:"words",wordsClass:"word"});const p=M.current.words;m.set(p,{opacity:0}),g.current&&m.set(g.current,{opacity:0}),B.current=q.create({trigger:r.current,start:"top center-=10%",end:`top+=${v*1.5+80}px center-=10%`,scrub:!0,onUpdate:ee=>{const u=ee.progress,te=p.length,ve=1/te,oe=.5;p.forEach((ye,be)=>{const he=be/te*(1-oe),we=ve*(1+oe);let D=(u-he)/we;D=Math.max(0,Math.min(D,1)),m.set(ye,{opacity:D})}),m.set(W.current,{opacity:u}),g.current&&m.set(g.current,{opacity:u>=.6?1:0})}})}function a(){C.current=q.create({trigger:r.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:v=>{const p=v.progress;ge(p)}})}return c&&(t(),a()),()=>{M.current&&M.current.revert(),B.current&&B.current.kill(),C.current&&C.current.kill()}},[H,c]),Ie(X,{componentType:Pe,componentName:Ee,componentTitle:x});const xe=ke(()=>c&&T>0&&T<.9?3:c?2:1,[T,c]);if(ce==="text-layout")return l("div",{..._,ref:r,className:o("relative flex w-full items-center overflow-hidden","aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]","laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]",{"aiui-dark":I==="dark","rounded-box":E==="rounded"},f),children:[e("div",{ref:Z,className:"pointer-events-none absolute inset-0"}),l("div",{className:"absolute inset-0 z-0",children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:Y?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute inset-0 bg-black/30"})]}),l("div",{className:o("relative z-10 mx-auto flex w-full max-w-[1920px] flex-col","gap-6 px-4 py-10","tablet:gap-8 tablet:px-8","laptop:flex-row laptop:gap-12 laptop:px-16","desktop:gap-16 desktop:px-20","lg-desktop:px-24"),children:[e("div",{className:"laptop:w-1/2 w-full shrink-0",children:O&&e(Me,{as:"h2",size:5,className:"text-info-primary",children:O})}),l("div",{className:o("laptop:w-1/2 flex w-full flex-col justify-start","tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6"),children:[P&&P.length>0&&e("div",{className:"tablet:gap-4 flex flex-col gap-3",children:P.map((t,a)=>e(se,{as:"p",size:3,className:"text-info-primary lg-desktop:text-[18px] opacity-90",children:typeof t=="string"?t:t.text},a))}),S&&S.length>0&&e("div",{className:o("tablet:grid-cols-3 grid grid-cols-2","tablet:gap-6 desktop:gap-8 gap-4"),children:S.map((t,a)=>l("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]",children:t.value}),e(se,{as:"span",size:2,className:"text-info-primary opacity-80",children:t.label})]},a))})]})]})]});const j="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return l(Se,{children:[i&&e("div",{..._,ref:r,className:o("pointer-events-none relative z-10",j,{"aiui-dark":I==="dark","rounded-box":E==="rounded"},f),children:e("div",{ref:Z,children:!H&&l("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[x&&!G&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),A&&G&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:A}}),w&&e(le,{variant:"link",className:o("member-equity-button-secondary text-info-primary"),onClick:()=>{$(!0),s&&s?.()},children:w})]})})}),l("div",{...i?{}:_,style:i?{marginBottom:`-${K}px`,marginTop:`-${me}px`,zIndex:xe}:{zIndex:5},className:o("relative",f),children:[e("div",{className:"sticky top-0 ",children:l("div",{id:R,className:o("relative overflow-hidden",i?"h-screen w-full":j,{"aiui-dark":I==="dark","rounded-box":E==="rounded"}),children:[H==="fade-in"&&l("div",{className:o("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",i?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[x&&e("div",{ref:z,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),w&&e(le,{ref:g,variant:"link",className:o("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{$(!0),s&&s?.()},children:w})]}),l("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-T*100}vh`},children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:Y?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:W,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),i&&e("div",{className:o(i&&"pointer-events-none relative box-content block",j),style:i?{height:`${K}px`}:{},ref:X})]}),Q&&U&&e(Le,{visible:Q,youTubeId:U,onCloseModal:()=>$(!1)})]})});ie.displayName="MediaPlayerBase";var Ke=ze(ie);export{Ke as default};
1
+ "use client";import{Fragment as Pe,jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as y,useRef as n,useMemo as we,useEffect as D,forwardRef as ke,useImperativeHandle as Ne}from"react";import{debounce as He}from"lodash";import{cn as l}from"../../helpers/utils.js";import{withLayout as Te}from"../../shared/Styles.js";import le from"../../components/button.js";import{Heading as ze,Text as oe}from"../../components/index.js";import{VideoModal as Me}from"../VideoModal/index.js";import{convertLexicalToHTML as se}from"@payloadcms/richtext-lexical/html";import{useInView as Le}from"react-intersection-observer";import{useExposure as Re}from"../../hooks/useExposure.js";import L from"../../helpers/ScrollLoadVideo.js";import{gsap as m}from"gsap";import{SplitText as ae}from"gsap/dist/SplitText";import{ScrollTrigger as F}from"gsap/dist/ScrollTrigger";const Ie="media_player_base",Ee="video";m.registerPlugin(F,ae);const re=({defaultConverters:f})=>({...f,text:R=>{const{node:s}=R;return s.$&&s.$.color?`<span class="lexical-${s.$.color}">${s.text}</span>`:s.text}}),ne=ke(({className:f="",id:R,onBtnClick:s,data:{title:b,videoTitle:h,btnText:w,youtubeId:q,video:k,mobileVideo:U,theme:I,img:N,shape:Se,titleAnimation:H="fade-in",variant:ie,headline:Y,paragraphs:E,metrics:P,...ce},...S},pe)=>{const{sticky:i}=ce,[O,G]=y(!1),[J,de]=y(0),[ue,me]=y(0),[T,fe]=y(0),[K,_]=y(!1),d=n(null),Q=n(null),r=n(null),z=n(null),W=n(null),M=n(null),g=n(null),$=n(null),B=n(null),{ref:X,inView:c}=Le();Ne(pe,()=>r.current);const x=typeof b=="string"?b:b&&se({data:b,converters:re}),Z=typeof h=="string"?h:h&&se({data:h,converters:re});D(()=>{c?(d.current?.play(),G(!0)):(d.current?.pause(),G(!1))},[c]);const C=He(()=>{if(r.current){const t=r.current.getBoundingClientRect(),a=window.innerHeight,v=window.scrollY||window.pageYOffset,p=t.bottom+v,u=document.documentElement.scrollHeight-p;de(u>a?a:u)}if(r.current){const t=r.current.clientHeight,a=window.innerHeight;me(t+a)}},600);D(()=>(C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[]),D(()=>{function t(){if(!z.current||H!=="fade-in")return;const v=z.current?.clientHeight||80;M.current=new ae(z.current,{type:"words",wordsClass:"word"});const p=M.current.words;m.set(p,{opacity:0}),g.current&&m.set(g.current,{opacity:0}),$.current=F.create({trigger:r.current,start:"top center-=10%",end:`top+=${v*1.5+80}px center-=10%`,scrub:!0,onUpdate:A=>{const u=A.progress,ee=p.length,xe=1/ee,te=.5;p.forEach((ve,ye)=>{const be=ye/ee*(1-te),he=xe*(1+te);let j=(u-be)/he;j=Math.max(0,Math.min(j,1)),m.set(ve,{opacity:j})}),m.set(Q.current,{opacity:u}),g.current&&m.set(g.current,{opacity:u>=.6?1:0})}})}function a(){B.current=F.create({trigger:r.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:v=>{const p=v.progress;fe(p)}})}return c&&(t(),a()),()=>{M.current&&M.current.revert(),$.current&&$.current.kill(),B.current&&B.current.kill()}},[H,c]),Re(W,{componentType:Ee,componentName:Ie,componentTitle:x});const ge=we(()=>c&&T>0&&T<.9?3:c?2:1,[T,c]);if(ie==="text-layout")return o("div",{...S,ref:r,className:l("relative flex w-full items-center overflow-hidden","aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]","laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]",{"aiui-dark":I==="dark","rounded-box":!0},f),children:[e("div",{ref:X,className:"pointer-events-none absolute inset-0"}),o("div",{className:"absolute inset-0 z-0",children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute inset-0 bg-black/30"})]}),o("div",{className:l("relative z-10 mx-auto flex w-full max-w-[1920px] flex-col","gap-6 px-4 py-10","tablet:gap-8 tablet:px-8","laptop:flex-row laptop:gap-12 laptop:px-16","desktop:gap-16 desktop:px-20","lg-desktop:px-24"),children:[e("div",{className:"laptop:w-1/2 w-full shrink-0",children:Y&&e(ze,{as:"h2",size:5,className:"text-info-primary",children:Y})}),o("div",{className:l("laptop:w-1/2 flex w-full flex-col justify-start","tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6"),children:[E&&E.length>0&&e("div",{className:"tablet:gap-4 flex flex-col gap-3",children:E.map((t,a)=>e(oe,{as:"p",size:3,className:"text-info-primary lg-desktop:text-[18px] opacity-90",children:typeof t=="string"?t:t.text},a))}),P&&P.length>0&&e("div",{className:l("tablet:grid-cols-3 grid grid-cols-2","tablet:gap-6 desktop:gap-8 gap-4"),children:P.map((t,a)=>o("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]",children:t.value}),e(oe,{as:"span",size:2,className:"text-info-primary opacity-80",children:t.label})]},a))})]})]})]});const V="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return o(Pe,{children:[i&&e("div",{...S,ref:r,className:l("pointer-events-none relative z-10",V,{"aiui-dark":I==="dark","rounded-box":!0},f),children:e("div",{ref:X,children:!H&&o("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[x&&!O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),Z&&O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:Z}}),w&&e(le,{variant:"link",className:l("member-equity-button-secondary text-info-primary"),onClick:()=>{_(!0),s&&s?.()},children:w})]})})}),o("div",{...i?{}:S,style:i?{marginBottom:`-${J}px`,marginTop:`-${ue}px`,zIndex:ge}:{zIndex:5},className:l("relative",f),children:[e("div",{className:"sticky top-0 ",children:o("div",{id:R,className:l("relative overflow-hidden",i?"h-screen w-full":V,{"aiui-dark":I==="dark","rounded-box":!0}),children:[H==="fade-in"&&o("div",{className:l("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",i?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[x&&e("div",{ref:z,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),w&&e(le,{ref:g,variant:"link",className:l("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{_(!0),s&&s?.()},children:w})]}),o("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-T*100}vh`},children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:Q,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),i&&e("div",{className:l(i&&"pointer-events-none relative box-content block",V),style:i?{height:`${J}px`}:{},ref:W})]}),K&&q&&e(Me,{visible:K,youTubeId:q,onCloseModal:()=>_(!1)})]})});ne.displayName="MediaPlayerBase";var Ke=Te(ne);export{Ke as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n variant,\n headline,\n paragraphs,\n metrics,\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n if (variant === 'text-layout') {\n return (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'relative flex w-full items-center overflow-hidden',\n 'aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]',\n 'laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]',\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef} className=\"pointer-events-none absolute inset-0\" />\n\n {/* Video Background */}\n <div className=\"absolute inset-0 z-0\">\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div className=\"absolute inset-0 bg-black/30\" />\n </div>\n\n {/* Content */}\n {/* Content \u2014 Fix#1/#9: laptop:flex-row, reduced spacing */}\n <div\n className={cn(\n 'relative z-10 mx-auto flex w-full max-w-[1920px] flex-col',\n 'gap-6 px-4 py-10',\n 'tablet:gap-8 tablet:px-8',\n 'laptop:flex-row laptop:gap-12 laptop:px-16',\n 'desktop:gap-16 desktop:px-20',\n 'lg-desktop:px-24'\n )}\n >\n {/* 1. Headline */}\n {/* 1. Headline \u2014 Fix#1(w-1/2) + Fix#5(Heading size=5) */}\n <div className=\"laptop:w-1/2 w-full shrink-0\">\n {headline && (\n <Heading as=\"h2\" size={5} className=\"text-info-primary\">\n {headline}\n </Heading>\n )}\n </div>\n\n {/* Right column for paragraphs and metrics */}\n {/* Right column \u2014 Fix#1(w-1/2) + Fix#4(justify-start) + Fix#10(gap) */}\n <div\n className={cn(\n 'laptop:w-1/2 flex w-full flex-col justify-start',\n 'tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6'\n )}\n >\n {/* 2. Paragraphs */}\n {paragraphs && paragraphs.length > 0 && (\n <div className=\"tablet:gap-4 flex flex-col gap-3\">\n {paragraphs.map((p, i) => (\n <Text key={i} as=\"p\" size={3} className=\"text-info-primary lg-desktop:text-[18px] opacity-90\">\n {typeof p === 'string' ? p : p.text}\n </Text>\n ))}\n </div>\n )}\n\n {/* 3. Metrics */}\n {metrics && metrics.length > 0 && (\n <div className={cn('tablet:grid-cols-3 grid grid-cols-2', 'tablet:gap-6 desktop:gap-8 gap-4')}>\n {metrics.map((m, i) => (\n <div key={i} className=\"flex flex-col gap-1\">\n {/* Fix#7: Heading size=4 equivalent classes on span */}\n <span className=\"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]\">\n {m.value}\n </span>\n {/* Fix#8: Text size=2 \u2192 14px, removed uppercase/tracking-wider */}\n <Text as=\"span\" size={2} className=\"text-info-primary opacity-80\">\n {m.label}\n </Text>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n }\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block size-full\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
5
- "mappings": "aA0NU,OAoGJ,YAAAA,GApGI,OAAAC,EAGA,QAAAC,MAHA,oBAzNV,OAAS,YAAAC,EAAU,UAAAC,EAAQ,WAAAC,GAAS,aAAAC,EAAW,cAAAC,GAAY,uBAAAC,OAA2B,QACtF,OAAS,YAAAC,OAAgB,SACzB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,OAAkB,yBAC3B,OAAOC,OAAY,6BACnB,OAAS,WAAAC,GAAS,QAAAC,OAAY,4BAC9B,OAAS,cAAAC,OAAkB,yBAC3B,OAAS,wBAAAC,OAA4B,oCAGrC,OAAS,aAAAC,OAAiB,8BAE1B,OAAS,eAAAC,OAAmB,6BAC5B,OAAOC,MAAqB,mCAC5B,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,OAAiB,sBAC1B,O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,EAAS,UAAWvB,EAAW,aAAc,IAAMwB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA/B,GAAgB,YAAc,kBAE9B,IAAOqE,GAAQvF,GAAWkB,EAAe",
4
+ "sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n variant,\n headline,\n paragraphs,\n metrics,\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n if (variant === 'text-layout') {\n return (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'relative flex w-full items-center overflow-hidden',\n 'aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]',\n 'laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]',\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': true,\n },\n className\n )}\n >\n <div ref={inViewRef} className=\"pointer-events-none absolute inset-0\" />\n\n {/* Video Background */}\n <div className=\"absolute inset-0 z-0\">\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div className=\"absolute inset-0 bg-black/30\" />\n </div>\n\n {/* Content */}\n {/* Content \u2014 Fix#1/#9: laptop:flex-row, reduced spacing */}\n <div\n className={cn(\n 'relative z-10 mx-auto flex w-full max-w-[1920px] flex-col',\n 'gap-6 px-4 py-10',\n 'tablet:gap-8 tablet:px-8',\n 'laptop:flex-row laptop:gap-12 laptop:px-16',\n 'desktop:gap-16 desktop:px-20',\n 'lg-desktop:px-24'\n )}\n >\n {/* 1. Headline */}\n {/* 1. Headline \u2014 Fix#1(w-1/2) + Fix#5(Heading size=5) */}\n <div className=\"laptop:w-1/2 w-full shrink-0\">\n {headline && (\n <Heading as=\"h2\" size={5} className=\"text-info-primary\">\n {headline}\n </Heading>\n )}\n </div>\n\n {/* Right column for paragraphs and metrics */}\n {/* Right column \u2014 Fix#1(w-1/2) + Fix#4(justify-start) + Fix#10(gap) */}\n <div\n className={cn(\n 'laptop:w-1/2 flex w-full flex-col justify-start',\n 'tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6'\n )}\n >\n {/* 2. Paragraphs */}\n {paragraphs && paragraphs.length > 0 && (\n <div className=\"tablet:gap-4 flex flex-col gap-3\">\n {paragraphs.map((p, i) => (\n <Text key={i} as=\"p\" size={3} className=\"text-info-primary lg-desktop:text-[18px] opacity-90\">\n {typeof p === 'string' ? p : p.text}\n </Text>\n ))}\n </div>\n )}\n\n {/* 3. Metrics */}\n {metrics && metrics.length > 0 && (\n <div className={cn('tablet:grid-cols-3 grid grid-cols-2', 'tablet:gap-6 desktop:gap-8 gap-4')}>\n {metrics.map((m, i) => (\n <div key={i} className=\"flex flex-col gap-1\">\n {/* Fix#7: Heading size=4 equivalent classes on span */}\n <span className=\"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]\">\n {m.value}\n </span>\n {/* Fix#8: Text size=2 \u2192 14px, removed uppercase/tracking-wider */}\n <Text as=\"span\" size={2} className=\"text-info-primary opacity-80\">\n {m.label}\n </Text>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n }\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': true,\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': true,\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block size-full\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
5
+ "mappings": "aA0NU,OAoGJ,YAAAA,GApGI,OAAAC,EAGA,QAAAC,MAHA,oBAzNV,OAAS,YAAAC,EAAU,UAAAC,EAAQ,WAAAC,GAAS,aAAAC,EAAW,cAAAC,GAAY,uBAAAC,OAA2B,QACtF,OAAS,YAAAC,OAAgB,SACzB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,OAAkB,yBAC3B,OAAOC,OAAY,6BACnB,OAAS,WAAAC,GAAS,QAAAC,OAAY,4BAC9B,OAAS,cAAAC,OAAkB,yBAC3B,OAAS,wBAAAC,OAA4B,oCAGrC,OAAS,aAAAC,OAAiB,8BAE1B,OAAS,eAAAC,OAAmB,6BAC5B,OAAOC,MAAqB,mCAC5B,OA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C,EAACc,GAAA,CAAW,QAAS4C,EAAS,UAAWvB,EAAW,aAAc,IAAMwB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA/B,GAAgB,YAAc,kBAE9B,IAAOqE,GAAQvF,GAAWkB,EAAe",
6
6
  "names": ["Fragment", "jsx", "jsxs", "useState", "useRef", "useMemo", "useEffect", "forwardRef", "useImperativeHandle", "debounce", "cn", "withLayout", "Button", "Heading", "Text", "VideoModal", "convertLexicalToHTML", "useInView", "useExposure", "ScrollLoadVideo", "gsap", "SplitText", "ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "variant", "headline", "paragraphs", "metrics", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "p", "m", "aspect", "MediaPlayerBase_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as l,jsxs as i}from"react/jsx-runtime";import{useState as r,forwardRef as C,useRef as h}from"react";import{cn as V,getLocalizedPath as B}from"../../helpers/utils.js";import{withLayout as $}from"../../shared/Styles.js";import{Picture as v,Link as z,Text as D}from"../../components/index.js";import E from"../Title/index.js";import H from"../SwiperBox/index.js";import{Container as R}from"../../components/container.js";import{VideoModal as S}from"../VideoModal/index.js";import{convertLexicalToHTML as U}from"@payloadcms/richtext-lexical/html";import{useExposure as _}from"../../hooks/useExposure.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{trackUrlRef as q}from"../../shared/trackUrlRef.js";const a="video",p="media_player_multi",Y=({data:e,configuration:o})=>{const t=h(null);return _(t,{componentType:a,componentName:p,componentTitle:e?.title,position:o?.index+1,componentDescription:e?.description}),i("div",{ref:t,className:V("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",o.shape==="round"?"rounded-2xl":""),children:[i("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(v,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(v,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),i("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[i("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(z,{asChild:!e?.href,href:q(B(e?.href||"",o?.locale||"us"),`${a}_${p}`),"data-headless-type-name":`${a}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(D,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=C(({data:{items:e=[],shape:o="square",title:t,containerProps:g},className:n="",key:w,onVideoPlayBtnClick:y,...M},k)=>{const[m,d]=r(!1),[P,c]=r(""),[N,f]=r(""),{locale:L="us"}=j(),u=typeof t=="string"?t:t&&U({data:t}),T=h(null),x=e.length===2;return i("div",{...M,ref:T,className:n,children:[l("div",{className:"mediaplayermulti-box",children:l(R,{...g||{},className:"overflow-hidden",children:i("div",{className:n,ref:k,children:[t&&l(E,{className:"mediaplayermulti-title",data:{title:u||""}}),l(H,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+w,data:{list:e,configuration:{shape:o,locale:L,onVideoPlayBtnClick:(I,s)=>{d(!0),s?.isYouTube?(f(s?.youtubeId||""),c("")):(c(s?.video?.url||""),f("")),y?.(I)},title:u}},Slide:Y,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&l(S,{visible:m,youTubeId:N,videoUrl:P,onCloseModal:()=>d(!1)})]})});b.displayName="MediaPlayerMulti";var te=$(b);export{te as default};
1
+ "use client";import{jsx as l,jsxs as i}from"react/jsx-runtime";import{useState as r,forwardRef as C,useRef as h}from"react";import{cn as V,getLocalizedPath as B}from"../../helpers/utils.js";import{withLayout as $}from"../../shared/Styles.js";import{Picture as v,Link as z,Text as D}from"../../components/index.js";import E from"../Title/index.js";import H from"../SwiperBox/index.js";import{Container as R}from"../../components/container.js";import{VideoModal as S}from"../VideoModal/index.js";import{convertLexicalToHTML as U}from"@payloadcms/richtext-lexical/html";import{useExposure as _}from"../../hooks/useExposure.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{trackUrlRef as q}from"../../shared/trackUrlRef.js";const a="video",p="media_player_multi",Y=({data:e,configuration:o})=>{const t=h(null);return _(t,{componentType:a,componentName:p,componentTitle:e?.title,position:o?.index+1,componentDescription:e?.description}),i("div",{ref:t,className:V("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto","rounded-box"),children:[i("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(v,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(v,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),i("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[i("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(z,{asChild:!e?.href,href:q(B(e?.href||"",o?.locale||"us"),`${a}_${p}`),"data-headless-type-name":`${a}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(D,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=C(({data:{items:e=[],shape:o="square",title:t,containerProps:g},className:n="",key:w,onVideoPlayBtnClick:y,...M},k)=>{const[m,d]=r(!1),[P,c]=r(""),[N,f]=r(""),{locale:L="us"}=j(),u=typeof t=="string"?t:t&&U({data:t}),T=h(null),x=e.length===2;return i("div",{...M,ref:T,className:n,children:[l("div",{className:"mediaplayermulti-box",children:l(R,{...g||{},className:"overflow-hidden",children:i("div",{className:n,ref:k,children:[t&&l(E,{className:"mediaplayermulti-title",data:{title:u||""}}),l(H,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+w,data:{list:e,configuration:{shape:o,locale:L,onVideoPlayBtnClick:(I,s)=>{d(!0),s?.isYouTube?(f(s?.youtubeId||""),c("")):(c(s?.video?.url||""),f("")),y?.(I)},title:u}},Slide:Y,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&l(S,{visible:m,youTubeId:N,videoUrl:P,onCloseModal:()=>d(!1)})]})});b.displayName="MediaPlayerMulti";var te=$(b);export{te as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerMulti/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(\n getLocalizedPath(data?.href || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n {\n data: { items = [], shape = 'square', title, containerProps },\n className = '',\n key,\n onVideoPlayBtnClick,\n ...rest\n },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const { locale = 'us' } = useAiuiContext()\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div {...rest} ref={wrapperRef} className={className}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n locale,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId(data?.youtubeId || '')\n setVideoUrl('')\n } else {\n setVideoUrl(data?.video?.url || '')\n setYouTubeId('')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
- "mappings": "aAuCM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAtCN,OAAS,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Y,UAAWZ,EACzC,UAAA9B,EAAC,OAAI,UAAU,uBACb,SAAAA,EAACa,EAAA,CAAW,GAAIgB,GAAkB,CAAC,EAAI,UAAU,kBAC/C,SAAA5B,EAAC,OAAI,UAAW6B,EAAW,IAAKN,EAC7B,UAAAI,GAAS5B,EAACW,EAAA,CAAM,UAAU,yBAAyB,KAAM,CAAE,MAAO8B,GAAc,EAAG,EAAG,EACvFzC,EAACY,EAAA,CACC,UAAU,oBACV,GAAI,yBAA2BmB,EAC/B,KAAM,CACJ,KAAML,EACN,cAAe,CACb,MAAAC,EACA,OAAAa,EACA,oBAAqB,CAACI,EAAWtB,IAA+B,CAC9Da,EAAW,EAAI,EACXb,GAAM,WACRiB,EAAajB,GAAM,WAAa,EAAE,EAClCe,EAAY,EAAE,IAEdA,EAAYf,GAAM,OAAO,KAAO,EAAE,EAClCiB,EAAa,EAAE,GAEjBP,IAAsBY,CAAC,CACzB,EACA,MAAOH,CACT,CACF,EACA,MAAOpB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAesB,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCT,GACClC,EAACc,EAAA,CACC,QAASoB,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAV,EAAiB,YAAc,mBAC/B,IAAOoB,GAAQtC,EAAWkB,CAAgB",
4
+ "sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n 'rounded-box'\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(\n getLocalizedPath(data?.href || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n {\n data: { items = [], shape = 'square', title, containerProps },\n className = '',\n key,\n onVideoPlayBtnClick,\n ...rest\n },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const { locale = 'us' } = useAiuiContext()\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div {...rest} ref={wrapperRef} className={className}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n locale,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId(data?.youtubeId || '')\n setVideoUrl('')\n } else {\n setVideoUrl(data?.video?.url || '')\n setYouTubeId('')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
+ "mappings": "aAuCM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAtCN,OAAS,YAAAC,EAAU,cAAAC,EAAY,UAAAC,MAAc,QAC7C,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,MAAY,4BACpC,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wB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AAc,EAAG,EAAG,EACvFzC,EAACY,EAAA,CACC,UAAU,oBACV,GAAI,yBAA2BmB,EAC/B,KAAM,CACJ,KAAML,EACN,cAAe,CACb,MAAAC,EACA,OAAAa,EACA,oBAAqB,CAACI,EAAWtB,IAA+B,CAC9Da,EAAW,EAAI,EACXb,GAAM,WACRiB,EAAajB,GAAM,WAAa,EAAE,EAClCe,EAAY,EAAE,IAEdA,EAAYf,GAAM,OAAO,KAAO,EAAE,EAClCiB,EAAa,EAAE,GAEjBP,IAAsBY,CAAC,CACzB,EACA,MAAOH,CACT,CACF,EACA,MAAOpB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAesB,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCT,GACClC,EAACc,EAAA,CACC,QAASoB,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAV,EAAiB,YAAc,mBAC/B,IAAOoB,GAAQtC,EAAWkB,CAAgB",
6
6
  "names": ["jsx", "jsxs", "useState", "forwardRef", "useRef", "cn", "getLocalizedPath", "withLayout", "Picture", "Link", "Text", "Title", "SwiperBox", "Container", "VideoModal", "convertLexicalToHTML", "useExposure", "useAiuiContext", "trackUrlRef", "componentType", "componentName", "MediaPlayerItem", "data", "configuration", "ref", "MediaPlayerMulti", "items", "shape", "title", "containerProps", "className", "key", "onVideoPlayBtnClick", "rest", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "locale", "title_html", "wrapperRef", "itemsLength", "_", "MediaPlayerMulti_default"]
7
7
  }