@anker-in/headless-ui 1.1.74 → 1.1.76

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 (216) hide show
  1. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  2. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js.map +2 -2
  3. package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +9 -0
  4. package/dist/cjs/biz-components/ActivityMechanism/index.js +2 -0
  5. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +7 -0
  6. package/dist/cjs/biz-components/ActivityMechanism/types.d.ts +43 -0
  7. package/dist/cjs/biz-components/ActivityMechanism/types.js +2 -0
  8. package/dist/cjs/biz-components/ActivityMechanism/types.js.map +7 -0
  9. package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +3 -0
  10. package/dist/cjs/biz-components/ActivitySchedule/index.js +2 -0
  11. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +7 -0
  12. package/dist/cjs/biz-components/ActivitySchedule/types.d.ts +44 -0
  13. package/dist/cjs/biz-components/ActivitySchedule/types.js +2 -0
  14. package/dist/cjs/biz-components/ActivitySchedule/types.js.map +7 -0
  15. package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +20 -0
  16. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  17. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  18. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  19. package/dist/cjs/biz-components/EventSchedule/index.js.map +2 -2
  20. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  21. package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
  22. package/dist/cjs/biz-components/FooterNavigation/types.d.ts +7 -0
  23. package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
  24. package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
  25. package/dist/cjs/biz-components/GiftShelf/index.d.ts +3 -0
  26. package/dist/cjs/biz-components/GiftShelf/index.js +2 -0
  27. package/dist/cjs/biz-components/GiftShelf/index.js.map +7 -0
  28. package/dist/cjs/biz-components/GiftShelf/types.d.ts +120 -0
  29. package/dist/cjs/biz-components/GiftShelf/types.js +2 -0
  30. package/dist/cjs/biz-components/GiftShelf/types.js.map +7 -0
  31. package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +3 -0
  32. package/dist/cjs/biz-components/GiftTierShelf/index.js +2 -0
  33. package/dist/cjs/biz-components/GiftTierShelf/index.js.map +7 -0
  34. package/dist/cjs/biz-components/GiftTierShelf/types.d.ts +75 -0
  35. package/dist/cjs/biz-components/GiftTierShelf/types.js +2 -0
  36. package/dist/cjs/biz-components/GiftTierShelf/types.js.map +7 -0
  37. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  38. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  39. package/dist/cjs/biz-components/HeroBanner/types.d.ts +2 -0
  40. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  41. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  42. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  43. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  44. package/dist/cjs/biz-components/Ksp/index.d.ts +45 -6
  45. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  46. package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
  47. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  48. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  49. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  50. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  51. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  52. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  53. package/dist/cjs/biz-components/Title/index.js +1 -1
  54. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  55. package/dist/cjs/biz-components/Title/types.d.ts +10 -1
  56. package/dist/cjs/biz-components/Title/types.js +1 -1
  57. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  58. package/dist/cjs/biz-components/VideoModal/index.js +1 -1
  59. package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
  60. package/dist/cjs/biz-components/WheelLottery/BaseModal.d.ts +61 -0
  61. package/dist/cjs/biz-components/WheelLottery/BaseModal.js +2 -0
  62. package/dist/cjs/biz-components/WheelLottery/BaseModal.js.map +7 -0
  63. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.d.ts +25 -0
  64. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js +2 -0
  65. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js.map +7 -0
  66. package/dist/cjs/biz-components/WheelLottery/ErrorModal.d.ts +47 -0
  67. package/dist/cjs/biz-components/WheelLottery/ErrorModal.js +2 -0
  68. package/dist/cjs/biz-components/WheelLottery/ErrorModal.js.map +7 -0
  69. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.d.ts +101 -0
  70. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js +2 -0
  71. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js.map +7 -0
  72. package/dist/cjs/biz-components/WheelLottery/PrizePool.d.ts +29 -0
  73. package/dist/cjs/biz-components/WheelLottery/PrizePool.js +2 -0
  74. package/dist/cjs/biz-components/WheelLottery/PrizePool.js.map +7 -0
  75. package/dist/cjs/biz-components/WheelLottery/RulesModal.d.ts +56 -0
  76. package/dist/cjs/biz-components/WheelLottery/RulesModal.js +2 -0
  77. package/dist/cjs/biz-components/WheelLottery/RulesModal.js.map +7 -0
  78. package/dist/cjs/biz-components/WheelLottery/ShareModal.d.ts +79 -0
  79. package/dist/cjs/biz-components/WheelLottery/ShareModal.js +2 -0
  80. package/dist/cjs/biz-components/WheelLottery/ShareModal.js.map +7 -0
  81. package/dist/cjs/biz-components/WheelLottery/Wheel.d.ts +27 -0
  82. package/dist/cjs/biz-components/WheelLottery/Wheel.js +2 -0
  83. package/dist/cjs/biz-components/WheelLottery/Wheel.js.map +7 -0
  84. package/dist/cjs/biz-components/WheelLottery/WinnerModal.d.ts +27 -0
  85. package/dist/cjs/biz-components/WheelLottery/WinnerModal.js +2 -0
  86. package/dist/cjs/biz-components/WheelLottery/WinnerModal.js.map +7 -0
  87. package/dist/cjs/biz-components/WheelLottery/index.d.ts +48 -0
  88. package/dist/cjs/biz-components/WheelLottery/index.js +2 -0
  89. package/dist/cjs/biz-components/WheelLottery/index.js.map +7 -0
  90. package/dist/cjs/biz-components/WheelLottery/types.d.ts +1229 -0
  91. package/dist/cjs/biz-components/WheelLottery/types.js +2 -0
  92. package/dist/cjs/biz-components/WheelLottery/types.js.map +7 -0
  93. package/dist/cjs/biz-components/index.d.ts +11 -0
  94. package/dist/cjs/biz-components/index.js +1 -1
  95. package/dist/cjs/biz-components/index.js.map +3 -3
  96. package/dist/cjs/components/Countdown.d.ts +27 -4
  97. package/dist/cjs/components/Countdown.js +1 -1
  98. package/dist/cjs/components/Countdown.js.map +3 -3
  99. package/dist/cjs/hooks/useCountDown.js +1 -1
  100. package/dist/cjs/hooks/useCountDown.js.map +3 -3
  101. package/dist/cjs/hooks/useDraggableScroll.d.ts +77 -0
  102. package/dist/cjs/hooks/useDraggableScroll.js +2 -0
  103. package/dist/cjs/hooks/useDraggableScroll.js.map +7 -0
  104. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  105. package/dist/esm/biz-components/ActiveShelf/ProductCard.js.map +2 -2
  106. package/dist/esm/biz-components/ActivityMechanism/index.d.ts +9 -0
  107. package/dist/esm/biz-components/ActivityMechanism/index.js +2 -0
  108. package/dist/esm/biz-components/ActivityMechanism/index.js.map +7 -0
  109. package/dist/esm/biz-components/ActivityMechanism/types.d.ts +43 -0
  110. package/dist/esm/biz-components/ActivityMechanism/types.js +1 -0
  111. package/dist/esm/biz-components/ActivityMechanism/types.js.map +7 -0
  112. package/dist/esm/biz-components/ActivitySchedule/index.d.ts +3 -0
  113. package/dist/esm/biz-components/ActivitySchedule/index.js +2 -0
  114. package/dist/esm/biz-components/ActivitySchedule/index.js.map +7 -0
  115. package/dist/esm/biz-components/ActivitySchedule/types.d.ts +44 -0
  116. package/dist/esm/biz-components/ActivitySchedule/types.js +1 -0
  117. package/dist/esm/biz-components/ActivitySchedule/types.js.map +7 -0
  118. package/dist/esm/biz-components/AnchorNavigation/index.d.ts +20 -0
  119. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  120. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  121. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  122. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  123. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  124. package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
  125. package/dist/esm/biz-components/FooterNavigation/types.d.ts +7 -0
  126. package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
  127. package/dist/esm/biz-components/GiftShelf/index.d.ts +3 -0
  128. package/dist/esm/biz-components/GiftShelf/index.js +2 -0
  129. package/dist/esm/biz-components/GiftShelf/index.js.map +7 -0
  130. package/dist/esm/biz-components/GiftShelf/types.d.ts +120 -0
  131. package/dist/esm/biz-components/GiftShelf/types.js +1 -0
  132. package/dist/esm/biz-components/GiftShelf/types.js.map +7 -0
  133. package/dist/esm/biz-components/GiftTierShelf/index.d.ts +3 -0
  134. package/dist/esm/biz-components/GiftTierShelf/index.js +2 -0
  135. package/dist/esm/biz-components/GiftTierShelf/index.js.map +7 -0
  136. package/dist/esm/biz-components/GiftTierShelf/types.d.ts +75 -0
  137. package/dist/esm/biz-components/GiftTierShelf/types.js +1 -0
  138. package/dist/esm/biz-components/GiftTierShelf/types.js.map +7 -0
  139. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  140. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  141. package/dist/esm/biz-components/HeroBanner/types.d.ts +2 -0
  142. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  143. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  144. package/dist/esm/biz-components/Ksp/index.d.ts +45 -6
  145. package/dist/esm/biz-components/Ksp/index.js +1 -1
  146. package/dist/esm/biz-components/Ksp/index.js.map +3 -3
  147. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  148. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  149. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  150. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  151. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  152. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  153. package/dist/esm/biz-components/Title/index.js +1 -1
  154. package/dist/esm/biz-components/Title/index.js.map +3 -3
  155. package/dist/esm/biz-components/Title/types.d.ts +10 -1
  156. package/dist/esm/biz-components/VideoModal/index.js +1 -1
  157. package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
  158. package/dist/esm/biz-components/WheelLottery/BaseModal.d.ts +61 -0
  159. package/dist/esm/biz-components/WheelLottery/BaseModal.js +2 -0
  160. package/dist/esm/biz-components/WheelLottery/BaseModal.js.map +7 -0
  161. package/dist/esm/biz-components/WheelLottery/ChanceMethods.d.ts +25 -0
  162. package/dist/esm/biz-components/WheelLottery/ChanceMethods.js +2 -0
  163. package/dist/esm/biz-components/WheelLottery/ChanceMethods.js.map +7 -0
  164. package/dist/esm/biz-components/WheelLottery/ErrorModal.d.ts +47 -0
  165. package/dist/esm/biz-components/WheelLottery/ErrorModal.js +2 -0
  166. package/dist/esm/biz-components/WheelLottery/ErrorModal.js.map +7 -0
  167. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.d.ts +101 -0
  168. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js +2 -0
  169. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js.map +7 -0
  170. package/dist/esm/biz-components/WheelLottery/PrizePool.d.ts +29 -0
  171. package/dist/esm/biz-components/WheelLottery/PrizePool.js +2 -0
  172. package/dist/esm/biz-components/WheelLottery/PrizePool.js.map +7 -0
  173. package/dist/esm/biz-components/WheelLottery/RulesModal.d.ts +56 -0
  174. package/dist/esm/biz-components/WheelLottery/RulesModal.js +2 -0
  175. package/dist/esm/biz-components/WheelLottery/RulesModal.js.map +7 -0
  176. package/dist/esm/biz-components/WheelLottery/ShareModal.d.ts +79 -0
  177. package/dist/esm/biz-components/WheelLottery/ShareModal.js +2 -0
  178. package/dist/esm/biz-components/WheelLottery/ShareModal.js.map +7 -0
  179. package/dist/esm/biz-components/WheelLottery/Wheel.d.ts +27 -0
  180. package/dist/esm/biz-components/WheelLottery/Wheel.js +2 -0
  181. package/dist/esm/biz-components/WheelLottery/Wheel.js.map +7 -0
  182. package/dist/esm/biz-components/WheelLottery/WinnerModal.d.ts +27 -0
  183. package/dist/esm/biz-components/WheelLottery/WinnerModal.js +2 -0
  184. package/dist/esm/biz-components/WheelLottery/WinnerModal.js.map +7 -0
  185. package/dist/esm/biz-components/WheelLottery/index.d.ts +48 -0
  186. package/dist/esm/biz-components/WheelLottery/index.js +2 -0
  187. package/dist/esm/biz-components/WheelLottery/index.js.map +7 -0
  188. package/dist/esm/biz-components/WheelLottery/types.d.ts +1229 -0
  189. package/dist/esm/biz-components/WheelLottery/types.js +2 -0
  190. package/dist/esm/biz-components/WheelLottery/types.js.map +7 -0
  191. package/dist/esm/biz-components/index.d.ts +11 -0
  192. package/dist/esm/biz-components/index.js +1 -1
  193. package/dist/esm/biz-components/index.js.map +2 -2
  194. package/dist/esm/components/Countdown.d.ts +27 -4
  195. package/dist/esm/components/Countdown.js +1 -1
  196. package/dist/esm/components/Countdown.js.map +3 -3
  197. package/dist/esm/hooks/useCountDown.js +1 -1
  198. package/dist/esm/hooks/useCountDown.js.map +3 -3
  199. package/dist/esm/hooks/useDraggableScroll.d.ts +77 -0
  200. package/dist/esm/hooks/useDraggableScroll.js +2 -0
  201. package/dist/esm/hooks/useDraggableScroll.js.map +7 -0
  202. package/package.json +1 -1
  203. package/style.css +6252 -862
  204. package/tailwind.config.js +18 -2
  205. package/dist/cjs/biz-components/HeroBanner/Countdown.d.ts +0 -10
  206. package/dist/cjs/biz-components/HeroBanner/Countdown.js +0 -2
  207. package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +0 -7
  208. package/dist/cjs/biz-components/Title/Countdown.d.ts +0 -14
  209. package/dist/cjs/biz-components/Title/Countdown.js +0 -2
  210. package/dist/cjs/biz-components/Title/Countdown.js.map +0 -7
  211. package/dist/esm/biz-components/HeroBanner/Countdown.d.ts +0 -10
  212. package/dist/esm/biz-components/HeroBanner/Countdown.js +0 -2
  213. package/dist/esm/biz-components/HeroBanner/Countdown.js.map +0 -7
  214. package/dist/esm/biz-components/Title/Countdown.d.ts +0 -14
  215. package/dist/esm/biz-components/Title/Countdown.js +0 -2
  216. package/dist/esm/biz-components/Title/Countdown.js.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { 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 id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n 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 function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n console.log('progress__', progress)\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: videoTitle_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n '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\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : {}\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && title_html && (\n <div>\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title 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 </div>\n )}\n {btnText && (\n <div className=\"flex items-center justify-center\">\n <Button\n variant=\"link\"\n className={cn(\n 'media-player-base-button member-equity-button-secondary text-btn-primary-foreground z-20 translate-y-10'\n )}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full min-h-screen\"\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 min-h-screen\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAgMM,IAAAI,EAAA,6BA/LNC,EAAsF,iBACtFC,GAAyB,kBACzBC,EAAmB,kCACnBC,GAA2B,kCAC3BC,EAAmB,yCACnBC,GAA2B,kCAC3BC,EAAqC,6CAGrCC,GAA0B,uCAE1BC,GAA4B,sCAC5BC,EAA4B,+CAC5BC,EAAqB,gBACrBC,GAA0B,+BAC1BC,EAA8B,mCAE9B,MAAMC,GAAgB,oBAChBC,GAAgB,QAEhBC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,MAAkB,cACtB,CACE,CACE,UAAAC,EAAY,GACZ,GAAAC,EACA,WAAAC,EACA,KAAM,CACJ,MAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,YAAAC,GACA,MAAAC,EACA,IAAAC,EACA,MAAAC,EACA,eAAAC,EAAiB,UACjB,GAAGC,EACL,EACA,GAAGC,CACL,EACAC,KACG,CACH,KAAM,CAAE,OAAAC,CAAO,EAA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G,GAE/F,CAEJ,CACF,EAEA3B,GAAgB,YAAc,kBAE9B,IAAOtB,MAAQ,eAAWsB,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", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "aspect", "Button", "ScrollLoadVideo"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n console.log('progress__', progress)\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full min-h-screen\"\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 min-h-screen\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
5
+ "mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAwMM,IAAAI,EAAA,6BAvMNC,EAAsF,iBACtFC,GAAyB,kBACzBC,EAAmB,kCACnBC,GAA2B,kCAC3BC,EAAmB,0CACnBC,GAA2B,kCAC3BC,EAAqC,6CAGrCC,GAA0B,uCAE1BC,GAA4B,sCAC5BC,EAA4B,gDAC5BC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAE9B,MAAMC,GAAgB,oBAChBC,GAAgB,QAGtB,OAAK,eAAe,gBAAe,WAAS,EAE5C,MAAMC,GAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EA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I,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,EAAAwD,QAAA,CACC,SAAUpC,EACV,OAAQjB,GAAK,KAAO,GACpB,IAAKF,IAAa,KAAOD,GAAO,IAChC,UAAU,6CACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,OACC,IAAKqB,EACL,UAAU,iDACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,GACF,EACF,EACCZ,MACC,OAAC,OACC,aAAW,MAAGA,GAAU,iDAAkD6C,CAAM,EAChF,MAAO7C,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKY,EACP,GAEJ,EACCN,GAAWnB,MACV,OAAC,eAAW,QAASmB,EAAS,UAAWnB,EAAW,aAAc,IAAMoB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA3B,GAAgB,YAAc,kBAE9B,IAAOtB,MAAQ,eAAWsB,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", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "aspect", "Button", "ScrollLoadVideo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var M=Object.create;var x=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var n in e)x(t,n,{get:e[n],enumerable:!0})},h=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of T(e))!N.call(t,r)&&r!==n&&x(t,r,{get:()=>e[r],enumerable:!(s=P(e,r))||s.enumerable});return t};var y=(t,e,n)=>(n=t!=null?M(D(t)):{},h(e||!t||!t.__esModule?x(n,"default",{value:t,enumerable:!0}):n,t)),R=t=>h(x({},"__esModule",{value:!0}),t);var I={};F(I,{default:()=>w});module.exports=R(I);var i=require("react/jsx-runtime"),b=y(require("react")),c=require("../../helpers/index.js"),m=require("../../components/index.js"),k=require("../../shared/Styles.js");const L=t=>{if(!t)return;const{mobile:e,tablet:n,laptop:s,desktop:r,lgDesktop:f}=t,o=[],u=B=>B?.url,l=u(f),a=u(r),p=u(s),d=u(n),g=u(e);return l?o.push(l):a?o.push(a):p?o.push(p):d?o.push(d):g&&o.push(g),a&&l&&o.push(`${a} 1920`),p&&(a||l)&&o.push(`${p} 1440`),d&&(p||a||l)&&o.push(`${d} 1024`),g&&(d||p||a||l)&&o.push(`${g} 768`),o.length>0?o.join(", "):void 0},v=b.forwardRef(({classNames:t,data:e,className:n,...s},r)=>{const{backgroundImage:f}=e,o=b.useMemo(()=>L(f),[f]);return(0,i.jsx)("div",{ref:r,...s,className:(0,c.cn)("laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",t?.root,n),children:(0,i.jsxs)("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[(0,i.jsxs)("div",{className:(0,c.cn)("laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",t?.content),children:[e.contentTitle&&(0,i.jsx)(m.Heading,{className:(0,c.cn)("line-clamp-2 text-[#F5F6F7]",t?.title),html:e.contentTitle,size:3}),e.contentDesc&&(0,i.jsx)("p",{className:(0,c.cn)("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]",t?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),(0,i.jsx)("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&(0,i.jsx)(m.Button,{as:"a",variant:"link",className:(0,c.cn)("!p-0 text-[#F5F6F7]",t?.button),href:e.buttonLink,iconClassName:"size-4",children:e.buttonText})})]}),(0,i.jsx)(m.Picture,{source:o,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});v.displayName="PromotionalBar";var w=(0,k.withLayout)(v);
1
+ "use strict";"use client";var T=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},h=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!y.call(t,r)&&r!==n&&g(t,r,{get:()=>e[r],enumerable:!(l=D(e,r))||l.enumerable});return t};var R=(t,e,n)=>(n=t!=null?T(F(t)):{},h(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),w=t=>h(g({},"__esModule",{value:!0}),t);var z={};L(z,{default:()=>U});module.exports=w(z);var i=require("react/jsx-runtime"),b=R(require("react")),m=require("../../helpers/index.js"),u=require("../../components/index.js"),k=require("../../shared/Styles.js"),B=require("../../helpers/index.js"),P=require("../AiuiProvider/index.js");const I=t=>{if(!t)return;const{mobile:e,tablet:n,laptop:l,desktop:r,lgDesktop:x}=t,o=[],a=M=>M?.url,p=a(x),s=a(r),c=a(l),d=a(n),f=a(e);return p?o.push(p):s?o.push(s):c?o.push(c):d?o.push(d):f&&o.push(f),s&&p&&o.push(`${s} 1920`),c&&(s||p)&&o.push(`${c} 1440`),d&&(c||s||p)&&o.push(`${d} 1024`),f&&(d||c||s||p)&&o.push(`${f} 768`),o.length>0?o.join(", "):void 0},v=b.forwardRef(({classNames:t,data:e,className:n,...l},r)=>{const{locale:x="us"}=(0,P.useAiuiContext)(),{backgroundImage:o}=e,a=b.useMemo(()=>I(o),[o]);return(0,i.jsx)("div",{ref:r,...l,className:(0,m.cn)("laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",t?.root,n),children:(0,i.jsxs)("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[(0,i.jsxs)("div",{className:(0,m.cn)("laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",t?.content),children:[e.contentTitle&&(0,i.jsx)(u.Heading,{className:(0,m.cn)("line-clamp-2 text-[#F5F6F7]",t?.title),html:e.contentTitle,size:3}),e.contentDesc&&(0,i.jsx)("p",{className:(0,m.cn)("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]",t?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),(0,i.jsx)("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&(0,i.jsx)(u.Button,{as:"a",variant:"link",className:(0,m.cn)("!p-0 text-[#F5F6F7]",t?.button),href:(0,B.getLocalizedPath)(e.buttonLink||"",x),iconClassName:"size-4",children:e.buttonText})})]}),(0,i.jsx)(u.Picture,{source:a,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});v.displayName="PromotionalBar";var U=(0,k.withLayout)(v);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/PromotionalBar/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Picture } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { Media } from '../../types/props.js'\n\nexport interface PromotionalBarSemanticName {\n root: 'root'\n content: 'content'\n title: 'title'\n description: 'description'\n button: 'button'\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 (<768px) */\n mobile?: Media\n /** \u5E73\u677F\u56FE\u7247 (768-1440px) */\n tablet?: Media\n /** \u7B14\u8BB0\u672C\u56FE\u7247 (1025-1440px) */\n laptop?: Media\n /** \u684C\u9762\u56FE\u7247 (1441-1920px) */\n desktop?: Media\n /** \u8D85\u5927\u684C\u9762\u56FE\u7247 (\u22651921px) */\n lgDesktop?: Media\n}\n\n/**\n * PromotionalBar \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface PromotionalBarData {\n /** \u7EC4\u4EF6\u5185\u5BB9\u6807\u9898 */\n contentTitle?: string\n /** \u7EC4\u4EF6\u5185\u5BB9\u63CF\u8FF0 */\n contentDesc?: string\n /** \u6309\u94AE\u6587\u672C */\n buttonText?: string\n /** \u6309\u94AE\u94FE\u63A5 */\n buttonLink?: string\n /** \u80CC\u666F\u56FE\u7247 - \u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61 */\n backgroundImage?: ResponsiveBackgroundImage\n}\n\nexport interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: PromotionalBarData\n classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>\n}\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3A Picture \u7EC4\u4EF6\u6240\u9700\u7684\u5B57\u7B26\u4E32\u683C\u5F0F\n */\nconst convertResponsiveImageToString = (backgroundImage: ResponsiveBackgroundImage | undefined): string | undefined => {\n if (!backgroundImage) return undefined\n\n const { mobile, tablet, laptop, desktop, lgDesktop } = backgroundImage\n const parts: string[] = []\n\n // \u8F85\u52A9\u51FD\u6570\uFF1A\u4ECE Media \u5BF9\u8C61\u4E2D\u63D0\u53D6 URL\n const getUrl = (media: Media | undefined): string | undefined => {\n return media?.url\n }\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n const lgDesktopUrl = getUrl(lgDesktop)\n const desktopUrl = getUrl(desktop)\n const laptopUrl = getUrl(laptop)\n const tabletUrl = getUrl(tablet)\n const mobileUrl = getUrl(mobile)\n\n if (lgDesktopUrl) parts.push(lgDesktopUrl)\n else if (desktopUrl) parts.push(desktopUrl)\n else if (laptopUrl) parts.push(laptopUrl)\n else if (tabletUrl) parts.push(tabletUrl)\n else if (mobileUrl) parts.push(mobileUrl)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktopUrl && lgDesktopUrl) parts.push(`${desktopUrl} 1920`)\n if (laptopUrl && (desktopUrl || lgDesktopUrl)) parts.push(`${laptopUrl} 1440`)\n if (tabletUrl && (laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${tabletUrl} 1024`)\n if (mobileUrl && (tabletUrl || laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${mobileUrl} 768`)\n\n return parts.length > 0 ? parts.join(', ') : undefined\n}\n\n/**\n * PromotionalBar - \u63A8\u5E7F\u680F\n *\n * @description \u63A8\u5E7F\u680F\n */\nconst PromotionalBar = React.forwardRef<HTMLDivElement, PromotionalBarProps>(\n ({ classNames, data, className, ...rest }, ref) => {\n const { backgroundImage } = data\n const pictureSource = React.useMemo(() => {\n return convertResponsiveImageToString(backgroundImage)\n }, [backgroundImage])\n return (\n <div\n ref={ref}\n {...rest}\n className={cn('laptop:h-[192px] lg-desktop:h-[240px] h-[240px]', classNames?.root, className)}\n >\n {/* \u63A8\u5E7F\u680F\u5185\u5BB9\u533A\u57DF - \u6839\u636E\u5177\u4F53\u4E1A\u52A1\u9700\u6C42\u5B9A\u5236 */}\n <div className=\"promotional-bar-content rounded-card relative h-full overflow-hidden\">\n <div\n className={cn(\n 'laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4',\n classNames?.content\n )}\n >\n {data.contentTitle && (\n <Heading\n className={cn('line-clamp-2 text-[#F5F6F7]', classNames?.title)}\n html={data.contentTitle}\n size={3}\n />\n )}\n {data.contentDesc && (\n <p\n className={cn(\n 'laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]',\n classNames?.description\n )}\n dangerouslySetInnerHTML={{ __html: data.contentDesc }}\n />\n )}\n <div className=\"laptop:mt-4 mt-2\">\n {data.buttonText && (\n <Button\n as=\"a\"\n variant=\"link\"\n className={cn('!p-0 text-[#F5F6F7]', classNames?.button)}\n href={data.buttonLink}\n iconClassName=\"size-4\"\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n <Picture\n source={pictureSource}\n className=\"absolute inset-0 z-10 \"\n imgClassName=\"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]\"\n />\n </div>\n </div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EACtBI,EAAgBzB,EAAM,QAAQ,IAC3BI,EAA+BC,CAAe,EACpD,CAACA,CAAe,CAAC,EACpB,SACE,OAAC,OACC,IAAKmB,EACJ,GAAGD,EACJ,aAAW,MAAG,kDAAmDH,GAAY,KAAME,CAAS,EAG5F,oBAAC,OAAI,UAAU,uEACb,qBAAC,OACC,aAAW,MACT,mLACAF,GAAY,OACd,EAEC,UAAAC,EAAK,iBACJ,OAAC,WACC,aAAW,MAAG,8BAA+BD,GAAY,KAAK,EAC9D,KAAMC,EAAK,aACX,KAAM,EACR,EAEDA,EAAK,gBACJ,OAAC,KACC,aAAW,MACT,6HACAD,GAAY,WACd,EACA,wBAAyB,CAAE,OAAQC,EAAK,WAAY,EACtD,KAEF,OAAC,OAAI,UAAU,mBACZ,SAAAA,EAAK,eACJ,OAAC,UACC,GAAG,IACH,QAAQ,OACR,aAAW,MAAG,sBAAuBD,GAAY,MAAM,EACvD,KAAMC,EAAK,WACX,cAAc,SAEb,SAAAA,EAAK,WACR,EAEJ,GACF,KACA,OAAC,WACC,OAAQI,EACR,UAAU,yBACV,aAAa,uFACf,GACF,EACF,CAEJ,CACF,EAEAN,EAAe,YAAc,iBAC7B,IAAOtB,KAAQ,cAAWsB,CAAc",
6
- "names": ["PromotionalBar_exports", "__export", "PromotionalBar_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_Styles", "convertResponsiveImageToString", "backgroundImage", "mobile", "tablet", "laptop", "desktop", "lgDesktop", "parts", "getUrl", "media", "lgDesktopUrl", "desktopUrl", "laptopUrl", "tabletUrl", "mobileUrl", "PromotionalBar", "classNames", "data", "className", "rest", "ref", "pictureSource"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Picture } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { Media } from '../../types/props.js'\nimport { getLocalizedPath } from '../../helpers/index.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nexport interface PromotionalBarSemanticName {\n root: 'root'\n content: 'content'\n title: 'title'\n description: 'description'\n button: 'button'\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 (<768px) */\n mobile?: Media\n /** \u5E73\u677F\u56FE\u7247 (768-1440px) */\n tablet?: Media\n /** \u7B14\u8BB0\u672C\u56FE\u7247 (1025-1440px) */\n laptop?: Media\n /** \u684C\u9762\u56FE\u7247 (1441-1920px) */\n desktop?: Media\n /** \u8D85\u5927\u684C\u9762\u56FE\u7247 (\u22651921px) */\n lgDesktop?: Media\n}\n\n/**\n * PromotionalBar \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface PromotionalBarData {\n /** \u7EC4\u4EF6\u5185\u5BB9\u6807\u9898 */\n contentTitle?: string\n /** \u7EC4\u4EF6\u5185\u5BB9\u63CF\u8FF0 */\n contentDesc?: string\n /** \u6309\u94AE\u6587\u672C */\n buttonText?: string\n /** \u6309\u94AE\u94FE\u63A5 */\n buttonLink?: string\n /** \u80CC\u666F\u56FE\u7247 - \u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61 */\n backgroundImage?: ResponsiveBackgroundImage\n}\n\nexport interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: PromotionalBarData\n classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>\n}\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3A Picture \u7EC4\u4EF6\u6240\u9700\u7684\u5B57\u7B26\u4E32\u683C\u5F0F\n */\nconst convertResponsiveImageToString = (backgroundImage: ResponsiveBackgroundImage | undefined): string | undefined => {\n if (!backgroundImage) return undefined\n\n const { mobile, tablet, laptop, desktop, lgDesktop } = backgroundImage\n const parts: string[] = []\n\n // \u8F85\u52A9\u51FD\u6570\uFF1A\u4ECE Media \u5BF9\u8C61\u4E2D\u63D0\u53D6 URL\n const getUrl = (media: Media | undefined): string | undefined => {\n return media?.url\n }\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n const lgDesktopUrl = getUrl(lgDesktop)\n const desktopUrl = getUrl(desktop)\n const laptopUrl = getUrl(laptop)\n const tabletUrl = getUrl(tablet)\n const mobileUrl = getUrl(mobile)\n\n if (lgDesktopUrl) parts.push(lgDesktopUrl)\n else if (desktopUrl) parts.push(desktopUrl)\n else if (laptopUrl) parts.push(laptopUrl)\n else if (tabletUrl) parts.push(tabletUrl)\n else if (mobileUrl) parts.push(mobileUrl)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktopUrl && lgDesktopUrl) parts.push(`${desktopUrl} 1920`)\n if (laptopUrl && (desktopUrl || lgDesktopUrl)) parts.push(`${laptopUrl} 1440`)\n if (tabletUrl && (laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${tabletUrl} 1024`)\n if (mobileUrl && (tabletUrl || laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${mobileUrl} 768`)\n\n return parts.length > 0 ? parts.join(', ') : undefined\n}\n\n/**\n * PromotionalBar - \u63A8\u5E7F\u680F\n *\n * @description \u63A8\u5E7F\u680F\n */\nconst PromotionalBar = React.forwardRef<HTMLDivElement, PromotionalBarProps>(\n ({ classNames, data, className, ...rest }, ref) => {\n const { locale = 'us' } = useAiuiContext()\n const { backgroundImage } = data\n const pictureSource = React.useMemo(() => {\n return convertResponsiveImageToString(backgroundImage)\n }, [backgroundImage])\n return (\n <div\n ref={ref}\n {...rest}\n className={cn('laptop:h-[192px] lg-desktop:h-[240px] h-[240px]', classNames?.root, className)}\n >\n {/* \u63A8\u5E7F\u680F\u5185\u5BB9\u533A\u57DF - \u6839\u636E\u5177\u4F53\u4E1A\u52A1\u9700\u6C42\u5B9A\u5236 */}\n <div className=\"promotional-bar-content rounded-card relative h-full overflow-hidden\">\n <div\n className={cn(\n 'laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4',\n classNames?.content\n )}\n >\n {data.contentTitle && (\n <Heading\n className={cn('line-clamp-2 text-[#F5F6F7]', classNames?.title)}\n html={data.contentTitle}\n size={3}\n />\n )}\n {data.contentDesc && (\n <p\n className={cn(\n 'laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]',\n classNames?.description\n )}\n dangerouslySetInnerHTML={{ __html: data.contentDesc }}\n />\n )}\n <div className=\"laptop:mt-4 mt-2\">\n {data.buttonText && (\n <Button\n as=\"a\"\n variant=\"link\"\n className={cn('!p-0 text-[#F5F6F7]', classNames?.button)}\n href={getLocalizedPath(data.buttonLink || '', locale)}\n iconClassName=\"size-4\"\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n <Picture\n source={pictureSource}\n className=\"absolute inset-0 z-10 \"\n imgClassName=\"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]\"\n />\n </div>\n </div>\n )\n }\n)\n\nPromotionalBar.displayName = 'PromotionalBar'\nexport default withLayout(PromotionalBar)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgHU,IAAAI,EAAA,6BA9GVC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAyC,qCACzCC,EAA2B,kCAE3BF,EAAiC,kCACjCG,EAA+B,oCAmD/B,MAAMC,EAAkCC,GAA+E,CACrH,GAAI,CAACA,EAAiB,O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,EAAK,iBACJ,OAAC,WACC,aAAW,MAAG,8BAA+BD,GAAY,KAAK,EAC9D,KAAMC,EAAK,aACX,KAAM,EACR,EAEDA,EAAK,gBACJ,OAAC,KACC,aAAW,MACT,6HACAD,GAAY,WACd,EACA,wBAAyB,CAAE,OAAQC,EAAK,WAAY,EACtD,KAEF,OAAC,OAAI,UAAU,mBACZ,SAAAA,EAAK,eACJ,OAAC,UACC,GAAG,IACH,QAAQ,OACR,aAAW,MAAG,sBAAuBD,GAAY,MAAM,EACvD,QAAM,oBAAiBC,EAAK,YAAc,GAAII,CAAM,EACpD,cAAc,SAEb,SAAAJ,EAAK,WACR,EAEJ,GACF,KACA,OAAC,WACC,OAAQK,EACR,UAAU,yBACV,aAAa,uFACf,GACF,EACF,CAEJ,CACF,EAEAP,EAAe,YAAc,iBAC7B,IAAOvB,KAAQ,cAAWuB,CAAc",
6
+ "names": ["PromotionalBar_exports", "__export", "PromotionalBar_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_Styles", "import_AiuiProvider", "convertResponsiveImageToString", "backgroundImage", "mobile", "tablet", "laptop", "desktop", "lgDesktop", "parts", "getUrl", "media", "lgDesktopUrl", "desktopUrl", "laptopUrl", "tabletUrl", "mobileUrl", "PromotionalBar", "classNames", "data", "className", "rest", "ref", "locale", "pictureSource"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var z=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var j=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},g=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!R.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=E(r,a))||u.enumerable});return o};var B=(o,r,s)=>(s=o!=null?z(P(o)):{},g(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),M=o=>g(f({},"__esModule",{value:!0}),o);var W={};j(W,{default:()=>V});module.exports=M(W);var e=require("react/jsx-runtime"),i=B(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),S=require("../AiuiProvider/index.js"),p=require("swiper/react"),h=require("swiper/modules"),q=require("swiper/css"),F=require("swiper/css/navigation"),G=require("swiper/css/pagination"),J=require("swiper/css/effect-coverflow");const H="carousel",U="three_d_carousel",I=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,w=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),[T,C]=i.default.useState(180),{locale:b="us"}=(0,S.useAiuiContext)();return(0,y.useExposure)(v,{componentType:H,componentName:U,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=x.current;if(!t)return;const d=()=>{const L=t.offsetWidth,_=Math.round(L*.18);C(_),n.current?.params?.coverflowEffect&&(n.current.params.coverflowEffect.stretch=_,n.current.update())};d();const m=new ResizeObserver(d);return m.observe(t),()=>m.disconnect()},[]),(0,e.jsxs)("section",{ref:v,"data-ui-component-id":"ThreeDCarousel",className:(0,c.cn)("three-d-carousel laptop:overflow-hidden w-full overflow-visible",r),children:[(0,e.jsx)(l.Heading,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),(0,e.jsxs)("div",{ref:x,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full px-4",children:[(0,e.jsx)(p.Swiper,{onSwiper:t=>n.current=t,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[h.EffectCoverflow,h.Navigation],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:T,depth:300,modifier:1,slideShadows:!0},children:w.map((t,d)=>(0,e.jsx)(p.SwiperSlide,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:m})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Picture,{source:t.imageUrl?.url||"",alt:t.imageUrl?.alt||t.title,className:(0,c.cn)("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:m?"":"brightness(50%) contrast(120%)"}}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark","opacity-0":!m}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:t.buttonText})})]})]})},d))}),(0,e.jsxs)("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>n.current?.slidePrev(),"aria-label":"Previous slide",children:(0,e.jsx)(I,{})}),(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>n.current?.slideNext(),"aria-label":"Next slide",children:(0,e.jsx)(O,{})})]})]}),(0,e.jsx)("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:(0,e.jsx)(p.Swiper,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:w.map((t,d)=>(0,e.jsxs)(p.SwiperSlide,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[(0,e.jsx)(l.Picture,{source:t.mobImageUrl?.url||t.imageUrl?.url||"",alt:t.mobImageUrl?.alt||t.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark"}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-mobile-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:t.buttonText})})]})]},d))})})]})});k.displayName="ThreeDCarousel";var V=(0,N.withLayout)(k,{style:"overflow: hidden;"});
1
+ "use strict";"use client";var z=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var j=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},g=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!R.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=E(r,a))||u.enumerable});return o};var B=(o,r,s)=>(s=o!=null?z(P(o)):{},g(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),M=o=>g(f({},"__esModule",{value:!0}),o);var W={};j(W,{default:()=>V});module.exports=M(W);var e=require("react/jsx-runtime"),i=B(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),S=require("../AiuiProvider/index.js"),p=require("swiper/react"),h=require("swiper/modules"),q=require("swiper/css"),F=require("swiper/css/navigation"),G=require("swiper/css/pagination"),J=require("swiper/css/effect-coverflow");const H="carousel",U="three_d_carousel",I=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,w=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),[T,C]=i.default.useState(180),{locale:b="us"}=(0,S.useAiuiContext)();return(0,y.useExposure)(v,{componentType:H,componentName:U,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=x.current;if(!t)return;const d=()=>{const L=t.offsetWidth,_=Math.round(L*.125);C(_),n.current?.params?.coverflowEffect&&(n.current.params.coverflowEffect.stretch=_,n.current.update())};d();const m=new ResizeObserver(d);return m.observe(t),()=>m.disconnect()},[]),(0,e.jsxs)("section",{ref:v,"data-ui-component-id":"ThreeDCarousel",className:(0,c.cn)("three-d-carousel laptop:overflow-hidden w-full overflow-visible",r),children:[(0,e.jsx)(l.Heading,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),(0,e.jsxs)("div",{ref:x,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[(0,e.jsx)(p.Swiper,{onSwiper:t=>n.current=t,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[h.EffectCoverflow,h.Navigation],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:T,depth:300,modifier:1,slideShadows:!0},children:w.map((t,d)=>(0,e.jsx)(p.SwiperSlide,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:m})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Picture,{source:t.imageUrl?.url||"",alt:t.imageUrl?.alt||t.title,className:(0,c.cn)("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:m?"":"brightness(50%) contrast(120%)"}}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark","opacity-0":!m}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:t.buttonText})})]})]})},d))}),(0,e.jsxs)("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>n.current?.slidePrev(),"aria-label":"Previous slide",children:(0,e.jsx)(I,{})}),(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>n.current?.slideNext(),"aria-label":"Next slide",children:(0,e.jsx)(O,{})})]})]}),(0,e.jsx)("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:(0,e.jsx)(p.Swiper,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:w.map((t,d)=>(0,e.jsxs)(p.SwiperSlide,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[(0,e.jsx)(l.Picture,{source:t.mobImageUrl?.url||t.imageUrl?.url||"",alt:t.mobImageUrl?.alt||t.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark"}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-mobile-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:t.buttonText})})]})]},d))})})]})});k.displayName="ThreeDCarousel";var V=(0,N.withLayout)(k,{style:"overflow: hidden;"});
2
2
  //# sourceMappingURL=ThreeDCarousel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ThreeDCarousel/ThreeDCarousel.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u7EA6\u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 18%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.18)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full px-4\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBE,IAAAI,EAAA,6BApBFC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAqC,kCACrCC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA+B,oCAE/BL,EAAoC,wBACpCM,EAA4C,0B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rB,EAAe,YAAc,iBAE7B,IAAOlB,KAAQ,cAAWkB,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
4
+ "sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper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,GAAG,KAAK,KAAM,EAAG,KAAMA,EAAK,MAAO,KAC5C,OAAC,QACC,GAAG,IACH,KAAM,EACN,KAAMA,EAAK,YACX,UAAU,yDACZ,EACCA,EAAK,eACJ,OAAC,KACC,QAAM,oBAAiBA,EAAK,YAAc,GAAIP,CAAM,EACpD,UAAU,uCAEV,mBAAC,UAAO,KAAK,OAAO,QAAQ,YAAY,UAAU,6CAC/C,SAAAO,EAAK,WACR,EACF,GAEJ,IAlCKC,CAmCP,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDrB,EAAe,YAAc,iBAE7B,IAAOlB,KAAQ,cAAWkB,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
6
6
  "names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "import_modules", "import_css", "import_navigation", "import_pagination", "import_effect_coverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "React", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var it=Object.create;var f=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var ct=(t,e)=>{for(var n in e)f(t,n,{get:e[n],enumerable:!0})},V=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ot(e))!lt.call(t,s)&&s!==n&&f(t,s,{get:()=>e[s],enumerable:!(o=st(e,s))||o.enumerable});return t};var P=(t,e,n)=>(n=t!=null?it(at(t)):{},V(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),dt=t=>V(f({},"__esModule",{value:!0}),t);var ft={};ct(ft,{default:()=>ut});module.exports=dt(ft);var r=require("react/jsx-runtime"),i=P(require("react")),g=require("gsap"),b=require("gsap/dist/SplitText"),k=require("gsap/dist/ScrollTrigger"),l=require("../../helpers/utils.js"),F=require("class-variance-authority"),h=require("../../components/index.js"),S=require("../../shared/Styles.js"),j=require("../../shared/trackUrlRef.js"),D=require("react-intersection-observer"),I=P(require("./Countdown.js"));const $="link",z="title",mt=(0,F.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),pt=(0,F.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),A=({data:t,className:e})=>{const{theme:n="light",extensions:o,title:s,caption:x,align:c}=t;return o?.textLink?(0,r.jsxs)("a",{className:(0,l.cn)({"aiui-dark":n==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":n==="light"},{"text-[#F5F6F7]":n==="dark"},{"justify-center mt-4":c==="center"},{"mt-1 laptop:mt-0":c==="left"},e),href:(0,j.trackUrlRef)(o?.link,`${$}_${z}`),"data-headless-type-name":`${$}#${z}`,"data-headless-title-desc-button":`${s}#${x}`,children:[(0,r.jsx)("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),(0,r.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",children:(0,r.jsx)("path",{d:"M6.91058 4.41083C7.23602 4.08539 7.76353 4.08539 8.08897 4.41083L13.089 9.41083C13.4144 9.73626 13.4144 10.2638 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2638 6.58514 14.7363 6.91058 14.4108L11.3214 10L6.91058 5.58921C6.58514 5.26377 6.58514 4.73626 6.91058 4.41083Z",fill:n==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]}):null},B=i.default.forwardRef(({data:t,className:e,as:n="h2",weight:o="bold",...s},x)=>{const{title:c,caption:y,subtitle:N,countdown:L,showCountdown:_=!1,theme:u="light",extensions:O,align:d="left"}=t,C=(0,i.useRef)(null),m=(0,i.useRef)(null),a=(0,i.useRef)(null),p=(0,i.useRef)(null),[U,Z]=(0,i.useState)(!0),{ref:q,inView:H}=(0,D.useInView)();(0,i.useImperativeHandle)(x,()=>C.current);const G=()=>{Z(!1)};return(0,i.useEffect)(()=>{g.gsap.registerPlugin(b.SplitText,k.ScrollTrigger);function J(){if(!m.current)return;const K=m.current?.clientHeight||80;a.current&&a.current.revert(),p.current&&p.current.kill(),a.current=new b.SplitText(m.current,{type:"words",wordsClass:"word"});const w=a.current.words;g.gsap.set(w,{opacity:0}),p.current=k.ScrollTrigger.create({trigger:m.current,start:"bottom bottom-=4%",end:`bottom+=${K*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:Q=>{const W=Q.progress,R=w.length||1,X=.5,v=1/R,E=v*(1-X),M=(R-1)*E+v,Y=Math.min(1,M>0?W/M:0);w.forEach((tt,et)=>{const nt=et*E,rt=v;let T=(Y-nt)/rt;T=Math.max(0,Math.min(1,T)),g.gsap.set(tt,{opacity:T})})}})}return H&&J(),()=>{a.current&&a.current.revert(),p.current&&p.current.kill()}},[H]),(0,r.jsxs)("div",{...s,id:O?.id,className:"titleBottom title-box flex items-end justify-between gap-2 pb-6",ref:C,children:[(0,r.jsxs)("div",{ref:q,className:(0,l.cn)("flex-1",e,{"aiui-dark":u==="dark","text-center":d==="center","text-left":d==="left"}),children:[(y||c)&&(0,r.jsx)(h.Heading,{ref:m,as:n,size:4,html:y||c,weight:o,className:mt({theme:u})}),N&&(0,r.jsx)(h.Text,{html:N,as:"p",className:pt({theme:u})}),(0,r.jsx)(A,{data:t,className:(0,l.cn)({"laptop:hidden":d==="left"})}),_&&L&&U&&(0,r.jsx)(I.default,{className:(0,l.cn)("mt-4 justify-start",{"justify-center":d==="center"}),config:L,onCountdownEnd:G,theme:u})]}),(0,r.jsx)(A,{data:t,className:(0,l.cn)("hidden",{"laptop:flex":d==="left"})})]})});B.displayName="Title";var ut=(0,S.withLayout)(B);
1
+ "use strict";"use client";var it=Object.create;var g=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var dt=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},R=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of at(e))!ct.call(t,o)&&o!==n&&g(t,o,{get:()=>e[o],enumerable:!(a=ot(e,o))||a.enumerable});return t};var mt=(t,e,n)=>(n=t!=null?it(lt(t)):{},R(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),ut=t=>R(g({},"__esModule",{value:!0}),t);var gt={};dt(gt,{default:()=>ht});module.exports=ut(gt);var s=require("react/jsx-runtime"),i=mt(require("react")),w=require("gsap"),k=require("gsap/dist/SplitText"),y=require("gsap/dist/ScrollTrigger"),c=require("../../helpers/utils.js"),F=require("class-variance-authority"),d=require("../../components/index.js"),$=require("../../shared/Styles.js"),A=require("../../shared/trackUrlRef.js"),B=require("react-intersection-observer");const V="link",z="title",pt=(0,F.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),ft=(0,F.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),S=({data:t,className:e})=>{const{theme:n="light",extensions:a,title:o,caption:x,align:m}=t;return a?.textLink?(0,s.jsxs)("a",{className:(0,c.cn)({"aiui-dark":n==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":n==="light"},{"text-[#F5F6F7]":n==="dark"},{"justify-center mt-4":m==="center"},{"mt-1 laptop:mt-0":m==="left"},e),href:(0,A.trackUrlRef)(a?.link,`${V}_${z}`),"data-headless-type-name":`${V}#${z}`,"data-headless-title-desc-button":`${o}#${x}`,children:[(0,s.jsx)("div",{className:"truncate whitespace-nowrap",children:a?.textLink}),(0,s.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",children:(0,s.jsx)("path",{d:"M6.91058 4.41083C7.23602 4.08539 7.76353 4.08539 8.08897 4.41083L13.089 9.41083C13.4144 9.73626 13.4144 10.2638 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2638 6.58514 14.7363 6.91058 14.4108L11.3214 10L6.91058 5.58921C6.58514 5.26377 6.58514 4.73626 6.91058 4.41083Z",fill:n==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]}):null},P=i.default.forwardRef(({data:t,className:e,as:n="h2",weight:a="bold",...o},x)=>{const{title:m,caption:L,subtitle:N,countdown:r,showCountdown:_=!1,theme:h="light",extensions:I,align:u="left"}=t,H=(0,i.useRef)(null),p=(0,i.useRef)(null),l=(0,i.useRef)(null),f=(0,i.useRef)(null),[j,O]=(0,i.useState)(!0),{ref:U,inView:D}=(0,B.useInView)();(0,i.useImperativeHandle)(x,()=>H.current);const W=()=>{O(!1)},Z=r?.targetDateTime||r?.targetDate||"",q=r?.targetDateTime_tz,G=r?.labels?{day:r.labels.days||"Day",hour:r.labels.hours||"Hours",minute:r.labels.minutes||"Mins",second:r.labels.seconds||"Secs"}:void 0;return(0,i.useEffect)(()=>{w.gsap.registerPlugin(k.SplitText,y.ScrollTrigger);function J(){if(!p.current)return;const K=p.current?.clientHeight||80;l.current&&l.current.revert(),f.current&&f.current.kill(),l.current=new k.SplitText(p.current,{type:"words",wordsClass:"word"});const v=l.current.words;w.gsap.set(v,{opacity:0}),f.current=y.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${K*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:Q=>{const X=Q.progress,M=v.length||1,Y=.5,b=1/M,E=b*(1-Y),C=(M-1)*E+b,tt=Math.min(1,C>0?X/C:0);v.forEach((et,nt)=>{const st=nt*E,rt=b;let T=(tt-st)/rt;T=Math.max(0,Math.min(1,T)),w.gsap.set(et,{opacity:T})})}})}return D&&J(),()=>{l.current&&l.current.revert(),f.current&&f.current.kill()}},[D]),(0,s.jsxs)("div",{...o,id:I?.id,className:"titleBottom title-box flex items-end justify-between gap-2 pb-6",ref:H,children:[(0,s.jsxs)("div",{ref:U,className:(0,c.cn)("flex-1",e,{"aiui-dark":h==="dark","text-center":u==="center","text-left":u==="left"}),children:[(L||m)&&(0,s.jsx)(d.Heading,{ref:p,as:n,size:4,html:L||m,weight:a,className:pt({theme:h})}),N&&(0,s.jsx)(d.Text,{html:N,as:"p",className:ft({theme:h})}),(0,s.jsx)(S,{data:t,className:(0,c.cn)({"laptop:hidden":u==="left"})}),_&&r&&j&&(0,s.jsx)(d.Countdown,{endDate:Z,endDate_tz:q,timeLabels:G,showDays:r?.showDays,showHours:r?.showHours,showMinutes:r?.showMinutes,showSeconds:r?.showSeconds,theme:h,onExpire:W,hideWhenExpired:!0,align:u==="center"?"center":"left",className:(0,c.cn)("mt-4")})]}),(0,s.jsx)(S,{data:t,className:(0,c.cn)("hidden",{"laptop:flex":u==="left"})})]})});P.displayName="Title";var ht=(0,$.withLayout)(P);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\nimport Countdown from './Countdown.js'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({ data, className }: { data: TitleProps['data']; className?: string }) => {\n const { theme = 'light', extensions, title, caption, align } = data\n if (!extensions?.textLink) return null\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M6.91058 4.41083C7.23602 4.08539 7.76353 4.08539 8.08897 4.41083L13.089 9.41083C13.4144 9.73626 13.4144 10.2638 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2638 6.58514 14.7363 6.91058 14.4108L11.3214 10L6.91058 5.58921C6.58514 5.26377 6.58514 4.73626 6.91058 4.41083Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, as = 'h2', weight = 'bold', ...rest }, ref) => {\n const {\n title,\n caption,\n subtitle,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.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: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className=\"titleBottom title-box flex items-end justify-between gap-2 pb-6\"\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={4}\n html={caption || title}\n weight={weight}\n className={titleHeadingVariants({ theme })}\n />\n )}\n {subtitle && <Text html={subtitle} as=\"p\" className={subtitleVariants({ theme })} />}\n <TitleButton data={data} className={cn({ 'laptop:hidden': align === 'left' })} />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n className={cn('mt-4 justify-start', {\n 'justify-center': align === 'center',\n })}\n config={countdown}\n onCountdownEnd={handleCountdownEnd}\n theme={theme}\n />\n )}\n </div>\n <TitleButton data={data} className={cn('hidden', { ['laptop:flex']: align === 'left' })} />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAwDI,IAAAI,EAAA,6BAvDJC,EAAwE,oBACxEC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAoB,oCACpBC,EAA8B,qCAC9BC,EAA2B,kCAI3BC,EAA4B,uCAC5BC,EAA0B,uCAC1BC,EAAsB,6BAEtB,MAAMC,EAAgB,OAChBC,EAAgB,QAKhBC,MAAuB,OAAI,GAAI,CACnC,SAAU,CACR,MAAO,CACL,MAAO,iBACP,KAAM,gBACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAKKC,MAAmB,OACvB,oHACA,CACE,SAAU,CACR,MAAO,CACL,MAAO,iBACP,KAAM,gBACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CACF,EAEMC,EAAc,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAwD,CAC7F,KAAM,CAAE,MAAAC,EAAQ,QAAS,WAAAC,EAAY,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIN,EAC/D,OAAKG,GAAY,YAEf,QAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,4KACA,CAAE,iBAAkBA,IAAU,OAAQ,EACtC,CAAE,iBAAkBA,IAAU,MAAO,EACrC,CAAE,sBAAuBI,IAAU,QAAS,EAC5C,CAAE,mBAAoBA,IAAU,MAAO,EACvCL,CACF,EACA,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EACjB,OAAQM,EACR,UAAWb,GAAqB,CAAE,MAAAK,CAAM,CAAC,EAC3C,EAEDW,MAAY,OAAC,QAAK,KAAMA,EAAU,GAAG,IAAI,UAAWf,GAAiB,CAAE,MAAAI,CAAM,CAAC,EAAG,KAClF,OAACH,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,CAAE,gBAAiBM,IAAU,MAAO,CAAC,EAAG,EAC9ES,GAAiBD,GAAaM,MAC7B,OAAC,EAAAqB,QAAA,CACC,aAAW,MAAG,qBAAsB,CAClC,iBAAkBnC,IAAU,QAC9B,CAAC,EACD,OAAQQ,EACR,eAAgBU,EAChB,MAAOtB,EACT,GAEJ,KACA,OAACH,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,SAAU,CAAG,cAAgBM,IAAU,MAAO,CAAC,EAAG,GAC3F,CAEJ,CACF,EAEAC,EAAM,YAAc,QAEpB,IAAO1B,MAAQ,cAAW0B,CAAK",
6
- "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_class_variance_authority", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "import_Countdown", "componentType", "componentName", "titleHeadingVariants", "subtitleVariants", "TitleButton", "data", "className", "theme", "extensions", "title", "caption", "align", "Title", "React", "as", "weight", "rest", "ref", "subtitle", "countdown", "showCountdown", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "isCountdownVisible", "setIsCountdownVisible", "inViewRef", "inView", "handleCountdownEnd", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity", "Countdown"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text, Countdown } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({ data, className }: { data: TitleProps['data']; className?: string }) => {\n const { theme = 'light', extensions, title, caption, align } = data\n if (!extensions?.textLink) return null\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M6.91058 4.41083C7.23602 4.08539 7.76353 4.08539 8.08897 4.41083L13.089 9.41083C13.4144 9.73626 13.4144 10.2638 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2638 6.58514 14.7363 6.91058 14.4108L11.3214 10L6.91058 5.58921C6.58514 5.26377 6.58514 4.73626 6.91058 4.41083Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, as = 'h2', weight = 'bold', ...rest }, ref) => {\n const {\n title,\n caption,\n subtitle,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n // CMS field mapping: new targetDateTime > legacy targetDate\n const countdownEndDate = countdown?.targetDateTime || countdown?.targetDate || ''\n const countdownTz = countdown?.targetDateTime_tz\n // Label mapping: plural keys (Title CMS format) \u2192 atomic Countdown format\n const countdownLabels = countdown?.labels\n ? {\n day: countdown.labels.days || 'Day',\n hour: countdown.labels.hours || 'Hours',\n minute: countdown.labels.minutes || 'Mins',\n second: countdown.labels.seconds || 'Secs',\n }\n : undefined\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.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: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className=\"titleBottom title-box flex items-end justify-between gap-2 pb-6\"\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={4}\n html={caption || title}\n weight={weight}\n className={titleHeadingVariants({ theme })}\n />\n )}\n {subtitle && <Text html={subtitle} as=\"p\" className={subtitleVariants({ theme })} />}\n <TitleButton data={data} className={cn({ 'laptop:hidden': align === 'left' })} />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n endDate={countdownEndDate}\n endDate_tz={countdownTz}\n timeLabels={countdownLabels}\n showDays={countdown?.showDays}\n showHours={countdown?.showHours}\n showMinutes={countdown?.showMinutes}\n showSeconds={countdown?.showSeconds}\n theme={theme}\n onExpire={handleCountdownEnd}\n hideWhenExpired={true}\n align={align === 'center' ? 'center' : 'left'}\n className={cn('mt-4')}\n />\n )}\n </div>\n <TitleButton data={data} className={cn('hidden', { ['laptop:flex']: align === 'left' })} />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuDI,IAAAI,EAAA,6BAtDJC,EAAwE,qBACxEC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAoB,oCACpBC,EAAyC,qCACzCC,EAA2B,kCAI3BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAKhBC,MAAuB,OAAI,GAAI,CACnC,SAAU,CACR,MAAO,CACL,MAAO,iBACP,KAAM,gBACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAKKC,MAAmB,OACvB,oHACA,CACE,SAAU,CACR,MAAO,CACL,MAAO,iBACP,KAAM,gBACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CACF,EAEMC,EAAc,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAwD,CAC7F,KAAM,CAAE,MAAAC,EAAQ,QAAS,WAAAC,EAAY,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIN,EAC/D,OAAKG,GAAY,YAEf,QAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,4KACA,CAAE,iBAAkBA,IAAU,OAAQ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C,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACI,CAAM,CAAC,KAGT,QAAC,OACE,GAAGZ,EACJ,GAAIR,GAAY,GAChB,UAAU,kEACV,IAAKa,EAEL,qBAAC,OACC,IAAKM,EACL,aAAW,MAAG,SAAUrB,EAAW,CACjC,YAAaC,IAAU,OACvB,cAAeI,IAAU,SACzB,YAAaA,IAAU,MACzB,CAAC,EAEC,WAAAD,GAAWD,OACX,OAAC,WACC,IAAKa,EACL,GAAIR,EACJ,KAAM,EACN,KAAMJ,GAAWD,EACjB,OAAQM,EACR,UAAWb,GAAqB,CAAE,MAAAK,CAAM,CAAC,EAC3C,EAEDW,MAAY,OAAC,QAAK,KAAMA,EAAU,GAAG,IAAI,UAAWf,GAAiB,CAAE,MAAAI,CAAM,CAAC,EAAG,KAClF,OAACH,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,CAAE,gBAAiBM,IAAU,MAAO,CAAC,EAAG,EAC9ES,GAAiBD,GAAaM,MAC7B,OAAC,aACC,QAASK,EACT,WAAYC,EACZ,WAAYC,EACZ,SAAUb,GAAW,SACrB,UAAWA,GAAW,UACtB,YAAaA,GAAW,YACxB,YAAaA,GAAW,YACxB,MAAOZ,EACP,SAAUsB,EACV,gBAAiB,GACjB,MAAOlB,IAAU,SAAW,SAAW,OACvC,aAAW,MAAG,MAAM,EACtB,GAEJ,KACA,OAACP,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,SAAU,CAAG,cAAgBM,IAAU,MAAO,CAAC,EAAG,GAC3F,CAEJ,CACF,EAEAC,EAAM,YAAc,QAEpB,IAAOzB,MAAQ,cAAWyB,CAAK",
6
+ "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_class_variance_authority", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "titleHeadingVariants", "subtitleVariants", "TitleButton", "data", "className", "theme", "extensions", "title", "caption", "align", "Title", "React", "as", "weight", "rest", "ref", "subtitle", "countdown", "showCountdown", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "isCountdownVisible", "setIsCountdownVisible", "inViewRef", "inView", "handleCountdownEnd", "countdownEndDate", "countdownTz", "countdownLabels", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity"]
7
7
  }
@@ -9,10 +9,19 @@ export interface Feature {
9
9
  * 倒计时配置
10
10
  */
11
11
  export interface CountdownConfig {
12
+ /**
13
+ * 新 CMS 字段,ISO 8601 带时区(如 '2026-03-28T16:00:00.000Z')。优先于 targetDate 使用。
14
+ */
15
+ targetDateTime?: string;
16
+ /**
17
+ * 时区标识符(如 'Asia/Shanghai'),与 targetDateTime 配合使用
18
+ */
19
+ targetDateTime_tz?: string;
12
20
  /**
13
21
  * 倒计时目标时间(ISO 8601 格式或任何 dayjs 支持的格式)
22
+ * @deprecated 请使用 targetDateTime 替代。仅用于兼容旧 CMS 数据。
14
23
  */
15
- targetDate: string;
24
+ targetDate?: string;
16
25
  /**
17
26
  * 是否显示天数
18
27
  * @default true
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!l.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(s=i(e,o))||s.enumerable});return t};var g=t=>h(n({},"__esModule",{value:!0}),t);var p={};module.exports=g(p);
1
+ "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!g.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(s=i(e,o))||s.enumerable});return t};var h=t=>l(n({},"__esModule",{value:!0}),t);var p={};module.exports=h(p);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/types.ts"],
4
- "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\n/**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\nexport interface CountdownConfig {\n /**\n * \u5012\u8BA1\u65F6\u76EE\u6807\u65F6\u95F4\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF09\n */\n targetDate: string\n /**\n * \u662F\u5426\u663E\u793A\u5929\u6570\n * @default true\n */\n showDays?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5C0F\u65F6\n * @default true\n */\n showHours?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5206\u949F\n * @default true\n */\n showMinutes?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u79D2\u6570\n * @default true\n */\n showSeconds?: boolean\n /**\n * \u81EA\u5B9A\u4E49\u6807\u7B7E\u6587\u672C\n */\n labels?: {\n days?: string\n hours?: string\n minutes?: string\n seconds?: string\n }\n}\n\nexport interface TitlePropsBase {\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title?: string\n caption?: string\n /**\n * \u526F\u6807\u9898\n */\n subtitle?: string\n /**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\n countdown?: CountdownConfig\n /**\n * \u662F\u5426\u663E\u793A\u5012\u8BA1\u65F6\n * @default false\n */\n showCountdown?: boolean\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extensions?: any\n /**\n * \u5BF9\u9F50\u65B9\u5F0F\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right'\n }\n weight?: 'medium' | 'semibold' | 'bold' | 'extraBold' | 'black'\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\n/** @deprecated Use TitlePropsBase and extend with React.HTMLAttributes<HTMLDivElement> */\nexport type TitleProps = TitlePropsBase\n"],
4
+ "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\n/**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\nexport interface CountdownConfig {\n /**\n * \u65B0 CMS \u5B57\u6BB5\uFF0CISO 8601 \u5E26\u65F6\u533A\uFF08\u5982 '2026-03-28T16:00:00.000Z'\uFF09\u3002\u4F18\u5148\u4E8E targetDate \u4F7F\u7528\u3002\n */\n targetDateTime?: string\n /**\n * \u65F6\u533A\u6807\u8BC6\u7B26\uFF08\u5982 'Asia/Shanghai'\uFF09\uFF0C\u4E0E targetDateTime \u914D\u5408\u4F7F\u7528\n */\n targetDateTime_tz?: string\n /**\n * \u5012\u8BA1\u65F6\u76EE\u6807\u65F6\u95F4\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF09\n * @deprecated \u8BF7\u4F7F\u7528 targetDateTime \u66FF\u4EE3\u3002\u4EC5\u7528\u4E8E\u517C\u5BB9\u65E7 CMS \u6570\u636E\u3002\n */\n targetDate?: string\n /**\n * \u662F\u5426\u663E\u793A\u5929\u6570\n * @default true\n */\n showDays?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5C0F\u65F6\n * @default true\n */\n showHours?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5206\u949F\n * @default true\n */\n showMinutes?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u79D2\u6570\n * @default true\n */\n showSeconds?: boolean\n /**\n * \u81EA\u5B9A\u4E49\u6807\u7B7E\u6587\u672C\n */\n labels?: {\n days?: string\n hours?: string\n minutes?: string\n seconds?: string\n }\n}\n\nexport interface TitlePropsBase {\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title?: string\n caption?: string\n /**\n * \u526F\u6807\u9898\n */\n subtitle?: string\n /**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\n countdown?: CountdownConfig\n /**\n * \u662F\u5426\u663E\u793A\u5012\u8BA1\u65F6\n * @default false\n */\n showCountdown?: boolean\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extensions?: any\n /**\n * \u5BF9\u9F50\u65B9\u5F0F\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right'\n }\n weight?: 'medium' | 'semibold' | 'bold' | 'extraBold' | 'black'\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\n/** @deprecated Use TitlePropsBase and extend with React.HTMLAttributes<HTMLDivElement> */\nexport type TitleProps = TitlePropsBase\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var i in o)a(e,i,{get:o[i],enumerable:!0})},g=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of b(o))!h.call(e,l)&&l!==i&&a(e,l,{get:()=>o[l],enumerable:!(r=c(o,l))||r.enumerable});return e};var m=e=>g(a({},"__esModule",{value:!0}),e);var w={};v(w,{VideoModal:()=>d});module.exports=m(w);var t=require("react/jsx-runtime"),n=require("../../components/dialog.js"),s=require("../VideoModal/YouTubePlayer.js");const d=e=>{const{visible:o,youTubeId:i,videoUrl:r,onCloseModal:l,className:u,...p}=e;return(0,t.jsx)(n.Dialog,{open:o,onOpenChange:()=>l(),children:(0,t.jsxs)(n.DialogContent,{...p,className:`max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden ${u||""}`,children:[i?(0,t.jsx)(s.YouTubePlayer,{youTubeId:i}):null,r?(0,t.jsx)("video",{className:"size-full overflow-hidden rounded-2xl object-cover",src:r,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,(0,t.jsx)("div",{onClick:()=>l(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};
1
+ "use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var b=(e,o)=>{for(var i in o)n(e,i,{get:o[i],enumerable:!0})},h=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of p(o))!c.call(e,l)&&l!==i&&n(e,l,{get:()=>o[l],enumerable:!(r=u(o,l))||r.enumerable});return e};var v=e=>h(n({},"__esModule",{value:!0}),e);var g={};b(g,{VideoModal:()=>d});module.exports=v(g);var t=require("react/jsx-runtime"),a=require("../../components/dialog.js"),s=require("../VideoModal/YouTubePlayer.js");const d=e=>{const{visible:o,youTubeId:i,videoUrl:r,onCloseModal:l,className:m,...w}=e;return(0,t.jsx)(a.Dialog,{open:o,onOpenChange:()=>l(),children:(0,t.jsxs)(a.DialogContent,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[i?(0,t.jsx)(s.YouTubePlayer,{youTubeId:i}):r?(0,t.jsx)("video",{className:"size-full overflow-hidden rounded-2xl object-cover",src:r,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,(0,t.jsx)("div",{onClick:()=>l(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/VideoModal/index.tsx"],
4
- "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent\n {...rest}\n className={`max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden ${className || ''}`}\n >\n {youTubeId ? <YouTubePlayer youTubeId={youTubeId} /> : null}\n {videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-cover\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAfNC,EAAsC,sCACtCC,EAA8B,0CAS9B,MAAMJ,EAAcK,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,SACE,OAAC,UAAO,KAAMC,EAAS,aAAc,IAAMG,EAAa,EACtD,oBAAC,iBACE,GAAGE,EACJ,UAAW,yFAAyFD,GAAa,EAAE,GAElH,UAAAH,KAAY,OAAC,iBAAc,UAAWA,EAAW,EAAK,KACtDC,KACC,OAAC,SACC,UAAU,qDACV,IAAKA,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,QACJ,OAAC,OACC,QAAS,IAAMC,EAAa,EAC5B,UAAU,wHAEV,mBAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,mBAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
4
+ "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-cover\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAfNC,EAAsC,sCACtCC,EAA8B,0CAS9B,MAAMJ,EAAcK,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,SACE,OAAC,UAAO,KAAMC,EAAS,aAAc,IAAMG,EAAa,EACtD,oBAAC,iBAAc,UAAU,wFACtB,UAAAF,KACC,OAAC,iBAAc,UAAWA,EAAW,EACnCC,KACF,OAAC,SACC,UAAU,qDACV,IAAKA,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,QACJ,OAAC,OACC,QAAS,IAAMC,EAAa,EAC5B,UAAU,wHAEV,mBAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,mBAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
6
6
  "names": ["VideoModal_exports", "__export", "VideoModal", "__toCommonJS", "import_jsx_runtime", "import_dialog", "import_YouTubePlayer", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "rest"]
7
7
  }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * BaseModal - 通用弹窗基础组件
3
+ *
4
+ * 基于 Radix UI Dialog 实现的统一弹窗组件,提供遮罩层、关闭按钮等功能
5
+ *
6
+ * @module BaseModal
7
+ * @date 2026-01-29
8
+ */
9
+ import React from 'react';
10
+ export interface BaseModalProps {
11
+ /**
12
+ * 是否显示弹窗
13
+ */
14
+ isOpen: boolean;
15
+ /**
16
+ * 关闭弹窗回调
17
+ */
18
+ onClose: () => void;
19
+ /**
20
+ * 弹窗内容
21
+ */
22
+ children: React.ReactNode;
23
+ /**
24
+ * 弹窗最大宽度类名
25
+ * @default 'max-w-[358px] laptop:max-w-[480px]'
26
+ */
27
+ maxWidth?: string;
28
+ /**
29
+ * 弹窗背景渐变
30
+ * @default 'bg-white'
31
+ */
32
+ background?: string;
33
+ /**
34
+ * 是否显示关闭按钮
35
+ * @default true
36
+ */
37
+ showCloseButton?: boolean;
38
+ /**
39
+ * 自定义类名
40
+ */
41
+ className?: string;
42
+ /**
43
+ * title 弹窗标题
44
+ */
45
+ title?: string;
46
+ description?: string;
47
+ /**
48
+ * ARIA 标签
49
+ */
50
+ ariaLabelledBy?: string;
51
+ /**
52
+ * 主题模式
53
+ * @default 'light'
54
+ */
55
+ theme?: 'light' | 'dark';
56
+ }
57
+ /**
58
+ * BaseModal 通用弹窗组件(基于 Radix UI Dialog)
59
+ */
60
+ export declare const BaseModal: React.FC<BaseModalProps>;
61
+ export default BaseModal;