@anker-in/headless-ui 1.0.9 → 1.0.10

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 (251) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.d.ts +3 -2
  2. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  3. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  4. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
  5. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  6. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +1 -1
  7. package/dist/cjs/biz-components/Category/index.d.ts +1 -1
  8. package/dist/cjs/biz-components/Category/index.js +1 -1
  9. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  10. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
  11. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  12. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  13. package/dist/cjs/biz-components/Faq/Faq.d.ts +14 -0
  14. package/dist/cjs/biz-components/Faq/Faq.js +2 -0
  15. package/dist/cjs/biz-components/Faq/Faq.js.map +7 -0
  16. package/dist/cjs/biz-components/Faq/index.d.ts +2 -0
  17. package/dist/cjs/biz-components/Faq/index.js +2 -0
  18. package/dist/cjs/biz-components/Faq/index.js.map +7 -0
  19. package/dist/cjs/biz-components/Faq/types.d.ts +12 -0
  20. package/dist/cjs/biz-components/Faq/types.js +2 -0
  21. package/dist/cjs/biz-components/Faq/types.js.map +7 -0
  22. package/dist/cjs/biz-components/Graphic/index.d.ts +2 -1
  23. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  24. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  25. package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  26. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js +1 -1
  27. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js.map +1 -1
  28. package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
  29. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  30. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  31. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +1 -1
  32. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  33. package/dist/cjs/biz-components/Marquee/Marquee.js.map +1 -1
  34. package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -1
  35. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  36. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  37. package/dist/cjs/biz-components/MediaPlayerBase/types.d.ts +2 -0
  38. package/dist/cjs/biz-components/MediaPlayerBase/types.js +1 -1
  39. package/dist/cjs/biz-components/MediaPlayerBase/types.js.map +1 -1
  40. package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -1
  41. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  42. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +1 -1
  43. package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -1
  44. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  45. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  46. package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -1
  47. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  48. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  49. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
  50. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  51. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  52. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +5 -0
  53. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
  54. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
  55. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +6 -3
  56. package/dist/cjs/biz-components/ShelfDisplay/index.js +3 -3
  57. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  58. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  59. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  60. package/dist/cjs/biz-components/Slogan/index.d.ts +1 -1
  61. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  62. package/dist/cjs/biz-components/Slogan/index.js.map +3 -3
  63. package/dist/cjs/biz-components/Spacer/index.d.ts +1 -1
  64. package/dist/cjs/biz-components/Spacer/index.js +1 -1
  65. package/dist/cjs/biz-components/Spacer/index.js.map +1 -1
  66. package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -1
  67. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  68. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  69. package/dist/cjs/biz-components/Tabs/types.d.ts +6 -0
  70. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  71. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  72. package/dist/cjs/biz-components/Title/index.d.ts +1 -1
  73. package/dist/cjs/biz-components/Title/index.js +1 -1
  74. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  75. package/dist/cjs/biz-components/Title/types.d.ts +4 -0
  76. package/dist/cjs/biz-components/Title/types.js +1 -1
  77. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  78. package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +14 -0
  79. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js +2 -0
  80. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js.map +7 -0
  81. package/dist/cjs/biz-components/WhyChoose/index.d.ts +2 -0
  82. package/dist/cjs/biz-components/WhyChoose/index.js +2 -0
  83. package/dist/cjs/biz-components/WhyChoose/index.js.map +7 -0
  84. package/dist/cjs/biz-components/WhyChoose/types.d.ts +12 -0
  85. package/dist/cjs/biz-components/WhyChoose/types.js +2 -0
  86. package/dist/cjs/biz-components/WhyChoose/types.js.map +7 -0
  87. package/dist/cjs/biz-components/index.d.ts +4 -0
  88. package/dist/cjs/biz-components/index.js +1 -1
  89. package/dist/cjs/biz-components/index.js.map +3 -3
  90. package/dist/cjs/components/button.d.ts +3 -0
  91. package/dist/cjs/components/button.js +1 -1
  92. package/dist/cjs/components/button.js.map +3 -3
  93. package/dist/cjs/components/container.js +1 -1
  94. package/dist/cjs/components/container.js.map +2 -2
  95. package/dist/cjs/components/picture.js +1 -1
  96. package/dist/cjs/components/picture.js.map +3 -3
  97. package/dist/cjs/helpers/utils.d.ts +1 -0
  98. package/dist/cjs/helpers/utils.js +1 -1
  99. package/dist/cjs/helpers/utils.js.map +3 -3
  100. package/dist/cjs/hooks/useExposure.js +1 -1
  101. package/dist/cjs/hooks/useExposure.js.map +3 -3
  102. package/dist/cjs/shared/Styles.d.ts +11 -3
  103. package/dist/cjs/shared/Styles.js +1 -1
  104. package/dist/cjs/shared/Styles.js.map +3 -3
  105. package/dist/cjs/stories/HeroBanner.stories.d.ts +1 -1
  106. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.d.ts +1 -0
  107. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js +1 -1
  108. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js.map +3 -3
  109. package/dist/cjs/stories/accordionCards.stories.d.ts +1 -21
  110. package/dist/cjs/stories/brandEquity.stories.d.ts +1 -1
  111. package/dist/cjs/stories/button.stories.d.ts +1 -0
  112. package/dist/cjs/stories/button.stories.js +1 -1
  113. package/dist/cjs/stories/button.stories.js.map +3 -3
  114. package/dist/cjs/stories/category.stories.d.ts +1 -1
  115. package/dist/cjs/stories/evaluate.stories.d.ts +1 -1
  116. package/dist/cjs/stories/faq.stories.d.ts +21 -0
  117. package/dist/cjs/stories/faq.stories.js +2 -0
  118. package/dist/cjs/stories/faq.stories.js.map +7 -0
  119. package/dist/cjs/stories/graphic.stories.d.ts +7 -2
  120. package/dist/cjs/stories/graphic.stories.js +1 -1
  121. package/dist/cjs/stories/graphic.stories.js.map +2 -2
  122. package/dist/cjs/stories/marquee.stories.d.ts +1 -1
  123. package/dist/cjs/stories/mediaplayerMulti.stories.d.ts +1 -1
  124. package/dist/cjs/stories/shelfDisplay.stories.d.ts +1 -1
  125. package/dist/cjs/stories/slogan.stories.d.ts +1 -1
  126. package/dist/cjs/stories/whychoose.stories.d.ts +21 -0
  127. package/dist/cjs/stories/whychoose.stories.js +2 -0
  128. package/dist/cjs/stories/whychoose.stories.js.map +7 -0
  129. package/dist/esm/biz-components/AccordionCards/index.d.ts +3 -2
  130. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  131. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  132. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
  133. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  134. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  135. package/dist/esm/biz-components/Category/index.d.ts +1 -1
  136. package/dist/esm/biz-components/Category/index.js +1 -1
  137. package/dist/esm/biz-components/Category/index.js.map +3 -3
  138. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
  139. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  140. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  141. package/dist/esm/biz-components/Faq/Faq.d.ts +14 -0
  142. package/dist/esm/biz-components/Faq/Faq.js +2 -0
  143. package/dist/esm/biz-components/Faq/Faq.js.map +7 -0
  144. package/dist/esm/biz-components/Faq/index.d.ts +2 -0
  145. package/dist/esm/biz-components/Faq/index.js +2 -0
  146. package/dist/esm/biz-components/Faq/index.js.map +7 -0
  147. package/dist/esm/biz-components/Faq/types.d.ts +12 -0
  148. package/dist/esm/biz-components/Faq/types.js +1 -0
  149. package/dist/esm/biz-components/Faq/types.js.map +7 -0
  150. package/dist/esm/biz-components/Graphic/index.d.ts +2 -1
  151. package/dist/esm/biz-components/Graphic/index.js +1 -1
  152. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  153. package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  154. package/dist/esm/biz-components/GraphicAttractionBlock/index.js +1 -1
  155. package/dist/esm/biz-components/GraphicAttractionBlock/index.js.map +2 -2
  156. package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
  157. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  158. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  159. package/dist/esm/biz-components/Marquee/Marquee.d.ts +1 -1
  160. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  161. package/dist/esm/biz-components/Marquee/Marquee.js.map +2 -2
  162. package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -1
  163. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  164. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  165. package/dist/esm/biz-components/MediaPlayerBase/types.d.ts +2 -0
  166. package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -1
  167. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  168. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
  169. package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -1
  170. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  171. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
  172. package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -1
  173. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  174. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  175. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
  176. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  177. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  178. package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +5 -0
  179. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +6 -3
  180. package/dist/esm/biz-components/ShelfDisplay/index.js +5 -5
  181. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  182. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  183. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  184. package/dist/esm/biz-components/Slogan/index.d.ts +1 -1
  185. package/dist/esm/biz-components/Slogan/index.js +1 -1
  186. package/dist/esm/biz-components/Slogan/index.js.map +3 -3
  187. package/dist/esm/biz-components/Spacer/index.d.ts +1 -1
  188. package/dist/esm/biz-components/Spacer/index.js +1 -1
  189. package/dist/esm/biz-components/Spacer/index.js.map +2 -2
  190. package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -1
  191. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  192. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  193. package/dist/esm/biz-components/Tabs/types.d.ts +6 -0
  194. package/dist/esm/biz-components/Title/index.d.ts +1 -1
  195. package/dist/esm/biz-components/Title/index.js +1 -1
  196. package/dist/esm/biz-components/Title/index.js.map +3 -3
  197. package/dist/esm/biz-components/Title/types.d.ts +4 -0
  198. package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +14 -0
  199. package/dist/esm/biz-components/WhyChoose/WhyChoose.js +2 -0
  200. package/dist/esm/biz-components/WhyChoose/WhyChoose.js.map +7 -0
  201. package/dist/esm/biz-components/WhyChoose/index.d.ts +2 -0
  202. package/dist/esm/biz-components/WhyChoose/index.js +2 -0
  203. package/dist/esm/biz-components/WhyChoose/index.js.map +7 -0
  204. package/dist/esm/biz-components/WhyChoose/types.d.ts +12 -0
  205. package/dist/esm/biz-components/WhyChoose/types.js +1 -0
  206. package/dist/esm/biz-components/WhyChoose/types.js.map +7 -0
  207. package/dist/esm/biz-components/index.d.ts +4 -0
  208. package/dist/esm/biz-components/index.js +1 -1
  209. package/dist/esm/biz-components/index.js.map +3 -3
  210. package/dist/esm/components/button.d.ts +3 -0
  211. package/dist/esm/components/button.js +1 -1
  212. package/dist/esm/components/button.js.map +3 -3
  213. package/dist/esm/components/container.js +1 -1
  214. package/dist/esm/components/container.js.map +2 -2
  215. package/dist/esm/components/picture.js +1 -1
  216. package/dist/esm/components/picture.js.map +3 -3
  217. package/dist/esm/helpers/utils.d.ts +1 -0
  218. package/dist/esm/helpers/utils.js +1 -1
  219. package/dist/esm/helpers/utils.js.map +3 -3
  220. package/dist/esm/hooks/useExposure.js +1 -1
  221. package/dist/esm/hooks/useExposure.js.map +3 -3
  222. package/dist/esm/shared/Styles.d.ts +11 -3
  223. package/dist/esm/shared/Styles.js +1 -1
  224. package/dist/esm/shared/Styles.js.map +3 -3
  225. package/dist/esm/stories/HeroBanner.stories.d.ts +1 -1
  226. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.d.ts +1 -0
  227. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js +1 -1
  228. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js.map +3 -3
  229. package/dist/esm/stories/accordionCards.stories.d.ts +1 -21
  230. package/dist/esm/stories/brandEquity.stories.d.ts +1 -1
  231. package/dist/esm/stories/button.stories.d.ts +1 -0
  232. package/dist/esm/stories/button.stories.js +1 -1
  233. package/dist/esm/stories/button.stories.js.map +3 -3
  234. package/dist/esm/stories/category.stories.d.ts +1 -1
  235. package/dist/esm/stories/evaluate.stories.d.ts +1 -1
  236. package/dist/esm/stories/faq.stories.d.ts +21 -0
  237. package/dist/esm/stories/faq.stories.js +2 -0
  238. package/dist/esm/stories/faq.stories.js.map +7 -0
  239. package/dist/esm/stories/graphic.stories.d.ts +7 -2
  240. package/dist/esm/stories/graphic.stories.js +1 -1
  241. package/dist/esm/stories/graphic.stories.js.map +2 -2
  242. package/dist/esm/stories/marquee.stories.d.ts +1 -1
  243. package/dist/esm/stories/mediaplayerMulti.stories.d.ts +1 -1
  244. package/dist/esm/stories/shelfDisplay.stories.d.ts +1 -1
  245. package/dist/esm/stories/slogan.stories.d.ts +1 -1
  246. package/dist/esm/stories/whychoose.stories.d.ts +21 -0
  247. package/dist/esm/stories/whychoose.stories.js +2 -0
  248. package/dist/esm/stories/whychoose.stories.js.map +7 -0
  249. package/dist/tokens/base.css +1 -1
  250. package/package.json +1 -1
  251. package/tailwind.config.js +1 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Graphic/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading } from '../../components/index.js'\nimport { Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n youtubeId?: string\n isYouTube?: boolean\n buttonText?: string\n}\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n return (\n <div\n className={cn(handleAspect(), 'laptop:h-auto h-[360px] flex-1 shrink-0 md:basis-[296px]', {\n 'aiui-dark': configuration.theme === 'dark',\n })}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <a\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n className=\"relative block size-full cursor-pointer overflow-hidden\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <Text\n style={{\n color: data?.textColor,\n }}\n html={data?.title}\n // eslint-disable-next-line tailwindcss/classnames-order\n className=\"graphic-title line-clamp-3 lg-desktop:text-[18px] desktop:text-[16px] text-[14px] font-bold leading-[1.2]\"\n />\n <div className=\"flex items-end justify-between\">\n <div className=\"flex-1\">\n {data?.description && (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className=\"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-10 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 {data.buttonText && (\n <a href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}>\n <Button variant=\"secondary\" className=\"desktop:mt-[24px] mt-[12px] self-start\">\n {data.buttonText}\n </Button>\n </a>\n )}\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className, ...props }, ref) => {\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n },\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal visible={visible} youTubeId={youTubeId} videoUrl={videoUrl} onCloseModal={() => setVisible(false)} />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withStyles(Graphic)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkEU,IAAAI,EAAA,6BAjEVC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAsB,oCACtBC,EAAgC,qCAChCA,EAA8B,qCAC9BC,EAAkB,gCAClBC,EAA2B,kCAE3BC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAuBhBC,EAAO,CAAC,CAAE,KAAA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,UACH,aAAW,MAAG,mBAAmB,EACjC,KAAM,CACJ,KAAMvB,GAAM,OAAS,CAAC,EACtB,cAAe,CACb,UAAWA,EAAK,UAChB,IAAKA,GAAM,OAAO,QAAU,EAC5B,oBAAqB,CAACwB,EAAWxB,IAAsB,CACrDU,EAAW,EAAI,EACXV,GAAM,UACRc,IAAed,GAAM,WAAa,EAAE,EAEpCY,IAAcZ,GAAM,OAAO,KAAO,EAAE,CAExC,CACF,CACF,EACA,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAegB,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,KACA,OAAC,cAAW,QAASN,EAAS,UAAWI,EAAW,SAAUF,EAAU,aAAc,IAAMD,EAAW,EAAK,EAAG,GACjH,CAEJ,CAAC,EAEDP,EAAQ,YAAc,UAEtB,IAAOlB,KAAQ,cAAWkB,CAAO",
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading } from '../../components/index.js'\nimport { Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n youtubeId?: string\n isYouTube?: boolean\n buttonText?: string\n theme?: Theme\n}\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n return (\n <div\n className={cn(\n handleAspect(),\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n className=\"relative block size-full cursor-pointer overflow-hidden\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n // eslint-disable-next-line tailwindcss/classnames-order\n className=\"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className=\"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n {(data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-10 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 {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"desktop:mt-[24px] mt-[12px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className, ...props }, ref) => {\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n },\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal visible={visible} youTubeId={youTubeId} videoUrl={videoUrl} onCloseModal={() => setVisible(false)} />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwEU,IAAAI,EAAA,6BAvEVC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAsB,oCACtBC,EAAgC,qCAChCA,EAA8B,qCAC9BC,EAAkB,gCAClBC,EAA2B,kCAE3BC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAwBhBC,EAAO,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAehC,OAAC,OACC,aAAW,OAfM,IAAM,CACzB,OAAQA,EAAc,IAAK,CACzB,IAAK,GACH,MAAO,8LACT,IAAK,GACH,MAAO,4LACT,IAAK,GACH,MAAO,4LACT,QACE,MAAO,2LACX,CACF,GAKmB,EACb,uFACA,CACE,YAAaD,EAAK,QAAU,MAC9B,CACF,EAEA,mBAAC,OACC,aAAW,MAAG,mBAAoB,CAC/B,gDAAkDC,GAAe,YAAc,OAClF,CAAC,EAED,oBAAC,KACC,aAAYD,GAAM,OAASA,GAAM,YACjC,QAAM,eAAYA,GAAM,KAAM,GAAGH,CAAa,IAAIC,CAAa,EAAE,EACjE,UAAU,0DAEV,oBAAC,WACC,UAAU,SACV,aAAa,yEACb,OAAQE,GAAM,QAAQ,IACtB,IAAKA,GAAM,QAAQ,KAAO,GAC5B,KACA,QAAC,OAAI,UAAU,yEACb,qBAAC,OAAI,aAAW,MAAG,iCAAkC,gBAAgB,EACnE,qBAAC,OAAI,UAAU,yBACb,oBAAC,QACC,KAAMA,GAAM,MACZ,MAAO,CAAE,MAAOA,GAAM,SAAU,EAEhC,UAAU,kGACZ,EACCA,GAAM,gBACL,OAAC,WACC,KAAMA,GAAM,YACZ,MAAO,CACL,MAAOA,GAAM,SACf,EACA,G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,CAEJ,CAAC,EAEDP,EAAQ,YAAc,UAEtB,IAAOlB,KAAQ,cAAWkB,CAAO",
6
6
  "names": ["Graphic_exports", "__export", "Graphic_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_SwiperBox", "import_components", "import_Title", "import_VideoModal", "import_useExposure", "import_trackUrlRef", "componentType", "componentName", "Item", "data", "configuration", "e", "Graphic", "React", "className", "props", "ref", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "handleSwiperShow", "width", "isShow", "isMobile", "descriptions", "maxHeight", "el", "Title", "SwiperBox", "_"]
7
7
  }
@@ -17,7 +17,7 @@ interface GraphicAttractionBlockProps extends ComponentCommonProps {
17
17
  attractionItems?: AttractionItem[];
18
18
  };
19
19
  }
