@anker-in/headless-ui 0.0.27-alpha.141 → 0.0.27-alpha.145

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 (29) hide show
  1. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  2. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  3. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  4. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
  5. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  6. package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
  7. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  8. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Title/index.js +1 -1
  10. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  11. package/dist/cjs/components/container.js +1 -1
  12. package/dist/cjs/components/container.js.map +2 -2
  13. package/dist/cjs/components/tabs.js +1 -1
  14. package/dist/cjs/components/tabs.js.map +2 -2
  15. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  16. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  17. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  18. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
  19. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  20. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  21. package/dist/esm/biz-components/Slogan/index.js +1 -1
  22. package/dist/esm/biz-components/Slogan/index.js.map +2 -2
  23. package/dist/esm/biz-components/Title/index.js +1 -1
  24. package/dist/esm/biz-components/Title/index.js.map +2 -2
  25. package/dist/esm/components/container.js +1 -1
  26. package/dist/esm/components/container.js.map +2 -2
  27. package/dist/esm/components/tabs.js +1 -1
  28. package/dist/esm/components/tabs.js.map +2 -2
  29. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var D=Object.create;var u=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var A=(t,s)=>{for(var e in s)u(t,e,{get:s[e],enumerable:!0})},k=(t,s,e,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of Y(s))!O.call(t,r)&&r!==e&&u(t,r,{get:()=>s[r],enumerable:!(a=F(s,r))||a.enumerable});return t};var H=(t,s,e)=>(e=t!=null?D(q(t)):{},k(s||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t)),G=t=>k(u({},"__esModule",{value:!0}),t);var Q={};A(Q,{default:()=>K});module.exports=G(Q);var o=require("react/jsx-runtime"),l=require("react"),p=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),L=H(require("../../components/picture.js")),T=H(require("../../components/button.js")),v=require("@payloadcms/richtext-lexical/html"),P=require("react-intersection-observer");const M=({defaultConverters:t})=>({...t,text:s=>{const{node:e}=s;return e.$&&e.$.color?`<span class="lexical-${e.$.color}">${e.text}</span>`:e.text}}),J=(0,l.forwardRef)(({className:t="",onBtnClick:s,data:{title:e,videoTitle:a,btnText:r,img:f,video:B,theme:R,shape:E,...I}},$)=>{const{sticky:n}=I,[i,d]=(0,l.useState)(!1),[g,z]=(0,l.useState)(0),c=(0,l.useRef)(null),m=(0,l.useRef)(null),_=(0,l.useRef)(null),{ref:C,inView:x}=(0,P.useInView)();(0,l.useImperativeHandle)($,()=>m.current);const y=typeof e=="string"?e:e&&(0,v.convertLexicalToHTML)({data:e,converters:M}),h=typeof a=="string"?a:a&&(0,v.convertLexicalToHTML)({data:a,converters:M});return(0,l.useEffect)(()=>{x&&!r?(c.current?.play(),d(!0)):(c.current?.pause(),d(!1))},[x]),(0,l.useEffect)(()=>{if(m.current&&n){const S=m.current.getBoundingClientRect(),b=window.innerHeight,V=window.scrollY||window.pageYOffset,j=S.bottom+V,w=document.documentElement.scrollHeight-j;z(w>b?b:w)}},[]),(0,o.jsxs)("div",{ref:m,style:n?{marginBottom:`-${g}px`}:{},className:(0,p.cn)("relative",n&&"mt-[-100vh]"),children:[(0,o.jsx)("div",{className:"sticky top-0 ",children:(0,o.jsxs)("div",{className:(0,p.cn)("relative overflow-hidden",n?"h-screen w-screen":"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",t,{"aiui-dark":R==="dark","rounded-box":E==="rounded"}),children:[(0,o.jsx)("div",{children:(0,o.jsxs)("div",{ref:C,className:"media-content absolute left-1/2 top-1/2 z-20 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-5",children:[y&&!i&&(0,o.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:y}}),h&&i&&(0,o.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:h}}),!i&&r&&(0,o.jsx)(T.default,{variant:"link",className:(0,p.cn)("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{i?(c.current&&c.current.pause(),d(!1)):(c.current&&c.current.play(),d(!0)),s&&s?.()},children:r})]})}),(0,o.jsx)("div",{children:(0,o.jsxs)("div",{ref:_,className:"media-cover left-0 top-0 h-screen w-full",children:[(0,o.jsx)("video",{ref:c,className:"size-full object-cover",src:B?.url,muted:!0,loop:!0,playsInline:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),!i&&f?.url&&(0,o.jsx)(L.default,{className:"z-1 absolute left-0 top-0 size-full object-cover",source:f?.url,alt:f?.alt,imgClassName:"w-full h-full object-cover"}),(0,o.jsx)("div",{className:"absolute left-0 top-0 z-10 size-full"})]})})]})}),(0,o.jsx)("div",{className:(0,p.cn)(n&&"relative box-content block",n&&"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),style:n?{height:`${g}px`}:{}})]})});var K=(0,N.withStyles)(J);
1
+ "use strict";"use client";var q=Object.create;var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(n,o)=>{for(var e in o)f(n,e,{get:o[e],enumerable:!0})},T=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of A(o))!J.call(n,s)&&s!==e&&f(n,s,{get:()=>o[s],enumerable:!(i=O(o,s))||i.enumerable});return n};var Q=(n,o,e)=>(e=n!=null?q(G(n)):{},T(o||!n||!n.__esModule?f(e,"default",{value:n,enumerable:!0}):e,n)),U=n=>T(f({},"__esModule",{value:!0}),n);var Z={};K(Z,{default:()=>X});module.exports=U(Z);var t=require("react/jsx-runtime"),r=require("react"),N=require("lodash"),c=require("../../helpers/utils.js"),E=require("../../shared/Styles.js"),re=require("../../components/picture.js"),P=Q(require("../../components/button.js")),y=require("@payloadcms/richtext-lexical/html"),R=require("react-intersection-observer");const k=({defaultConverters:n})=>({...n,text:o=>{const{node:e}=o;return e.$&&e.$.color?`<span class="lexical-${e.$.color}">${e.text}</span>`:e.text}}),W=(0,r.forwardRef)(({className:n="",onBtnClick:o,data:{title:e,videoTitle:i,btnText:s,img:ee,video:z,theme:B,shape:$,...I}},_)=>{const{sticky:l}=I,[d,p]=(0,r.useState)(!1),[w,C]=(0,r.useState)(0),[D,S]=(0,r.useState)(0),a=(0,r.useRef)(null),m=(0,r.useRef)(null),V=(0,r.useRef)(null),v=(0,r.useRef)(null),{ref:F,inView:H}=(0,R.useInView)();(0,r.useImperativeHandle)(_,()=>m.current);const b=typeof e=="string"?e:e&&(0,y.convertLexicalToHTML)({data:e,converters:k}),L=typeof i=="string"?i:i&&(0,y.convertLexicalToHTML)({data:i,converters:k});(0,r.useEffect)(()=>{H&&!s?(a.current?.play(),p(!0)):(a.current?.pause(),p(!1))},[H]);const g=(0,N.debounce)(()=>{if(m.current){const h=m.current.getBoundingClientRect(),u=window.innerHeight,Y=window.scrollY||window.pageYOffset,j=h.bottom+Y,M=document.documentElement.scrollHeight-j;C(M>u?u:M)}if(v.current){const h=v.current.clientHeight,u=window.innerHeight;S(h+u)}},600);(0,r.useEffect)(()=>(g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}),[]);const x="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)("div",{ref:v,className:(0,c.cn)("relative z-10 ",x),children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{ref:F,className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4",children:[b&&!d&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:b}}),L&&d&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:L}}),!d&&s&&(0,t.jsx)(P.default,{variant:"link",className:(0,c.cn)("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{d?(a.current&&a.current.pause(),p(!1)):(a.current&&a.current.play(),p(!0)),o&&o?.()},children:s})]})})}),(0,t.jsxs)("div",{ref:m,style:l?{marginBottom:`-${w}px`,marginTop:`-${D}px`}:{},className:"relative",children:[(0,t.jsx)("div",{className:"sticky top-0 ",children:(0,t.jsx)("div",{className:(0,c.cn)("relative overflow-hidden",l?"h-screen w-screen":x,n,{"aiui-dark":B==="dark","rounded-box":$==="rounded"}),children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{ref:V,className:"media-cover left-0 top-0 h-screen w-screen",children:[(0,t.jsx)("video",{ref:a,className:"size-full object-cover",src:z?.url,muted:!0,loop:!0,playsInline:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),(0,t.jsx)("div",{className:"absolute left-0 top-0 z-10 size-full"})]})})})}),(0,t.jsx)("div",{className:(0,c.cn)(l&&"relative box-content block",x),style:l?{height:`${w}px`}:{}})]})]})});var X=(0,E.withStyles)(W);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.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'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 ({ className = '', onBtnClick, data: { title, videoTitle, btnText, img, video, theme, shape, ...rest } }, ref) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => boxRef.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 && !btnText) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n useEffect(() => {\n if (boxRef.current && sticky) {\n const rect = boxRef.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 }, [])\n\n // useGSAP(() => {\n // if (!bgRef.current) return\n // const height = boxRef.current?.clientHeight || 100\n // const screenHeight = bgRef.current?.clientHeight || 100\n // const base = screenHeight + height\n\n // ScrollTrigger.create({\n // trigger: boxRef.current,\n // start: 'top bottom',\n // end: 'bottom top',\n // scrub: true,\n // onUpdate: (self: any) => {\n // const value = self.progress * base - screenHeight\n // gsap.set(bgRef.current, { y: value })\n // },\n // })\n // return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n // }\n // }, [])\n\n return (\n <div\n ref={boxRef}\n style={sticky ? { marginBottom: `-${btb}px` } : {}}\n className={cn('relative', sticky && 'mt-[-100vh]')}\n >\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'relative overflow-hidden',\n sticky\n ? 'h-screen w-screen'\n : 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n }\n )}\n >\n <div>\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-20 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-5\"\n >\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {!isPlaying && btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-btn-primary-foreground')}\n onClick={() => {\n if (isPlaying) {\n if (videoRef.current) {\n videoRef.current.pause()\n }\n setIsPlaying(false)\n } else {\n if (videoRef.current) {\n videoRef.current.play()\n }\n setIsPlaying(true)\n }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n </div>\n <div>\n <div ref={bgRef} className=\"media-cover left-0 top-0 h-screen w-full\">\n <video\n ref={videoRef}\n className=\"size-full object-cover\"\n src={video?.url}\n muted\n loop\n playsInline\n webkit-playsinline\n x5-playsinline\n />\n {!isPlaying && img?.url && (\n <Picture\n className=\"z-1 absolute left-0 top-0 size-full object-cover\"\n source={img?.url}\n alt={img?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n )}\n <div className=\"absolute left-0 top-0 z-10 size-full\" />\n </div>\n </div>\n </div>\n </div>\n <div\n className={cn(\n sticky && 'relative box-content block',\n sticky &&\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}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I,IAAKc,EAAO,UAAU,2CACzB,oBAAC,SACC,IAAKF,EACL,UAAU,yBACV,IAAKV,GAAO,IACZ,MAAK,GACL,KAAI,GACJ,YAAW,GACX,qBAAkB,GAClB,iBAAc,GAChB,EACC,CAACM,GAAaP,GAAK,QAClB,OAAC,EAAAwB,QAAA,CACC,UAAU,mDACV,OAAQxB,GAAK,IACb,IAAKA,GAAK,IACV,aAAa,6BACf,KAEF,OAAC,OAAI,UAAU,uCAAuC,GACxD,EACF,GACF,EACF,KACA,OAAC,OACC,aAAW,MACTM,GAAU,6BACVA,GACE,+KACJ,EACA,MAAOA,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC5C,GACF,CAEJ,CACF,EAEA,IAAO7B,KAAQ,cAAWc,CAAe",
6
- "names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_picture", "import_button", "import_html", "import_react_intersection_observer", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "img", "video", "theme", "shape", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "videoRef", "boxRef", "bgRef", "inViewRef", "inView", "title_html", "videoTitle_html", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "Button", "Picture"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.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'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 ({ className = '', onBtnClick, data: { title, videoTitle, btnText, img, video, theme, shape, ...rest } }, ref) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => boxRef.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 && !btnText) {\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 (boxRef.current) {\n const rect = boxRef.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 // useGSAP(() => {\n // if (!bgRef.current) return\n // const height = boxRef.current?.clientHeight || 100\n // const screenHeight = bgRef.current?.clientHeight || 100\n // const base = screenHeight + height\n\n // ScrollTrigger.create({\n // trigger: boxRef.current,\n // start: 'top bottom',\n // end: 'bottom top',\n // scrub: true,\n // onUpdate: (self: any) => {\n // const value = self.progress * base - screenHeight\n // gsap.set(bgRef.current, { y: value })\n // },\n // })\n // return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n // }\n // }, [])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div ref={titleRef} className={cn('relative z-10 ', aspect)}>\n <div>\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4\"\n >\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {!isPlaying && btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-btn-primary-foreground')}\n onClick={() => {\n if (isPlaying) {\n if (videoRef.current) {\n videoRef.current.pause()\n }\n setIsPlaying(false)\n } else {\n if (videoRef.current) {\n videoRef.current.play()\n }\n setIsPlaying(true)\n }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n </div>\n </div>\n )}\n <div\n ref={boxRef}\n style={sticky ? { marginBottom: `-${btb}px`, marginTop: `-${titleHeight}px` } : {}}\n className=\"relative\"\n >\n <div className=\"sticky top-0 \">\n <div\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-screen' : aspect, className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div>\n <div ref={bgRef} className=\"media-cover left-0 top-0 h-screen w-screen\">\n <video\n ref={videoRef}\n className=\"size-full object-cover\"\n src={video?.url}\n muted\n loop\n playsInline\n webkit-playsinline\n x5-playsinline\n />\n <div className=\"absolute left-0 top-0 z-10 size-full\" />\n </div>\n </div>\n </div>\n </div>\n <div\n className={cn(sticky && 'relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n />\n </div>\n </>\n )\n }\n)\n\nexport default withStyles(MediaPlayerBase)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4GM,IAAAI,EAAA,6BA3GNC,EAAoF,iBACpFC,EAAyB,kBACzBC,EAAmB,kCACnBC,EAA2B,kCAC3BC,GAAoB,uCACpBC,EAAmB,yCACnBC,EAAqC,6CAGrCC,EAA0B,uCAG1B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,KAAkB,cACtB,CAAC,CAAE,UAAAC,EAAY,GAAI,WAAAC,EAAY,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,QAAAC,EAAS,IAAAC,GAAK,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAK,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OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC5C,GACF,GACF,CAEJ,CACF,EAEA,IAAO9B,KAAQ,cAAWe,CAAe",
6
+ "names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lodash", "import_utils", "import_Styles", "import_picture", "import_button", "import_html", "import_react_intersection_observer", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "img", "video", "theme", "shape", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoRef", "boxRef", "bgRef", "titleRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "aspect", "Button"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var D=Object.create;var c=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var X=(r,a)=>{for(var t in a)c(r,t,{get:a[t],enumerable:!0})},S=(r,a,t,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of K(a))!W.call(r,s)&&s!==t&&c(r,s,{get:()=>a[s],enumerable:!(i=J(a,s))||i.enumerable});return r};var n=(r,a,t)=>(t=r!=null?D(U(r)):{},S(a||!r||!r.__esModule?c(t,"default",{value:r,enumerable:!0}):t,r)),Z=r=>S(c({},"__esModule",{value:!0}),r);var ae={};X(ae,{default:()=>re});module.exports=Z(ae);var e=require("react/jsx-runtime"),o=n(require("react")),T=require("es-toolkit"),z=require("react-intersection-observer"),d=require("../../helpers/utils.js"),E=require("../../shared/Styles.js"),L=n(require("../Slogan/index.js")),l=require("../../components/gird.js"),$=require("../../components/container.js"),B=n(require("../BrandEquity/index.js")),Y=n(require("../MemberEquity/index.js")),q=n(require("../Spacer/index.js")),I=n(require("gsap")),v=require("@payloadcms/richtext-lexical/html"),g=require("react-responsive");const C=({defaultConverters:r})=>({...r,text:a=>{const{node:t}=a;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),y=({children:r,spaceY:a})=>{const t=(0,g.useMediaQuery)({query:"(max-width: 768px)"});return(0,e.jsx)($.Container,{spaceY:a,className:"!bg-transparent",children:(0,e.jsxs)(l.Grid,{children:[!t&&(0,e.jsx)(l.GridItem,{span:1}),(0,e.jsx)(l.GridItem,{span:t?12:10,children:r}),!t&&(0,e.jsx)(l.GridItem,{span:1})]})})},ee=o.default.forwardRef(({children:r,id:a,components:t})=>{const i=(0,o.useRef)(null);return(0,e.jsxs)("div",{ref:i,className:"relative z-10",children:[(0,e.jsx)(e.Fragment,{children:r}),(0,e.jsx)(e.Fragment,{children:t?.map(s=>{switch(s.blockType){case"ipc-brand-equity":return(0,e.jsx)("div",{className:"relative z-20 bg-transparent",children:(0,e.jsx)(y,{spaceY:"none",children:(0,e.jsx)(B.default,{data:s,style:s?.style})})});case"ipc-member-equity":return(0,e.jsx)("div",{className:"relative z-20 w-full bg-transparent",children:(0,e.jsx)(y,{spaceY:"none",children:(0,e.jsx)(Y.default,{data:s,className:"w-full",style:s?.style})})});case"ipc-spacer":return(0,e.jsx)(q.default,{data:s,style:s?.style,className:"!bg-transparent"});default:return null}})})]})}),te=(0,o.forwardRef)(({className:r="",id:a,data:{title:t,videoTitle:i,mobVideo:s,mobImg:b,img:w,video:h,theme:x,shape:G,components:F}})=>{const N=(0,o.useRef)(null),p=(0,o.useRef)(null),{ref:V,inView:m}=(0,z.useInView)(),[M,k]=(0,o.useState)(!1),j=typeof t=="string"?t:t&&(0,v.convertLexicalToHTML)({data:t,converters:C});typeof i=="string"||i&&(0,v.convertLexicalToHTML)({data:i,converters:C});const[O,Q]=(0,o.useState)(0),R=(0,g.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,T.debounce)(()=>{if(p.current){const f=p.current.getBoundingClientRect(),H=window.innerHeight,_=window.scrollY||window.pageYOffset,A=f.bottom+_,P=document.documentElement.scrollHeight-A;Q(P>H?H:P)}},600);return(0,o.useEffect)(()=>{m&&!M?(N.current?.play(),k(!0)):m||k(!1)},[m,M]),(0,o.useEffect)(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[]),(0,o.useEffect)(()=>{const f=window.screen.height;I.default.timeline({scrollTrigger:{trigger:`#${a}`,start:"top top",end:`top+=${f*1.8}px bottom`,scrub:0}}).to(`.${a} .sticky-cover`,{opacity:1,duration:.3}).to(`#${a} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")},[]),console.log("img11",w?.url),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:a,className:(0,d.cn)("relative z-20 h-screen w-full",r,{"aiui-dark":x==="dark","rounded-box":G==="rounded"}),children:(0,e.jsx)("div",{ref:V,className:"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2",children:(0,e.jsx)(y,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:(0,e.jsx)(L.default,{className:"sticky-title",data:{title:j||"",theme:x}})})})}),(0,e.jsxs)("div",{ref:p,style:{marginBottom:`-${O}px`},className:(0,d.cn)(a,"relative mt-[-200vh]"),children:[(0,e.jsx)("div",{className:"sticky top-0 ",children:(0,e.jsxs)("div",{className:(0,d.cn)("media-cover","relative h-screen w-full","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),children:[h?.url&&(0,e.jsx)("video",{ref:N,className:"size-full object-cover object-right",poster:R&&b?.url?b?.url:w?.url,src:R&&s?.url?s?.url:h?.url,muted:!0,playsInline:!0}),(0,e.jsx)("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)"}})]})}),(0,e.jsx)("div",{className:"relative h-screen w-full"}),(0,e.jsx)(ee,{components:F}),(0,e.jsx)("div",{className:"relative h-screen w-full"})]})]})});var re=(0,E.withStyles)(te);
1
+ "use strict";"use client";var K=Object.create;var c=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var ee=(r,s)=>{for(var t in s)c(r,t,{get:s[t],enumerable:!0})},P=(r,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of W(s))!Z.call(r,a)&&a!==t&&c(r,a,{get:()=>s[a],enumerable:!(n=U(s,a))||n.enumerable});return r};var i=(r,s,t)=>(t=r!=null?K(X(r)):{},P(s||!r||!r.__esModule?c(t,"default",{value:r,enumerable:!0}):t,r)),te=r=>P(c({},"__esModule",{value:!0}),r);var oe={};ee(oe,{default:()=>ae});module.exports=te(oe);var e=require("react/jsx-runtime"),o=i(require("react")),z=require("es-toolkit"),C=require("react-intersection-observer"),d=require("../../helpers/utils.js"),T=require("../../shared/Styles.js"),L=i(require("../Slogan/index.js")),l=require("../../components/gird.js"),$=require("../../components/container.js"),B=i(require("../BrandEquity/index.js")),Y=i(require("../MemberEquity/index.js")),q=i(require("../Spacer/index.js")),I=i(require("gsap")),v=require("@payloadcms/richtext-lexical/html"),b=require("react-responsive");const S=({defaultConverters:r})=>({...r,text:s=>{const{node:t}=s;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),y=({children:r,spaceY:s})=>{const t=(0,b.useMediaQuery)({query:"(max-width: 768px)"});return(0,e.jsx)($.Container,{spaceY:s,className:"!bg-transparent",children:(0,e.jsxs)(l.Grid,{children:[!t&&(0,e.jsx)(l.GridItem,{span:1}),(0,e.jsx)(l.GridItem,{span:t?12:10,children:r}),!t&&(0,e.jsx)(l.GridItem,{span:1})]})})},re=o.default.forwardRef(({children:r,id:s,components:t})=>{const n=(0,o.useRef)(null);return(0,e.jsxs)("div",{ref:n,className:"relative z-10",children:[(0,e.jsx)(e.Fragment,{children:r}),(0,e.jsx)(e.Fragment,{children:t?.map(a=>{switch(a.blockType){case"ipc-brand-equity":return(0,e.jsx)("div",{className:"relative z-20 bg-transparent",children:(0,e.jsx)(y,{spaceY:"none",children:(0,e.jsx)(B.default,{data:a,style:a?.style})})});case"ipc-member-equity":return(0,e.jsx)("div",{className:"relative z-20 w-full bg-transparent",children:(0,e.jsx)(y,{spaceY:"none",children:(0,e.jsx)(Y.default,{data:a,className:"w-full",style:a?.style})})});case"ipc-spacer":return(0,e.jsx)(q.default,{data:a,style:a?.style,className:"!bg-transparent"});default:return null}})})]})}),se=(0,o.forwardRef)(({className:r="",id:s,data:{title:t,videoTitle:n,mobVideo:a,mobImg:g,img:p,video:w,theme:h,shape:j,components:G}})=>{const x=(0,o.useRef)(null),m=(0,o.useRef)(null),{ref:F,inView:N}=(0,C.useInView)(),[M,V]=(0,o.useState)(!1),[O,Q]=(0,o.useState)(!1),_=typeof t=="string"?t:t&&(0,v.convertLexicalToHTML)({data:t,converters:S});typeof n=="string"||n&&(0,v.convertLexicalToHTML)({data:n,converters:S});const[k,A]=(0,o.useState)(0),R=(0,b.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,z.debounce)(()=>{if(m.current){const f=m.current.getBoundingClientRect(),H=window.innerHeight,D=window.scrollY||window.pageYOffset,J=f.bottom+D,E=document.documentElement.scrollHeight-J;A(E>H?H:E)}},600);return(0,o.useEffect)(()=>{N&&!M&&(x.current?.play(),V(!0))},[N,M]),(0,o.useEffect)(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[]),(0,o.useEffect)(()=>{const f=window.screen.height;I.default.timeline({scrollTrigger:{trigger:`#${s}`,start:"top top",end:`top+=${f*1.8}px bottom`,scrub:0}}).to(`.${s} .sticky-cover`,{opacity:1,duration:.4}).to(`#${s} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")},[k]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:s,className:(0,d.cn)("relative z-20 h-screen w-full",r,{"aiui-dark":h==="dark","rounded-box":j==="rounded"}),children:(0,e.jsx)("div",{ref:F,className:"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2",children:(0,e.jsx)(y,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:(0,e.jsx)(L.default,{className:"sticky-title",data:{title:_||"",theme:h}})})})}),(0,e.jsxs)("div",{ref:m,style:{marginBottom:`-${k}px`},className:(0,d.cn)(s,"relative mt-[-200vh]"),children:[(0,e.jsx)("div",{className:"sticky top-0 ",children:(0,e.jsxs)("div",{className:(0,d.cn)("media-cover","relative h-screen w-full","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),children:[w?.url&&(0,e.jsx)("video",{ref:x,className:"size-full object-cover object-[82%]",src:R&&a?.url?a?.url:w?.url,muted:!0,playsInline:!0,onEnded:()=>{Q(!0)}}),p?.url&&O&&(0,e.jsx)("img",{src:R&&g?.url?g?.url:p?.url,alt:p?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]"}),(0,e.jsx)("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)"}})]})}),(0,e.jsx)("div",{className:"relative h-screen w-full"}),(0,e.jsx)(re,{components:G}),(0,e.jsx)("div",{className:"relative h-screen w-full"})]})]})});var ae=(0,T.withStyles)(se);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerSticky/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\n// import ScrollTrigger from 'gsap/ScrollTrigger'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({ children, spaceY }: { children: React.ReactNode; spaceY?: string }) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className=\"!bg-transparent\">\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(({ className = '', id, data: { title, videoTitle, mobVideo, mobImg, img, video, theme, shape, components } }) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [isPlaying, setIsPlaying] = useState(false)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.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 }, 600)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else if (!inView) {\n setIsPlaying(false)\n }\n }, [inView, isPlaying])\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n const height = window.screen.height\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0,\n },\n })\n .to(`.${id} .sticky-cover`, {\n opacity: 1,\n duration: 0.3,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }, [])\n\n console.log('img11', img?.url)\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2\"\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div ref={boxRef} style={{ marginBottom: `-${btb}px` }} className={cn(id, 'relative mt-[-200vh]')}>\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'media-cover',\n 'relative h-screen w-full',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}\n >\n {video?.url && (\n <video\n ref={videoRef}\n className=\"size-full object-cover object-right\"\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n muted\n playsInline\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n})\n\nexport default withStyles(MediaPlayerSticky)\n"],
5
- "mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAsCM,IAAAI,EAAA,6BArCNC,EAAoF,oBACpFC,EAAyB,sBACzBC,EAA0B,uCAC1BC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAmB,iCACnBC,EAA+B,oCAC/BC,EAA0B,yCAC1BC,EAAwB,sCACxBC,EAAyB,uCACzBC,EAAmB,iCACnBC,EAAiB,mBAEjBC,EAAqC,6CAIrCC,EAA8B,4BAG9B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAe,CAAC,CAAE,SAAAC,EAAU,OAAAC,CAAO,IAAsD,CAC7F,MAAMC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAC9D,SACE,OAAC,aAAU,OAAQD,EAAQ,UAAU,kBACnC,oBAAC,QACE,WAACC,MAAY,OAAC,YAAS,KAAM,EAAG,KACjC,OAAC,YAAS,KAAMA,EAAW,GAAK,GAAK,SAAAF,EAAS,EAC7C,CAACE,MAAY,OAAC,YAAS,KAAM,EAAG,GACnC,EACF,CAEJ,EAEMC,GAAS,EAAAC,QAAM,WASnB,CAAC,CAAE,SAAAJ,EAAU,GAAAK,EAAI,WAAAC,CAAW,IAAM,CAClC,MAAMC,KAAuB,UAAuB,IAAI,EAExD,SACE,QAAC,OAAI,IAAKA,EAAsB,UAAU,gBACxC,gCAA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,MAAO,CAAE,aAAc,IAAIM,CAAG,IAAK,EAAG,aAAW,MAAGxB,EAAI,sBAAsB,EAC9F,oBAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,MACT,cACA,2BACA,oNACF,EAEC,UAAAc,GAAO,QACN,OAAC,SACC,IAAKG,EACL,UAAU,sCACV,OAAQpB,GAAYe,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IACrD,IAAKhB,GAAYc,GAAU,IAAMA,GAAU,IAAMG,GAAO,IACxD,MAAK,GACL,YAAW,GACb,KAEF,OAAC,OACC,UAAU,8DACV,MAAO,CACL,WAAY,+DACd,EACF,GACF,EACF,KAEA,OAAC,OAAI,UAAU,2BAA2B,KAC1C,OAAChB,GAAA,CAAO,WAAYG,EAAY,KAChC,OAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CAAC,EAED,IAAO5B,MAAQ,cAAWkC,EAAiB",
6
- "names": ["MediaPlayerSticky_exports", "__export", "MediaPlayerSticky_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_es_toolkit", "import_react_intersection_observer", "import_utils", "import_Styles", "import_Slogan", "import_gird", "import_container", "import_BrandEquity", "import_MemberEquity", "import_Spacer", "import_gsap", "import_html", "import_react_responsive", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "isMobile", "SubBox", "React", "id", "components", "mediaPlayerStickyRef", "componentData", "BrandEquity", "MemberEquity", "Spacer", "MediaPlayerSticky", "className", "title", "videoTitle", "mobVideo", "mobImg", "img", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "isPlaying", "setIsPlaying", "title_html", "btb", "setbtb", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "height", "gsap", "Slogan"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\n// import ScrollTrigger from 'gsap/ScrollTrigger'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({ children, spaceY }: { children: React.ReactNode; spaceY?: string }) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className=\"!bg-transparent\">\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(({ className = '', id, data: { title, videoTitle, mobVideo, mobImg, img, video, theme, shape, components } }) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.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 }, 600)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n const height = window.screen.height\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0,\n },\n })\n .to(`.${id} .sticky-cover`, {\n opacity: 1,\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }, [btb])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2\"\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div ref={boxRef} style={{ marginBottom: `-${btb}px` }} className={cn(id, 'relative mt-[-200vh]')}>\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'media-cover',\n 'relative h-screen w-full',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}\n >\n {video?.url && (\n <video\n ref={videoRef}\n className=\"size-full object-cover object-[82%]\"\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n muted\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )}\n {img?.url && isEntered && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n})\n\nexport default withStyles(MediaPlayerSticky)\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAsCM,IAAAI,EAAA,6BArCNC,EAAoF,oBACpFC,EAAyB,sBACzBC,EAA0B,uCAC1BC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAmB,iCACnBC,EAA+B,oCAC/BC,EAA0B,yCAC1BC,EAAwB,sCACxBC,EAAyB,uCACzBC,EAAmB,iCACnBC,EAAiB,mBAEjBC,EAAqC,6CAIrCC,EAA8B,4BAG9B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAe,CAAC,CAAE,SAAAC,EAAU,OAAAC,CAAO,IAAsD,CAC7F,MAAMC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAC9D,SACE,OAAC,aAAU,OAAQD,EAAQ,UAAU,kBACnC,oBAAC,QACE,WAACC,MAAY,OAAC,YAAS,KAAM,EAAG,KACjC,OAAC,YAAS,KAAMA,EAAW,GAAK,GAAK,SAAAF,EAAS,EAC7C,CAACE,MAAY,OAAC,YAAS,KAAM,EAAG,GACnC,EACF,CAEJ,EAEMC,GAAS,EAAAC,QAAM,WASnB,CAAC,CAAE,SAAAJ,EAAU,GAAAK,EAAI,WAAAC,CAAW,IAAM,CAClC,MAAMC,KAAuB,UAAuB,IAAI,EAExD,SACE,QAAC,OAAI,IAAKA,EAAsB,UAAU,gBACxC,gCAAG,SAAAP,EAAS,KACZ,mBAC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AAK,EAAG,aAAW,MAAG1B,EAAI,sBAAsB,EAC9F,oBAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,MACT,cACA,2BACA,oNACF,EAEC,UAAAc,GAAO,QACN,OAAC,SACC,IAAKG,EACL,UAAU,sCACV,IAAKpB,GAAYc,GAAU,IAAMA,GAAU,IAAMG,GAAO,IACxD,MAAK,GACL,YAAW,GACX,QAAS,IAAM,CACbU,EAAa,EAAI,CACnB,EACF,EAEDX,GAAK,KAAOU,MACX,OAAC,OACC,IAAK1B,GAAYe,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IAClD,IAAKA,GAAK,IACV,UAAU,iEACZ,KAEF,OAAC,OACC,UAAU,8DACV,MAAO,CACL,WAAY,+DACd,EACF,GACF,EACF,KAEA,OAAC,OAAI,UAAU,2BAA2B,KAC1C,OAACf,GAAA,CAAO,WAAYG,EAAY,KAChC,OAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CAAC,EAED,IAAO5B,MAAQ,cAAWkC,EAAiB",
6
+ "names": ["MediaPlayerSticky_exports", "__export", "MediaPlayerSticky_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_es_toolkit", "import_react_intersection_observer", "import_utils", "import_Styles", "import_Slogan", "import_gird", "import_container", "import_BrandEquity", "import_MemberEquity", "import_Spacer", "import_gsap", "import_html", "import_react_responsive", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "isMobile", "SubBox", "React", "id", "components", "mediaPlayerStickyRef", "componentData", "BrandEquity", "MemberEquity", "Spacer", "MediaPlayerSticky", "className", "title", "videoTitle", "mobVideo", "mobImg", "img", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "title_html", "btb", "setbtb", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "height", "gsap", "Slogan"]
7
7
  }
@@ -1,5 +1,5 @@
1
- "use strict";"use client";var _=Object.create;var d=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var I=(t,o)=>{for(var a in o)d(t,a,{get:o[a],enumerable:!0})},k=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of C(o))!D.call(t,l)&&l!==a&&d(t,l,{get:()=>o[l],enumerable:!(s=j(o,l))||s.enumerable});return t};var S=(t,o,a)=>(a=t!=null?_(R(t)):{},k(o||!t||!t.__esModule?d(a,"default",{value:t,enumerable:!0}):a,t)),$=t=>k(d({},"__esModule",{value:!0}),t);var F={};I(F,{default:()=>L});module.exports=$(F);var e=require("react/jsx-runtime"),i=S(require("react")),p=require("../../components/index.js"),h=require("../../shared/Styles.js"),u=require("../../helpers/utils.js"),g=require("../../shared/mimeType.js"),N=require("../../hooks/useExposure.js"),B=require("../AiuiProvider/index.js"),y=require("../../shared/trackUrlRef.js");const f="image",b="member_area",A=i.default.forwardRef(({data:t,className:o=""},a)=>{const{title:s,description:l,backgroundImage:r,mobileBackgroundImage:m,primaryButton:n,secondaryButton:c,theme:q,shape:E,primaryButtonHandler:w,secondaryButtonHandler:M}=t,x=(0,i.useRef)(null);(0,i.useImperativeHandle)(a,()=>x.current);const{trackingData:T}=(0,B.useAiuiContext)(),{profileActivated:z}=T;(0,N.useExposure)(x,{componentType:f,componentName:b,componentTitle:s,componentDescription:l,memberActiveStatus:z?"active":"not active"});const H=()=>{w?.()},P=()=>{M?.()},v="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("section",{"data-ui-component-id":"MemberEquity",className:(0,u.cn)("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative h-[480px] overflow-hidden",o,{"aiui-dark":q==="dark","rounded-box":E==="rounded"}),ref:x,children:[(0,g.isVideo)(r?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:(0,e.jsx)("source",{src:r?.url,type:"video/mp4"})}):(0,e.jsx)(p.Picture,{source:r?.url,alt:r?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,g.isVideo)(m?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:(0,e.jsx)("source",{src:m?.url,type:"video/mp4"})}):(0,e.jsx)(p.Picture,{source:m?.url,alt:m?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,e.jsx)("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:(0,e.jsxs)("div",{className:`
1
+ "use strict";"use client";var C=Object.create;var d=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var $=(t,o)=>{for(var a in o)d(t,a,{get:o[a],enumerable:!0})},k=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of D(o))!S.call(t,i)&&i!==a&&d(t,i,{get:()=>o[i],enumerable:!(s=R(o,i))||s.enumerable});return t};var A=(t,o,a)=>(a=t!=null?C(I(t)):{},k(o||!t||!t.__esModule?d(a,"default",{value:t,enumerable:!0}):a,t)),L=t=>k(d({},"__esModule",{value:!0}),t);var U={};$(U,{default:()=>Q});module.exports=L(U);var e=require("react/jsx-runtime"),l=A(require("react")),h=require("react-responsive"),p=require("../../components/index.js"),N=require("../../shared/Styles.js"),u=require("../../helpers/utils.js"),y=require("../../shared/mimeType.js"),B=require("../../hooks/useExposure.js"),q=require("../AiuiProvider/index.js"),g=require("../../shared/trackUrlRef.js");const f="image",b="member_area",F=l.default.forwardRef(({data:t,className:o=""},a)=>{const{title:s,description:i,backgroundImage:r,mobileBackgroundImage:m,primaryButton:n,secondaryButton:c,theme:M,shape:w,primaryButtonHandler:E,secondaryButtonHandler:T}=t,z=(0,h.useMediaQuery)({query:"(max-width: 768px)"}),x=(0,l.useRef)(null);(0,l.useImperativeHandle)(a,()=>x.current);const{trackingData:H}=(0,q.useAiuiContext)(),{profileActivated:P}=H;(0,B.useExposure)(x,{componentType:f,componentName:b,componentTitle:s,componentDescription:i,memberActiveStatus:P?"active":"not active"});const _=()=>{E?.()},j=()=>{T?.()},v="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("section",{"data-ui-component-id":"MemberEquity",className:(0,u.cn)("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",o,{"aiui-dark":M==="dark","rounded-box":w==="rounded","h-[480px]":z}),ref:x,children:[(0,y.isVideo)(r?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:(0,e.jsx)("source",{src:r?.url,type:"video/mp4"})}):(0,e.jsx)(p.Picture,{source:r?.url,alt:r?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,y.isVideo)(m?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:(0,e.jsx)("source",{src:m?.url,type:"video/mp4"})}):(0,e.jsx)(p.Picture,{source:m?.url,alt:m?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,e.jsx)("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:(0,e.jsxs)("div",{className:`
2
2
  tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5
3
3
  laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4
4
- `,children:[(0,e.jsxs)("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[(0,e.jsx)(p.Heading,{as:"h2",size:3,className:"member-equity-title ",html:s}),(0,e.jsx)(p.Text,{size:2,className:"member-equity-description",html:l})]}),(0,e.jsxs)("div",{className:"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3",children:[c&&c.text&&(0,e.jsx)("a",{href:(0,y.trackUrlRef)(c.link,`${f}_${b}`),children:(0,e.jsx)(p.Button,{variant:"secondary",onClick:P,className:(0,u.cn)("member-equity-button-secondary ",v),children:c.text})}),n&&n.text&&(0,e.jsx)("a",{href:(0,y.trackUrlRef)(n.link,`${f}_${b}`),children:(0,e.jsx)(p.Button,{variant:"primary",onClick:H,className:(0,u.cn)("member-equity-button-primary ",v),children:n.text})})]})]})})]})});var L=(0,h.withStyles)(A);
4
+ `,children:[(0,e.jsxs)("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[(0,e.jsx)(p.Heading,{as:"h2",size:3,className:"member-equity-title ",html:s}),(0,e.jsx)(p.Text,{size:2,className:"member-equity-description",html:i})]}),(0,e.jsxs)("div",{className:"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3",children:[c&&c.text&&(0,e.jsx)("a",{href:(0,g.trackUrlRef)(c.link,`${f}_${b}`),children:(0,e.jsx)(p.Button,{variant:"secondary",onClick:j,className:(0,u.cn)("member-equity-button-secondary ",v),children:c.text})}),n&&n.text&&(0,e.jsx)("a",{href:(0,g.trackUrlRef)(n.link,`${f}_${b}`),children:(0,e.jsx)(p.Button,{variant:"primary",onClick:_,className:(0,u.cn)("member-equity-button-primary ",v),children:n.text})})]})]})})]})});var Q=(0,N.withStyles)(F);
5
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MemberEquity/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MemberEquityProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'member_area'\n\nconst MemberEquity: React.FC<MemberEquityProps> = React.forwardRef<HTMLDivElement, MemberEquityProps>(\n ({ data, className = '' }, ref) => {\n const {\n title,\n description,\n backgroundImage,\n mobileBackgroundImage,\n primaryButton,\n secondaryButton,\n theme,\n shape,\n primaryButtonHandler,\n secondaryButtonHandler,\n } = data\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: description,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n const handleButtonPrimaryClick = () => {\n // \u6267\u884C\u4E3B\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n primaryButtonHandler?.()\n }\n\n const handleButtonSecondaryClick = () => {\n // \u6267\u884C\u526F\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n secondaryButtonHandler?.()\n }\n\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <section\n data-ui-component-id=\"MemberEquity\"\n className={cn(\n 'lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]',\n 'text-info-primary relative h-[480px] overflow-hidden',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n }\n )}\n ref={innerRef}\n >\n {isVideo(backgroundImage?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"laptop:block absolute inset-0 hidden size-full object-cover\"\n >\n <source src={backgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={backgroundImage?.url}\n alt={backgroundImage?.alt}\n className=\"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n {isVideo(mobileBackgroundImage?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"laptop:hidden absolute inset-0 size-full object-cover\">\n <source src={mobileBackgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={mobileBackgroundImage?.url}\n alt={mobileBackgroundImage?.alt}\n className=\"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n <div className={'laptop:items-center absolute inset-0 flex w-full items-end py-[16px]'}>\n <div\n className={`\n tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5 \n laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4\n `}\n >\n <div className=\"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col\">\n <Heading as=\"h2\" size={3} className={`member-equity-title `} html={title} />\n <Text size={2} className={`member-equity-description`} html={description} />\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3\">\n {secondaryButton && secondaryButton.text && (\n <a href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"secondary\"\n onClick={handleButtonSecondaryClick}\n className={cn('member-equity-button-secondary ', lgButtonSize)}\n >\n {secondaryButton.text}\n </Button>\n </a>\n )}\n {primaryButton && primaryButton.text && (\n <a href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"primary\"\n onClick={handleButtonPrimaryClick}\n className={cn('member-equity-button-primary ', lgButtonSize)}\n >\n {primaryButton.text}\n </Button>\n </a>\n )}\n </div>\n </div>\n </div>\n </section>\n )\n }\n)\n\nexport default withStyles(MemberEquity)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8EY,IAAAI,EAAA,6BA7EZC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAA2B,kCAE3BC,EAAmB,kCACnBC,EAAwB,oCACxBC,EAA4B,sCAC5BC,EAA+B,oCAC/BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,cAEhBC,EAA4C,EAAAC,QAAM,WACtD,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,EAAGC,IAAQ,CACjC,KAAM,CACJ,MAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,MAAAC,EACA,qBAAAC,EACA,uBAAAC,CACF,EAAIZ,EAEEa,KAAW,UAAuB,IAAI,KAE5C,uBAAoBX,EAAK,IAAMW,EAAS,OAAyB,EAEjE,KAAM,CAAE,aAAAC,CAAa,KAAI,kBAAe,EAClC,CAAE,iBAAAC,CAAiB,EAAID,KAE7B,eAAYD,EAAU,CACpB,cAAAjB,EACA,cAAAC,EACA,eAAgBM,EAChB,qBAAsBC,EACtB,mBAAoBW,EAAmB,SAAW,YACpD,CAAC,EAED,MAAMC,EAA2B,IAAM,CAErCL,IAAuB,CACzB,EAEMM,EAA6B,IAAM,CAEvCL,IAAyB,CAC3B,EAEMM,EAAe,mFAErB,SACE,QAAC,WACC,uB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F,GAEJ,GACF,EACF,GACF,CAEJ,CACF,EAEA,IAAOtB,KAAQ,cAAWa,CAAY",
6
- "names": ["MemberEquity_exports", "__export", "MemberEquity_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Styles", "import_utils", "import_mimeType", "import_useExposure", "import_AiuiProvider", "import_trackUrlRef", "componentType", "componentName", "MemberEquity", "React", "data", "className", "ref", "title", "description", "backgroundImage", "mobileBackgroundImage", "primaryButton", "secondaryButton", "theme", "shape", "primaryButtonHandler", "secondaryButtonHandler", "innerRef", "trackingData", "profileActivated", "handleButtonPrimaryClick", "handleButtonSecondaryClick", "lgButtonSize"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MemberEquityProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'member_area'\n\nconst MemberEquity: React.FC<MemberEquityProps> = React.forwardRef<HTMLDivElement, MemberEquityProps>(\n ({ data, className = '' }, ref) => {\n const {\n title,\n description,\n backgroundImage,\n mobileBackgroundImage,\n primaryButton,\n secondaryButton,\n theme,\n shape,\n primaryButtonHandler,\n secondaryButtonHandler,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: description,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n const handleButtonPrimaryClick = () => {\n // \u6267\u884C\u4E3B\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n primaryButtonHandler?.()\n }\n\n const handleButtonSecondaryClick = () => {\n // \u6267\u884C\u526F\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n secondaryButtonHandler?.()\n }\n\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <section\n data-ui-component-id=\"MemberEquity\"\n className={cn(\n 'lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]',\n 'text-info-primary relative overflow-hidden',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n 'h-[480px]': isMobile,\n }\n )}\n ref={innerRef}\n >\n {isVideo(backgroundImage?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"laptop:block absolute inset-0 hidden size-full object-cover\"\n >\n <source src={backgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={backgroundImage?.url}\n alt={backgroundImage?.alt}\n className=\"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n {isVideo(mobileBackgroundImage?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"laptop:hidden absolute inset-0 size-full object-cover\">\n <source src={mobileBackgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={mobileBackgroundImage?.url}\n alt={mobileBackgroundImage?.alt}\n className=\"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n <div className={'laptop:items-center absolute inset-0 flex w-full items-end py-[16px]'}>\n <div\n className={`\n tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5 \n laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4\n `}\n >\n <div className=\"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col\">\n <Heading as=\"h2\" size={3} className={`member-equity-title `} html={title} />\n <Text size={2} className={`member-equity-description`} html={description} />\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3\">\n {secondaryButton && secondaryButton.text && (\n <a href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"secondary\"\n onClick={handleButtonSecondaryClick}\n className={cn('member-equity-button-secondary ', lgButtonSize)}\n >\n {secondaryButton.text}\n </Button>\n </a>\n )}\n {primaryButton && primaryButton.text && (\n <a href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"primary\"\n onClick={handleButtonPrimaryClick}\n className={cn('member-equity-button-primary ', lgButtonSize)}\n >\n {primaryButton.text}\n </Button>\n </a>\n )}\n </div>\n </div>\n </div>\n </section>\n )\n }\n)\n\nexport default withStyles(MemberEquity)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiFY,IAAAI,EAAA,6BAhFZC,EAAmD,oBACnDC,EAA8B,4BAC9BC,EAA+C,qCAC/CC,EAA2B,kCAE3BC,EAAmB,kCACnBC,EAAwB,oCACxBC,EAA4B,sCAC5BC,EAA+B,oCAC/BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,cAEhBC,EAA4C,EAAAC,QAAM,WACtD,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,EAAGC,IAAQ,CACjC,KAAM,CACJ,MAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,MAAAC,EACA,qBAAAC,EACA,uBAAAC,CACF,EAAIZ,EAEEa,KAAW,iBAAc,CAAE,M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C,OAAI,UAAU,mFACZ,UAAAI,GAAmBA,EAAgB,SAClC,OAAC,KAAE,QAAM,eAAYA,EAAgB,KAAM,GAAGZ,CAAa,IAAIC,CAAa,EAAE,EAC5E,mBAAC,UACC,QAAQ,YACR,QAASqB,EACT,aAAW,MAAG,kCAAmCC,CAAY,EAE5D,SAAAX,EAAgB,KACnB,EACF,EAEDD,GAAiBA,EAAc,SAC9B,OAAC,KAAE,QAAM,eAAYA,EAAc,KAAM,GAAGX,CAAa,IAAIC,CAAa,EAAE,EAC1E,mBAAC,UACC,QAAQ,UACR,QAASoB,EACT,aAAW,MAAG,gCAAiCE,CAAY,EAE1D,SAAAZ,EAAc,KACjB,EACF,GAEJ,GACF,EACF,GACF,CAEJ,CACF,EAEA,IAAOvB,KAAQ,cAAWc,CAAY",
6
+ "names": ["MemberEquity_exports", "__export", "MemberEquity_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_responsive", "import_components", "import_Styles", "import_utils", "import_mimeType", "import_useExposure", "import_AiuiProvider", "import_trackUrlRef", "componentType", "componentName", "MemberEquity", "React", "data", "className", "ref", "title", "description", "backgroundImage", "mobileBackgroundImage", "primaryButton", "secondaryButton", "theme", "shape", "primaryButtonHandler", "secondaryButtonHandler", "isMobile", "innerRef", "trackingData", "profileActivated", "handleButtonPrimaryClick", "handleButtonSecondaryClick", "lgButtonSize"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Q=Object.create;var v=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var tt=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},$=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of W(e))!Z.call(t,n)&&n!==o&&v(t,n,{get:()=>e[n],enumerable:!(s=V(e,n))||s.enumerable});return t};var et=(t,e,o)=>(o=t!=null?Q(X(t)):{},$(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>$(v({},"__esModule",{value:!0}),t);var st={};tt(st,{componentName:()=>j,componentType:()=>z,default:()=>nt});module.exports=rt(st);var a=require("react/jsx-runtime"),r=et(require("react")),G=require("@gsap/react"),f=require("gsap"),N=require("gsap/dist/SplitText"),g=require("gsap/dist/ScrollTrigger"),p=require("../../helpers/utils.js"),b=require("../../components/index.js"),L=require("../../shared/Styles.js"),C=require("../../hooks/useExposure.js"),P=require("../AiuiProvider/index.js");const z="copy",j="brand_slogan";function ot(t=[],e=3){const o=[];for(let s=0;s<t.length;s+=e)o.push(t.slice(s,s+e));return o}const D=r.default.forwardRef(({data:t,className:e=""},o)=>{const{title:s,features:n=[],featureChunkSize:k=3}=t,[y,I]=r.default.useState(0),[F,w]=r.default.useState(!0),T=(0,r.useRef)(null),d=ot(n,k),E=d.length,u=n.length>k,U=u?[...d,d[0]]:d,S=40;(0,r.useImperativeHandle)(o,()=>T.current);const{trackingData:Y}=(0,P.useAiuiContext)(),{profileActivated:_}=Y;(0,C.useExposure)(T,{componentType:z,componentName:j,componentTitle:s,memberActiveStatus:_?"active":"not active"}),r.default.useEffect(()=>{if(!u)return;const l=setInterval(()=>{I(i=>i+1),w(!0)},3e3);return()=>clearInterval(l)},[E,u]),r.default.useEffect(()=>{if(u)if(y===E){const l=setTimeout(()=>{w(!1),I(0)},500);return()=>clearTimeout(l)}else w(!0)},[y,E,u]);const m=(0,r.useRef)(null),M=(0,r.useRef)(null),x=(0,r.useRef)(null);return(0,G.useGSAP)(()=>{if(f.gsap.registerPlugin(g.ScrollTrigger,N.SplitText),!m.current)return;x.current=new N.SplitText(m.current,{type:"words",wordsClass:"word"});const l=m.current?.clientHeight||100,i=x.current.words;return f.gsap.set(i,{opacity:0}),g.ScrollTrigger.create({trigger:m.current,start:"bottom bottom-=6%",end:`bottom+=${l*2+80}px bottom-=6%`,scrub:!0,onUpdate:c=>{const h=c.progress,R=i.length,q=1/R,A=.5;i.forEach((B,J)=>{const K=J/R*(1-A),O=q*(1+A);let H=(h-K)/O;H=Math.max(0,Math.min(H,1)),f.gsap.set(B,{opacity:H})})}}),n&&n.length>0&&g.ScrollTrigger.create({trigger:M.current,start:`bottom+=${l*2}px bottom-=6%`,end:`bottom+=${l*2+100}px bottom-=6%`,onUpdate:c=>{f.gsap.set(M.current,{opacity:c.progress})}}),()=>{x.current&&x.current.revert(),g.ScrollTrigger.getAll().forEach(c=>c.kill())}},[]),(0,a.jsxs)("div",{ref:T,className:(0,p.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,a.jsx)(b.Heading,{ref:m,as:"h2",size:2,weight:"bold",align:"left",className:(0,p.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:s}),n&&n.length>0&&(0,a.jsx)("div",{className:(0,p.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:(0,a.jsx)("div",{className:(0,p.cn)(["flex flex-col",F?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${y*S}px)`},children:U.map((l,i)=>(0,a.jsx)("div",{className:(0,p.cn)("flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:l.map((c,h)=>(0,a.jsxs)(r.default.Fragment,{children:[h>0&&(0,a.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,a.jsx)(b.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:c.title})]},h))},i))})})]})});D.displayName="Slogan";var nt=(0,L.withStyles)(D);
1
+ "use strict";"use client";var Q=Object.create;var v=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var tt=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},$=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of W(e))!Z.call(t,n)&&n!==o&&v(t,n,{get:()=>e[n],enumerable:!(s=V(e,n))||s.enumerable});return t};var et=(t,e,o)=>(o=t!=null?Q(X(t)):{},$(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>$(v({},"__esModule",{value:!0}),t);var st={};tt(st,{componentName:()=>j,componentType:()=>z,default:()=>nt});module.exports=rt(st);var a=require("react/jsx-runtime"),r=et(require("react")),G=require("@gsap/react"),f=require("gsap"),N=require("gsap/dist/SplitText"),g=require("gsap/dist/ScrollTrigger"),p=require("../../helpers/utils.js"),b=require("../../components/index.js"),L=require("../../shared/Styles.js"),C=require("../../hooks/useExposure.js"),P=require("../AiuiProvider/index.js");const z="copy",j="brand_slogan";function ot(t=[],e=3){const o=[];for(let s=0;s<t.length;s+=e)o.push(t.slice(s,s+e));return o}const D=r.default.forwardRef(({data:t,className:e=""},o)=>{const{title:s,features:n=[],featureChunkSize:k=3}=t,[y,I]=r.default.useState(0),[F,w]=r.default.useState(!0),T=(0,r.useRef)(null),d=ot(n,k),E=d.length,u=n.length>k,U=u?[...d,d[0]]:d,S=40;(0,r.useImperativeHandle)(o,()=>T.current);const{trackingData:Y}=(0,P.useAiuiContext)(),{profileActivated:_}=Y;(0,C.useExposure)(T,{componentType:z,componentName:j,componentTitle:s,memberActiveStatus:_?"active":"not active"}),r.default.useEffect(()=>{if(!u)return;const l=setInterval(()=>{I(i=>i+1),w(!0)},3e3);return()=>clearInterval(l)},[E,u]),r.default.useEffect(()=>{if(u)if(y===E){const l=setTimeout(()=>{w(!1),I(0)},500);return()=>clearTimeout(l)}else w(!0)},[y,E,u]);const m=(0,r.useRef)(null),M=(0,r.useRef)(null),x=(0,r.useRef)(null);return(0,G.useGSAP)(()=>{if(f.gsap.registerPlugin(g.ScrollTrigger,N.SplitText),!m.current)return;x.current=new N.SplitText(m.current,{type:"words",wordsClass:"word"});const l=m.current?.clientHeight||100,i=x.current.words;return f.gsap.set(i,{opacity:0}),g.ScrollTrigger.create({trigger:m.current,start:"bottom bottom-=4%",end:`bottom+=${l*1.5}px bottom-=4%`,scrub:!0,onUpdate:c=>{const h=c.progress,R=i.length,q=1/R,A=.5;i.forEach((B,J)=>{const K=J/R*(1-A),O=q*(1+A);let H=(h-K)/O;H=Math.max(0,Math.min(H,1)),f.gsap.set(B,{opacity:H})})}}),n&&n.length>0&&g.ScrollTrigger.create({trigger:M.current,start:`bottom+=${l*2}px bottom-=6%`,end:`bottom+=${l*2+100}px bottom-=6%`,onUpdate:c=>{f.gsap.set(M.current,{opacity:c.progress})}}),()=>{x.current&&x.current.revert(),g.ScrollTrigger.getAll().forEach(c=>c.kill())}},[]),(0,a.jsxs)("div",{ref:T,className:(0,p.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,a.jsx)(b.Heading,{ref:m,as:"h2",size:2,weight:"bold",align:"left",className:(0,p.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:s}),n&&n.length>0&&(0,a.jsx)("div",{className:(0,p.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:(0,a.jsx)("div",{className:(0,p.cn)(["flex flex-col",F?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${y*S}px)`},children:U.map((l,i)=>(0,a.jsx)("div",{className:(0,p.cn)("flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:l.map((c,h)=>(0,a.jsxs)(r.default.Fragment,{children:[h>0&&(0,a.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,a.jsx)(b.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:c.title})]},h))},i))})})]})});D.displayName="Slogan";var nt=(0,L.withStyles)(D);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Slogan/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=6%',\n end: `bottom+=${height * 2 + 80}px bottom-=6%`,\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 },\n })\n\n if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
- "mappings": "0kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,EAAA,kBAAAC,EAAA,YAAAC,KAAA,eAAAC,GAAAL,IAkIM,IAAAM,EAAA,6BAjINC,EAAmD,qBACnDA,EAAwB,uBACxBC,EAAq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S,GAChC,gBAAc,OAAO,CACnB,QAASiB,EAAY,QACrB,MAAO,WAAWE,EAAS,CAAC,gBAC5B,IAAK,WAAWA,EAAS,EAAI,GAAG,gBAChC,SAAWE,GAAc,CACvB,OAAK,IAAIJ,EAAY,QAAS,CAAE,QAASI,EAAK,QAAS,CAAC,CAC1D,CACF,CAAC,EAGI,IAAM,CACXH,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASY,GAAWA,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAAC,CAAC,KAGH,QAAC,OACC,IAAKxB,EACL,aAAW,MACT,2KACAT,CACF,EAEA,oBAAC,WACC,IAAKmB,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,aAAW,MACT,sGACF,EACA,KAAMjB,EACR,EACCC,GAAYA,EAAS,OAAS,MAC7B,OAAC,OAAI,aAAW,MAAG,gDAAiD,aAAaW,CAAW,KAAK,EAC/F,mBAAC,OACC,aAAW,MAAG,CACZ,gBACAP,EAAkB,mEAAqE,kBACzF,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,OACzB,OAAC,OACC,aAAW,MACT,2DACA,aAAarB,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAvC,QAAM,SAAN,CACE,UAAAuC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,mGACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDtC,EAAO,YAAc,SAErB,IAAOjB,MAAQ,cAAWiB,CAAM",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}px bottom-=4%`,\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 },\n })\n\n if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
+ "mappings": "0kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,EAAA,kBAAAC,EAAA,YAAAC,KAAA,eAAAC,GAAAL,IAkIM,IAAAM,EAAA,6BAjINC,EAAmD,qBACnDA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAA2B,kCAE3BC,EAA4B,sCAC5BC,EAA+B,oCAExB,MAAMZ,EAAgB,OAChBD,EAAgB,eAE7B,SAASc,GAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO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,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAAC,CAAC,KAGH,QAAC,OACC,IAAKxB,EACL,aAAW,MACT,2KACAT,CACF,EAEA,oBAAC,WACC,IAAKmB,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,aAAW,MACT,sGACF,EACA,KAAMjB,EACR,EACCC,GAAYA,EAAS,OAAS,MAC7B,OAAC,OAAI,aAAW,MAAG,gDAAiD,aAAaW,CAAW,KAAK,EAC/F,mBAAC,OACC,aAAW,MAAG,CACZ,gBACAP,EAAkB,mEAAqE,kBACzF,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,OACzB,OAAC,OACC,aAAW,MACT,2DACA,aAAarB,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAvC,QAAM,SAAN,CACE,UAAAuC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,mGACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDtC,EAAO,YAAc,SAErB,IAAOjB,MAAQ,cAAWiB,CAAM",
6
6
  "names": ["Slogan_exports", "__export", "componentName", "componentType", "Slogan_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_useExposure", "import_AiuiProvider", "chunkArray", "array", "size", "result", "i", "Slogan", "React", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "trackingData", "profileActivated", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "t", "group", "idx", "feature", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var A=Object.create;var l=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var D=(t,r)=>{for(var e in r)l(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of N(r))!C.call(t,o)&&o!==e&&l(t,o,{get:()=>r[o],enumerable:!(s=L(r,o))||s.enumerable});return t};var G=(t,r,e)=>(e=t!=null?A(z(t)):{},y(r||!t||!t.__esModule?l(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>y(l({},"__esModule",{value:!0}),t);var $={};D($,{default:()=>U});module.exports=I($);var d=require("react/jsx-runtime"),n=G(require("react")),b=require("@gsap/react"),a=require("gsap"),f=require("gsap/dist/SplitText"),c=require("gsap/dist/ScrollTrigger"),w=require("../../helpers/utils.js"),x=require("../../components/index.js"),v=require("../../shared/Styles.js");const T=n.default.forwardRef(({data:t,className:r})=>{const{title:e,theme:s}=t,o=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,b.useGSAP)(()=>{if(a.gsap.registerPlugin(f.SplitText,c.ScrollTrigger),!o.current)return;const H=o.current?.clientHeight||80;i.current=new f.SplitText(o.current,{type:"words",wordsClass:"word"});const m=i.current.words;return a.gsap.set(m,{opacity:0}),c.ScrollTrigger.create({trigger:o.current,start:"bottom bottom-=6%",end:`bottom+=${H*2+40}px bottom-=6%`,scrub:!0,onUpdate:p=>{const S=p.progress,g=m.length,k=1/g,h=.5;m.forEach((E,M)=>{const P=M/g*(1-h),R=k*(1+h);let u=(S-P)/R;u=Math.max(0,Math.min(u,1)),a.gsap.set(E,{opacity:u})})}}),()=>{i.current&&i.current.revert(),c.ScrollTrigger.getAll().forEach(p=>p.kill())}},[]),e&&(0,d.jsx)("div",{className:(0,w.cn)("tablet:mb-[32px] mb-[24px] space-y-4",r,{"aiui-dark":s==="dark"}),children:(0,d.jsx)(x.Heading,{ref:o,as:"h1",size:4,html:e})})});T.displayName="Title";var U=(0,v.withStyles)(T);
1
+ "use strict";"use client";var A=Object.create;var l=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var D=(t,r)=>{for(var e in r)l(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of N(r))!C.call(t,o)&&o!==e&&l(t,o,{get:()=>r[o],enumerable:!(s=L(r,o))||s.enumerable});return t};var G=(t,r,e)=>(e=t!=null?A(z(t)):{},y(r||!t||!t.__esModule?l(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>y(l({},"__esModule",{value:!0}),t);var $={};D($,{default:()=>U});module.exports=I($);var d=require("react/jsx-runtime"),n=G(require("react")),b=require("@gsap/react"),a=require("gsap"),f=require("gsap/dist/SplitText"),c=require("gsap/dist/ScrollTrigger"),w=require("../../helpers/utils.js"),x=require("../../components/index.js"),v=require("../../shared/Styles.js");const T=n.default.forwardRef(({data:t,className:r})=>{const{title:e,theme:s}=t,o=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,b.useGSAP)(()=>{if(a.gsap.registerPlugin(f.SplitText,c.ScrollTrigger),!o.current)return;const H=o.current?.clientHeight||80;i.current=new f.SplitText(o.current,{type:"words",wordsClass:"word"});const m=i.current.words;return a.gsap.set(m,{opacity:0}),c.ScrollTrigger.create({trigger:o.current,start:"bottom bottom-=4%",end:`bottom+=${H*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:p=>{const S=p.progress,g=m.length,k=1/g,h=.5;m.forEach((E,M)=>{const P=M/g*(1-h),R=k*(1+h);let u=(S-P)/R;u=Math.max(0,Math.min(u,1)),a.gsap.set(E,{opacity:u})})}}),()=>{i.current&&i.current.revert(),c.ScrollTrigger.getAll().forEach(p=>p.kill())}},[]),e&&(0,d.jsx)("div",{className:(0,w.cn)("tablet:mb-[32px] mb-[24px] space-y-4",r,{"aiui-dark":s==="dark"}),children:(0,d.jsx)(x.Heading,{ref:o,as:"h1",size:4,html:e})})});T.displayName="Title";var U=(0,v.withStyles)(T);
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, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\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 ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=6%',\n end: `bottom+=${height * 2 + 40}px bottom-=6%`,\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 },\n })\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [])\n\n return (\n title && (\n <div className={cn('tablet:mb-[32px] mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withStyles(Title)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqDQ,IAAAI,EAAA,6BApDRC,EAA8B,oBAC9BA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAG3B,MAAMC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACvD,oBAAQ,IAAM,CAEZ,GADA,OAAK,eAAe,YAAW,eAAa,EACxC,CAACD,EAAS,QAAS,OACvB,MAAME,EAASF,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMG,EAAQF,EAAkB,QAAQ,MACxC,cAAK,IAAIE,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9B,gBAAc,OAAO,CACnB,QAASH,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWE,EAAS,EAAI,EAAE,gBAC/B,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,EACM,IAAM,CACXZ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASa,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAAC,CAAC,EAGHhB,MACE,OAAC,OAAI,aAAW,MAAG,uCAAwCD,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACrG,mBAAC,WAAQ,IAAKC,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDJ,EAAM,YAAc,QAEpB,IAAOV,KAAQ,cAAWU,CAAK",
4
+ "sourcesContent": ["'use client'\nimport React, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\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 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 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 },\n })\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [])\n\n return (\n title && (\n <div className={cn('tablet:mb-[32px] mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withStyles(Title)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqDQ,IAAAI,EAAA,6BApDRC,EAA8B,oBAC9BA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAG3B,MAAMC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACvD,oBAAQ,IAAM,CAEZ,GADA,OAAK,eAAe,YAAW,eAAa,EACxC,CAACD,EAAS,QAAS,OACvB,MAAME,EAASF,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMG,EAAQF,EAAkB,QAAQ,MACxC,cAAK,IAAIE,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9B,gBAAc,OAAO,CACnB,QAASH,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWE,EAAS,IAAM,EAAE,gBACjC,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,EACM,IAAM,CACXZ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASa,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAAC,CAAC,EAGHhB,MACE,OAAC,OAAI,aAAW,MAAG,uCAAwCD,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACrG,mBAAC,WAAQ,IAAKC,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDJ,EAAM,YAAc,QAEpB,IAAOV,KAAQ,cAAWU,CAAK",
6
6
  "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "Title", "React", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "t"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var g=Object.create;var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var N=(e,o)=>{for(var t in o)c(e,t,{get:o[t],enumerable:!0})},d=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of S(o))!P.call(e,p)&&p!==t&&c(e,p,{get:()=>o[p],enumerable:!(n=u(o,p))||n.enumerable});return e};var T=(e,o,t)=>(t=e!=null?g(h(e)):{},d(o||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e)),w=e=>d(c({},"__esModule",{value:!0}),e);var Y={};N(Y,{Container:()=>m});module.exports=w(Y);var a=require("react/jsx-runtime"),r=T(require("react")),x=require("../helpers/utils.js"),f=require("@radix-ui/react-slot");const B=({children:e})=>(0,a.jsx)(a.Fragment,{children:e}),M=r.default.forwardRef(({...e},o)=>{const{asChild:t,children:n,className:p,spaceY:s="none",spaceTop:l="none",spaceBottom:i="none",...C}=e,y=t?f.Slot:"div",R={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},b={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},k={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return(0,a.jsx)(y,{...C,ref:o,className:(0,x.cn)(p,"ipc_container","relative z-10","desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",R?.[s]||s,b?.[l]||l,k?.[i]||i),children:n})}),m=r.default.forwardRef(({...e},o)=>{const{children:t,mode:n="section"}=e,s={section:M,fragment:B}[n];return(0,a.jsx)(s,{...e,ref:o,children:t})});m.displayName="Container";
1
+ "use strict";var u=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var P=(e,o)=>{for(var t in o)c(e,t,{get:o[t],enumerable:!0})},x=(e,o,t,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of S(o))!N.call(e,p)&&p!==t&&c(e,p,{get:()=>o[p],enumerable:!(a=g(o,p))||a.enumerable});return e};var v=(e,o,t)=>(t=e!=null?u(h(e)):{},x(o||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e)),w=e=>x(c({},"__esModule",{value:!0}),e);var M={};P(M,{Container:()=>l});module.exports=w(M);var n=require("react/jsx-runtime"),r=v(require("react")),m=require("../helpers/utils.js"),f=require("@radix-ui/react-slot");const T=({children:e})=>(0,n.jsx)(n.Fragment,{children:e}),B=r.default.forwardRef(({...e},o)=>{const{asChild:t,children:a,className:p,spaceY:s="none",spaceTop:i="none",spaceBottom:d="none",...C}=e,y=t?f.Slot:"div",R={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},b={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},k={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return(0,n.jsx)(y,{...C,ref:o,className:(0,m.cn)(p,"ipc_container","relative z-10 w-full"),children:(0,n.jsx)("div",{className:(0,m.cn)(p,"desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",R?.[s]||s,b?.[i]||i,k?.[d]||d),children:a})})}),l=r.default.forwardRef(({...e},o)=>{const{children:t,mode:a="section"}=e,s={section:B,fragment:T}[a];return(0,n.jsx)(s,{...e,ref:o,children:t})});l.displayName="Container";
2
2
  //# sourceMappingURL=container.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/container.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp\n {...containerProps}\n ref={forwardedRef}\n className={cn(\n className,\n 'ipc_container',\n 'relative z-10',\n 'desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full',\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4',\n spaceY_map?.[spaceY] || spaceY,\n spaceTop_map?.[spaceTop] || spaceTop,\n spaceBottom_map?.[spaceBottom] || spaceBottom\n )}\n >\n {children}\n </Comp>\n )\n})\n\nconst Container = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const { children, mode = 'section' } = props\n\n const componentsMap: {\n [P in Mode]: React.ComponentType<any> | string\n } = {\n section: Section,\n fragment: Fragment,\n }\n\n const Component = componentsMap![mode!]\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n )\n})\n\nContainer.displayName = 'Container'\n\nexport { Container }\nexport type { ContainerProps }\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GAiBS,IAAAI,EAAA,6BAjBTC,EAAkB,oBAClBC,EAAmB,+BACnBC,EAAqB,gCAcrB,MAAMC,EAAW,CAAC,CAAE,SAAAC,CAAS,OACpB,mBAAG,SAAAA,EAAS,EAGfC,EAAU,EAAAC,QAAM,WAA6C,CAAC,CAAE,GAAGC,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAL,EACA,UAAAM,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIP,EAEEQ,EAAON,EAAU,OAAO,MAExBO,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,SACE,OAACH,EAAA,CACE,GAAGD,EACJ,IAAKN,EACL,aAAW,MACTE,EACA,gBACA,gBACA,8DACA,8EACAM,IAAaL,CAAM,GAAKA,EACxBM,IAAeL,CAAQ,GAAKA,EAC5BM,IAAkBL,CAAW,GAAKA,CACpC,EAEC,SAAAT,EACH,CAEJ,CAAC,EAEKP,EAAY,EAAAS,QAAM,WAA6C,CAAC,CAAE,GAAGC,CAAM,EAAGC,IAAiB,CACnG,KAAM,CAAE,SAAAJ,EAAU,KAAAe,EAAO,SAAU,EAAIZ,EASjCa,EALF,CACF,QAASf,EACT,SAAUF,CACZ,EAEiCgB,CAAK,EAEtC,SACE,OAACC,EAAA,CAAW,GAAGb,EAAO,IAAKC,EACxB,SAAAJ,EACH,CAEJ,CAAC,EAEDP,EAAU,YAAc",
4
+ "sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp {...containerProps} ref={forwardedRef} className={cn(className, 'ipc_container', 'relative z-10 w-full')}>\n <div\n className={cn(\n className,\n 'desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full',\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4',\n spaceY_map?.[spaceY] || spaceY,\n spaceTop_map?.[spaceTop] || spaceTop,\n spaceBottom_map?.[spaceBottom] || spaceBottom\n )}\n >\n {children}\n </div>\n </Comp>\n )\n})\n\nconst Container = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const { children, mode = 'section' } = props\n\n const componentsMap: {\n [P in Mode]: React.ComponentType<any> | string\n } = {\n section: Section,\n fragment: Fragment,\n }\n\n const Component = componentsMap![mode!]\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n )\n})\n\nContainer.displayName = 'Container'\n\nexport { Container }\nexport type { ContainerProps }\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GAiBS,IAAAI,EAAA,6BAjBTC,EAAkB,oBAClBC,EAAmB,+BACnBC,EAAqB,gCAcrB,MAAMC,EAAW,CAAC,CAAE,SAAAC,CAAS,OACpB,mBAAG,SAAAA,EAAS,EAGfC,EAAU,EAAAC,QAAM,WAA6C,CAAC,CAAE,GAAGC,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAL,EACA,UAAAM,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIP,EAEEQ,EAAON,EAAU,OAAO,MAExBO,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,SACE,OAACH,EAAA,CAAM,GAAGD,EAAgB,IAAKN,EAAc,aAAW,MAAGE,EAAW,gBAAiB,sBAAsB,EAC3G,mBAAC,OACC,aAAW,MACTA,EACA,8DACA,8EACAM,IAAaL,CAAM,GAAKA,EACxBM,IAAeL,CAAQ,GAAKA,EAC5BM,IAAkBL,CAAW,GAAKA,CACpC,EAEC,SAAAT,EACH,EACF,CAEJ,CAAC,EAEKP,EAAY,EAAAS,QAAM,WAA6C,CAAC,CAAE,GAAGC,CAAM,EAAGC,IAAiB,CACnG,KAAM,CAAE,SAAAJ,EAAU,KAAAe,EAAO,SAAU,EAAIZ,EASjCa,EALF,CACF,QAASf,EACT,SAAUF,CACZ,EAEiCgB,CAAK,EAEtC,SACE,OAACC,EAAA,CAAW,GAAGb,EAAO,IAAKC,EACxB,SAAAJ,EACH,CAEJ,CAAC,EAEDP,EAAU,YAAc",
6
6
  "names": ["container_exports", "__export", "Container", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_react_slot", "Fragment", "children", "Section", "React", "props", "forwardedRef", "asChild", "className", "spaceY", "spaceTop", "spaceBottom", "containerProps", "Comp", "spaceY_map", "spaceTop_map", "spaceBottom_map", "mode", "Component"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var T=Object.create;var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},h=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of v(t))!C.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(o=y(t,s))||o.enumerable});return e};var R=(e,t,a)=>(a=e!=null?T(P(e)):{},h(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),N=e=>h(p({},"__esModule",{value:!0}),e);var q={};w(q,{Tabs:()=>m,TabsContent:()=>g,TabsList:()=>c,TabsTrigger:()=>b});module.exports=N(q);var n=require("react/jsx-runtime"),i=R(require("react")),l=require("../helpers/index.js"),r=R(require("@radix-ui/react-tabs")),d=require("class-variance-authority");const f=i.createContext({align:"left",shape:"square"}),m=i.forwardRef(({children:e,align:t="left",shape:a="square",...o},s)=>(0,n.jsx)(r.Root,{ref:s,...o,children:(0,n.jsx)(f.Provider,{value:{align:t,shape:a},children:e})}));m.displayName="Tabs";const L=(0,d.cva)("",{variants:{align:{left:"justify-left",center:"justify-center",right:"justify-end"},shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{align:"left",shape:"square"}}),k=(0,d.cva)("",{variants:{shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"square"}}),c=i.forwardRef(({className:e,...t},a)=>{const{align:o,shape:s}=i.useContext(f);return(0,n.jsx)(r.List,{ref:a,className:(0,l.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",L({align:o,shape:s}),e),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...t})});c.displayName=r.List.displayName;const b=i.forwardRef(({className:e,onClick:t,...a},o)=>{const{shape:s}=i.useContext(f),x=u=>{t?.(u),u.currentTarget.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})};return(0,n.jsx)(r.Trigger,{ref:o,className:(0,l.cn)("text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]",e,k({shape:s})),onClick:x,...a})});b.displayName=r.Trigger.displayName;const g=i.forwardRef(({className:e,...t},a)=>(0,n.jsx)(r.Content,{ref:a,className:(0,l.cn)(e),...t}));g.displayName=r.Content.displayName;
1
+ "use strict";"use client";var y=Object.create;var p=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},u=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of v(t))!C.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(o=T(t,s))||o.enumerable});return e};var R=(e,t,a)=>(a=e!=null?y(P(e)):{},u(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),w=e=>u(p({},"__esModule",{value:!0}),e);var q={};N(q,{Tabs:()=>m,TabsContent:()=>b,TabsList:()=>c,TabsTrigger:()=>g});module.exports=w(q);var n=require("react/jsx-runtime"),i=R(require("react")),l=require("../helpers/index.js"),r=R(require("@radix-ui/react-tabs")),d=require("class-variance-authority");const f=i.createContext({align:"left",shape:"square"}),m=i.forwardRef(({children:e,align:t="left",shape:a="square",...o},s)=>(0,n.jsx)(r.Root,{ref:s,...o,children:(0,n.jsx)(f.Provider,{value:{align:t,shape:a},children:e})}));m.displayName="Tabs";const L=(0,d.cva)("",{variants:{align:{left:"justify-left",center:"justify-center",right:"justify-end"},shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{align:"left",shape:"square"}}),k=(0,d.cva)("",{variants:{shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"square"}}),c=i.forwardRef(({className:e,...t},a)=>{const{align:o,shape:s}=i.useContext(f);return(0,n.jsx)(r.List,{ref:a,className:(0,l.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",L({align:o,shape:s}),e),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...t})});c.displayName=r.List.displayName;const g=i.forwardRef(({className:e,onClick:t,...a},o)=>{const{shape:s}=i.useContext(f),h=x=>{t?.(x)};return(0,n.jsx)(r.Trigger,{ref:o,className:(0,l.cn)("text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]",e,k({shape:s})),onClick:h,...a})});g.displayName=r.Trigger.displayName;const b=i.forwardRef(({className:e,...t},a)=>(0,n.jsx)(r.Content,{ref:a,className:(0,l.cn)(e),...t}));b.displayName=r.Content.displayName;
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/tabs.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: Shape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: Shape\n }\n>(({ children, align = 'left', shape = 'square', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('', {\n variants: {\n align: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n align: 'left',\n shape: 'square',\n },\n})\n\nconst tabsTriggerVariants = cva('', {\n variants: {\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({\n align: alignFromParent,\n shape: shapeFromParent,\n }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n e.currentTarget.scrollIntoView({\n behavior: 'smooth',\n inline: 'center',\n block: 'nearest',\n })\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GAyBI,IAAAO,EAAA,6BAvBJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAGpB,MAAMC,EAAiBJ,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKN,EAAOM,EAAM,WAMjB,CAAC,CAAE,SAAAK,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,SAAU,GAAGC,CAAM,EAAGC,OAC3D,OAACP,EAAc,KAAd,CAAmB,IAAKO,EAAM,GAAGD,EAChC,mBAACJ,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAE,EAAO,MAAAC,CAAM,EAAI,SAAAF,EAAS,EAC9D,CACD,EACDX,EAAK,YAAc,OAEnB,MAAMgB,KAAmB,OAAI,GAAI,CAC/B,SAAU,CACR,MAAO,CACL,KAAM,eACN,OAAQ,iBACR,MAAO,aACT,EACA,MAAO,CACL,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,OACP,MAAO,QACT,CACF,CAAC,EA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import * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: Shape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: Shape\n }\n>(({ children, align = 'left', shape = 'square', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('', {\n variants: {\n align: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n align: 'left',\n shape: 'square',\n },\n})\n\nconst tabsTriggerVariants = cva('', {\n variants: {\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({\n align: alignFromParent,\n shape: shapeFromParent,\n }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n // e.currentTarget.scrollIntoView({\n // behavior: 'smooth',\n // inline: 'center',\n // block: 'nearest',\n // })\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GAyBI,IAAAO,EAAA,6BAvBJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAGpB,MAAMC,EAAiBJ,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKN,EAAOM,EAAM,WAMjB,CAAC,CAAE,SAAAK,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,SAAU,GAAGC,CAAM,EAAGC,OAC3D,OAACP,EAAc,KAAd,CAAmB,IAAKO,EAAM,GAAGD,EAChC,mBAACJ,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAE,EAAO,MAAAC,CA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Ac,QAAd,CAAsB,IAAKO,EAAK,aAAW,MAAGG,CAAS,EAAI,GAAGJ,EAAO,CAAE,EAC5Gb,EAAY,YAAcO,EAAc,QAAQ",
6
6
  "names": ["tabs_exports", "__export", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "TabsPrimitive", "import_class_variance_authority", "TabListContext", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "className", "alignFromParent", "shapeFromParent", "onClick", "handleClick", "e"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import{useState as w,useRef as f,useEffect as k,forwardRef as C,useImperativeHandle as S}from"react";import{cn as i}from"../../helpers/utils.js";import{withStyles as V}from"../../shared/Styles.js";import j from"../../components/picture.js";import D from"../../components/button.js";import{convertLexicalToHTML as H}from"@payloadcms/richtext-lexical/html";import{useInView as F}from"react-intersection-observer";const M=({defaultConverters:d})=>({...d,text:r=>{const{node:e}=r;return e.$&&e.$.color?`<span class="lexical-${e.$.color}">${e.text}</span>`:e.text}}),Y=C(({className:d="",onBtnClick:r,data:{title:e,videoTitle:a,btnText:m,img:u,video:N,theme:L,shape:T,...P}},B)=>{const{sticky:s}=P,[l,n]=w(!1),[v,R]=w(0),o=f(null),c=f(null),E=f(null),{ref:I,inView:g}=F();S(B,()=>c.current);const x=typeof e=="string"?e:e&&H({data:e,converters:M}),y=typeof a=="string"?a:a&&H({data:a,converters:M});return k(()=>{g&&!m?(o.current?.play(),n(!0)):(o.current?.pause(),n(!1))},[g]),k(()=>{if(c.current&&s){const $=c.current.getBoundingClientRect(),h=window.innerHeight,z=window.scrollY||window.pageYOffset,_=$.bottom+z,b=document.documentElement.scrollHeight-_;R(b>h?h:b)}},[]),p("div",{ref:c,style:s?{marginBottom:`-${v}px`}:{},className:i("relative",s&&"mt-[-100vh]"),children:[t("div",{className:"sticky top-0 ",children:p("div",{className:i("relative overflow-hidden",s?"h-screen w-screen":"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",d,{"aiui-dark":L==="dark","rounded-box":T==="rounded"}),children:[t("div",{children:p("div",{ref:I,className:"media-content absolute left-1/2 top-1/2 z-20 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-5",children:[x&&!l&&t("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),y&&l&&t("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:y}}),!l&&m&&t(D,{variant:"link",className:i("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{l?(o.current&&o.current.pause(),n(!1)):(o.current&&o.current.play(),n(!0)),r&&r?.()},children:m})]})}),t("div",{children:p("div",{ref:E,className:"media-cover left-0 top-0 h-screen w-full",children:[t("video",{ref:o,className:"size-full object-cover",src:N?.url,muted:!0,loop:!0,playsInline:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),!l&&u?.url&&t(j,{className:"z-1 absolute left-0 top-0 size-full object-cover",source:u?.url,alt:u?.alt,imgClassName:"w-full h-full object-cover"}),t("div",{className:"absolute left-0 top-0 z-10 size-full"})]})})]})}),t("div",{className:i(s&&"relative box-content block",s&&"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),style:s?{height:`${v}px`}:{}})]})});var X=V(Y);export{X as default};
1
+ "use client";import{Fragment as J,jsx as e,jsxs as m}from"react/jsx-runtime";import{useState as y,useRef as d,useEffect as T,forwardRef as F,useImperativeHandle as Y}from"react";import{debounce as j}from"lodash";import{cn as p}from"../../helpers/utils.js";import{withStyles as q}from"../../shared/Styles.js";import"../../components/picture.js";import O from"../../components/button.js";import{convertLexicalToHTML as k}from"@payloadcms/richtext-lexical/html";import{useInView as A}from"react-intersection-observer";const N=({defaultConverters:u})=>({...u,text:r=>{const{node:t}=r;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),G=F(({className:u="",onBtnClick:r,data:{title:t,videoTitle:s,btnText:f,img:K,video:E,theme:P,shape:R,...z}},B)=>{const{sticky:o}=z,[i,a]=y(!1),[w,$]=y(0),[I,_]=y(0),n=d(null),l=d(null),C=d(null),v=d(null),{ref:D,inView:H}=A();Y(B,()=>l.current);const b=typeof t=="string"?t:t&&k({data:t,converters:N}),L=typeof s=="string"?s:s&&k({data:s,converters:N});T(()=>{H&&!f?(n.current?.play(),a(!0)):(n.current?.pause(),a(!1))},[H]);const g=j(()=>{if(l.current){const h=l.current.getBoundingClientRect(),c=window.innerHeight,S=window.scrollY||window.pageYOffset,V=h.bottom+S,M=document.documentElement.scrollHeight-V;$(M>c?c:M)}if(v.current){const h=v.current.clientHeight,c=window.innerHeight;_(h+c)}},600);T(()=>(g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}),[]);const x="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return m(J,{children:[o&&e("div",{ref:v,className:p("relative z-10 ",x),children:e("div",{children:m("div",{ref:D,className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4",children:[b&&!i&&e("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:b}}),L&&i&&e("div",{className:"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:L}}),!i&&f&&e(O,{variant:"link",className:p("member-equity-button-secondary text-btn-primary-foreground"),onClick:()=>{i?(n.current&&n.current.pause(),a(!1)):(n.current&&n.current.play(),a(!0)),r&&r?.()},children:f})]})})}),m("div",{ref:l,style:o?{marginBottom:`-${w}px`,marginTop:`-${I}px`}:{},className:"relative",children:[e("div",{className:"sticky top-0 ",children:e("div",{className:p("relative overflow-hidden",o?"h-screen w-screen":x,u,{"aiui-dark":P==="dark","rounded-box":R==="rounded"}),children:e("div",{children:m("div",{ref:C,className:"media-cover left-0 top-0 h-screen w-screen",children:[e("video",{ref:n,className:"size-full object-cover",src:E?.url,muted:!0,loop:!0,playsInline:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute left-0 top-0 z-10 size-full"})]})})})}),e("div",{className:p(o&&"relative box-content block",x),style:o?{height:`${w}px`}:{}})]})]})});var ie=q(G);export{ie as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.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'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 ({ className = '', onBtnClick, data: { title, videoTitle, btnText, img, video, theme, shape, ...rest } }, ref) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => boxRef.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 && !btnText) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n useEffect(() => {\n if (boxRef.current && sticky) {\n const rect = boxRef.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 }, [])\n\n // useGSAP(() => {\n // if (!bgRef.current) return\n // const height = boxRef.current?.clientHeight || 100\n // const screenHeight = bgRef.current?.clientHeight || 100\n // const base = screenHeight + height\n\n // ScrollTrigger.create({\n // trigger: boxRef.current,\n // start: 'top bottom',\n // end: 'bottom top',\n // scrub: true,\n // onUpdate: (self: any) => {\n // const value = self.progress * base - screenHeight\n // gsap.set(bgRef.current, { y: value })\n // },\n // })\n // return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n // }\n // }, [])\n\n return (\n <div\n ref={boxRef}\n style={sticky ? { marginBottom: `-${btb}px` } : {}}\n className={cn('relative', sticky && 'mt-[-100vh]')}\n >\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'relative overflow-hidden',\n sticky\n ? 'h-screen w-screen'\n : 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n }\n )}\n >\n <div>\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-20 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-5\"\n >\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {!isPlaying && btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-btn-primary-foreground')}\n onClick={() => {\n if (isPlaying) {\n if (videoRef.current) {\n videoRef.current.pause()\n }\n setIsPlaying(false)\n } else {\n if (videoRef.current) {\n videoRef.current.play()\n }\n setIsPlaying(true)\n }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n </div>\n <div>\n <div ref={bgRef} className=\"media-cover left-0 top-0 h-screen w-full\">\n <video\n ref={videoRef}\n className=\"size-full object-cover\"\n src={video?.url}\n muted\n loop\n playsInline\n webkit-playsinline\n x5-playsinline\n />\n {!isPlaying && img?.url && (\n <Picture\n className=\"z-1 absolute left-0 top-0 size-full object-cover\"\n source={img?.url}\n alt={img?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n )}\n <div className=\"absolute left-0 top-0 z-10 size-full\" />\n </div>\n </div>\n </div>\n </div>\n <div\n className={cn(\n sticky && 'relative box-content block',\n sticky &&\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}\n style={sticky ? { height: `${btb}px` } : {}}\n />\n </div>\n )\n }\n)\n\nexport default withStyles(MediaPlayerBase)\n"],
5
- "mappings": "aA8Gc,OAKI,OAAAA,EALJ,QAAAC,MAAA,oBA7Gd,OAAgB,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,EAAY,uBAAAC,MAA2B,QACpF,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAa,8BACpB,OAAOC,MAAY,6BACnB,OAAS,wBAAAC,MAA4B,oCAGrC,OAAS,aAAAC,MAAiB,8BAG1B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAkBZ,EACtB,CAAC,CAAE,UAAAa,EAAY,GAAI,WAAAC,EAAY,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,QAAAC,EAAS,IAAAC,EAAK,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAK,CAAE,EAAGC,IAAQ,CAChH,KAAM,CAAE,OAAAC,CAAO,EAAIF,EACb,CAACG,EAAWC,CAAY,EAAI7B,EAAS,EAAK,EAC1C,CAAC8B,EAAKC,CAAM,EAAI/B,EAAS,CAAC,EAE1BgC,EAAW/B,EAAyB,IAAI,EACxCgC,EAAShC,EAAuB,IA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B9B,EAAC,OACC,UAAU,gHACV,wBAAyB,CAAE,OAAQwC,CAAgB,EACrD,EAED,CAACV,GAAaR,GACbtB,EAACU,EAAA,CACC,QAAQ,OACR,UAAWH,EAAG,4DAA4D,EAC1E,QAAS,IAAM,CACTuB,GACEI,EAAS,SACXA,EAAS,QAAQ,MAAM,EAEzBH,EAAa,EAAK,IAEdG,EAAS,SACXA,EAAS,QAAQ,KAAK,EAExBH,EAAa,EAAI,GAEnBZ,GAAcA,IAAa,CAC7B,EAEC,SAAAG,EAEH,GAEJ,EACF,EACAtB,EAAC,OACC,SAAAC,EAAC,OAAI,IAAKmC,EAAO,UAAU,2CACzB,UAAApC,EAAC,SACC,IAAKkC,EACL,UAAU,yBACV,IAAKV,GAAO,IACZ,MAAK,GACL,KAAI,GACJ,YAAW,GACX,qBAAkB,GAClB,iBAAc,GAChB,EACC,CAACM,GAAaP,GAAK,KAClBvB,EAACS,EAAA,CACC,UAAU,mDACV,OAAQc,GAAK,IACb,IAAKA,GAAK,IACV,aAAa,6BACf,EAEFvB,EAAC,OAAI,UAAU,uCAAuC,GACxD,EACF,GACF,EACF,EACAA,EAAC,OACC,UAAWO,EACTsB,GAAU,6BACVA,GACE,+KACJ,EACA,MAAOA,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC5C,GACF,CAEJ,CACF,EAEA,IAAOc,EAAQtC,EAAWS,CAAe",
6
- "names": ["jsx", "jsxs", "useState", "useRef", "useEffect", "forwardRef", "useImperativeHandle", "cn", "withStyles", "Picture", "Button", "convertLexicalToHTML", "useInView", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "img", "video", "theme", "shape", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "videoRef", "boxRef", "bgRef", "inViewRef", "inView", "title_html", "videoTitle_html", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "MediaPlayerBase_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.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'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 ({ className = '', onBtnClick, data: { title, videoTitle, btnText, img, video, theme, shape, ...rest } }, ref) => {\n const { sticky } = rest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => boxRef.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 && !btnText) {\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 (boxRef.current) {\n const rect = boxRef.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 // useGSAP(() => {\n // if (!bgRef.current) return\n // const height = boxRef.current?.clientHeight || 100\n // const screenHeight = bgRef.current?.clientHeight || 100\n // const base = screenHeight + height\n\n // ScrollTrigger.create({\n // trigger: boxRef.current,\n // start: 'top bottom',\n // end: 'bottom top',\n // scrub: true,\n // onUpdate: (self: any) => {\n // const value = self.progress * base - screenHeight\n // gsap.set(bgRef.current, { y: value })\n // },\n // })\n // return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n // }\n // }, [])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div ref={titleRef} className={cn('relative z-10 ', aspect)}>\n <div>\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4\"\n >\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-btn-primary-foreground text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {!isPlaying && btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-btn-primary-foreground')}\n onClick={() => {\n if (isPlaying) {\n if (videoRef.current) {\n videoRef.current.pause()\n }\n setIsPlaying(false)\n } else {\n if (videoRef.current) {\n videoRef.current.play()\n }\n setIsPlaying(true)\n }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n </div>\n </div>\n )}\n <div\n ref={boxRef}\n style={sticky ? { marginBottom: `-${btb}px`, marginTop: `-${titleHeight}px` } : {}}\n className=\"relative\"\n >\n <div className=\"sticky top-0 \">\n <div\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-screen' : aspect, className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div>\n <div ref={bgRef} className=\"media-cover left-0 top-0 h-screen w-screen\">\n <video\n ref={videoRef}\n className=\"size-full object-cover\"\n src={video?.url}\n muted\n loop\n playsInline\n webkit-playsinline\n x5-playsinline\n />\n <div className=\"absolute left-0 top-0 z-10 size-full\" />\n </div>\n </div>\n </div>\n </div>\n <div\n className={cn(sticky && 'relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n />\n </div>\n </>\n )\n }\n)\n\nexport default withStyles(MediaPlayerBase)\n"],
5
+ "mappings": "aA4GM,mBAAAA,EASY,OAAAC,EALJ,QAAAC,MAJR,oBA3GN,OAAgB,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,EAAY,uBAAAC,MAA2B,QACpF,OAAS,YAAAC,MAAgB,SACzB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,MAAoB,8BACpB,OAAOC,MAAY,6BACnB,OAAS,wBAAAC,MAA4B,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S,CAAE,aAAc,IAAIG,CAAG,KAAM,UAAW,IAAIE,CAAW,IAAK,EAAI,CAAC,EACjF,UAAU,WAEV,UAAAlC,EAAC,OAAI,UAAU,gBACb,SAAAA,EAAC,OACC,UAAWQ,EAAG,2BAA4BqB,EAAS,oBAAsBqB,EAAQhC,EAAW,CAC1F,YAAaO,IAAU,OACvB,cAAeC,IAAU,SAC3B,CAAC,EAED,SAAA1B,EAAC,OACC,SAAAC,EAAC,OAAI,IAAKqC,EAAO,UAAU,6CACzB,UAAAtC,EAAC,SACC,IAAKoC,EACL,UAAU,yBACV,IAAKZ,GAAO,IACZ,MAAK,GACL,KAAI,GACJ,YAAW,GACX,qBAAkB,GAClB,iBAAc,GAChB,EACAxB,EAAC,OAAI,UAAU,uCAAuC,GACxD,EACF,EACF,EACF,EACAA,EAAC,OACC,UAAWQ,EAAGqB,GAAU,6BAA8BqB,CAAM,EAC5D,MAAOrB,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC5C,GACF,GACF,CAEJ,CACF,EAEA,IAAOmB,GAAQ1C,EAAWQ,CAAe",
6
+ "names": ["Fragment", "jsx", "jsxs", "useState", "useRef", "useEffect", "forwardRef", "useImperativeHandle", "debounce", "cn", "withStyles", "Button", "convertLexicalToHTML", "useInView", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "onBtnClick", "title", "videoTitle", "btnText", "img", "video", "theme", "shape", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoRef", "boxRef", "bgRef", "titleRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "aspect", "MediaPlayerBase_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as v,jsx as e,jsxs as i}from"react/jsx-runtime";import G,{useState as P,useRef as p,useEffect as m,forwardRef as F}from"react";import{debounce as V}from"es-toolkit";import{useInView as j}from"react-intersection-observer";import{cn as u}from"../../helpers/utils.js";import{withStyles as O}from"../../shared/Styles.js";import Q from"../Slogan/index.js";import{Grid as _,GridItem as f}from"../../components/gird.js";import{Container as A}from"../../components/container.js";import D from"../BrandEquity/index.js";import J from"../MemberEquity/index.js";import K from"../Spacer/index.js";import U from"gsap";import{convertLexicalToHTML as S}from"@payloadcms/richtext-lexical/html";import{useMediaQuery as C}from"react-responsive";const T=({defaultConverters:s})=>({...s,text:r=>{const{node:t}=r;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),y=({children:s,spaceY:r})=>{const t=C({query:"(max-width: 768px)"});return e(A,{spaceY:r,className:"!bg-transparent",children:i(_,{children:[!t&&e(f,{span:1}),e(f,{span:t?12:10,children:s}),!t&&e(f,{span:1})]})})},W=G.forwardRef(({children:s,id:r,components:t})=>{const o=p(null);return i("div",{ref:o,className:"relative z-10",children:[e(v,{children:s}),e(v,{children:t?.map(a=>{switch(a.blockType){case"ipc-brand-equity":return e("div",{className:"relative z-20 bg-transparent",children:e(y,{spaceY:"none",children:e(D,{data:a,style:a?.style})})});case"ipc-member-equity":return e("div",{className:"relative z-20 w-full bg-transparent",children:e(y,{spaceY:"none",children:e(J,{data:a,className:"w-full",style:a?.style})})});case"ipc-spacer":return e(K,{data:a,style:a?.style,className:"!bg-transparent"});default:return null}})})]})}),X=F(({className:s="",id:r,data:{title:t,videoTitle:o,mobVideo:a,mobImg:g,img:b,video:w,theme:h,shape:z,components:E}})=>{const x=p(null),n=p(null),{ref:L,inView:l}=j(),[N,M]=P(!1),$=typeof t=="string"?t:t&&S({data:t,converters:T});typeof o=="string"||o&&S({data:o,converters:T});const[B,Y]=P(0),k=C({query:"(max-width: 768px)"}),c=V(()=>{if(n.current){const d=n.current.getBoundingClientRect(),R=window.innerHeight,q=window.scrollY||window.pageYOffset,I=d.bottom+q,H=document.documentElement.scrollHeight-I;Y(H>R?R:H)}},600);return m(()=>{l&&!N?(x.current?.play(),M(!0)):l||M(!1)},[l,N]),m(()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),m(()=>{const d=window.screen.height;U.timeline({scrollTrigger:{trigger:`#${r}`,start:"top top",end:`top+=${d*1.8}px bottom`,scrub:0}}).to(`.${r} .sticky-cover`,{opacity:1,duration:.3}).to(`#${r} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")},[]),console.log("img11",b?.url),i(v,{children:[e("div",{id:r,className:u("relative z-20 h-screen w-full",s,{"aiui-dark":h==="dark","rounded-box":z==="rounded"}),children:e("div",{ref:L,className:"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2",children:e(y,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:e(Q,{className:"sticky-title",data:{title:$||"",theme:h}})})})}),i("div",{ref:n,style:{marginBottom:`-${B}px`},className:u(r,"relative mt-[-200vh]"),children:[e("div",{className:"sticky top-0 ",children:i("div",{className:u("media-cover","relative h-screen w-full","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),children:[w?.url&&e("video",{ref:x,className:"size-full object-cover object-right",poster:k&&g?.url?g?.url:b?.url,src:k&&a?.url?a?.url:w?.url,muted:!0,playsInline:!0}),e("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)"}})]})}),e("div",{className:"relative h-screen w-full"}),e(W,{components:E}),e("div",{className:"relative h-screen w-full"})]})]})});var ye=O(X);export{ye as default};
1
+ "use client";import{Fragment as b,jsx as e,jsxs as n}from"react/jsx-runtime";import F,{useState as p,useRef as m,useEffect as u,forwardRef as V}from"react";import{debounce as O}from"es-toolkit";import{useInView as Q}from"react-intersection-observer";import{cn as f}from"../../helpers/utils.js";import{withStyles as _}from"../../shared/Styles.js";import A from"../Slogan/index.js";import{Grid as D,GridItem as y}from"../../components/gird.js";import{Container as J}from"../../components/container.js";import K from"../BrandEquity/index.js";import U from"../MemberEquity/index.js";import W from"../Spacer/index.js";import X from"gsap";import{convertLexicalToHTML as P}from"@payloadcms/richtext-lexical/html";import{useMediaQuery as S}from"react-responsive";const z=({defaultConverters:a})=>({...a,text:r=>{const{node:t}=r;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),v=({children:a,spaceY:r})=>{const t=S({query:"(max-width: 768px)"});return e(J,{spaceY:r,className:"!bg-transparent",children:n(D,{children:[!t&&e(y,{span:1}),e(y,{span:t?12:10,children:a}),!t&&e(y,{span:1})]})})},Z=F.forwardRef(({children:a,id:r,components:t})=>{const o=m(null);return n("div",{ref:o,className:"relative z-10",children:[e(b,{children:a}),e(b,{children:t?.map(s=>{switch(s.blockType){case"ipc-brand-equity":return e("div",{className:"relative z-20 bg-transparent",children:e(v,{spaceY:"none",children:e(K,{data:s,style:s?.style})})});case"ipc-member-equity":return e("div",{className:"relative z-20 w-full bg-transparent",children:e(v,{spaceY:"none",children:e(U,{data:s,className:"w-full",style:s?.style})})});case"ipc-spacer":return e(W,{data:s,style:s?.style,className:"!bg-transparent"});default:return null}})})]})}),ee=V(({className:a="",id:r,data:{title:t,videoTitle:o,mobVideo:s,mobImg:g,img:i,video:w,theme:h,shape:C,components:T}})=>{const x=m(null),l=m(null),{ref:L,inView:N}=Q(),[M,$]=p(!1),[B,Y]=p(!1),q=typeof t=="string"?t:t&&P({data:t,converters:z});typeof o=="string"||o&&P({data:o,converters:z});const[k,I]=p(0),R=S({query:"(max-width: 768px)"}),c=O(()=>{if(l.current){const d=l.current.getBoundingClientRect(),H=window.innerHeight,j=window.scrollY||window.pageYOffset,G=d.bottom+j,E=document.documentElement.scrollHeight-G;I(E>H?H:E)}},600);return u(()=>{N&&!M&&(x.current?.play(),$(!0))},[N,M]),u(()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),u(()=>{const d=window.screen.height;X.timeline({scrollTrigger:{trigger:`#${r}`,start:"top top",end:`top+=${d*1.8}px bottom`,scrub:0}}).to(`.${r} .sticky-cover`,{opacity:1,duration:.4}).to(`#${r} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")},[k]),n(b,{children:[e("div",{id:r,className:f("relative z-20 h-screen w-full",a,{"aiui-dark":h==="dark","rounded-box":C==="rounded"}),children:e("div",{ref:L,className:"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2",children:e(v,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:e(A,{className:"sticky-title",data:{title:q||"",theme:h}})})})}),n("div",{ref:l,style:{marginBottom:`-${k}px`},className:f(r,"relative mt-[-200vh]"),children:[e("div",{className:"sticky top-0 ",children:n("div",{className:f("media-cover","relative h-screen w-full","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]"),children:[w?.url&&e("video",{ref:x,className:"size-full object-cover object-[82%]",src:R&&s?.url?s?.url:w?.url,muted:!0,playsInline:!0,onEnded:()=>{Y(!0)}}),i?.url&&B&&e("img",{src:R&&g?.url?g?.url:i?.url,alt:i?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]"}),e("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)"}})]})}),e("div",{className:"relative h-screen w-full"}),e(Z,{components:T}),e("div",{className:"relative h-screen w-full"})]})]})});var be=_(ee);export{be as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerSticky/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\n// import ScrollTrigger from 'gsap/ScrollTrigger'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({ children, spaceY }: { children: React.ReactNode; spaceY?: string }) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className=\"!bg-transparent\">\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(({ className = '', id, data: { title, videoTitle, mobVideo, mobImg, img, video, theme, shape, components } }) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [isPlaying, setIsPlaying] = useState(false)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.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 }, 600)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else if (!inView) {\n setIsPlaying(false)\n }\n }, [inView, isPlaying])\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n const height = window.screen.height\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0,\n },\n })\n .to(`.${id} .sticky-cover`, {\n opacity: 1,\n duration: 0.3,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }, [])\n\n console.log('img11', img?.url)\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2\"\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div ref={boxRef} style={{ marginBottom: `-${btb}px` }} className={cn(id, 'relative mt-[-200vh]')}>\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'media-cover',\n 'relative h-screen w-full',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}\n >\n {video?.url && (\n <video\n ref={videoRef}\n className=\"size-full object-cover object-right\"\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n muted\n playsInline\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n})\n\nexport default withStyles(MediaPlayerSticky)\n"],
5
- "mappings": "aAsCM,OAuBA,YAAAA,EAtBgB,OAAAC,EADhB,QAAAC,MAAA,oBArCN,OAAOC,GAAS,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,MAAuC,QACpF,OAAS,YAAAC,MAAgB,aACzB,OAAS,aAAAC,MAAiB,8BAC1B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAY,qBACnB,OAAS,QAAAC,EAAM,YAAAC,MAAgB,2BAC/B,OAAS,aAAAC,MAAiB,gCAC1B,OAAOC,MAAiB,0BACxB,OAAOC,MAAkB,2BACzB,OAAOC,MAAY,qBACnB,OAAOC,MAAU,OAEjB,OAAS,wBAAAC,MAA4B,oCAIrC,OAAS,iBAAAC,MAAqB,mBAG9B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAe,CAAC,CAAE,SAAAC,EAAU,OAAAC,CAAO,IAAsD,CAC7F,MAAMC,EAAWR,EAAc,CAAE,MAAO,oBAAqB,CAAC,EAC9D,OACEpB,EAACc,EAAA,CAAU,OAAQa,EAAQ,UAAU,kBACnC,SAAA1B,EAACW,EAAA,CACE,WAACgB,GAAY5B,EAACa,EAAA,CAAS,KAAM,EAAG,EACjCb,EAACa,EAAA,CAAS,KAAMe,EAAW,GAAK,GAAK,SAAAF,E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U,GAAK,GAAG,EAG3BvC,EAAAF,EAAA,CACE,UAAAC,EAAC,OACC,GAAI8B,EACJ,UAAWrB,EAAG,gCAAiC0B,EAAW,CACxD,YAAaO,IAAU,OACvB,cAAeC,IAAU,SAC3B,CAAC,EAED,SAAA3C,EAAC,OACC,IAAK8C,EACL,UAAU,wFAEV,SAAA9C,EAACyB,EAAA,CAAa,OAAO,uCACnB,SAAAzB,EAACW,EAAA,CAAO,UAAU,eAAe,KAAM,CAAE,MAAOuC,GAAc,GAAI,MAAAR,CAAM,EAAG,EAC7E,EACF,EACF,EAEAzC,EAAC,OAAI,IAAK4C,EAAQ,MAAO,CAAE,aAAc,IAAIM,CAAG,IAAK,EAAG,UAAW1C,EAAGqB,EAAI,sBAAsB,EAC9F,UAAA9B,EAAC,OAAI,UAAU,gBACb,SAAAC,EAAC,OACC,UAAWQ,EACT,cACA,2BACA,oNACF,EAEC,UAAAgC,GAAO,KACNzC,EAAC,SACC,IAAK4C,EACL,UAAU,sCACV,OAAQhB,GAAYW,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IACrD,IAAKZ,GAAYU,GAAU,IAAMA,GAAU,IAAMG,GAAO,IACxD,MAAK,GACL,YAAW,GACb,EAEFzC,EAAC,OACC,UAAU,8DACV,MAAO,CACL,WAAY,+DACd,EACF,GACF,EACF,EAEAA,EAAC,OAAI,UAAU,2BAA2B,EAC1CA,EAAC6B,EAAA,CAAO,WAAYE,EAAY,EAChC/B,EAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CAAC,EAED,IAAO4D,GAAQlD,EAAWwB,CAAiB",
6
- "names": ["Fragment", "jsx", "jsxs", "React", "useState", "useRef", "useEffect", "forwardRef", "debounce", "useInView", "cn", "withStyles", "Slogan", "Grid", "GridItem", "Container", "BrandEquity", "MemberEquity", "Spacer", "gsap", "convertLexicalToHTML", "useMediaQuery", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "isMobile", "SubBox", "id", "components", "mediaPlayerStickyRef", "componentData", "MediaPlayerSticky", "className", "title", "videoTitle", "mobVideo", "mobImg", "img", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "isPlaying", "setIsPlaying", "title_html", "btb", "setbtb", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "height", "MediaPlayerSticky_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\n// import ScrollTrigger from 'gsap/ScrollTrigger'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({ children, spaceY }: { children: React.ReactNode; spaceY?: string }) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className=\"!bg-transparent\">\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(({ className = '', id, data: { title, videoTitle, mobVideo, mobImg, img, video, theme, shape, components } }) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.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 }, 600)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n const height = window.screen.height\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0,\n },\n })\n .to(`.${id} .sticky-cover`, {\n opacity: 1,\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }, [btb])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n <div\n ref={inViewRef}\n className=\"media-content absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2\"\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div ref={boxRef} style={{ marginBottom: `-${btb}px` }} className={cn(id, 'relative mt-[-200vh]')}>\n <div className=\"sticky top-0 \">\n <div\n className={cn(\n 'media-cover',\n 'relative h-screen w-full',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n )}\n >\n {video?.url && (\n <video\n ref={videoRef}\n className=\"size-full object-cover object-[82%]\"\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n muted\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )}\n {img?.url && isEntered && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #1D1D1F 100%)',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n})\n\nexport default withStyles(MediaPlayerSticky)\n"],
5
+ "mappings": "aAsCM,OAuBA,YAAAA,EAtBgB,OAAAC,EADhB,QAAAC,MAAA,oBArCN,OAAOC,GAAS,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,MAAuC,QACpF,OAAS,YAAAC,MAAgB,aACzB,OAAS,aAAAC,MAAiB,8BAC1B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAY,qBACnB,OAAS,QAAAC,EAAM,YAAAC,MAAgB,2BAC/B,OAAS,aAAAC,MAAiB,gCAC1B,OAAOC,MAAiB,0BACxB,OAAOC,MAAkB,2BACzB,OAAOC,MAAY,qBACnB,OAAOC,MAAU,OAEjB,OAAS,wBAAAC,MAA4B,oCAIrC,OAAS,iBAAAC,MAAqB,mBAG9B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAe,CA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AAU,2BAA2B,EAC1CA,EAAC6B,EAAA,CAAO,WAAYE,EAAY,EAChC/B,EAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CAAC,EAED,IAAO8D,GAAQpD,EAAWwB,EAAiB",
6
+ "names": ["Fragment", "jsx", "jsxs", "React", "useState", "useRef", "useEffect", "forwardRef", "debounce", "useInView", "cn", "withStyles", "Slogan", "Grid", "GridItem", "Container", "BrandEquity", "MemberEquity", "Spacer", "gsap", "convertLexicalToHTML", "useMediaQuery", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "isMobile", "SubBox", "id", "components", "mediaPlayerStickyRef", "componentData", "MediaPlayerSticky", "className", "title", "videoTitle", "mobVideo", "mobImg", "img", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "title_html", "btb", "setbtb", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "height", "MediaPlayerSticky_default"]
7
7
  }
@@ -1,5 +1,5 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import T,{useImperativeHandle as z,useRef as H}from"react";import{Button as u,Heading as P,Picture as x,Text as _}from"../../components/index.js";import{withStyles as j}from"../../shared/Styles.js";import{cn as s}from"../../helpers/utils.js";import{isVideo as f}from"../../shared/mimeType.js";import{useExposure as C}from"../../hooks/useExposure.js";import{useAiuiContext as R}from"../AiuiProvider/index.js";import{trackUrlRef as b}from"../../shared/trackUrlRef.js";const r="image",m="member_area",D=T.forwardRef(({data:g,className:y=""},v)=>{const{title:n,description:c,backgroundImage:t,mobileBackgroundImage:o,primaryButton:a,secondaryButton:p,theme:k,shape:h,primaryButtonHandler:N,secondaryButtonHandler:B}=g,i=H(null);z(v,()=>i.current);const{trackingData:q}=R(),{profileActivated:E}=q;C(i,{componentType:r,componentName:m,componentTitle:n,componentDescription:c,memberActiveStatus:E?"active":"not active"});const w=()=>{N?.()},M=()=>{B?.()},d="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return l("section",{"data-ui-component-id":"MemberEquity",className:s("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative h-[480px] overflow-hidden",y,{"aiui-dark":k==="dark","rounded-box":h==="rounded"}),ref:i,children:[f(t?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:e("source",{src:t?.url,type:"video/mp4"})}):e(x,{source:t?.url,alt:t?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),f(o?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:e("source",{src:o?.url,type:"video/mp4"})}):e(x,{source:o?.url,alt:o?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),e("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:l("div",{className:`
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import z,{useImperativeHandle as H,useRef as P}from"react";import{useMediaQuery as _}from"react-responsive";import{Button as u,Heading as j,Picture as x,Text as C}from"../../components/index.js";import{withStyles as R}from"../../shared/Styles.js";import{cn as s}from"../../helpers/utils.js";import{isVideo as f}from"../../shared/mimeType.js";import{useExposure as D}from"../../hooks/useExposure.js";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{trackUrlRef as b}from"../../shared/trackUrlRef.js";const r="image",m="member_area",S=z.forwardRef(({data:y,className:g=""},v)=>{const{title:n,description:c,backgroundImage:t,mobileBackgroundImage:o,primaryButton:a,secondaryButton:p,theme:k,shape:h,primaryButtonHandler:N,secondaryButtonHandler:B}=y,q=_({query:"(max-width: 768px)"}),l=P(null);H(v,()=>l.current);const{trackingData:M}=I(),{profileActivated:w}=M;D(l,{componentType:r,componentName:m,componentTitle:n,componentDescription:c,memberActiveStatus:w?"active":"not active"});const E=()=>{N?.()},T=()=>{B?.()},d="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return i("section",{"data-ui-component-id":"MemberEquity",className:s("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",g,{"aiui-dark":k==="dark","rounded-box":h==="rounded","h-[480px]":q}),ref:l,children:[f(t?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:e("source",{src:t?.url,type:"video/mp4"})}):e(x,{source:t?.url,alt:t?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),f(o?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:e("source",{src:o?.url,type:"video/mp4"})}):e(x,{source:o?.url,alt:o?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),e("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:i("div",{className:`
2
2
  tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5
3
3
  laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4
4
- `,children:[l("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[e(P,{as:"h2",size:3,className:"member-equity-title ",html:n}),e(_,{size:2,className:"member-equity-description",html:c})]}),l("div",{className:"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3",children:[p&&p.text&&e("a",{href:b(p.link,`${r}_${m}`),children:e(u,{variant:"secondary",onClick:M,className:s("member-equity-button-secondary ",d),children:p.text})}),a&&a.text&&e("a",{href:b(a.link,`${r}_${m}`),children:e(u,{variant:"primary",onClick:w,className:s("member-equity-button-primary ",d),children:a.text})})]})]})})]})});var G=j(D);export{G as default};
4
+ `,children:[i("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[e(j,{as:"h2",size:3,className:"member-equity-title ",html:n}),e(C,{size:2,className:"member-equity-description",html:c})]}),i("div",{className:"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3",children:[p&&p.text&&e("a",{href:b(p.link,`${r}_${m}`),children:e(u,{variant:"secondary",onClick:T,className:s("member-equity-button-secondary ",d),children:p.text})}),a&&a.text&&e("a",{href:b(a.link,`${r}_${m}`),children:e(u,{variant:"primary",onClick:E,className:s("member-equity-button-primary ",d),children:a.text})})]})]})})]})});var K=R(S);export{K as default};
5
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MemberEquity/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MemberEquityProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'member_area'\n\nconst MemberEquity: React.FC<MemberEquityProps> = React.forwardRef<HTMLDivElement, MemberEquityProps>(\n ({ data, className = '' }, ref) => {\n const {\n title,\n description,\n backgroundImage,\n mobileBackgroundImage,\n primaryButton,\n secondaryButton,\n theme,\n shape,\n primaryButtonHandler,\n secondaryButtonHandler,\n } = data\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: description,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n const handleButtonPrimaryClick = () => {\n // \u6267\u884C\u4E3B\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n primaryButtonHandler?.()\n }\n\n const handleButtonSecondaryClick = () => {\n // \u6267\u884C\u526F\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n secondaryButtonHandler?.()\n }\n\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <section\n data-ui-component-id=\"MemberEquity\"\n className={cn(\n 'lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]',\n 'text-info-primary relative h-[480px] overflow-hidden',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n }\n )}\n ref={innerRef}\n >\n {isVideo(backgroundImage?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"laptop:block absolute inset-0 hidden size-full object-cover\"\n >\n <source src={backgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={backgroundImage?.url}\n alt={backgroundImage?.alt}\n className=\"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n {isVideo(mobileBackgroundImage?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"laptop:hidden absolute inset-0 size-full object-cover\">\n <source src={mobileBackgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={mobileBackgroundImage?.url}\n alt={mobileBackgroundImage?.alt}\n className=\"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n <div className={'laptop:items-center absolute inset-0 flex w-full items-end py-[16px]'}>\n <div\n className={`\n tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5 \n laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4\n `}\n >\n <div className=\"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col\">\n <Heading as=\"h2\" size={3} className={`member-equity-title `} html={title} />\n <Text size={2} className={`member-equity-description`} html={description} />\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3\">\n {secondaryButton && secondaryButton.text && (\n <a href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"secondary\"\n onClick={handleButtonSecondaryClick}\n className={cn('member-equity-button-secondary ', lgButtonSize)}\n >\n {secondaryButton.text}\n </Button>\n </a>\n )}\n {primaryButton && primaryButton.text && (\n <a href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"primary\"\n onClick={handleButtonPrimaryClick}\n className={cn('member-equity-button-primary ', lgButtonSize)}\n >\n {primaryButton.text}\n </Button>\n </a>\n )}\n </div>\n </div>\n </div>\n </section>\n )\n }\n)\n\nexport default withStyles(MemberEquity)\n"],
5
- "mappings": "aA8EY,cAAAA,EA2BA,QAAAC,MA3BA,oBA7EZ,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,2BACxB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,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,YAAY,EAC5D,EAEAxB,EAACO,EAAA,CACC,OAAQiB,GAAuB,IAC/B,IAAKA,GAAuB,IAC5B,UAAU,4FACZ,EAEFxB,EAAC,OAAI,UAAW,uEACd,SAAAC,EAAC,OACC,UAAW;AAAA;AAAA;AAAA,cAKX,UAAAA,EAAC,OAAI,UAAU,mHACb,UAAAD,EAACM,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,UAAW,uBAAwB,KAAMe,EAAO,EAC1ErB,EAACQ,EAAA,CAAK,KAAM,EAAG,UAAW,4BAA6B,KAAMc,EAAa,GAC5E,EAEArB,EAAC,OAAI,UAAU,mFACZ,UAAAyB,GAAmBA,EAAgB,MAClC1B,EAAC,KAAE,KAAMc,EAAYY,EAAgB,KAAM,GAAGX,CAAa,IAAIC,CAAa,EAAE,EAC5E,SAAAhB,EAACK,EAAA,CACC,QAAQ,YACR,QAAS8B,EACT,UAAWzB,EAAG,kCAAmC0B,CAAY,EAE5D,SAAAV,EAAgB,KACnB,EACF,EAEDD,GAAiBA,EAAc,MAC9BzB,EAAC,KAAE,KAAMc,EAAYW,EAAc,KAAM,GAAGV,CAAa,IAAIC,CAAa,EAAE,EAC1E,SAAAhB,EAACK,EAAA,CACC,QAAQ,UACR,QAAS6B,EACT,UAAWxB,EAAG,gCAAiC0B,CAAY,EAE1D,SAAAX,EAAc,KACjB,EACF,GAEJ,GACF,EACF,GACF,CAEJ,CACF,EAEA,IAAOY,EAAQ5B,EAAWQ,CAAY",
6
- "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "Button", "Heading", "Picture", "Text", "withStyles", "cn", "isVideo", "useExposure", "useAiuiContext", "trackUrlRef", "componentType", "componentName", "MemberEquity", "data", "className", "ref", "title", "description", "backgroundImage", "mobileBackgroundImage", "primaryButton", "secondaryButton", "theme", "shape", "primaryButtonHandler", "secondaryButtonHandler", "innerRef", "trackingData", "profileActivated", "handleButtonPrimaryClick", "handleButtonSecondaryClick", "lgButtonSize", "MemberEquity_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MemberEquityProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'member_area'\n\nconst MemberEquity: React.FC<MemberEquityProps> = React.forwardRef<HTMLDivElement, MemberEquityProps>(\n ({ data, className = '' }, ref) => {\n const {\n title,\n description,\n backgroundImage,\n mobileBackgroundImage,\n primaryButton,\n secondaryButton,\n theme,\n shape,\n primaryButtonHandler,\n secondaryButtonHandler,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: description,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n const handleButtonPrimaryClick = () => {\n // \u6267\u884C\u4E3B\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n primaryButtonHandler?.()\n }\n\n const handleButtonSecondaryClick = () => {\n // \u6267\u884C\u526F\u6309\u94AE\u7684\u70B9\u51FB\u4E8B\u4EF6\n secondaryButtonHandler?.()\n }\n\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <section\n data-ui-component-id=\"MemberEquity\"\n className={cn(\n 'lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]',\n 'text-info-primary relative overflow-hidden',\n className,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n 'h-[480px]': isMobile,\n }\n )}\n ref={innerRef}\n >\n {isVideo(backgroundImage?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"laptop:block absolute inset-0 hidden size-full object-cover\"\n >\n <source src={backgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={backgroundImage?.url}\n alt={backgroundImage?.alt}\n className=\"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n {isVideo(mobileBackgroundImage?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"laptop:hidden absolute inset-0 size-full object-cover\">\n <source src={mobileBackgroundImage?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={mobileBackgroundImage?.url}\n alt={mobileBackgroundImage?.alt}\n className=\"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n )}\n <div className={'laptop:items-center absolute inset-0 flex w-full items-end py-[16px]'}>\n <div\n className={`\n tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5 \n laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4\n `}\n >\n <div className=\"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col\">\n <Heading as=\"h2\" size={3} className={`member-equity-title `} html={title} />\n <Text size={2} className={`member-equity-description`} html={description} />\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"tablet:gap-3 laptop:gap-4 desktop:gap-4 lg-desktop:gap-4 flex items-center gap-3\">\n {secondaryButton && secondaryButton.text && (\n <a href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"secondary\"\n onClick={handleButtonSecondaryClick}\n className={cn('member-equity-button-secondary ', lgButtonSize)}\n >\n {secondaryButton.text}\n </Button>\n </a>\n )}\n {primaryButton && primaryButton.text && (\n <a href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}>\n <Button\n variant=\"primary\"\n onClick={handleButtonPrimaryClick}\n className={cn('member-equity-button-primary ', lgButtonSize)}\n >\n {primaryButton.text}\n </Button>\n </a>\n )}\n </div>\n </div>\n </div>\n </section>\n )\n }\n)\n\nexport default withStyles(MemberEquity)\n"],
5
+ "mappings": "aAiFY,cAAAA,EA2BA,QAAAC,MA3BA,oBAhFZ,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,2BACxB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,eAAAC,MAAmB,8BAE5B,MAAMC,EAAgB,QAChBC,EAAgB,cAEhBC,EAA4ChB,EAAM,WACtD,CAAC,CAAE,KAAAiB,EAAM,UAAAC,EAAY,EAAG,EAAGC,IAAQ,CACjC,KAAM,CACJ,MAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,MAAAC,EACA,qBAAAC,EACA,uBAAAC,CACF,EAAIZ,EAEEa,EAAW3B,EAAc,CAAE,MAAO,oBAAqB,CAAC,EACxD4B,EAAW7B,EAAuB,IAAI,EAE5CD,EAAoBkB,EAAK,IAAMY,EAAS,OAAyB,EAEjE,KAAM,CAAE,aAAAC,CAAa,EAAIpB,EAAe,EAClC,CAAE,iBAAAqB,CAAiB,EAAID,EAE7BrB,EAAYoB,EAAU,CACpB,cAAAjB,EACA,cAAAC,EACA,eAAgBK,EAChB,qBAAsBC,EACtB,mBAAoBY,EAAmB,SAAW,YACpD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B,EAAG,kCAAmC2B,CAAY,EAE5D,SAAAX,EAAgB,KACnB,EACF,EAEDD,GAAiBA,EAAc,MAC9B1B,EAAC,KAAE,KAAMe,EAAYW,EAAc,KAAM,GAAGV,CAAa,IAAIC,CAAa,EAAE,EAC1E,SAAAjB,EAACM,EAAA,CACC,QAAQ,UACR,QAAS8B,EACT,UAAWzB,EAAG,gCAAiC2B,CAAY,EAE1D,SAAAZ,EAAc,KACjB,EACF,GAEJ,GACF,EACF,GACF,CAEJ,CACF,EAEA,IAAOa,EAAQ7B,EAAWQ,CAAY",
6
+ "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useMediaQuery", "Button", "Heading", "Picture", "Text", "withStyles", "cn", "isVideo", "useExposure", "useAiuiContext", "trackUrlRef", "componentType", "componentName", "MemberEquity", "data", "className", "ref", "title", "description", "backgroundImage", "mobileBackgroundImage", "primaryButton", "secondaryButton", "theme", "shape", "primaryButtonHandler", "secondaryButtonHandler", "isMobile", "innerRef", "trackingData", "profileActivated", "handleButtonPrimaryClick", "handleButtonSecondaryClick", "lgButtonSize", "MemberEquity_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as a,jsxs as $}from"react/jsx-runtime";import s,{useImperativeHandle as Y,useRef as x}from"react";import{useGSAP as _}from"@gsap/react";import{gsap as h}from"gsap";import{SplitText as R}from"gsap/dist/SplitText";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{cn as c}from"../../helpers/utils.js";import{Heading as q,Text as B}from"../../components/index.js";import{withStyles as J}from"../../shared/Styles.js";import{useExposure as K}from"../../hooks/useExposure.js";import{useAiuiContext as O}from"../AiuiProvider/index.js";const Q="copy",V="brand_slogan";function W(p=[],u=3){const m=[];for(let e=0;e<p.length;e+=u)m.push(p.slice(e,e+u));return m}const A=s.forwardRef(({data:p,className:u=""},m)=>{const{title:e,features:n=[],featureChunkSize:H=3}=p,[b,N]=s.useState(0),[D,y]=s.useState(!0),w=x(null),f=W(n,H),T=f.length,l=n.length>H,G=l?[...f,f[0]]:f,E=40;Y(m,()=>w.current);const{trackingData:L}=O(),{profileActivated:C}=L;K(w,{componentType:Q,componentName:V,componentTitle:e,memberActiveStatus:C?"active":"not active"}),s.useEffect(()=>{if(!l)return;const t=setInterval(()=>{N(r=>r+1),y(!0)},3e3);return()=>clearInterval(t)},[T,l]),s.useEffect(()=>{if(l)if(b===T){const t=setTimeout(()=>{y(!1),N(0)},500);return()=>clearTimeout(t)}else y(!0)},[b,T,l]);const i=x(null),k=x(null),g=x(null);return _(()=>{if(h.registerPlugin(v,R),!i.current)return;g.current=new R(i.current,{type:"words",wordsClass:"word"});const t=i.current?.clientHeight||100,r=g.current.words;return h.set(r,{opacity:0}),v.create({trigger:i.current,start:"bottom bottom-=6%",end:`bottom+=${t*2+80}px bottom-=6%`,scrub:!0,onUpdate:o=>{const d=o.progress,I=r.length,P=1/I,M=.5;r.forEach((z,j)=>{const F=j/I*(1-M),U=P*(1+M);let S=(d-F)/U;S=Math.max(0,Math.min(S,1)),h.set(z,{opacity:S})})}}),n&&n.length>0&&v.create({trigger:k.current,start:`bottom+=${t*2}px bottom-=6%`,end:`bottom+=${t*2+100}px bottom-=6%`,onUpdate:o=>{h.set(k.current,{opacity:o.progress})}}),()=>{g.current&&g.current.revert(),v.getAll().forEach(o=>o.kill())}},[]),$("div",{ref:w,className:c("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",u),children:[a(q,{ref:i,as:"h2",size:2,weight:"bold",align:"left",className:c("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:e}),n&&n.length>0&&a("div",{className:c("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${E}px]`),children:a("div",{className:c(["flex flex-col",D?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${b*E}px)`},children:G.map((t,r)=>a("div",{className:c("flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${E}px]`),children:t.map((o,d)=>$(s.Fragment,{children:[d>0&&a("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),a(B,{size:3,align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:o.title})]},d))},r))})})]})});A.displayName="Slogan";var it=J(A);export{V as componentName,Q as componentType,it as default};
1
+ "use client";import{jsx as a,jsxs as $}from"react/jsx-runtime";import s,{useImperativeHandle as Y,useRef as x}from"react";import{useGSAP as _}from"@gsap/react";import{gsap as h}from"gsap";import{SplitText as R}from"gsap/dist/SplitText";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{cn as c}from"../../helpers/utils.js";import{Heading as q,Text as B}from"../../components/index.js";import{withStyles as J}from"../../shared/Styles.js";import{useExposure as K}from"../../hooks/useExposure.js";import{useAiuiContext as O}from"../AiuiProvider/index.js";const Q="copy",V="brand_slogan";function W(p=[],u=3){const m=[];for(let e=0;e<p.length;e+=u)m.push(p.slice(e,e+u));return m}const A=s.forwardRef(({data:p,className:u=""},m)=>{const{title:e,features:n=[],featureChunkSize:H=3}=p,[b,N]=s.useState(0),[D,y]=s.useState(!0),w=x(null),f=W(n,H),T=f.length,l=n.length>H,G=l?[...f,f[0]]:f,E=40;Y(m,()=>w.current);const{trackingData:L}=O(),{profileActivated:C}=L;K(w,{componentType:Q,componentName:V,componentTitle:e,memberActiveStatus:C?"active":"not active"}),s.useEffect(()=>{if(!l)return;const t=setInterval(()=>{N(r=>r+1),y(!0)},3e3);return()=>clearInterval(t)},[T,l]),s.useEffect(()=>{if(l)if(b===T){const t=setTimeout(()=>{y(!1),N(0)},500);return()=>clearTimeout(t)}else y(!0)},[b,T,l]);const i=x(null),k=x(null),g=x(null);return _(()=>{if(h.registerPlugin(v,R),!i.current)return;g.current=new R(i.current,{type:"words",wordsClass:"word"});const t=i.current?.clientHeight||100,r=g.current.words;return h.set(r,{opacity:0}),v.create({trigger:i.current,start:"bottom bottom-=4%",end:`bottom+=${t*1.5}px bottom-=4%`,scrub:!0,onUpdate:o=>{const d=o.progress,I=r.length,P=1/I,M=.5;r.forEach((z,j)=>{const F=j/I*(1-M),U=P*(1+M);let S=(d-F)/U;S=Math.max(0,Math.min(S,1)),h.set(z,{opacity:S})})}}),n&&n.length>0&&v.create({trigger:k.current,start:`bottom+=${t*2}px bottom-=6%`,end:`bottom+=${t*2+100}px bottom-=6%`,onUpdate:o=>{h.set(k.current,{opacity:o.progress})}}),()=>{g.current&&g.current.revert(),v.getAll().forEach(o=>o.kill())}},[]),$("div",{ref:w,className:c("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",u),children:[a(q,{ref:i,as:"h2",size:2,weight:"bold",align:"left",className:c("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:e}),n&&n.length>0&&a("div",{className:c("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${E}px]`),children:a("div",{className:c(["flex flex-col",D?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${b*E}px)`},children:G.map((t,r)=>a("div",{className:c("flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${E}px]`),children:t.map((o,d)=>$(s.Fragment,{children:[d>0&&a("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),a(B,{size:3,align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:o.title})]},d))},r))})})]})});A.displayName="Slogan";var it=J(A);export{V as componentName,Q as componentType,it as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Slogan/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=6%',\n end: `bottom+=${height * 2 + 80}px bottom-=6%`,\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 },\n })\n\n if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
- "mappings": "aAkIM,cAAAA,EA+BY,QAAAC,MA/BZ,oBAjIN,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,WAAAC,MAAe,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,2BAExB,MAAMC,EAAgB,OAChBC,EAAgB,eAE7B,SAASC,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1C,EAAK,IAAIsC,EAAY,QAAS,CAAE,QAASI,EAAK,QAAS,CAAC,CAC1D,CACF,CAAC,EAGI,IAAM,CACXH,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9DrC,EAAc,OAAO,EAAE,QAASiD,GAAWA,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAAC,CAAC,EAGHxD,EAAC,OACC,IAAKgC,EACL,UAAWxB,EACT,2KACAe,CACF,EAEA,UAAAxB,EAACU,EAAA,CACC,IAAKiC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWlC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa6B,CAAW,KAAK,EAC/F,SAAAtC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EAAkB,mEAAqE,kBACzF,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB3D,EAAC,OACC,UAAWS,EACT,2DACA,aAAa6B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB5D,EAACC,EAAM,SAAN,CACE,UAAA2D,EAAQ,GAAK7D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,mGACV,KAAMiD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDrC,EAAO,YAAc,SAErB,IAAOwC,GAAQlD,EAAWU,CAAM",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { trackingData } = useAiuiContext()\n const { profileActivated } = trackingData\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n memberActiveStatus: profileActivated ? 'active' : 'not active',\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}px bottom-=4%`,\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 },\n })\n\n if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
+ "mappings": "aAkIM,cAAAA,EA+BY,QAAAC,MA/BZ,oBAjIN,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,WAAAC,MAAe,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,2BAExB,MAAMC,EAAgB,OAChBC,EAAgB,eAE7B,SAASC,EAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG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E,QAASiD,GAAWA,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAAC,CAAC,EAGHxD,EAAC,OACC,IAAKgC,EACL,UAAWxB,EACT,2KACAe,CACF,EAEA,UAAAxB,EAACU,EAAA,CACC,IAAKiC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWlC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa6B,CAAW,KAAK,EAC/F,SAAAtC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EAAkB,mEAAqE,kBACzF,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB3D,EAAC,OACC,UAAWS,EACT,2DACA,aAAa6B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB5D,EAACC,EAAM,SAAN,CACE,UAAA2D,EAAQ,GAAK7D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,mGACV,KAAMiD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDrC,EAAO,YAAc,SAErB,IAAOwC,GAAQlD,EAAWU,CAAM",
6
6
  "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useGSAP", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "Text", "withStyles", "useExposure", "useAiuiContext", "componentType", "componentName", "chunkArray", "array", "size", "result", "i", "Slogan", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "trackingData", "profileActivated", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "t", "group", "idx", "feature", "index", "Slogan_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as f}from"react/jsx-runtime";import S,{useRef as m}from"react";import{useGSAP as k}from"@gsap/react";import{gsap as s}from"gsap";import{SplitText as p}from"gsap/dist/SplitText";import{ScrollTrigger as i}from"gsap/dist/ScrollTrigger";import{cn as E}from"../../helpers/utils.js";import{Heading as M}from"../../components/index.js";import{withStyles as P}from"../../shared/Styles.js";const u=S.forwardRef(({data:d,className:g})=>{const{title:l,theme:h}=d,t=m(null),r=m(null);return k(()=>{if(s.registerPlugin(p,i),!t.current)return;const y=t.current?.clientHeight||80;r.current=new p(t.current,{type:"words",wordsClass:"word"});const e=r.current.words;return s.set(e,{opacity:0}),i.create({trigger:t.current,start:"bottom bottom-=6%",end:`bottom+=${y*2+40}px bottom-=6%`,scrub:!0,onUpdate:o=>{const T=o.progress,a=e.length,b=1/a,c=.5;e.forEach((w,x)=>{const v=x/a*(1-c),H=b*(1+c);let n=(T-v)/H;n=Math.max(0,Math.min(n,1)),s.set(w,{opacity:n})})}}),()=>{r.current&&r.current.revert(),i.getAll().forEach(o=>o.kill())}},[]),l&&f("div",{className:E("tablet:mb-[32px] mb-[24px] space-y-4",g,{"aiui-dark":h==="dark"}),children:f(M,{ref:t,as:"h1",size:4,html:l})})});u.displayName="Title";var I=P(u);export{I as default};
1
+ "use client";import{jsx as f}from"react/jsx-runtime";import S,{useRef as m}from"react";import{useGSAP as k}from"@gsap/react";import{gsap as s}from"gsap";import{SplitText as p}from"gsap/dist/SplitText";import{ScrollTrigger as i}from"gsap/dist/ScrollTrigger";import{cn as E}from"../../helpers/utils.js";import{Heading as M}from"../../components/index.js";import{withStyles as P}from"../../shared/Styles.js";const u=S.forwardRef(({data:d,className:g})=>{const{title:l,theme:h}=d,t=m(null),r=m(null);return k(()=>{if(s.registerPlugin(p,i),!t.current)return;const y=t.current?.clientHeight||80;r.current=new p(t.current,{type:"words",wordsClass:"word"});const e=r.current.words;return s.set(e,{opacity:0}),i.create({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${y*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:o=>{const T=o.progress,a=e.length,b=1/a,c=.5;e.forEach((w,x)=>{const v=x/a*(1-c),H=b*(1+c);let n=(T-v)/H;n=Math.max(0,Math.min(n,1)),s.set(w,{opacity:n})})}}),()=>{r.current&&r.current.revert(),i.getAll().forEach(o=>o.kill())}},[]),l&&f("div",{className:E("tablet:mb-[32px] mb-[24px] space-y-4",g,{"aiui-dark":h==="dark"}),children:f(M,{ref:t,as:"h1",size:4,html:l})})});u.displayName="Title";var I=P(u);export{I as default};
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, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\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 ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=6%',\n end: `bottom+=${height * 2 + 40}px bottom-=6%`,\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 },\n })\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [])\n\n return (\n title && (\n <div className={cn('tablet:mb-[32px] mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withStyles(Title)\n"],
5
- "mappings": "aAqDQ,cAAAA,MAAA,oBApDR,OAAOC,GAAS,UAAAC,MAAc,QAC9B,OAAS,WAAAC,MAAe,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,4BACxB,OAAS,cAAAC,MAAkB,yBAG3B,MAAMC,EAAQT,EAAM,WAAuC,CAAC,CAAE,KAAAU,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,EAAWb,EAA2B,IAAI,EAC1Cc,EAAoBd,EAAyB,IAAI,EACvD,OAAAC,EAAQ,IAAM,CAEZ,GADAC,EAAK,eAAeC,EAAWC,CAAa,EACxC,CAACS,EAAS,QAAS,OACvB,MAAME,EAASF,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAIX,EAAUU,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMG,EAAQF,EAAkB,QAAQ,MACxC,OAAAZ,EAAK,IAAIc,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9BZ,EAAc,OAAO,CACnB,QAASS,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWE,EAAS,EAAI,EAAE,gBAC/B,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1CxB,EAAK,IAAIoB,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,EACM,IAAM,CACXZ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9DV,EAAc,OAAO,EAAE,QAASuB,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAAC,CAAC,EAGHhB,GACEb,EAAC,OAAI,UAAWO,EAAG,uCAAwCK,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACrG,SAAAd,EAACQ,EAAA,CAAQ,IAAKO,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDH,EAAM,YAAc,QAEpB,IAAOoB,EAAQrB,EAAWC,CAAK",
4
+ "sourcesContent": ["'use client'\nimport React, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\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 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 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 },\n })\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [])\n\n return (\n title && (\n <div className={cn('tablet:mb-[32px] mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withStyles(Title)\n"],
5
+ "mappings": "aAqDQ,cAAAA,MAAA,oBApDR,OAAOC,GAAS,UAAAC,MAAc,QAC9B,OAAS,WAAAC,MAAe,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,4BACxB,OAAS,cAAAC,MAAkB,yBAG3B,MAAMC,EAAQT,EAAM,WAAuC,CAAC,CAAE,KAAAU,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,EAAWb,EAA2B,IAAI,EAC1Cc,EAAoBd,EAAyB,IAAI,EACvD,OA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cn", "Heading", "withStyles", "Title", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "t", "Title_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as g,jsx as a}from"react/jsx-runtime";import m from"react";import{cn as y}from"../helpers/utils.js";import{Slot as R}from"@radix-ui/react-slot";const b=({children:e})=>a(g,{children:e}),k=m.forwardRef(({...e},t)=>{const{asChild:p,children:n,className:s,spaceY:o="none",spaceTop:c="none",spaceBottom:r="none",...i}=e,d=p?R:"div",x={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},f={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},C={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return a(d,{...i,ref:t,className:y(s,"ipc_container","relative z-10","desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",x?.[o]||o,f?.[c]||c,C?.[r]||r),children:n})}),l=m.forwardRef(({...e},t)=>{const{children:p,mode:n="section"}=e,o={section:k,fragment:b}[n];return a(o,{...e,ref:t,children:p})});l.displayName="Container";export{l as Container};
1
+ import{Fragment as u,jsx as t}from"react/jsx-runtime";import m from"react";import{cn as l}from"../helpers/utils.js";import{Slot as R}from"@radix-ui/react-slot";const b=({children:e})=>t(u,{children:e}),k=m.forwardRef(({...e},p)=>{const{asChild:n,children:a,className:s,spaceY:o="none",spaceTop:c="none",spaceBottom:r="none",...d}=e,x=n?R:"div",f={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},C={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},y={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return t(x,{...d,ref:p,className:l(s,"ipc_container","relative z-10 w-full"),children:t("div",{className:l(s,"desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",f?.[o]||o,C?.[c]||c,y?.[r]||r),children:a})})}),i=m.forwardRef(({...e},p)=>{const{children:n,mode:a="section"}=e,o={section:k,fragment:b}[a];return t(o,{...e,ref:p,children:n})});i.displayName="Container";export{i as Container};
2
2
  //# sourceMappingURL=container.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/container.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp\n {...containerProps}\n ref={forwardedRef}\n className={cn(\n className,\n 'ipc_container',\n 'relative z-10',\n 'desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full',\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4',\n spaceY_map?.[spaceY] || spaceY,\n spaceTop_map?.[spaceTop] || spaceTop,\n spaceBottom_map?.[spaceBottom] || spaceBottom\n )}\n >\n {children}\n </Comp>\n )\n})\n\nconst Container = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const { children, mode = 'section' } = props\n\n const componentsMap: {\n [P in Mode]: React.ComponentType<any> | string\n } = {\n section: Section,\n fragment: Fragment,\n }\n\n const Component = componentsMap![mode!]\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n )\n})\n\nContainer.displayName = 'Container'\n\nexport { Container }\nexport type { ContainerProps }\n"],
5
- "mappings": "AAiBS,mBAAAA,EAAA,OAAAC,MAAA,oBAjBT,OAAOC,MAAW,QAClB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAcrB,MAAMJ,EAAW,CAAC,CAAE,SAAAK,CAAS,IACpBJ,EAAAD,EAAA,CAAG,SAAAK,EAAS,EAGfC,EAAUJ,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAJ,EACA,UAAAK,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIP,EAEEQ,EAAON,EAAUL,EAAO,MAExBY,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,OACEjB,EAACc,EAAA,CACE,GAAGD,EACJ,IAAKN,EACL,UAAWL,EACTO,EACA,gBACA,gBACA,8DACA,8EACAM,IAAaL,CAAM,GAAKA,EACxBM,IAAeL,CAAQ,GAAKA,EAC5BM,IAAkBL,CAAW,GAAKA,CACpC,EAEC,SAAAR,EACH,CAEJ,CAAC,EAEKc,EAAYjB,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACnG,KAAM,CAAE,SAAAH,EAAU,KAAAe,EAAO,SAAU,EAAIb,EASjCc,EALF,CACF,QAASf,EACT,SAAUN,CACZ,EAEiCoB,CAAK,EAEtC,OACEnB,EAACoB,EAAA,CAAW,GAAGd,EAAO,IAAKC,EACxB,SAAAH,EACH,CAEJ,CAAC,EAEDc,EAAU,YAAc",
4
+ "sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp {...containerProps} ref={forwardedRef} className={cn(className, 'ipc_container', 'relative z-10 w-full')}>\n <div\n className={cn(\n className,\n 'desktop:max-w-[1792px] lg-desktop:max-w-full mx-auto w-full',\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4',\n spaceY_map?.[spaceY] || spaceY,\n spaceTop_map?.[spaceTop] || spaceTop,\n spaceBottom_map?.[spaceBottom] || spaceBottom\n )}\n >\n {children}\n </div>\n </Comp>\n )\n})\n\nconst Container = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const { children, mode = 'section' } = props\n\n const componentsMap: {\n [P in Mode]: React.ComponentType<any> | string\n } = {\n section: Section,\n fragment: Fragment,\n }\n\n const Component = componentsMap![mode!]\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n )\n})\n\nContainer.displayName = 'Container'\n\nexport { Container }\nexport type { ContainerProps }\n"],
5
+ "mappings": "AAiBS,mBAAAA,EAAA,OAAAC,MAAA,oBAjBT,OAAOC,MAAW,QAClB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAcrB,MAAMJ,EAAW,CAAC,CAAE,SAAAK,CAAS,IACpBJ,EAAAD,EAAA,CAAG,SAAAK,EAAS,EAGfC,EAAUJ,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAJ,EACA,UAAAK,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIP,EAEEQ,EAAON,EAAUL,EAAO,MAExBY,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,OACEjB,EAACc,EAAA,CAAM,GAAGD,EAAgB,IAAKN,EAAc,UAAWL,EAAGO,EAAW,gBAAiB,sBAAsB,EAC3G,SAAAT,EAAC,OACC,UAAWE,EACTO,EACA,8DACA,8EACAM,IAAaL,CAAM,GAAKA,EACxBM,IAAeL,CAAQ,GAAKA,EAC5BM,IAAkBL,CAAW,GAAKA,CACpC,EAEC,SAAAR,EACH,EACF,CAEJ,CAAC,EAEKc,EAAYjB,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACnG,KAAM,CAAE,SAAAH,EAAU,KAAAe,EAAO,SAAU,EAAIb,EASjCc,EALF,CACF,QAASf,EACT,SAAUN,CACZ,EAEiCoB,CAAK,EAEtC,OACEnB,EAACoB,EAAA,CAAW,GAAGd,EAAO,IAAKC,EACxB,SAAAH,EACH,CAEJ,CAAC,EAEDc,EAAU,YAAc",
6
6
  "names": ["Fragment", "jsx", "React", "cn", "Slot", "children", "Section", "props", "forwardedRef", "asChild", "className", "spaceY", "spaceTop", "spaceBottom", "containerProps", "Comp", "spaceY_map", "spaceTop_map", "spaceBottom_map", "Container", "mode", "Component"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import*as s from"react";import{cn as p}from"../helpers/index.js";import*as o from"@radix-ui/react-tabs";import{cva as d}from"class-variance-authority";const l=s.createContext({align:"left",shape:"square"}),m=s.forwardRef(({children:e,align:t="left",shape:a="square",...i},r)=>n(o.Root,{ref:r,...i,children:n(l.Provider,{value:{align:t,shape:a},children:e})}));m.displayName="Tabs";const h=d("",{variants:{align:{left:"justify-left",center:"justify-center",right:"justify-end"},shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{align:"left",shape:"square"}}),R=d("",{variants:{shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"square"}}),c=s.forwardRef(({className:e,...t},a)=>{const{align:i,shape:r}=s.useContext(l);return n(o.List,{ref:a,className:p("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",h({align:i,shape:r}),e),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...t})});c.displayName=o.List.displayName;const b=s.forwardRef(({className:e,onClick:t,...a},i)=>{const{shape:r}=s.useContext(l),u=f=>{t?.(f),f.currentTarget.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})};return n(o.Trigger,{ref:i,className:p("text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]",e,R({shape:r})),onClick:u,...a})});b.displayName=o.Trigger.displayName;const g=s.forwardRef(({className:e,...t},a)=>n(o.Content,{ref:a,className:p(e),...t}));g.displayName=o.Content.displayName;export{m as Tabs,g as TabsContent,c as TabsList,b as TabsTrigger};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import*as s from"react";import{cn as p}from"../helpers/index.js";import*as o from"@radix-ui/react-tabs";import{cva as f}from"class-variance-authority";const l=s.createContext({align:"left",shape:"square"}),d=s.forwardRef(({children:e,align:t="left",shape:a="square",...i},r)=>n(o.Root,{ref:r,...i,children:n(l.Provider,{value:{align:t,shape:a},children:e})}));d.displayName="Tabs";const R=f("",{variants:{align:{left:"justify-left",center:"justify-center",right:"justify-end"},shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{align:"left",shape:"square"}}),h=f("",{variants:{shape:{rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"square"}}),m=s.forwardRef(({className:e,...t},a)=>{const{align:i,shape:r}=s.useContext(l);return n(o.List,{ref:a,className:p("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",R({align:i,shape:r}),e),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...t})});m.displayName=o.List.displayName;const c=s.forwardRef(({className:e,onClick:t,...a},i)=>{const{shape:r}=s.useContext(l),b=u=>{t?.(u)};return n(o.Trigger,{ref:i,className:p("text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]",e,h({shape:r})),onClick:b,...a})});c.displayName=o.Trigger.displayName;const g=s.forwardRef(({className:e,...t},a)=>n(o.Content,{ref:a,className:p(e),...t}));g.displayName=o.Content.displayName;export{d as Tabs,g as TabsContent,m as TabsList,c as TabsTrigger};
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/tabs.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: Shape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: Shape\n }\n>(({ children, align = 'left', shape = 'square', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('', {\n variants: {\n align: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n align: 'left',\n shape: 'square',\n },\n})\n\nconst tabsTriggerVariants = cva('', {\n variants: {\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({\n align: alignFromParent,\n shape: shapeFromParent,\n }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n e.currentTarget.scrollIntoView({\n behavior: 'smooth',\n inline: 'center',\n block: 'nearest',\n })\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displ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Ac,KAAK,YAE1C,MAAMe,EAAcjB,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,QAAAI,EAAS,GAAGT,CAAM,EAAGC,IAAQ,CAC3C,KAAM,CAAE,MAAOM,CAAgB,EAAIhB,EAAM,WAAWI,CAAc,EAC5De,EAAeC,GAA2C,CAC9DF,IAAUE,CAAC,EACXA,EAAE,cAAc,eAAe,CAC7B,SAAU,SACV,OAAQ,SACR,MAAO,SACT,CAAC,CACH,EACA,OACErB,EAACG,EAAc,QAAd,CACC,IAAKQ,EACL,UAAWT,EACT,4QACAa,EACAF,EAAoB,CAClB,MAAOI,CACT,CAAC,CACH,EACA,QAASG,EACR,GAAGV,EACN,CAEJ,CAAC,EACDQ,EAAY,YAAcf,EAAc,QAAQ,YAEhD,MAAMmB,EAAcrB,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,GAAGL,CAAM,EAAGC,IAAQX,EAACG,EAAc,QAAd,CAAsB,IAAKQ,EAAK,UAAWT,EAAGa,CAAS,EAAI,GAAGL,EAAO,CAAE,EAC5GY,EAAY,YAAcnB,EAAc,QAAQ",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: Shape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: Shape\n }\n>(({ children, align = 'left', shape = 'square', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('', {\n variants: {\n align: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n align: 'left',\n shape: 'square',\n },\n})\n\nconst tabsTriggerVariants = cva('', {\n variants: {\n shape: {\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({\n align: alignFromParent,\n shape: shapeFromParent,\n }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n // e.currentTarget.scrollIntoView({\n // behavior: 'smooth',\n // inline: 'center',\n // block: 'nearest',\n // })\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-[16px] disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-[20px] pb-[10px] pt-[11px] text-[14px] font-bold data-[state=active]:bg-white data-[state=active]:text-[#1d1d1d]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
+ "mappings": "aAyBI,cAAAA,MAAA,oBAvBJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,UAAYC,MAAmB,uBAC/B,OAAS,OAAAC,MAAW,2BAGpB,MAAMC,EAAiBJ,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKK,EAAOL,EAAM,WAMjB,CAAC,CAAE,SAAAM,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,SAAU,GAAGC,CAAM,EAAGC,IAC3DX,EAACG,EAAc,KAAd,CAAmB,IAAKQ,EAAM,GAAGD,EAChC,SAAAV,EAACK,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAG,EAAO,MAAAC,CAAM,EAAI,SAAAF,EAAS,EAC9D,CACD,EACDD,EAAK,YAAc,OAEnB,MAAMM,EAAmBR,EAAI,GAAI,CAC/B,SAAU,CACR,MAAO,CACL,KAAM,eACN,OAAQ,iBACR,MAAO,aACT,EACA,MAAO,CACL,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,OACP,MAAO,QACT,CACF,CAAC,EAEKS,EAAsBT,EAAI,GAAI,CAClC,SAAU,CACR,MAAO,CACL,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,QACT,CACF,CAAC,EACKU,EAAWb,EAAM,WAGrB,CAAC,CAAE,UAAAc,EAAW,GAAGL,CAAM,EAAGC,IAAQ,CAClC,KAAM,CAAE,MAAOK,EAAiB,MAAOC,CAAgB,EAAIhB,EAAM,WAAWI,CAAc,EAC1F,OACEL,EAACG,EAAc,KAAd,CACC,IAAKQ,EACL,UAAWT,EACT,4DACAU,EAAiB,CACf,MAAOI,EACP,MAAOC,CACT,CAAC,EACDF,CACF,EACA,MAAO,CACL,eAAgB,OAChB,gBAAiB,MACnB,EACC,GAAGL,EACN,CAEJ,CAAC,EACDI,EAAS,YAAcX,EAAc,KAAK,YAE1C,MAAMe,EAAcjB,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,QAAAI,EAAS,GAAGT,CAAM,EAAGC,IAAQ,CAC3C,KAAM,CAAE,MAAOM,CAAgB,EAAIhB,EAAM,WAAWI,CAAc,EAC5De,EAAeC,GAA2C,CAC9DF,IAAUE,CAAC,CAMb,EACA,OACErB,EAACG,EAAc,QAAd,CACC,IAAKQ,EACL,UAAWT,EACT,4QACAa,EACAF,EAAoB,CAClB,MAAOI,CACT,CAAC,CACH,EACA,QAASG,EACR,GAAGV,EACN,CAEJ,CAAC,EACDQ,EAAY,YAAcf,EAAc,QAAQ,YAEhD,MAAMmB,EAAcrB,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,GAAGL,CAAM,EAAGC,IAAQX,EAACG,EAAc,QAAd,CAAsB,IAAKQ,EAAK,UAAWT,EAAGa,CAAS,EAAI,GAAGL,EAAO,CAAE,EAC5GY,EAAY,YAAcnB,EAAc,QAAQ",
6
6
  "names": ["jsx", "React", "cn", "TabsPrimitive", "cva", "TabListContext", "Tabs", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "TabsList", "className", "alignFromParent", "shapeFromParent", "TabsTrigger", "onClick", "handleClick", "e", "TabsContent"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "0.0.27-alpha.141",
3
+ "version": "0.0.27-alpha.145",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",