20
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<GraphicAttractionBlockProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
20
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<GraphicAttractionBlockProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
21
21
  className?: string;
22
22
  data?: Record<string, any>;
23
23
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";var y=Object.create;var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var C=(t,i)=>{for(var a in i)l(t,a,{get:i[a],enumerable:!0})},g=(t,i,a,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of P(i))!T.call(t,o)&&o!==a&&l(t,o,{get:()=>i[o],enumerable:!(s=w(i,o))||s.enumerable});return t};var m=(t,i,a)=>(a=t!=null?y(A(t)):{},g(i||!t||!t.__esModule?l(a,"default",{value:t,enumerable:!0}):a,t)),I=t=>g(l({},"__esModule",{value:!0}),t);var z={};C(z,{default:()=>j});module.exports=I(z);var e=require("react/jsx-runtime"),f=m(require("react")),x=require("../../shared/Styles.js"),n=m(require("../../components/picture.js")),h=require("../../components/heading.js"),p=require("../../components/text.js"),u=m(require("../Title/index.js")),c=require("../../helpers/utils.js");const M=f.default.forwardRef((t,i)=>{const{shape:a,imageUrlPc:s,imageUrlMob:o,sectionTitle:d,imageTitle:k,imageDescription:v,attractionItems:b}=t.data;return(0,e.jsxs)("section",{ref:i,"data-ui-component-id":"GraphicAttractionBlock",className:(0,c.cn)("text-info-primary relative",t.className),children:[d&&(0,e.jsx)(u.default,{data:{title:d}}),(0,e.jsxs)("div",{className:(0,c.cn)("tablet:aspect-[1664/560] relative aspect-[358/480] w-full overflow-hidden",{"rounded-box":a==="rounded"}),children:[(0,e.jsx)(n.default,{source:`${s?.url}, ${o?.url} 767`,className:"inset-0",imgClassName:"h-full object-cover",alt:s?.alt||""}),(0,e.jsxs)("div",{className:"lg-desktop:p-8 absolute inset-0 z-[1] flex flex-col justify-end p-4",children:[(0,e.jsx)(h.Heading,{as:"h3",className:"text-white",size:3,html:k}),(0,e.jsx)(p.Text,{as:"p",className:"text-white",size:2,html:v})]})]}),(0,e.jsx)("div",{className:"tablet:gap-4 tablet:grid-cols-4 tablet:mt-[10px] mt-4 grid grid-cols-2 gap-3",children:b?.map((r,N)=>(0,e.jsxs)("div",{className:(0,c.cn)("lg-desktop:p-8 desktop:p-6 desktop:gap-16 flex flex-col justify-between gap-12 bg-white p-4",{"rounded-box":a==="rounded"}),children:[(0,e.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,e.jsx)(p.Text,{as:"p",className:"lg-desktop:text-[18px] tracking text-[14px] font-semibold",html:r.title}),(0,e.jsx)(n.default,{className:"lg-desktop:size-[36px] size-[30px] shrink-0 object-cover",source:r.icon?.url,alt:r.icon?.alt,imgClassName:"w-full h-full object-cover"})]}),(0,e.jsx)(p.Text,{as:"p",className:"lg-desktop:text-[24px] tracking text-[20px] leading-tight",html:r.description})]},N))})]})});var j=(0,x.withStyles)(M);
1
+ "use strict";var y=Object.create;var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var C=(t,i)=>{for(var a in i)l(t,a,{get:i[a],enumerable:!0})},g=(t,i,a,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of P(i))!T.call(t,o)&&o!==a&&l(t,o,{get:()=>i[o],enumerable:!(s=w(i,o))||s.enumerable});return t};var m=(t,i,a)=>(a=t!=null?y(A(t)):{},g(i||!t||!t.__esModule?l(a,"default",{value:t,enumerable:!0}):a,t)),I=t=>g(l({},"__esModule",{value:!0}),t);var z={};C(z,{default:()=>j});module.exports=I(z);var e=require("react/jsx-runtime"),f=m(require("react")),x=require("../../shared/Styles.js"),n=m(require("../../components/picture.js")),h=require("../../components/heading.js"),p=require("../../components/text.js"),u=m(require("../Title/index.js")),c=require("../../helpers/utils.js");const M=f.default.forwardRef((t,i)=>{const{shape:a,imageUrlPc:s,imageUrlMob:o,sectionTitle:d,imageTitle:k,imageDescription:v,attractionItems:b}=t.data;return(0,e.jsxs)("section",{ref:i,"data-ui-component-id":"GraphicAttractionBlock",className:(0,c.cn)("text-info-primary relative",t.className),children:[d&&(0,e.jsx)(u.default,{data:{title:d}}),(0,e.jsxs)("div",{className:(0,c.cn)("tablet:aspect-[1664/560] relative aspect-[358/480] w-full overflow-hidden",{"rounded-box":a==="rounded"}),children:[(0,e.jsx)(n.default,{source:`${s?.url}, ${o?.url} 767`,className:"inset-0",imgClassName:"h-full object-cover",alt:s?.alt||""}),(0,e.jsxs)("div",{className:"lg-desktop:p-8 absolute inset-0 z-[1] flex flex-col justify-end p-4",children:[(0,e.jsx)(h.Heading,{as:"h3",className:"text-white",size:3,html:k}),(0,e.jsx)(p.Text,{as:"p",className:"text-white",size:2,html:v})]})]}),(0,e.jsx)("div",{className:"tablet:gap-4 tablet:grid-cols-4 tablet:mt-[10px] mt-4 grid grid-cols-2 gap-3",children:b?.map((r,N)=>(0,e.jsxs)("div",{className:(0,c.cn)("lg-desktop:p-8 desktop:p-6 desktop:gap-16 flex flex-col justify-between gap-12 bg-white p-4",{"rounded-box":a==="rounded"}),children:[(0,e.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,e.jsx)(p.Text,{as:"p",className:"lg-desktop:text-[18px] tracking text-[14px] font-semibold",html:r.title}),(0,e.jsx)(n.default,{className:"lg-desktop:size-[36px] size-[30px] shrink-0 object-cover",source:r.icon?.url,alt:r.icon?.alt,imgClassName:"w-full h-full object-cover"})]}),(0,e.jsx)(p.Text,{as:"p",className:"lg-desktop:text-[24px] tracking text-[20px] leading-tight",html:r.description})]},N))})]})});var j=(0,x.withLayout)(M);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/GraphicAttractionBlock/index.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport Title from '../Title/index.js'\nimport type { Shape } from '../../types/props'\nimport { cn } from '../../helpers/utils.js'\nimport type { ComponentCommonProps, Media, Img } from '../../types/props'\n\nexport interface AttractionItem {\n icon?: Img\n title: string\n description: string\n}\n\ninterface GraphicAttractionBlockProps extends ComponentCommonProps {\n data: {\n shape?: Shape\n sectionTitle?: string\n imageUrlPc?: Media\n imageUrlMob?: Media\n imageTitle?: string\n imageDescription?: string\n attractionItems?: AttractionItem[]\n }\n}\n\nconst GraphicAttractionBlock = React.forwardRef<HTMLDivElement, GraphicAttractionBlockProps>((props, ref) => {\n const { shape, imageUrlPc, imageUrlMob, sectionTitle, imageTitle, imageDescription, attractionItems } = props.data\n\n return (\n <section\n ref={ref}\n data-ui-component-id=\"GraphicAttractionBlock\"\n className={cn('text-info-primary relative', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} />}\n <div\n className={cn('tablet:aspect-[1664/560] relative aspect-[358/480] w-full overflow-hidden', {\n 'rounded-box': shape === 'rounded',\n })}\n >\n <Picture\n source={`${imageUrlPc?.url}, ${imageUrlMob?.url} 767`}\n className=\"inset-0\"\n imgClassName=\"h-full object-cover\"\n alt={imageUrlPc?.alt || ''}\n />\n <div className=\"lg-desktop:p-8 absolute inset-0 z-[1] flex flex-col justify-end p-4\">\n <Heading as=\"h3\" className=\"text-white\" size={3} html={imageTitle} />\n <Text as=\"p\" className=\"text-white\" size={2} html={imageDescription} />\n </div>\n </div>\n <div className=\"tablet:gap-4 tablet:grid-cols-4 tablet:mt-[10px] mt-4 grid grid-cols-2 gap-3\">\n {attractionItems?.map((item, index) => (\n <div\n key={index}\n className={cn(\n 'lg-desktop:p-8 desktop:p-6 desktop:gap-16 flex flex-col justify-between gap-12 bg-white p-4',\n { 'rounded-box': shape === 'rounded' }\n )}\n >\n <div className=\"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3\">\n <Text as=\"p\" className=\"lg-desktop:text-[18px] tracking text-[14px] font-semibold\" html={item.title} />\n <Picture\n className=\"lg-desktop:size-[36px] size-[30px] shrink-0 object-cover\"\n source={item.icon?.url}\n alt={item.icon?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <Text\n as=\"p\"\n className=\"lg-desktop:text-[24px] tracking text-[20px] leading-tight\"\n html={item.description}\n />\n </div>\n ))}\n </div>\n </section>\n )\n})\nexport default withStyles(GraphicAttractionBlock)\nexport type { GraphicAttractionBlockProps }\n"],
4
+ "sourcesContent": ["import React from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport Title from '../Title/index.js'\nimport type { Shape } from '../../types/props'\nimport { cn } from '../../helpers/utils.js'\nimport type { ComponentCommonProps, Media, Img } from '../../types/props'\n\nexport interface AttractionItem {\n icon?: Img\n title: string\n description: string\n}\n\ninterface GraphicAttractionBlockProps extends ComponentCommonProps {\n data: {\n shape?: Shape\n sectionTitle?: string\n imageUrlPc?: Media\n imageUrlMob?: Media\n imageTitle?: string\n imageDescription?: string\n attractionItems?: AttractionItem[]\n }\n}\n\nconst GraphicAttractionBlock = React.forwardRef<HTMLDivElement, GraphicAttractionBlockProps>((props, ref) => {\n const { shape, imageUrlPc, imageUrlMob, sectionTitle, imageTitle, imageDescription, attractionItems } = props.data\n\n return (\n <section\n ref={ref}\n data-ui-component-id=\"GraphicAttractionBlock\"\n className={cn('text-info-primary relative', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} />}\n <div\n className={cn('tablet:aspect-[1664/560] relative aspect-[358/480] w-full overflow-hidden', {\n 'rounded-box': shape === 'rounded',\n })}\n >\n <Picture\n source={`${imageUrlPc?.url}, ${imageUrlMob?.url} 767`}\n className=\"inset-0\"\n imgClassName=\"h-full object-cover\"\n alt={imageUrlPc?.alt || ''}\n />\n <div className=\"lg-desktop:p-8 absolute inset-0 z-[1] flex flex-col justify-end p-4\">\n <Heading as=\"h3\" className=\"text-white\" size={3} html={imageTitle} />\n <Text as=\"p\" className=\"text-white\" size={2} html={imageDescription} />\n </div>\n </div>\n <div className=\"tablet:gap-4 tablet:grid-cols-4 tablet:mt-[10px] mt-4 grid grid-cols-2 gap-3\">\n {attractionItems?.map((item, index) => (\n <div\n key={index}\n className={cn(\n 'lg-desktop:p-8 desktop:p-6 desktop:gap-16 flex flex-col justify-between gap-12 bg-white p-4',\n { 'rounded-box': shape === 'rounded' }\n )}\n >\n <div className=\"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3\">\n <Text as=\"p\" className=\"lg-desktop:text-[18px] tracking text-[14px] font-semibold\" html={item.title} />\n <Picture\n className=\"lg-desktop:size-[36px] size-[30px] shrink-0 object-cover\"\n source={item.icon?.url}\n alt={item.icon?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <Text\n as=\"p\"\n className=\"lg-desktop:text-[24px] tracking text-[20px] leading-tight\"\n html={item.description}\n />\n </div>\n ))}\n </div>\n </section>\n )\n})\nexport default withLayout(GraphicAttractionBlock)\nexport type { GraphicAttractionBlockProps }\n"],
5
5
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqCuB,IAAAI,EAAA,6BArCvBC,EAAkB,oBAClBC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAwB,uCACxBC,EAAqB,oCACrBC,EAAkB,gCAElBC,EAAmB,kCAqBnB,MAAMC,EAAyB,EAAAC,QAAM,WAAwD,CAACC,EAAOC,IAAQ,CAC3G,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,YAAAC,EAAa,aAAAC,EAAc,WAAAC,EAAY,iBAAAC,EAAkB,gBAAAC,CAAgB,EAAIR,EAAM,KAE9G,SACE,QAAC,WACC,IAAKC,EACL,uBAAqB,yBACrB,aAAW,MAAG,6BAA8BD,EAAM,SAAS,EAE1D,UAAAK,MAAgB,OAAC,EAAAI,QAAA,CAAM,KAAM,CAAE,MAAOJ,CAAa,EAAG,KACvD,QAAC,OACC,aAAW,MAAG,4EAA6E,CACzF,cAAeH,IAAU,SAC3B,CAAC,EAED,oBAAC,EAAAQ,QAAA,CACC,OAAQ,GAAGP,GAAY,GAAG,KAAKC,GAAa,GAAG,OAC/C,UAAU,UACV,aAAa,sBACb,IAAKD,GAAY,KAAO,GAC1B,KACA,QAAC,OAAI,UAAU,sEACb,oBAAC,WAAQ,GAAG,KAAK,UAAU,aAAa,KAAM,EAAG,KAAMG,EAAY,KACnE,OAAC,QAAK,GAAG,IAAI,UAAU,aAAa,KAAM,EAAG,KAAMC,EAAkB,GACvE,GACF,KACA,OAAC,OAAI,UAAU,+EACZ,SAAAC,GAAiB,IAAI,CAACG,EAAMC,OAC3B,QAAC,OAEC,aAAW,MACT,8FACA,CAAE,cAAeV,IAAU,SAAU,CACvC,EAEA,qBAAC,OAAI,UAAU,uEACb,oBAAC,QAAK,GAAG,IAAI,UAAU,4DAA4D,KAAMS,EAAK,MAAO,KACrG,OAAC,EAAAD,QAAA,CACC,UAAU,2DACV,OAAQC,EAAK,MAAM,IACnB,IAAKA,EAAK,MAAM,IAChB,aAAa,6BACf,GACF,KACA,OAAC,QACC,GAAG,IACH,UAAU,4DACV,KAAMA,EAAK,YACb,IAnBKC,CAoBP,CACD,EACH,GACF,CAEJ,CAAC,EACD,IAAOxB,KAAQ,cAAWU,CAAsB",
6
6
  "names": ["GraphicAttractionBlock_exports", "__export", "GraphicAttractionBlock_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_Styles", "import_picture", "import_heading", "import_text", "import_Title", "import_utils", "GraphicAttractionBlock", "React", "props", "ref", "shape", "imageUrlPc", "imageUrlMob", "sectionTitle", "imageTitle", "imageDescription", "attractionItems", "Title", "Picture", "item", "index"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { HeroBannerProps } from './types.js';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<HeroBannerProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<HeroBannerProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
4
4
  className?: string;
5
5
  data?: Record<string, any>;
6
6
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var K=Object.create;var v=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var ee=(t,o)=>{for(var a in o)v(t,a,{get:o[a],enumerable:!0})},U=(t,o,a,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of W(o))!Y.call(t,l)&&l!==a&&v(t,l,{get:()=>o[l],enumerable:!(c=O(o,l))||c.enumerable});return t};var H=(t,o,a)=>(a=t!=null?K(X(t)):{},U(o||!t||!t.__esModule?v(a,"default",{value:t,enumerable:!0}):a,t)),te=t=>U(v({},"__esModule",{value:!0}),t);var re={};ee(re,{default:()=>ae});module.exports=te(re);var e=require("react/jsx-runtime"),s=H(require("react")),_=require("@gsap/react"),b=H(require("gsap")),u=require("gsap/dist/ScrollTrigger"),z=require("react-responsive"),j=H(require("../../helpers/ScrollLoadVideo.js")),r=require("../../components/index.js"),i=require("../../helpers/index.js"),A=require("../../shared/Styles.js"),q=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),F=require("../../components/button.js"),G=require("../VideoModal/index.js");const y="image",w="hero_banner",oe=({size:t="base"})=>{const{width:o,height:a}=F.sizeMap[t];return(0,e.jsx)("svg",{width:o,height:a,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},D=s.default.forwardRef(({data:t,className:o},a)=>{const{title:c,subtitle:l,pcImage:P,padImage:Q,mobileImage:T,pcVideo:V,padVideo:I,mobileVideo:f,isShowVideo:Z,primaryButton:h,secondaryButton:p,theme:J="light",size:M="default",caption:N=[],blockLink:$}=t,L=(0,z.useMediaQuery)({query:"(max-width: 768px)"}),R=(0,z.useMediaQuery)({query:"(max-width: 1024px)"}),[C,S]=(0,s.useState)(!1),d=(0,s.useRef)(null),n=(0,s.useRef)(null);return(0,q.useExposure)(n,{componentType:y,componentName:w,componentTitle:c,componentDescription:l}),(0,s.useImperativeHandle)(a,()=>n.current),(0,_.useGSAP)(()=>{b.default.registerPlugin(u.ScrollTrigger);function B(){if(!d.current)return;const m=n.current?.clientHeight||100;window.innerHeight<=m?u.ScrollTrigger.create({trigger:n.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:g=>{const x=g.progress*40-20;b.default.set(d.current,{yPercent:x})}}):(u.ScrollTrigger.create({trigger:n.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:g=>{const x=g.progress*20-20;b.default.set(d.current,{yPercent:x})}}),u.ScrollTrigger.create({trigger:n.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:g=>{const x=g.progress*20;b.default.set(d.current,{yPercent:x})}}))}return setTimeout(()=>{B()},1e3),()=>{u.ScrollTrigger.getAll().forEach(m=>m.kill())}},[]),(0,e.jsxs)("div",{ref:n,"data-ui-component-id":"HeroBanner",className:(0,i.cn)(J==="dark"?"aiui-dark":""," tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]":M==="default","lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]":M==="sm"},o),children:[$&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,k.trackUrlRef)($,`${y}_${w}`),tabIndex:-1,"aria-hidden":"true"}),(0,e.jsx)("div",{ref:d,className:(0,i.cn)("absolute left-0 top-0 size-full"),children:Z?(0,e.jsx)(j.default,{poster:L?f?.url:R?I?.url||f?.url:V?.url,src:L?f?.url:R?I?.url||f?.url:V?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:!0,playsInline:!0}):(0,e.jsx)(r.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:P?.alt||"",source:`${P?.url||""} , ${Q?.url??(T?.url||"")} 1024, ${T?.url||""} 767`})}),(0,e.jsxs)("div",{className:"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]",children:[(0,e.jsxs)("div",{className:"laptop:text-left max-w-[686px]",children:[c&&(0,e.jsx)(r.Heading,{as:"h2",size:5,className:(0,i.cn)("hero-banner-title"),html:c}),l&&(0,e.jsx)(r.Heading,{as:"h3",className:(0,i.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-[16px] laptop:mt-[8px] lg-desktop:mt-[16px] mt-[4px] text-[14px]"),html:l})]}),(0,e.jsxs)("div",{className:"laptop:justify-start lg-desktop:gap-3 flex items-center gap-2",children:[p?.isShowPlayVideoButton&&p?.playVideoButtonText?(0,e.jsxs)(r.Button,{onClick:()=>S(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",children:[p?.playVideoButtonText," ",(0,e.jsx)(oe,{size:"lg"})]}):p?.text?(0,e.jsx)("a",{href:(0,k.trackUrlRef)(p?.link,`${y}_${w}`),children:(0,e.jsx)(r.Button,{size:"lg",variant:"secondary",className:"hero-banner-secondary-button",children:p?.text})}):null,h&&h.text&&(0,e.jsx)("a",{href:(0,k.trackUrlRef)(h.link,`${y}_${w}`),children:(0,e.jsx)(r.Button,{size:"lg",variant:"primary",className:"hero-banner-primary-button",children:h.text})})]})]}),N.length>0&&(0,e.jsx)("div",{className:"laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:N.map((B,m)=>(0,e.jsxs)(s.default.Fragment,{children:[(0,e.jsx)(r.Text,{size:2,className:(0,i.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:B.title}),m<N.length-1&&(0,e.jsx)("div",{className:(0,i.cn)("bg-info-primary w-px")})]},m))}),C&&(0,e.jsx)(G.VideoModal,{visible:C,videoUrl:p?.videoUrl?.url,youTubeId:p?.youtubeId,onCloseModal:()=>S(!1)})]})});D.displayName="HeroBanner";var ae=(0,A.withStyles)(D);
1
+ "use strict";"use client";var ee=Object.create;var v=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var le=(t,r)=>{for(var a in r)v(t,a,{get:r[a],enumerable:!0})},q=(t,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of re(r))!ae.call(t,l)&&l!==a&&v(t,l,{get:()=>r[l],enumerable:!(n=te(r,l))||n.enumerable});return t};var V=(t,r,a)=>(a=t!=null?ee(oe(t)):{},q(r||!t||!t.__esModule?v(a,"default",{value:t,enumerable:!0}):a,t)),se=t=>q(v({},"__esModule",{value:!0}),t);var pe={};le(pe,{default:()=>ie});module.exports=se(pe);var e=require("react/jsx-runtime"),o=V(require("react")),g=V(require("gsap")),f=require("gsap/dist/ScrollTrigger"),R=require("react-responsive"),A=require("react-intersection-observer"),Q=V(require("../../helpers/ScrollLoadVideo.js")),s=require("../../components/index.js"),c=require("../../helpers/index.js"),Z=require("../../shared/Styles.js"),G=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),J=require("../../components/button.js"),K=require("../VideoModal/index.js");const y="image",w="hero_banner",ne=({size:t="base"})=>{const{width:r,height:a}=J.sizeMap[t];return(0,e.jsx)("svg",{width:r,height:a,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},F=o.default.forwardRef(({data:t,className:r},a)=>{const{title:n,subtitle:l,pcImage:I,padImage:O,mobileImage:P,pcVideo:M,padVideo:L,mobileVideo:b,isShowVideo:W,primaryButton:x,secondaryButton:i,theme:X="light",size:$="default",caption:N=[],blockLink:S}=t,C=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),E=(0,R.useMediaQuery)({query:"(max-width: 1024px)"}),[U,D]=(0,o.useState)(!1),{ref:Y,inView:_}=(0,A.useInView)(),T=(0,o.useRef)(null),B=(0,o.useRef)(null),H=(0,o.useRef)(null),u=(0,o.useRef)(null),p=(0,o.useRef)(null);return(0,G.useExposure)(p,{componentType:y,componentName:w,componentTitle:n,componentDescription:l}),(0,o.useImperativeHandle)(a,()=>p.current),(0,o.useEffect)(()=>{g.default.registerPlugin(f.ScrollTrigger);function z(){if(!u.current)return;const h=p.current?.clientHeight||100;window.innerHeight<=h?T.current=f.ScrollTrigger.create({trigger:p.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:m=>{const d=m.progress*40-20;g.default.set(u.current,{yPercent:d})}}):(H.current=f.ScrollTrigger.create({trigger:p.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:m=>{const d=m.progress*20-20;g.default.set(u.current,{yPercent:d})}}),B.current=f.ScrollTrigger.create({trigger:p.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:m=>{const d=m.progress*20;g.default.set(u.current,{yPercent:d})}}))}return _&&z(),()=>{T.current&&T.current.kill(),H.current&&H.current.kill(),B.current&&B.current.kill()}},[_]),(0,e.jsx)("div",{ref:Y,"data-ui-component-id":"HeroBanner",children:(0,e.jsxs)("div",{ref:p,className:(0,c.cn)(X==="dark"?"aiui-dark":""," tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]":$==="default","lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]":$==="sm"},r),children:[S&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,k.trackUrlRef)(S,`${y}_${w}`),tabIndex:-1,"aria-hidden":"true","aria-label":n}),(0,e.jsx)("div",{ref:u,className:(0,c.cn)("absolute left-0 top-0 size-full"),children:W?(0,e.jsx)(Q.default,{poster:C?b?.url:E?L?.url||b?.url:M?.url,src:C?b?.url:E?L?.url||b?.url:M?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:!0,playsInline:!0}):(0,e.jsx)(s.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:I?.alt||"",source:`${I?.url||""} , ${O?.url??(P?.url||"")} 1024, ${P?.url||""} 767`})}),(0,e.jsxs)("div",{className:"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]",children:[(0,e.jsxs)("div",{className:"laptop:text-left max-w-[686px]",children:[n&&(0,e.jsx)(s.Heading,{as:"h2",size:5,className:(0,c.cn)("hero-banner-title"),html:n}),l&&(0,e.jsx)(s.Heading,{as:"h3",className:(0,c.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm"),html:l})]}),(0,e.jsxs)("div",{className:"laptop:justify-start lg-desktop:gap-3 flex items-center gap-2",children:[i?.isShowPlayVideoButton&&i?.playVideoButtonText?(0,e.jsxs)(s.Button,{onClick:()=>D(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",children:[i?.playVideoButtonText," ",(0,e.jsx)(ne,{size:"lg"})]}):i?.text?(0,e.jsxs)(s.Button,{"aria-label":n??l,size:"lg",variant:"secondary",className:"hero-banner-secondary-button",as:"a",href:(0,k.trackUrlRef)(i?.link,`${y}_${w}`),children:[i?.text,(0,e.jsx)("span",{className:"sr-only",children:n??l})]}):null,x&&x.text&&(0,e.jsx)(s.Button,{"aria-label":n??l,size:"lg",variant:"primary",className:"hero-banner-primary-button",as:"a",href:(0,k.trackUrlRef)(x.link,`${y}_${w}`),children:x.text})]})]}),N.length>0&&(0,e.jsx)("div",{className:"laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:N.map((z,h)=>(0,e.jsxs)(o.default.Fragment,{children:[(0,e.jsx)(s.Text,{size:2,className:(0,c.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:z.title}),h<N.length-1&&(0,e.jsx)("div",{className:(0,c.cn)("bg-info-primary w-px")})]},h))}),U&&(0,e.jsx)(K.VideoModal,{visible:U,videoUrl:i?.videoUrl?.url,youTubeId:i?.youtubeId,onCloseModal:()=>D(!1)})]})})});F.displayName="HeroBanner";var ie=(0,Z.withLayout)(F);
2
2
  //# sourceMappingURL=HeroBanner.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeroBanner/HeroBanner.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(({ data, className }, ref) => {\n const {\n title,\n subtitle,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n caption = [],\n blockLink,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n setTimeout(() => {\n gsapResize()\n }, 1000)\n return () => {\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={boxRef}\n data-ui-component-id=\"HeroBanner\"\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n ' tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]': size === 'default',\n 'lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]': size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n tabIndex={-1}\n aria-hidden=\"true\"\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileVideo?.url : isPad ? padVideo?.url || mobileVideo?.url : pcVideo?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]\">\n <div className=\"laptop:text-left max-w-[686px]\">\n {title && <Heading as=\"h2\" size={5} className={cn('hero-banner-title')} html={title} />}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-[16px] laptop:mt-[8px] lg-desktop:mt-[16px] mt-[4px] text-[14px]'\n )}\n html={subtitle}\n />\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"laptop:justify-start lg-desktop:gap-3 flex items-center gap-2\">\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <a href={trackUrlRef(secondaryButton?.link, `${componentType}_${componentName}`)}>\n <Button size=\"lg\" variant=\"secondary\" className=\"hero-banner-secondary-button\">\n {secondaryButton?.text}\n </Button>\n </a>\n ) : null}\n {primaryButton && primaryButton.text && (\n <a href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}>\n <Button size=\"lg\" variant=\"primary\" className=\"hero-banner-primary-button\">\n {primaryButton.text}\n </Button>\n </a>\n )}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div className=\"laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]\">\n {caption.map((c, index) => (\n <React.Fragment key={index}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.youtubeId}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n})\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withStyles(HeroBanner)\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuBM,IAAAI,EAAA,6BAtBNC,EAA6D,oBAC7DA,EAAwB,uBACxBC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,sCACxBC,EAA2B,kCAE3B,MAAMC,EAAgB,QAChBC,EAAgB,cAEhBC,GAAuB,CAAC,CAAE,KAAAC,EAAO,MAAO,IAAsC,CAClF,KAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAI,UAAQF,CAAI,EACtC,SACE,OAAC,OAAI,MAAOC,EAAO,OAAQC,EAAQ,QAAQ,YAAY,KAAK,eAAe,MAAM,6BAC/E,mBAAC,QACC,EAAE,0LACF,KAAK,eACP,EACF,CAEJ,EAEMC,EAAa,EAAAC,QAAM,WAA4C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACjG,KAAM,CACJ,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,EACA,YAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,M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AQ,YACR,UAAU,gCAET,UAAAP,GAAiB,oBAAoB,OAAC,OAACnB,GAAA,CAAqB,KAAK,KAAK,GACzE,EACEmB,GAAiB,QACnB,OAAC,KAAE,QAAM,eAAYA,GAAiB,KAAM,GAAGrB,CAAa,IAAIC,CAAa,EAAE,EAC7E,mBAAC,UAAO,KAAK,KAAK,QAAQ,YAAY,UAAU,+BAC7C,SAAAoB,GAAiB,KACpB,EACF,EACE,KACHD,GAAiBA,EAAc,SAC9B,OAAC,KAAE,QAAM,eAAYA,EAAc,KAAM,GAAGpB,CAAa,IAAIC,CAAa,EAAE,EAC1E,mBAAC,UAAO,KAAK,KAAK,QAAQ,UAAU,UAAU,6BAC3C,SAAAmB,EAAc,KACjB,EACF,GAEJ,GACF,EAGCG,EAAQ,OAAS,MAChB,OAAC,OAAI,UAAU,uKACZ,SAAAA,EAAQ,IAAI,CAACe,EAAGC,OACf,QAAC,EAAAhC,QAAM,SAAN,CACC,oBAAC,QACC,KAAM,EACN,aAAW,MACT,yIACF,EACA,KAAM+B,EAAE,MACV,EACCC,EAAQhB,EAAQ,OAAS,MAAK,OAAC,OAAI,aAAW,MAAG,sBAAsB,EAAG,IARxDgB,CASrB,CACD,EACH,EAIDZ,MACC,OAAC,cACC,QAASA,EACT,SAAUN,GAAiB,UAAU,IACrC,UAAWA,GAAiB,UAC5B,aAAc,IAAMO,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDtB,EAAW,YAAc,aAEzB,IAAOrB,MAAQ,cAAWqB,CAAU",
6
- "names": ["HeroBanner_exports", "__export", "HeroBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_ScrollTrigger", "import_react_responsive", "import_ScrollLoadVideo", "import_components", "import_helpers", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_button", "import_VideoModal", "componentType", "componentName", "PlayButtonAppendIcon", "size", "width", "height", "HeroBanner", "React", "data", "className", "ref", "title", "subtitle", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "primaryButton", "secondaryButton", "theme", "caption", "blockLink", "isMobile", "isPad", "visible", "setVisible", "bgRef", "boxRef", "gsap", "gsapResize", "clientHeight", "self", "value", "t", "ScrollLoadVideo", "c", "index"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(({ data, className }, ref) => {\n const {\n title,\n subtitle,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n caption = [],\n blockLink,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef} data-ui-component-id=\"HeroBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n ' tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]': size === 'default',\n 'lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]': size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileVideo?.url : isPad ? padVideo?.url || mobileVideo?.url : pcVideo?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]\">\n <div className=\"laptop:text-left max-w-[686px]\">\n {title && <Heading as=\"h2\" size={5} className={cn('hero-banner-title')} html={title} />}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm'\n )}\n html={subtitle}\n />\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"laptop:justify-start lg-desktop:gap-3 flex items-center gap-2\">\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-secondary-button\"\n as=\"a\"\n href={trackUrlRef(secondaryButton?.link, `${componentType}_${componentName}`)}\n >\n {secondaryButton?.text}\n <span className=\"sr-only\">{title ?? subtitle}</span>\n </Button>\n ) : null}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"primary\"\n className=\"hero-banner-primary-button\"\n as=\"a\"\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div className=\"laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]\">\n {caption.map((c, index) => (\n <React.Fragment key={index}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.youtubeId}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n </div>\n )\n})\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withLayout(HeroBanner)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuBM,IAAAI,EAAA,6BAtBNC,EAAwE,oBACxEC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA0B,uCAC1BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,sCACxBC,EAA2B,kCAE3B,MAAMC,EAAgB,QAChBC,EAAgB,cAEhBC,GAAuB,CAAC,CAAE,KAAAC,EAAO,MAAO,IAAsC,CAClF,KAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAI,UAAQF,CAAI,EACtC,SACE,OAAC,OAAI,MAAOC,EAAO,OAAQC,EAAQ,QAAQ,YAAY,KAAK,eAAe,MAAM,6BAC/E,mBAAC,QACC,EAAE,0LACF,KAAK,eACP,EACF,CAEJ,EAEMC,EAAa,EAAAC,QAAM,WAA4C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACjG,KAAM,CACJ,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,EACA,YAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EAAQ,QACR,KAAAnB,EAAO,UACP,QAAAoB,EAAU,CAAC,EACX,UAAAC,CACF,EAAIhB,EAEEiB,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAQ,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EACtD,CAACC,EAASC,CAAU,KAAI,YAAkB,EAAK,EAC/C,CA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AMO,EAAW,EAAI,EAC9B,KAAK,KACL,QAAQ,YACR,UAAU,gCAET,UAAAP,GAAiB,oBAAoB,OAAC,OAACnB,GAAA,CAAqB,KAAK,KAAK,GACzE,EACEmB,GAAiB,QACnB,QAAC,UACC,aAAYV,GAASC,EACrB,KAAK,KACL,QAAQ,YACR,UAAU,+BACV,GAAG,IACH,QAAM,eAAYS,GAAiB,KAAM,GAAGrB,CAAa,IAAIC,CAAa,EAAE,EAE3E,UAAAoB,GAAiB,QAClB,OAAC,QAAK,UAAU,UAAW,SAAAV,GAASC,EAAS,GAC/C,EACE,KACHQ,GAAiBA,EAAc,SAC9B,OAAC,UACC,aAAYT,GAASC,EACrB,KAAK,KACL,QAAQ,UACR,UAAU,6BACV,GAAG,IACH,QAAM,eAAYQ,EAAc,KAAM,GAAGpB,CAAa,IAAIC,CAAa,EAAE,EAExE,SAAAmB,EAAc,KACjB,GAEJ,GACF,EAGCG,EAAQ,OAAS,MAChB,OAAC,OAAI,UAAU,uKACZ,SAAAA,EAAQ,IAAI,CAACmB,EAAGC,OACf,QAAC,EAAApC,QAAM,SAAN,CACC,oBAAC,QACC,KAAM,EACN,aAAW,MACT,yIACF,EACA,KAAMmC,EAAE,MACV,EACCC,EAAQpB,EAAQ,OAAS,MAAK,OAAC,OAAI,aAAW,MAAG,sBAAsB,EAAG,IARxDoB,CASrB,CACD,EACH,EAIDhB,MACC,OAAC,cACC,QAASA,EACT,SAAUN,GAAiB,UAAU,IACrC,UAAWA,GAAiB,UAC5B,aAAc,IAAMO,EAAW,EAAK,EACtC,GAEJ,EACF,CAEJ,CAAC,EAEDtB,EAAW,YAAc,aAEzB,IAAOtB,MAAQ,cAAWsB,CAAU",
6
+ "names": ["HeroBanner_exports", "__export", "HeroBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_ScrollTrigger", "import_react_responsive", "import_react_intersection_observer", "import_ScrollLoadVideo", "import_components", "import_helpers", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_button", "import_VideoModal", "componentType", "componentName", "PlayButtonAppendIcon", "size", "width", "height", "HeroBanner", "React", "data", "className", "ref", "title", "subtitle", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "primaryButton", "secondaryButton", "theme", "caption", "blockLink", "isMobile", "isPad", "visible", "setVisible", "inViewRef", "inView", "scrollTriggerRef", "bgTriggerRef", "boxTriggerRef", "bgRef", "boxRef", "gsap", "gsapResize", "clientHeight", "self", "value", "ScrollLoadVideo", "c", "index"]
7
7
  }
@@ -10,7 +10,7 @@ declare const MarqueeImageContent: {
10
10
  displayName: string;
11
11
  };
12
12
  declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextContentProps & React.RefAttributes<HTMLDivElement>>;
13
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<MarqueeProps & React.RefAttributes<SwiperRef>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
13
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<MarqueeProps & React.RefAttributes<SwiperRef>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
14
14
  className?: string;
15
15
  data?: Record<string, any>;
16
16
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var N=Object.create;var i=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!g.call(e,o)&&o!==a&&i(e,o,{get:()=>t[o],enumerable:!(p=S(t,o))||p.enumerable});return e};var I=(e,t,a)=>(a=e!=null?N(R(e)):{},w(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),P=e=>w(i({},"__esModule",{value:!0}),e);var k={};v(k,{MarqueeImageContent:()=>l,MarqueeItem:()=>m,MarqueeTextContent:()=>u,default:()=>b});module.exports=P(k);var r=require("react/jsx-runtime"),s=I(require("react")),c=require("../../components/index.js"),n=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),f=require("swiper/react"),M=require("swiper/modules"),y=require("../../hooks/useExposure.js");const T="image",h="marquee",d=s.default.forwardRef(({data:e,className:t},a)=>{const p=(0,s.useRef)(null);return(0,s.useImperativeHandle)(a,()=>p.current),(0,y.useExposure)(p,{componentType:T,componentName:h}),(0,r.jsx)(f.Swiper,{direction:"horizontal",className:(0,n.cn)("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",t),ref:p,id:"Marquee"+e?.key,modules:[M.Autoplay],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((o,q)=>(0,r.jsx)(f.SwiperSlide,{children:(0,r.jsx)(m,{data:o})},o?.id+"SwiperSlide"+q))})});d.displayName="Marquee";const m=({data:e,configuration:t})=>(0,r.jsxs)(r.Fragment,{children:[e.type==="image"&&(0,r.jsx)(l,{image:e?.image,imageClassName:t?.imageClassName}),e.type==="text"&&(0,r.jsx)(u,{text:e?.text,textClassName:t?.textClassName})]});m.displayName="MarqueeItem";const l=({image:e,imageClassName:t})=>(0,r.jsx)("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:(0,r.jsx)(c.Picture,{source:e?.url,alt:e?.alt||"",imgClassName:(0,n.cn)("object-cover",t)})});l.displayName="MarqueeImageContent";const u=s.default.forwardRef(({text:e,textClassName:t},a)=>(0,r.jsx)(c.Text,{as:"div",ref:a,html:e,className:(0,n.cn)("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",t)}));u.displayName="MarqueeTextContent";var b=(0,x.withStyles)(d);
1
+ "use strict";"use client";var N=Object.create;var i=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of S(t))!g.call(e,o)&&o!==a&&i(e,o,{get:()=>t[o],enumerable:!(p=C(t,o))||p.enumerable});return e};var I=(e,t,a)=>(a=e!=null?N(R(e)):{},w(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),P=e=>w(i({},"__esModule",{value:!0}),e);var k={};v(k,{MarqueeImageContent:()=>l,MarqueeItem:()=>m,MarqueeTextContent:()=>u,default:()=>b});module.exports=P(k);var r=require("react/jsx-runtime"),s=I(require("react")),c=require("../../components/index.js"),n=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),f=require("swiper/react"),M=require("swiper/modules"),y=require("../../hooks/useExposure.js");const T="image",h="marquee",d=s.default.forwardRef(({data:e,className:t},a)=>{const p=(0,s.useRef)(null);return(0,s.useImperativeHandle)(a,()=>p.current),(0,y.useExposure)(p,{componentType:T,componentName:h}),(0,r.jsx)(f.Swiper,{direction:"horizontal",className:(0,n.cn)("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",t),ref:p,id:"Marquee"+e?.key,modules:[M.Autoplay],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((o,q)=>(0,r.jsx)(f.SwiperSlide,{children:(0,r.jsx)(m,{data:o})},o?.id+"SwiperSlide"+q))})});d.displayName="Marquee";const m=({data:e,configuration:t})=>(0,r.jsxs)(r.Fragment,{children:[e.type==="image"&&(0,r.jsx)(l,{image:e?.image,imageClassName:t?.imageClassName}),e.type==="text"&&(0,r.jsx)(u,{text:e?.text,textClassName:t?.textClassName})]});m.displayName="MarqueeItem";const l=({image:e,imageClassName:t})=>(0,r.jsx)("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:(0,r.jsx)(c.Picture,{source:e?.url,alt:e?.alt||"",imgClassName:(0,n.cn)("object-cover",t)})});l.displayName="MarqueeImageContent";const u=s.default.forwardRef(({text:e,textClassName:t},a)=>(0,r.jsx)(c.Text,{as:"div",ref:a,html:e,className:(0,n.cn)("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",t)}));u.displayName="MarqueeTextContent";var b=(0,x.withLayout)(d);
2
2
  //# sourceMappingURL=Marquee.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Marquee/Marquee.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, type RefObject } from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Autoplay } from 'swiper/modules'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'image'\nconst componentName = 'marquee'\n\nconst Marquee = React.forwardRef<SwiperRef, MarqueeProps>(({ data, className }, ref) => {\n const innerRef = useRef<SwiperRef>(null)\n useImperativeHandle(ref, () => innerRef.current as SwiperRef)\n\n useExposure(innerRef as unknown as RefObject<HTMLDivElement>, {\n componentType: componentType,\n componentName: componentName,\n })\n\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n ref={innerRef}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withStyles(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, type RefObject } from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Autoplay } from 'swiper/modules'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'image'\nconst componentName = 'marquee'\n\nconst Marquee = React.forwardRef<SwiperRef, MarqueeProps>(({ data, className }, ref) => {\n const innerRef = useRef<SwiperRef>(null)\n useImperativeHandle(ref, () => innerRef.current as SwiperRef)\n\n useExposure(innerRef as unknown as RefObject<HTMLDivElement>, {\n componentType: componentType,\n componentName: componentName,\n })\n\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n ref={innerRef}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withLayout(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
5
5
  "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAN,GAsDU,IAAAO,EAAA,6BArDVC,EAAmE,oBACnEC,EAA8B,qCAC9BC,EAAmB,kCACnBC,EAA2B,kCAG3BH,EAAoD,wBACpDI,EAAyB,0BACzBC,EAA4B,sCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAEhBC,EAAU,EAAAC,QAAM,WAAoC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACtF,MAAMC,KAAW,UAAkB,IAAI,EACvC,gCAAoBD,EAAK,IAAMC,EAAS,OAAoB,KAE5D,eAAYA,EAAkD,CAC5D,cAAeP,EACf,cAAeC,CACjB,CAAC,KAGC,OAAC,UACC,UAAU,aACV,aAAW,MACT,0GACAI,CACF,EACA,IAAKE,EACL,GAAI,UAAYH,GAAM,IACtB,QAAS,CAAC,UAAQ,EAClB,SAAU,CACR,MAAO,EACP,qBAAsB,GACtB,iBAAkBA,GAAM,gBAC1B,EACA,KAAM,GACN,eAAgB,GAChB,eAAc,GACd,cAAc,OACd,MAAOA,GAAM,OAAS,IACtB,YAAa,CACX,EAAG,CACD,aAAc,MAChB,EACA,KAAM,CACJ,aAAc,MAChB,CACF,EAEC,SAAAA,GAAM,OAAO,IAAI,CAACI,EAAMC,OACvB,OAAC,eACC,mBAACpB,EAAA,CAAY,KAAMmB,EAAM,GADTA,GAAM,GAAK,cAAgBC,CAE7C,CACD,EACH,CAEJ,CAAC,EACDP,EAAQ,YAAc,UAEtB,MAAMb,EAAc,CAAC,CAAE,KAAAe,EAAM,cAAAM,CAAc,OAEvC,oBACG,UAAAN,EAAK,OAAS,YACb,OAAChB,EAAA,CAAoB,MAAOgB,GAAM,MAAO,eAAgBM,GAAe,eAAgB,EAEzFN,EAAK,OAAS,WAAU,OAACd,EAAA,CAAmB,KAAMc,GAAM,KAAM,cAAeM,GAAe,cAAe,GAC9G,EAIJrB,EAAY,YAAc,cAE1B,MAAMD,EAAsB,CAAC,CAAE,MAAAuB,EAAO,eAAAC,CAAe,OAEjD,OAAC,OAAI,UAAU,4CACb,mBAAC,WAAQ,OAAQD,GAAO,IAAK,IAAKA,GAAO,KAAO,GAAI,gBAAc,MAAG,eAAgBC,CAAc,EAAG,EACxG,EAIJxB,EAAoB,YAAc,sBAElC,MAAME,EAAqB,EAAAa,QAAM,WAAoD,CAAC,CAAE,KAAAU,EAAM,cAAAC,CAAc,EAAGR,OAE3G,OAAC,QACC,GAAG,MACH,IAAKA,EACL,KAAMO,EACN,aAAW,MAAG,oFAAqFC,CAAa,EAClH,CAEH,EAEDxB,EAAmB,YAAc,qBAEjC,IAAOC,KAAQ,cAAWW,CAAO",
6
6
  "names": ["Marquee_exports", "__export", "MarqueeImageContent", "MarqueeItem", "MarqueeTextContent", "Marquee_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_modules", "import_useExposure", "componentType", "componentName", "Marquee", "React", "data", "className", "ref", "innerRef", "item", "index", "configuration", "image", "imageClassName", "text", "textClassName"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { MediaPlayerBaseProps } from './types.js';
2
- declare const _default: import("react").ForwardRefExoticComponent<Omit<Omit<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<Omit<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
3
3
  className?: string;
4
4
  data?: Record<string, any>;
5
5
  }, "ref"> & import("react").RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var W=Object.create;var p=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(o,s)=>{for(var e in s)p(o,e,{get:s[e],enumerable:!0})},E=(o,s,e,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of Z(s))!te.call(o,r)&&r!==e&&p(o,r,{get:()=>s[r],enumerable:!(l=X(s,r))||l.enumerable});return o};var R=(o,s,e)=>(e=o!=null?W(ee(o)):{},E(s||!o||!o.__esModule?p(e,"default",{value:o,enumerable:!0}):e,o)),ne=o=>E(p({},"__esModule",{value:!0}),o);var ie={};oe(ie,{default:()=>ae});module.exports=ne(ie);var t=require("react/jsx-runtime"),n=require("react"),z=require("lodash"),c=require("../../helpers/utils.js"),B=require("../../shared/Styles.js"),_=R(require("../../components/button.js")),$=require("../VideoModal/index.js"),x=require("@payloadcms/richtext-lexical/html"),I=require("react-intersection-observer"),V=require("../../hooks/useExposure.js"),C=R(require("../../helpers/ScrollLoadVideo.js"));const se="media_player_base",re="video",P=({defaultConverters:o})=>({...o,text:s=>{const{node:e}=s;return e.$&&e.$.color?`<span class="lexical-${e.$.color}">${e.text}</span>`:e.text}}),le=(0,n.forwardRef)(({className:o="",onBtnClick:s,data:{title:e,videoTitle:l,btnText:r,youtubeId:y,video:S,theme:D,img:F,shape:Y,...j}},q)=>{const{sticky:i}=j,[b,h]=(0,n.useState)(!1),[w,O]=(0,n.useState)(0),[A,G]=(0,n.useState)(0),[H,T]=(0,n.useState)(!1),m=(0,n.useRef)(null),J=(0,n.useRef)(null),a=(0,n.useRef)(null),M=(0,n.useRef)(null),{ref:K,inView:k}=(0,I.useInView)();(0,n.useImperativeHandle)(q,()=>a.current);const L=typeof e=="string"?e:e&&(0,x.convertLexicalToHTML)({data:e,converters:P}),u=typeof l=="string"?l:l&&(0,x.convertLexicalToHTML)({data:l,converters:P});(0,n.useEffect)(()=>{k?(m.current?.play(),h(!0)):(m.current?.pause(),h(!1))},[k]);const f=(0,z.debounce)(()=>{if(a.current){const g=a.current.getBoundingClientRect(),d=window.innerHeight,Q=window.scrollY||window.pageYOffset,U=g.bottom+Q,N=document.documentElement.scrollHeight-U;O(N>d?d:N)}if(a.current){const g=a.current.clientHeight,d=window.innerHeight;G(g+d)}},600);(0,n.useEffect)(()=>(f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),(0,V.useExposure)(M,{componentType:re,componentName:se,componentTitle:u});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(0,t.jsxs)(t.Fragment,{children:[i&&(0,t.jsx)("div",{ref:a,className:(0,c.cn)("relative z-10 ",v,o),children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{ref:K,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:[L&&!b&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:L}}),u&&b&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:u}}),r&&(0,t.jsx)(_.default,{variant:"link",className:(0,c.cn)("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{T(!0),s&&s?.()},children:r})]})})}),(0,t.jsxs)("div",{style:i?{marginBottom:`-${w}px`,marginTop:`-${A}px`}:{},className:"relative",children:[(0,t.jsx)("div",{className:"sticky top-0 ",children:(0,t.jsx)("div",{className:(0,c.cn)("relative overflow-hidden",i?"h-screen w-full":v,{"aiui-dark":D==="dark","rounded-box":Y==="rounded"}),children:(0,t.jsxs)("div",{ref:J,className:"media-cover left-0 top-0 h-screen w-screen",children:[(0,t.jsx)(C.default,{videoRef:m,poster:F?.url||"",src:S?.url,className:"size-full",videoClassName:"object-cover",muted:!1,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),(0,t.jsx)("div",{className:"absolute left-0 top-0 z-10 size-full",style:{background:"rgba(0, 0, 0, 0.2)"}})]})})}),(0,t.jsx)("div",{className:(0,c.cn)(i&&"relative box-content block",v),style:i?{height:`${w}px`}:{},ref:M})]}),H&&y&&(0,t.jsx)($.VideoModal,{visible:H,youTubeId:y,onCloseModal:()=>T(!1)})]})});var ae=(0,B.withStyles)(le);
1
+ "use strict";"use client";var me=Object.create;var h=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var ye=(r,n)=>{for(var o in n)h(r,o,{get:n[o],enumerable:!0})},O=(r,n,o,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ge(n))!xe.call(r,s)&&s!==o&&h(r,s,{get:()=>n[s],enumerable:!(l=fe(n,s))||l.enumerable});return r};var U=(r,n,o)=>(o=r!=null?me(ve(r)):{},O(n||!r||!r.__esModule?h(o,"default",{value:r,enumerable:!0}):o,r)),be=r=>O(h({},"__esModule",{value:!0}),r);var ke={};ye(ke,{default:()=>Te});module.exports=be(ke);var e=require("react/jsx-runtime"),t=require("react"),J=require("lodash"),m=require("../../helpers/utils.js"),K=require("../../shared/Styles.js"),Q=U(require("../../components/button.js")),W=require("../VideoModal/index.js"),E=require("@payloadcms/richtext-lexical/html"),X=require("react-intersection-observer"),Z=require("../../hooks/useExposure.js"),z=U(require("../../helpers/ScrollLoadVideo.js")),w=require("gsap"),A=require("gsap/dist/SplitText"),ee=require("gsap/dist/ScrollTrigger");const he="media_player_base",we="video",G=({defaultConverters:r})=>({...r,text:n=>{const{node:o}=n;return o.$&&o.$.color?`<span class="lexical-${o.$.color}">${o.text}</span>`:o.text}}),He=(0,t.forwardRef)(({className:r="",onBtnClick:n,data:{title:o,videoTitle:l,btnText:s,youtubeId:I,video:_,mobileVideo:te,theme:P,img:S,shape:$,titleAnimation:f,...oe}},re)=>{const{sticky:c}=oe,[B,C]=(0,t.useState)(!1),[V,ne]=(0,t.useState)(0),[se,le]=(0,t.useState)(0),[D,F]=(0,t.useState)(!1),g=(0,t.useRef)(null),j=(0,t.useRef)(null),a=(0,t.useRef)(null),v=(0,t.useRef)(null),Y=(0,t.useRef)(null),x=(0,t.useRef)(null),H=(0,t.useRef)(null),{ref:ae,inView:y}=(0,X.useInView)();(0,t.useImperativeHandle)(re,()=>a.current);const b=typeof o=="string"?o:o&&(0,E.convertLexicalToHTML)({data:o,converters:G}),T=typeof l=="string"?l:l&&(0,E.convertLexicalToHTML)({data:l,converters:G});(0,t.useEffect)(()=>{y?(g.current?.play(),C(!0)):(g.current?.pause(),C(!1))},[y]);const k=(0,J.debounce)(()=>{if(a.current){const d=a.current.getBoundingClientRect(),i=window.innerHeight,p=window.scrollY||window.pageYOffset,L=d.bottom+p,u=document.documentElement.scrollHeight-L;ne(u>i?i:u)}if(a.current){const d=a.current.clientHeight,i=window.innerHeight;le(d+i)}},600);(0,t.useEffect)(()=>(k(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}),[]),(0,t.useEffect)(()=>{function d(){if(!v.current||f!=="fade-in")return;const i=v.current?.clientHeight||80;x.current=new A.SplitText(v.current,{type:"words",wordsClass:"word"});const p=x.current.words;w.gsap.set(p,{opacity:0}),H.current=ee.ScrollTrigger.create({trigger:a.current,start:"top center-=10%",end:`top+=${i*1.5+80}px center-=10%`,scrub:!0,onUpdate:L=>{const N=L.progress,u=p.length,ie=1/u,q=.5;p.forEach((ce,de)=>{const pe=de/u*(1-q),ue=ie*(1+q);let R=(N-pe)/ue;R=Math.max(0,Math.min(R,1)),w.gsap.set(ce,{opacity:R})}),w.gsap.set(j.current,{opacity:N})}})}return y&&d(),()=>{x.current&&x.current.revert(),H.current&&H.current.kill()}},[f,y]),(0,Z.useExposure)(Y,{componentType:we,componentName:he,componentTitle:T});const M="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(0,e.jsxs)(e.Fragment,{children:[c&&(0,e.jsx)("div",{ref:a,className:(0,m.cn)("relative z-10",M,{"aiui-dark":P==="dark","rounded-box":$==="rounded"},r),children:(0,e.jsx)("div",{ref:ae,children:!f&&(0,e.jsxs)("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:[b&&!B&&(0,e.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:b}}),T&&B&&(0,e.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:T}}),s&&(0,e.jsx)(Q.default,{variant:"link",className:(0,m.cn)("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{F(!0),n&&n?.()},children:s})]})})}),(0,e.jsxs)("div",{style:c?{marginBottom:`-${V}px`,marginTop:`-${se}px`}:{},className:"relative",children:[(0,e.jsx)("div",{className:"sticky top-0 ",children:(0,e.jsxs)("div",{className:(0,m.cn)("relative overflow-hidden",c?"h-screen w-full":M,{"aiui-dark":P==="dark","rounded-box":$==="rounded"}),children:[f==="fade-in"&&b&&(0,e.jsx)("div",{ref:v,className:"lg-desktop:text-[64px] text-btn-primary-foreground absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:b}}),(0,e.jsxs)("div",{className:"media-cover left-0 top-0 h-screen w-screen",children:[(0,e.jsx)(z.default,{videoRef:g,poster:S?.url||"",src:_?.url,className:"tablet:block hidden size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),(0,e.jsx)(z.default,{videoRef:g,poster:S?.url||"",src:te?.url||_?.url,className:"tablet:hidden block size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),(0,e.jsx)("div",{ref:j,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),(0,e.jsx)("div",{className:(0,m.cn)(c&&"relative box-content block",M),style:c?{height:`${V}px`}:{},ref:Y})]}),D&&I&&(0,e.jsx)(W.VideoModal,{visible:D,youTubeId:I,onCloseModal:()=>F(!1)})]})});var Te=(0,K.withLayout)(He);
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, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Button from '../../components/button.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'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\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 { className = '', onBtnClick, data: { title, videoTitle, btnText, youtubeId, video, theme, img, shape, ...rest } },\n ref\n ) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = 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 trackRef = useRef<HTMLDivElement>(null)\n\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 useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: videoTitle_html,\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 ref={titleRef} className={cn('relative z-10 ', aspect, className)}>\n <div>\n <div\n ref={inViewRef}\n 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 >\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground 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-btn-primary-foreground 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-btn-primary-foreground')}\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 </div>\n </div>\n )}\n <div style={sticky ? { marginBottom: `-${btb}px`, marginTop: `-${titleHeight}px` } : {}} className=\"relative\">\n <div className=\"sticky top-0 \">\n <div\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 <div ref={bgRef} className=\"media-cover left-0 top-0 h-screen w-screen\">\n {/* <video\n ref={videoRef}\n className=\"size-full object-cover\"\n src={video?.url}\n muted\n loop\n playsInline\n webkit-playsinline\n x5-playsinline\n /> */}\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"size-full\"\n videoClassName=\"object-cover\"\n muted={false}\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n className=\"absolute left-0 top-0 z-10 size-full\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n <div\n className={cn(sticky && 'relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nexport default withStyles(MediaPlayerBase)\n"],
5
- "mappings": "6kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAqGM,IAAAI,EAAA,6BApGNC,EAA6E,iBAC7EC,EAAyB,kBACzBC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAmB,yCACnBC,EAA2B,kCAC3BC,EAAqC,6CAGrCC,EAA0B,uCAE1BC,EAA4B,sCAC5BC,EAA4B,+CAE5B,MAAMC,GAAgB,oBAChBC,GAAgB,QAEhBC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,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ACvB,cAAeE,IAAU,SAC3B,CAAC,EAED,oBAAC,OAAI,IAAKa,EAAO,UAAU,6CAWzB,oBAAC,EAAAe,QAAA,CACC,SAAUhB,EACV,OAAQb,GAAK,KAAO,GACpB,IAAKF,GAAO,IACZ,UAAU,YACV,eAAe,eACf,MAAO,GACP,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,OACC,UAAU,uCACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,EACF,EACF,KACA,OAAC,OACC,aAAW,MAAGM,GAAU,6BAA8BuB,CAAM,EAC5D,MAAOvB,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKS,EACP,GACF,EACCL,GAAWd,MACV,OAAC,cAAW,QAASc,EAAS,UAAWd,EAAW,aAAc,IAAMe,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA,IAAOxC,MAAQ,cAAWmB,EAAe",
6
- "names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lodash", "import_utils", "import_Styles", "import_button", "import_VideoModal", "import_html", "import_react_intersection_observer", "import_useExposure", "import_ScrollLoadVideo", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "theme", "img", "shape", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "trackRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "aspect", "Button", "ScrollLoadVideo"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useRef, 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 { 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\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 onBtnClick,\n data: { title, videoTitle, btnText, youtubeId, video, mobileVideo, theme, img, shape, titleAnimation, ...rest },\n },\n ref\n ) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = 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 scrollTriggerRef = 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 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 },\n })\n }\n\n if (inView) gsapResize()\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 }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: videoTitle_html,\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 ref={titleRef}\n className={cn(\n '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-btn-primary-foreground 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-btn-primary-foreground 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-btn-primary-foreground')}\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 style={sticky ? { marginBottom: `-${btb}px`, marginTop: `-${titleHeight}px` } : {}} className=\"relative\">\n <div className=\"sticky top-0 \">\n <div\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' && title_html && (\n <div\n ref={titleFadeInRef}\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n <div className=\"media-cover left-0 top-0 h-screen w-screen\">\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 <div\n className={cn(sticky && 'relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nexport default withLayout(MediaPlayerBase)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuJM,IAAAI,EAAA,6BAtJNC,EAA6E,iBAC7EC,EAAyB,kBACzBC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAmB,yCACnBC,EAA2B,kCAC3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E,aAAc,IAAIG,CAAG,KAAM,UAAW,IAAIE,EAAW,IAAK,EAAI,CAAC,EAAG,UAAU,WACjG,oBAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,MAAG,2BAA4BL,EAAS,kBAAoBuC,EAAQ,CAC7E,YAAa7C,IAAU,OACvB,cAAeE,IAAU,SAC3B,CAAC,EAEA,UAAAC,IAAmB,WAAaqB,MAC/B,OAAC,OACC,IAAKN,EACL,UAAU,wLACV,wBAAyB,CAAE,OAAQM,CAAW,EAChD,KAEF,QAAC,OAAI,UAAU,6CACb,oBAAC,EAAAuB,QAAA,CACC,SAAUhC,EACV,OAAQd,GAAK,KAAO,GACpB,IAAKH,GAAO,IACZ,UAAU,gCACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,EAAAiD,QAAA,CACC,SAAUhC,EACV,OAAQd,GAAK,KAAO,GACpB,IAAKF,IAAa,KAAOD,GAAO,IAChC,UAAU,gCACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,OACC,IAAKkB,EACL,UAAU,iDACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,GACF,EACF,KACA,OAAC,OACC,aAAW,MAAGV,GAAU,6BAA8BuC,CAAM,EAC5D,MAAOvC,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKU,EACP,GACF,EACCN,GAAWhB,MACV,OAAC,cAAW,QAASgB,EAAS,UAAWhB,EAAW,aAAc,IAAMiB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA,IAAO7C,MAAQ,cAAWsB,EAAe",
6
+ "names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lodash", "import_utils", "import_Styles", "import_button", "import_VideoModal", "import_html", "import_react_intersection_observer", "import_useExposure", "import_ScrollLoadVideo", "import_gsap", "import_SplitText", "import_ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "scrollTriggerRef", "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", "aspect", "Button", "ScrollLoadVideo"]
7
7
  }
@@ -10,7 +10,9 @@ export interface MediaPlayerBaseProps extends ComponentCommonProps {
10
10
  img?: Img;
11
11
  isYouTube?: boolean;
12
12
  video?: Video;
13
+ mobileVideo?: Video;
13
14
  youtubeId?: string;
15
+ titleAnimation?: 'fade-in';
14
16
  };
15
17
  onBtnClick?: () => void;
16
18
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var a=(o,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!r.call(o,t)&&t!==s&&n(o,t,{get:()=>e[t],enumerable:!(i=m(e,t))||i.enumerable});return o};var d=o=>a(n({},"__esModule",{value:!0}),o);var g={};module.exports=d(g);
1
+ "use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var r=(o,e,m,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of p(e))!a.call(o,i)&&i!==m&&n(o,i,{get:()=>e[i],enumerable:!(t=s(e,i))||t.enumerable});return o};var d=o=>r(n({},"__esModule",{value:!0}),o);var l={};module.exports=d(l);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerBase/types.ts"],
4
- "sourcesContent": ["import type { ComponentCommonProps, Shape, Theme, Video, Img } from '../../types/props.js'\n\nexport interface MediaPlayerBaseProps extends ComponentCommonProps {\n data: {\n sticky?: boolean\n shape?: Shape\n theme?: Theme\n title?: string\n videoTitle?: string\n btnText?: string\n img?: Img\n isYouTube?: boolean\n video?: Video\n youtubeId?: string\n }\n onBtnClick?: () => void\n}\n"],
4
+ "sourcesContent": ["import type { ComponentCommonProps, Shape, Theme, Video, Img } from '../../types/props.js'\n\nexport interface MediaPlayerBaseProps extends ComponentCommonProps {\n data: {\n sticky?: boolean\n shape?: Shape\n theme?: Theme\n title?: string\n videoTitle?: string\n btnText?: string\n img?: Img\n isYouTube?: boolean\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n titleAnimation?: 'fade-in'\n }\n onBtnClick?: () => void\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { MediaPlayerMultiProps } from './types.js';
2
- declare const _default: import("react").ForwardRefExoticComponent<Omit<Omit<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<Omit<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
3
3
  className?: string;
4
4
  data?: Record<string, any>;
5
5
  }, "ref"> & import("react").RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var _=Object.create;var p=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},x=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of q(t))!H.call(e,i)&&i!==o&&p(e,i,{get:()=>t[i],enumerable:!(a=j(t,i))||a.enumerable});return e};var v=(e,t,o)=>(o=e!=null?_(E(e)):{},x(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),Y=e=>x(p({},"__esModule",{value:!0}),e);var F={};D(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),s=require("react"),h=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),k=v(require("../SwiperBox/index.js")),M=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),I=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js");const b="video",g="media_player_multi",$=({data:e,configuration:t})=>(0,l.jsxs)("div",{className:(0,h.cn)("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",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{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"}),(0,l.jsx)(r.Picture,{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"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-12 flex size-10 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("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:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("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&&(0,l.jsx)(r.Link,{href:(0,T.trackUrlRef)(e?.href,`${b}_${g}`),className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm font-bold leading-[1.2] tracking-[-0.02em]",children:e.quote})]}),(0,l.jsx)("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})]})]}),Z=(0,s.forwardRef)(({data:{items:e=[],shape:t="square",title:o,containerProps:a},className:i="",key:L,onVideoPlayBtnClick:V},B)=>{const[m,d]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[z,R]=(0,s.useState)(""),f=typeof o=="string"?o:o&&(0,N.convertLexicalToHTML)({data:o}),c=(0,s.useRef)(null);(0,I.useExposure)(c,{componentType:b,componentName:g,componentTitle:f});const u=e.length;return(0,l.jsxs)("div",{className:i,ref:c,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(M.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:i,ref:B,children:[o&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:f||""}}),(0,l.jsx)(k.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+L,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(U,n)=>{d(!0),n?.isYouTube?R?.(n?.youtubeId||""):S?.(n?.video?.url||""),V?.(U)}}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:u===2?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:u===2?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&(0,l.jsx)(P.VideoModal,{visible:m,youTubeId:z,videoUrl:C,onCloseModal:()=>d(!1)})]})});var A=(0,w.withStyles)(Z);
1
+ "use strict";"use client";var _=Object.create;var p=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},x=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of q(t))!H.call(e,i)&&i!==o&&p(e,i,{get:()=>t[i],enumerable:!(a=j(t,i))||a.enumerable});return e};var v=(e,t,o)=>(o=e!=null?_(E(e)):{},x(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),Y=e=>x(p({},"__esModule",{value:!0}),e);var F={};D(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),s=require("react"),h=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),k=v(require("../SwiperBox/index.js")),M=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),I=require("../../hooks/useExposure.js"),L=require("../../shared/trackUrlRef.js");const b="video",g="media_player_multi",$=({data:e,configuration:t})=>(0,l.jsxs)("div",{className:(0,h.cn)("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",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{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"}),(0,l.jsx)(r.Picture,{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"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-12 flex size-10 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("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:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("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&&(0,l.jsx)(r.Link,{href:(0,L.trackUrlRef)(e?.href,`${b}_${g}`),className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm font-bold leading-[1.2] tracking-[-0.02em]",children:e.quote})]}),(0,l.jsx)("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})]})]}),Z=(0,s.forwardRef)(({data:{items:e=[],shape:t="square",title:o,containerProps:a},className:i="",key:T,onVideoPlayBtnClick:V},B)=>{const[m,d]=(0,s.useState)(!1),[C,z]=(0,s.useState)(""),[R,S]=(0,s.useState)(""),f=typeof o=="string"?o:o&&(0,N.convertLexicalToHTML)({data:o}),c=(0,s.useRef)(null);(0,I.useExposure)(c,{componentType:b,componentName:g,componentTitle:f});const u=e.length;return(0,l.jsxs)("div",{className:i,ref:c,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(M.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:i,ref:B,children:[o&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:f||""}}),(0,l.jsx)(k.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+T,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(U,n)=>{d(!0),n?.isYouTube?S?.(n?.youtubeId||""):z?.(n?.video?.url||""),V?.(U)}}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:u===2?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:u===2?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&(0,l.jsx)(P.VideoModal,{visible:m,youTubeId:R,videoUrl:C,onCloseModal:()=>d(!1)})]})});var A=(0,w.withLayout)(Z);
2
2
  //# sourceMappingURL=index.js.map