@udixio/ui-react 2.10.15 → 2.10.17
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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/theme.worker.js +121 -113
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Dn=Object.defineProperty;var An=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>An(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),Ve=require("react-dom"),Y=require("motion/react"),ht=require("clsx"),Fn=require("tailwind-merge"),we=require("@udixio/theme"),Oe=require("@udixio/tailwind"),Pn=require("react-textarea-autosize");var Pe=typeof document<"u"?document.currentScript:null;const mt=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[s,r]=o.useState(!0),[u,c]=o.useState(!1),[a,d]=o.useState({x:50,y:50});o.useEffect(()=>{u&&(r(!0),r(!1))},[u]),o.useEffect(()=>{const p=t==null?void 0:t.current;if(p)return p.addEventListener("mousedown",i),p.addEventListener("mouseup",x),p.addEventListener("mouseleave",f),()=>{p.removeEventListener("mousedown",i),p.removeEventListener("mouseup",x),p.removeEventListener("mouseleave",f)}},[t]);const i=p=>{const b=t==null?void 0:t.current,w=b.getBoundingClientRect();c(!0),d({x:(p.clientX-w.left)/b.clientWidth*100,y:(p.clientY-w.top)/b.clientHeight*100})},f=p=>{c(!1)},x=p=>{c(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={position:"absolute",inset:0,width:"100%",height:"100%","--x":a.x+"%","--y":a.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return l.jsx(Y.AnimatePresence,{mode:"wait",children:(u||!u&&!s)&&l.jsx(Y.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>r(!0)})})},pt=Fn.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),y=(...e)=>pt(ht.clsx(e)),yt=(...e)=>pt(ht.clsx(e));function $n(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const Re=e=>{const t={};e.classNameList.forEach(s=>{var r;if(s)if(typeof s=="string")(t[r=e.default]??(t[r]=[])).push(s);else{const u=s(e.states);Object.entries(u).map(c=>{const[a,d]=c;(t[a]??(t[a]=[])).push(d)})}});const n=t;return Object.entries(t).map(s=>{let[r,u]=s;u=u.reverse(),r==e.default&&u.unshift("relative"),u.unshift($n(r)),n[r]=yt(...u)}),n},ne=(e,t)=>n=>Re({classNameList:[n.className,t],default:e,states:n}),Z=(e,t)=>n=>o.useMemo(()=>Re({classNameList:[n.className,t],default:e,states:n}),[n]);function Wn(e,t,n){return o.useMemo(()=>Re({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const xt=ne("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:y("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":n,"[&::-webkit-scrollbar-thumb]:bg-transparent":!n},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!n,"cursor-grabbing":t&&n}),track:y("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function Tn(e,t){let n=0,s=null,r=null;const u=(c,a)=>{n=Date.now(),t(c,a)};return(c,a)=>{const d=Date.now(),i=e-(d-n);i<=0?(s&&(clearTimeout(s),s=null),u(c,a)):(r={v:c,o:a},s||(s=setTimeout(()=>{s=null;const f=r;r=null,f&&u(f.v,f.o)},i)))}}const vt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:s,className:r,draggable:u=!1,throttleDuration:c=75,scroll:a,setScroll:d})=>{var G,S;const i=o.useRef(null),f=o.useRef(null),[x,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const N=new ResizeObserver(C=>{for(const q of C)q.target===i.current&&h({width:q.contentRect.width,height:q.contentRect.height})});return N.observe(i.current),()=>{N.disconnect()}},[i]);const m=o.useRef(null),p=o.useRef(null),b=()=>{const N=f.current;return N?{width:n??N.scrollWidth,height:n??N.scrollHeight}:null},w=()=>{const N=i.current;return N?{width:N.clientWidth,height:N.clientHeight}:null},{scrollYProgress:L,scrollXProgress:E}=Y.useScroll({container:i}),g=o.useRef(null);g.current||(g.current=Tn(c,(N,C)=>{!p.current||!m.current||!i.current||(C===(t==="horizontal"?"x":"y")&&(d==null||d(N)),s&&(t==="horizontal"&&C==="x"&&s({scrollProgress:N,scroll:N*(m.current.width-i.current.clientWidth),scrollTotal:m.current.width-i.current.clientWidth,scrollVisible:p.current.width}),t==="vertical"&&C==="y"&&s({scrollProgress:N,scroll:N*(m.current.height-i.current.clientHeight),scrollTotal:m.current.height-i.current.clientHeight,scrollVisible:p.current.height})))}));const F=(N,C)=>{g.current&&g.current(N,C)};o.useEffect(()=>{x.width&&F(E.get(),"x"),x.height&&F(L.get(),"y")},[x]),o.useEffect(()=>{const N=i.current,C=f.current;if(!N||!C||typeof a!="number")return;const q=(U,J,te)=>Math.min(te,Math.max(J,U));if(t==="horizontal"){const U=Math.max(0,(n??C.scrollWidth)-N.clientWidth);N.scrollLeft=q(a*U,0,U)}else{const U=Math.max(0,(n??C.scrollHeight)-N.clientHeight);N.scrollTop=q(a*U,0,U)}},[a,t,n]),Y.useMotionValueEvent(E,"change",N=>{F(N,"x")}),Y.useMotionValueEvent(L,"change",N=>{F(N,"y")});const[I,v]=o.useState(!1);o.useLayoutEffect(()=>{I||!p.current||!m.current||!s||(s({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?p.current.height:p.current.width}),v(!0))},[p,m,s]),m.current=b(),p.current=w();const[k,D]=o.useState(!1),M=xt({isDragging:k,children:e,className:r,onScroll:s,orientation:t,scrollSize:n,draggable:u,throttleDuration:c}),[T,j]=o.useState(0),[X,V]=o.useState(0),Q=N=>{if(!u)return;const C=i.current;if(!C||T==null)return;const U=(N.pageX-C.offsetLeft-T)*1.5;C.scrollLeft=X-U},z=N=>{const C=i.current;C&&(D(!0),j(N.pageX-C.offsetLeft),V(C.scrollLeft))},$=N=>{k&&(N.preventDefault(),Q(N))},R=()=>{D(!1)},O=()=>{D(!1)},A=N=>{N.preventDefault()},W=o.useRef(null);return o.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]),o.useEffect(()=>{const N=i.current;if(!N)return;const C=q=>{var se,P,_,B;const U=q.detail,J=i.current;if(!J||!U)return;const te=U.orientation??t;if(typeof U.progress=="number")if(te==="horizontal"){const ee=Math.max(0,(((se=m.current)==null?void 0:se.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.progress*ee))}else{const ee=Math.max(0,(((P=m.current)==null?void 0:P.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.progress*ee))}else if(typeof U.scroll=="number")if(te==="horizontal"){const ee=Math.max(0,(((_=m.current)==null?void 0:_.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.scroll))}else{const ee=Math.max(0,(((B=m.current)==null?void 0:B.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.scroll))}};return N.addEventListener("udx:customScroll:set",C),()=>{N.removeEventListener("udx:customScroll:set",C)}},[t]),l.jsxs("div",{className:M.customScroll,ref:i,onMouseDown:z,onMouseMove:$,onMouseUp:R,onMouseLeave:O,onDragStart:A,onScroll:N=>{k||(j(null),D(!0),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{D(!1)},1e3))},children:[l.jsx("div",{ref:f,style:t==="vertical"?{height:((G=p==null?void 0:p.current)==null?void 0:G.height)??"100%"}:{width:((S=p==null?void 0:p.current)==null?void 0:S.width)??"100%"},className:M.track,children:e}),p.current&&m.current&&l.jsxs(l.Fragment,{children:[t==="vertical"&&m.current.height>p.current.height&&l.jsx(Y.motion.div,{className:"flex-none",style:{height:m.current.height-p.current.height}}),t==="horizontal"&&m.current.width>p.current.width&&l.jsx(Y.motion.div,{className:"flex-none",style:{width:m.current.width-p.current.width}})]})]})};var On="1.3.17";function gt(e,t,n){return Math.max(e,Math.min(t,n))}function Bn(e,t,n){return(1-n)*e+n*t}function Hn(e,t,n,s){return Bn(e,t,1-Math.exp(-n*s))}function Vn(e,t){return(e%t+t)%t}var zn=class{constructor(){H(this,"isRunning",!1);H(this,"value",0);H(this,"from",0);H(this,"to",0);H(this,"currentTime",0);H(this,"lerp");H(this,"duration");H(this,"easing");H(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const s=gt(0,this.currentTime/this.duration,1);t=s>=1;const r=t?1:this.easing(s);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=Hn(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:s,easing:r,onStart:u,onUpdate:c}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=s,this.easing=r,this.currentTime=0,this.isRunning=!0,u==null||u(),this.onUpdate=c}};function _n(e,t){let n;return function(...s){let r=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(r,s)},t)}}var Yn=class{constructor(e,t,{autoResize:n=!0,debounce:s=250}={}){H(this,"width",0);H(this,"height",0);H(this,"scrollHeight",0);H(this,"scrollWidth",0);H(this,"debouncedResize");H(this,"wrapperResizeObserver");H(this,"contentResizeObserver");H(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});H(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});H(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=_n(this.resize,s),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},wt=class{constructor(){H(this,"events",{})}emit(e,...t){var s;let n=this.events[e]||[];for(let r=0,u=n.length;r<u;r++)(s=n[r])==null||s.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var s;this.events[e]=(s=this.events[e])==null?void 0:s.filter(r=>t!==r)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(s=>t!==s)}destroy(){this.events={}}},ot=100/6,he={passive:!1},qn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){H(this,"touchStart",{x:0,y:0});H(this,"lastDelta",{x:0,y:0});H(this,"window",{width:0,height:0});H(this,"emitter",new wt);H(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});H(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,s=-(t-this.touchStart.x)*this.options.touchMultiplier,r=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:s,y:r},this.emitter.emit("scroll",{deltaX:s,deltaY:r,event:e})});H(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});H(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:s}=e;const r=s===1?ot:s===2?this.window.width:1,u=s===1?ot:s===2?this.window.height:1;t*=r,n*=u,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});H(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,he),this.element.addEventListener("touchstart",this.onTouchStart,he),this.element.addEventListener("touchmove",this.onTouchMove,he),this.element.addEventListener("touchend",this.onTouchEnd,he)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,he),this.element.removeEventListener("touchstart",this.onTouchStart,he),this.element.removeEventListener("touchmove",this.onTouchMove,he),this.element.removeEventListener("touchend",this.onTouchEnd,he)}},it=e=>Math.min(1,1.001-Math.pow(2,-10*e)),Un=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:s=!0,syncTouch:r=!1,syncTouchLerp:u=.075,touchInertiaExponent:c=1.7,duration:a,easing:d,lerp:i=.1,infinite:f=!1,orientation:x="vertical",gestureOrientation:h=x==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:p=1,autoResize:b=!0,prevent:w,virtualScroll:L,overscroll:E=!0,autoRaf:g=!1,anchors:F=!1,autoToggle:I=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:k=!1,naiveDimensions:D=k,stopInertiaOnNavigate:M=!1}={}){H(this,"_isScrolling",!1);H(this,"_isStopped",!1);H(this,"_isLocked",!1);H(this,"_preventNextNativeScrollEvent",!1);H(this,"_resetVelocityTimeout",null);H(this,"_rafId",null);H(this,"isTouching");H(this,"time",0);H(this,"userData",{});H(this,"lastVelocity",0);H(this,"velocity",0);H(this,"direction",0);H(this,"options");H(this,"targetScroll");H(this,"animatedScroll");H(this,"animate",new zn);H(this,"emitter",new wt);H(this,"dimensions");H(this,"virtualScroll");H(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});H(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});H(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});H(this,"onClick",e=>{const n=e.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.getAttribute("href"));if(this.options.anchors){const s=n.find(r=>{var u;return(u=r.getAttribute("href"))==null?void 0:u.includes("#")});if(s){const r=s.getAttribute("href");if(r){const u=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,c=`#${r.split("#")[1]}`;this.scrollTo(c,u)}}}this.options.stopInertiaOnNavigate&&n.find(r=>r.host===window.location.host)&&this.reset()});H(this,"onPointerDown",e=>{e.button===1&&this.reset()});H(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:s}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const r=s.type.includes("touch"),u=s.type.includes("wheel");this.isTouching=s.type==="touchstart"||s.type==="touchmove";const c=t===0&&n===0;if(this.options.syncTouch&&r&&s.type==="touchstart"&&c&&!this.isStopped&&!this.isLocked){this.reset();return}const d=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(c||d)return;let i=s.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(w=>{var L,E,g;return w instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(w))||((L=w.hasAttribute)==null?void 0:L.call(w,"data-lenis-prevent"))||r&&((E=w.hasAttribute)==null?void 0:E.call(w,"data-lenis-prevent-touch"))||u&&((g=w.hasAttribute)==null?void 0:g.call(w,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(w,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&r||this.options.smoothWheel&&u)){this.isScrolling="native",this.animate.stop(),s.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const m=r&&this.options.syncTouch,b=r&&s.type==="touchend";b&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:b?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});H(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});H(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=On,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof d!="function"?d=it:typeof d=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:s,syncTouch:r,syncTouchLerp:u,touchInertiaExponent:c,duration:a,easing:d,lerp:i,infinite:f,gestureOrientation:h,orientation:x,touchMultiplier:m,wheelMultiplier:p,autoResize:b,prevent:w,virtualScroll:L,overscroll:E,autoRaf:g,anchors:F,autoToggle:I,allowNestedScroll:v,naiveDimensions:D,stopInertiaOnNavigate:M},this.dimensions=new Yn(e,t,{autoResize:b}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new qn(n,{touchMultiplier:m,wheelMultiplier:p}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:s=!1,programmatic:r=!0,lerp:u=r?this.options.lerp:void 0,duration:c=r?this.options.duration:void 0,easing:a=r?this.options.easing:void 0,onStart:d,onComplete:i,force:f=!1,userData:x}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const p=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?p.left:p.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(r){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=gt(0,e,this.limit);if(e===this.targetScroll){d==null||d(this),i==null||i(this);return}if(this.userData=x??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}r||(this.targetScroll=e),typeof c=="number"&&typeof a!="function"?a=it:typeof a=="function"&&typeof c!="number"&&(c=1),this.animate.fromTo(this.animatedScroll,e,{duration:c,easing:a,lerp:u,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),r&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const s=Date.now(),r=e._lenis??(e._lenis={});let u,c,a,d,i,f,x,h;const m=this.options.gestureOrientation;if(s-(r.time??0)>2e3){r.time=Date.now();const I=window.getComputedStyle(e);r.computedStyle=I;const v=I.overflowX,k=I.overflowY;if(u=["auto","overlay","scroll"].includes(v),c=["auto","overlay","scroll"].includes(k),r.hasOverflowX=u,r.hasOverflowY=c,!u&&!c||m==="vertical"&&!c||m==="horizontal"&&!u)return!1;i=e.scrollWidth,f=e.scrollHeight,x=e.clientWidth,h=e.clientHeight,a=i>x,d=f>h,r.isScrollableX=a,r.isScrollableY=d,r.scrollWidth=i,r.scrollHeight=f,r.clientWidth=x,r.clientHeight=h}else a=r.isScrollableX,d=r.isScrollableY,u=r.hasOverflowX,c=r.hasOverflowY,i=r.scrollWidth,f=r.scrollHeight,x=r.clientWidth,h=r.clientHeight;if(!u&&!c||!a&&!d||m==="vertical"&&(!c||!d)||m==="horizontal"&&(!u||!a))return!1;let p;if(m==="horizontal")p="x";else if(m==="vertical")p="y";else{const I=t!==0,v=n!==0;I&&u&&a&&(p="x"),v&&c&&d&&(p="y")}if(!p)return!1;let b,w,L,E,g;if(p==="x")b=e.scrollLeft,w=i-x,L=t,E=u,g=a;else if(p==="y")b=e.scrollTop,w=f-h,L=n,E=c,g=d;else return!1;return(L>0?b<w:b>0)&&E&&g}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?Vn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const Xn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:s=!1,touchMultiplier:r=2,children:u})=>{const c=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let d;typeof e=="string"?e.endsWith("ms")?d=parseFloat(e)/1e3:e.endsWith("s")?d=parseFloat(e):d=parseFloat(e)||1.2:d=e;const i=x=>1-Math.pow(1-x,5);c.current=new Un({duration:d,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:r,syncTouch:s});const f=x=>{var h;(h=c.current)==null||h.raf(x),a.current=requestAnimationFrame(f)};return a.current=requestAnimationFrame(f),()=>{var x;a.current!==null&&cancelAnimationFrame(a.current),(x=c.current)==null||x.destroy(),c.current=null}},[e,t,n,s,r]),u?l.jsx(l.Fragment,{children:u}):null},ue=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:s,className:r})=>{const u=o.useRef(null),c=o.useRef(null),[a,d]=o.useState(!1),i=bt({isClient:a,stateClassName:n,className:r,colorName:t});return o.useEffect(()=>{if(u.current&&n!=="state-layer"){const x=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=u.current.closest(`.${x}:not(.${x} .${x})`);c.current=h}d(!0)},[]),l.jsxs("div",{ref:u,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&l.jsx(mt,{triggerRef:c}),s]})},Gn=({isClient:e,stateClassName:t})=>({stateLayer:y(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),bt=Z("stateLayer",Gn),St=({targetRef:e,children:t})=>{const[n,s]=o.useState(null),r=o.useRef(null),u=()=>{const c=e.current;if(!c)return;const a=c.getBoundingClientRect();s({position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"none",zIndex:999})};return o.useEffect(()=>{const c=e.current;if(c)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),r.current=new ResizeObserver(u),r.current.observe(c),()=>{var a;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(a=r.current)==null||a.disconnect()}},[e]),n?Ve.createPortal(l.jsx("div",{style:n,children:t}),document.body):null};function Kn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Jn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:s=!1})=>{const[r,u]=o.useState(null),[c,a]=o.useState(null),d=o.useRef(null),i=o.useRef(0),f=o.useRef(0),x=o.useRef(null),h=o.useRef(!1),m=o.useRef(n);o.useEffect(()=>{m.current=n},[n]),o.useEffect(()=>{let E=!1;return(async()=>{const g=await we.loader(e,s);if(E)return;x.current=g,u(g);const F=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/theme.worker.js").href:new URL("theme.worker.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:Pe&&Pe.tagName.toUpperCase()==="SCRIPT"&&Pe.src||new URL("index.cjs",document.baseURI).href),{type:"module"});d.current=F,F.onmessage=I=>{var v;I.data.id>f.current&&(f.current=I.data.id,h.current=!0,a(I.data.css),(v=m.current)==null||v.call(m,x.current))}})(),()=>{var g;E=!0,(g=d.current)==null||g.terminate(),d.current=null}},[]);const p=o.useRef(null),b=o.useRef(0),w=o.useRef(null);o.useEffect(()=>{if(!r)return;const E={...e,sourceColor:e.sourceColor},g=Date.now(),F=g-b.current,I=async v=>{await L(v)};if(b.current===0||F>=t)p.current&&(clearTimeout(p.current),p.current=null),w.current=null,b.current=g,I(E);else if(w.current=E,!p.current){const v=Math.max(0,t-F);p.current=setTimeout(async()=>{p.current=null;const k=w.current;w.current=null,k&&(b.current=Date.now(),await I(k))},v)}return()=>{}},[e,t,r]);const L=async E=>{if(typeof E.sourceColor=="string"&&!Kn(E.sourceColor))throw new Error("Invalid hex color");const g=x.current;if(!g)return;g.context.update(E),g.palettes.sync(E.palettes);const F=d.current;if(!F||!h.current){await g.load();const v=g.plugins.getPlugin(Oe.TailwindPlugin).getInstance().outputCss;a(v),h.current=!0,n==null||n(g);return}const I=++i.current;F.postMessage({id:I,snapshot:we.serializeThemeContext(g),tailwindOptions:g.plugins.getPlugin(Oe.TailwindPlugin).options,fontOptions:g.plugins.getPlugin(we.FontPlugin).options})};return o.useEffect(()=>()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),c?l.jsx("style",{dangerouslySetInnerHTML:{__html:c}}):null};function Zn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function Qn(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ze(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function lt(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function $e(e,t){if(!ze(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const c=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),a=c==="x"||c==="inline"?"inline":c==="y"||c==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(a==="inline"?e.classList.add(`${t}-timeline-inline`):a==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const s=e.getAttribute(`data-${t}-end`);s&&e.style.setProperty(`--${t}-range-end`,s);const r=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),u=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!r&&!u&&e.setAttribute(`data-${t}-run`,"")}function We(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(s=>ze(s))}function es(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),s=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(r=>{if(!(r instanceof HTMLElement))return!1;const u=r.classList;return u.contains(`${t}-in`)||u.contains(`${t}-out`)||Array.from(u).some(d=>d.startsWith(`${t}-`)&&!d.includes("scroll")&&!s.has(d))?!0:!ze(r)})}function ts(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function at(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function ct(e,t,n){const s=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=s}const ns=[0,.2],ut=new WeakSet;function dt(e,t){if(ut.has(e))return;ut.add(e);const n=r=>{r.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},s=r=>{r.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",s),e.addEventListener("animationcancel",s)}function _e(e={}){const{prefix:t="anim",once:n=!0}=e;if(Qn())return()=>{};const s=Zn(),r=new WeakSet;let u=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,c=!0;const a=()=>{const m=window.pageYOffset||window.scrollY||0;c=m>=u,u=m};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const d=new IntersectionObserver(m=>{for(const p of m){const b=p.target;if(!lt(b)||b.hasAttribute(`data-${t}-animating`))continue;const w=ts(b.classList,t);p.isIntersecting?(w&&ct(b,t,"out"),at(b,t,"in"),n&&d.unobserve(b)):n||(c||ct(b,t,"in"),w&&at(b,t,"out"))}},{threshold:ns}),i=m=>{const p=es(m||document,t);for(const b of p)r.has(b)||(r.add(b),d.observe(b),dt(b,t))};i();let f,x=null,h=null;if(s)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const p=We(void 0,t);for(const b of p)$e(b,t)}))})(),x=new MutationObserver(p=>{for(const b of p)if(b.type==="attributes"){const w=b.target;w instanceof HTMLElement&&($e(w,t),lt(w)&&(r.has(w)||(r.add(w),d.observe(w),dt(w,t))))}else if(b.type==="childList"&&b.addedNodes&&b.addedNodes.length){for(const w of Array.from(b.addedNodes))if(w instanceof HTMLElement){const L=We(w,t);for(const E of L)$e(E,t);i(w)}}}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),x&&x.disconnect()};else{let m;We(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven.js")).then(b=>{m=b.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),d.disconnect()}}const ss=_e,rs=_e,be=({anchorRef:e,position:t="bottom",children:n,style:s,...r})=>{const c=`--anchor-${o.useId().replace(/:/g,"")}`,[a,d]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&d(!0)},[]),o.useLayoutEffect(()=>{if(a&&e.current){const f=e.current;return f.style.anchorName=c,()=>{e.current&&(e.current.style.anchorName="")}}},[a,e,c]),a){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:c,positionArea:t,positionTryFallbacks:"flip-block, flip-inline",...s};return Ve.createPortal(l.jsx("div",{style:f,...r,children:n}),document.body)}const i={position:"absolute",pointerEvents:"auto",...s};switch(t){case"top":i.bottom="100%",i.left="50%",i.transform="translateX(-50%)";break;case"top-left":i.bottom="100%",i.left=0;break;case"top-right":i.bottom="100%",i.right=0;break;case"bottom":i.top="100%",i.left="50%",i.transform="translateX(-50%)";break;case"bottom-left":i.top="100%",i.left=0;break;case"bottom-right":i.top="100%",i.right=0;break;case"left":i.right="100%",i.top="50%",i.transform="translateY(-50%)";break;case"right":i.left="100%",i.top="50%",i.transform="translateY(-50%)";break}return l.jsx(St,{targetRef:e,children:l.jsx("div",{style:i,...r,children:n})})},Et=({variant:e,disableTextMargins:t,disabled:n,iconPosition:s,icon:r,isActive:u,loading:c,shape:a,onToggle:d,size:i,allowShapeTransformation:f})=>({button:y(" relative cursor-pointer group/button outline-none inline-block flex w-fit justify-center items-center ",i==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",i==="small"&&"text-label-large px-4 py-2.5 gap-2",i==="medium"&&"text-title-medium px-6 py-4 gap-2",i==="large"&&"text-headline-small px-12 py-8 gap-3",i==="xLarge"&&"text-headline-large px-16 py-12 gap-4",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&u)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"active:rounded-[12px]":i==="xSmall"||i=="small","active:rounded-[16px]":i==="medium","active:rounded-[28px]":i==="large"||i=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!u,"bg-primary text-on-primary":!n&&u,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!u&&d,"bg-primary text-on-primary":!n&&(u&&d||!d),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!u,"bg-secondary text-on-secondary":!n&&u,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!u,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&u}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[i==="xSmall"&&"-mx-3 ",i==="small"&&"-mx-4 ",i==="medium"&&"-mx-6 ",i==="large"&&"-mx-12",i==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:y("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:y("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&u)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":i==="xSmall"||i=="small","group-active/button:rounded-[16px]":i==="medium","group-active/button:rounded-[28px]":i==="large"||i=="xLarge"}),label:y({invisible:c}),icon:y({invisible:c},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),os=ne("button",Et),Nt=Z("button",Et),kt=({variant:e,interactive:t})=>({card:y(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card cursor-pointer":t})}),is=ne("card",kt),jt=Z("card",kt),Ye=()=>({carouselItem:y("rounded-[28px] overflow-hidden flex-none",{})}),ls=ne("carouselItem",Ye),Lt=Z("carouselItem",Ye),Mt=()=>({carousel:y(["w-full h-[400px]"]),track:y("flex h-full w-full")}),as=ne("carousel",Mt),It=Z("carousel",Mt),Ct=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:s,isFocused:r,isHovered:u})=>({checkbox:y("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:y("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:y("relative flex items-center justify-center w-[18px] h-[18px] "),box:y("absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200",!e&&!t&&{"border-on-surface-variant":!s&&!n,"border-error":s&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!s&&!n,"bg-error border-error":s&&!n,"bg-on-surface border-on-surface":n}),icon:y("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":s&&!n,"text-surface":n}),stateLayer:"size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),cs=ne("checkbox",Ct),Rt=Z("checkbox",Ct),Dt=({variant:e,disabled:t,trailingIcon:n,icon:s,isActive:r,isInteractive:u,activated:c,isFocused:a,isDragging:d,isEditing:i})=>({chip:y(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":s,"pr-2":n,"cursor-pointer":!t&&u},{" text-on-surface-variant":!c&&!a||i,"bg-secondary-container text-on-secondary-container":(c||a)&&!i},d&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:y("rounded-lg overflow-hidden",{}),label:y("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:y("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:y("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),us=ne("chip",Dt),At=Z("chip",Dt),Ft=({scrollable:e})=>({chips:y(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),ds=ne("chips",Ft),Pt=Z("chips",Ft),$t=({orientation:e})=>({divider:y("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),fs=ne("divider",$t),Wt=Z("divider",$t),Tt=({size:e,variant:t,extended:n})=>({fab:y("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:y({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:y("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),hs=ne("fab",Tt),Ot=Z("fab",Tt),Bt=({size:e,variant:t,open:n})=>({fabMenu:y("relative inline-flex flex-col items-end"),actions:y("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:y("text-nowrap")}),ms=ne("fabMenu",Bt),Ht=Z("fabMenu",Bt),Vt=({variant:e,disabled:t,onToggle:n,isActive:s,size:r,width:u,shape:c,allowShapeTransformation:a})=>({iconButton:y("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},c==="rounded"&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(c==="squared"||a&&s)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"active:rounded-[12px]":r==="xSmall"||r=="small","active:rounded-[16px]":r==="medium","active:rounded-[28px]":r==="large"||r=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!s&&!!n,"bg-primary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!s&&!!n,"bg-secondary text-on-secondary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!s,"border border-transparent bg-inverse-surface":s},!!t&&{"border border-on-surface/[0.12]":!s,"border border-transparent bg-on-surface/[0.12]":s}]),touchTarget:y("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:y("absolute top-0 left-0 h-full w-full overflow-hidden",(c==="rounded"||c==="squared"&&n&&!t&&s&&a)&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(c==="squared"||c==="rounded"&&n&&!t&&s&&a)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":r==="xSmall"||r=="small","group-active/icon-button:rounded-[16px]":r==="medium","group-active/icon-button:rounded-[28px]":r==="large"||r=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!s,"state-primary":s},e==="filled"&&{"state-primary":!s&&!!n,"state-inverse-on-surface":s||!n},e==="tonal"&&{"state-on-surface-variant":!s&&!!n,"state-on-secondary-container":s||!n},e==="outlined"&&{"state-on-surface-variant":!s,"state-on-primary":s}]),icon:y(" transition-all duration-300",{"size-5 p-1.5":r==="xSmall"},{"size-6 p-2":r==="small"},{"size-6 p-4":r==="medium"},{"size-8 p-8":r==="large"},{"size-10 p-12":r==="xLarge"},u=="narrow"&&[{"px-1":r==="xSmall"},{"px-1":r==="small"},{"px-3":r==="medium"},{"px-4":r==="large"},{"px-8":r==="xLarge"}],u=="wide"&&[{"px-2.5":r==="xSmall"},{"px-3.5":r==="small"},{"px-6":r==="medium"},{"px-12":r==="large"},{"px-[72px]":r==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!s,"text-primary":s},e==="filled"&&{"text-primary":!s&&!!n,"text-on-primary":s||!n},e==="outlined"&&{"text-on-surface-variant":!s,"text-inverse-on-surface":s}],!!t&&"text-on-surface/[0.38]")}),ps=ne("iconButton",Vt),zt=Z("iconButton",Vt),_t=({variant:e,hasGroups:t})=>({menu:y("z-50 min-w-[112px] max-w-[280px] max-h-[300px] ","flex flex-col",{"overflow-y-auto":!t},{"bg-surface-container":!e||e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant","py-0.5 shadow-2 px-1 rounded-2xl":!t,"bg-transparent ":t})}),ys=ne("menu",_t),Yt=Z("menu",_t),qt=({variant:e})=>({menuGroup:y("flex flex-col gap-0.5 mb-0.5 last:mb-0","rounded-lg py-0.5 px-1 shadow-2 first:rounded-t-2xl last:rounded-b-2xl",{"bg-surface-container":e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant"}),groupLabel:y("px-3 pt-2 text-label-small tracking-wide ",{"text-on-surface-variant":e==="standard","text-on-tertiary-container opacity-80":e==="vibrant"})}),xs=ne("menuGroup",qt),Ut=Z("menuGroup",qt),Xt=({variant:e,isVisible:t})=>({progressIndicator:y((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1",e==="linear-indeterminate"&&"relative overflow-hidden rounded-full"),firstTrack:y((e==="linear-determinate"||e==="linear-indeterminate")&&"h-full rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),activeIndicator:y("h-full rounded-full bg-primary",e==="linear-determinate"&&{"rounded-l-full":!0},(e==="linear-indeterminate"||e==="linear-determinate")&&{"max-h-0":!t,"max-h-full":t},(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),lastTrack:y((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),stop:y("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),vs=ne("progressIndicator",Xt),Gt=Z("progressIndicator",Xt),qe=({variant:e,position:t})=>({sideSheet:y("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:y("w-full overflow-hidden flex flex-col",{}),header:y("p-4 flex items-center gap-2"),content:y("flex-1 overflow-y-auto"),title:y("text-on-surface-variant text-title-large"),closeButton:y("ml-auto"),divider:y({hidden:e=="modal"}),overlay:y("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),Kt=ne("sideSheet",qe),gs=Z("sideSheet",qe),Ue=({isChanging:e})=>({slider:y(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:y(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:y(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:y(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:y(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:y(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),ws=ne("slider",Ue),Jt=Z("slider",Ue),Zt=()=>({snackbar:y(" rounded bg-inverse-surface "),container:y("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:y("text-body-medium text-inverse-on-surface "),icon:y(" ml-auto mr-0 text-inverse-on-surface block dark")}),bs=ne("snackbar",Zt),Qt=Z("snackbar",Zt),en=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:y("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:y("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:y("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:y("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:y("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),Ss=ne("switch",en),tn=Z("switch",en),nn=({isSelected:e,icon:t,label:n,variant:s})=>({tab:y("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&s==="primary"&&"h-16",!(t&&n&&s==="primary")&&"h-12"),stateLayer:y("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",s==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},s==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:y("flex gap-0.5 h-full justify-center",{relative:s=="primary"},{"":!!(n&&!t)},s==="primary"&&"flex-col items-center",s==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:y("h-6 w-6 p-0.5 !box-border",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:y("text-title-small text-nowrap",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:y("bg-primary absolute w-full left-0 bottom-0",s==="primary"&&"h-[3px] rounded-t",s==="secondary"&&"h-0.5")}),Es=ne("tab",nn),sn=Z("tab",nn),rn=({scrollable:e})=>({tabs:y("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),Ns=ne("tabs",rn),on=Z("tabs",rn),ln=()=>({tabPanels:y("overflow-hidden")}),ks=ne("tabPanels",ln),an=Z("tabPanels",ln),cn=()=>({tabPanel:y("")}),js=ne("tabPanel",cn),un=Z("tabPanel",cn),dn=({disabled:e,leadingIcon:t,trailingIcon:n,variant:s,errorText:r,isFocused:u,value:c,suffix:a,multiline:d})=>({textField:y({"opacity-[.38]":e}),content:y("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!d},{"border-on-surface-variant":!(r!=null&&r.length)&&!u&&s=="filled","border-outline":!(r!=null&&r.length)&&!u&&s=="outlined","border-primary":!(r!=null&&r.length)&&u,"border-error":!!(r!=null&&r.length)},{"bg-on-surface/[0.04]":e},s=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],s=="outlined"&&["border rounded box-border",{"border-[3px]":u}]),stateLayer:y("absolute -z-10 w-full h-full top-0 left-0",{hidden:s=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:y("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"text-error":!!(r!=null&&r.length)},{"text-primary":!(r!=null&&r.length)&&u}),input:y("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!a},s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10"),activeIndicator:y("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",s=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(r!=null&&r.length)},{"bg-error":!!(r!=null&&r.length)},{"!w-full":u}]),supportingText:y(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(r!=null&&r.length)}),leadingIcon:y(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:y("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:y("text-on-surface-variant pl-0 pr-4",s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10")}),Ls=ne("textField",dn),fn=Z("textField",dn),hn=({position:e,variant:t})=>({toolTip:y(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:y("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:y("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:y("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:y(""),content:y("w-full")}),Ms=ne("toolTip",hn),mn=Z("toolTip",hn),le=({icon:e,colors:t=[],className:n,...s})=>{if(typeof e=="string"){let f=e,x="";return t[0]&&(x=` fill="${t[0]}" color="${t[0]}"`,f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),f=f.replace(/<svg([^>]*)>/,(h,m)=>`<svg${m.replace(/\s+(width|height)=["'][^"']*["']/g,"")} width="100%" height="100%"${x}>`),l.jsx("div",{className:y("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||""},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return l.jsx("img",{src:f.src,width:f.width,height:f.height,className:y("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const r=e;if(!(r!=null&&r.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:u}=r,[c,a,,,d]=u||[],i=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return l.jsx("svg",{className:y("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${c} ${a}`,role:"img","aria-hidden":"true",...s,children:typeof d=="string"?l.jsx("path",{className:"fill-current",d}):d.map((f,x)=>l.jsx("path",{d:f},x))})},pn=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:s,...r})=>{const[u,c]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),c(t)},[t]);const[d,i]=o.useState(!0),f=()=>d?a:a*.5;o.useEffect(()=>{if(e==="circular-indeterminate"&&u!==100){const p=setInterval(()=>{c(d?20:40),i(!d)},f()*1e3);return()=>clearInterval(p)}},[e,d,u]);const[x,h]=o.useState(!1);o.useEffect(()=>{if(u>=100){const p=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(p)}}else h(!0)},[u,n]);const m=Gt({className:s,variant:e,value:t,transitionDuration:n,isVisible:x});return l.jsxs(l.Fragment,{children:[e==="linear-indeterminate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx(Y.motion.div,{animate:{width:["0%","0%","0%","20%"],marginLeft:["0px","0px","6px","6px"],marginRight:["0px","0px","6px","6px"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.499,.5,1]},style:{flexShrink:0},className:m.activeIndicator}),l.jsx(Y.motion.div,{animate:{width:["0%","40%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{flexShrink:0},className:m.firstTrack}),l.jsx(Y.motion.div,{animate:{width:["20%","60%","20%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.5,1]},style:{flexShrink:0,marginLeft:"6px"},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:"6px"},className:m.lastTrack})]}),e==="linear-determinate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx("div",{style:{width:`${u}%`,transition:`width ${n}ms ease-in-out ${u==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:u!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${u==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.lastTrack}),l.jsx("div",{style:{width:"4px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&l.jsx(Y.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:e==="circular-indeterminate"?270:-90},transition:e==="circular-indeterminate"?{repeat:1/0,duration:f(),ease:"linear"}:{duration:n/1e3},className:m.progressIndicator,...r,children:l.jsx(Y.motion.circle,{cx:"50%",cy:"50%",r:x?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:e==="circular-indeterminate"?"hidden":"determinate",animate:e==="circular-indeterminate"?"visible":"determinate",className:m.activeIndicator,variants:{hidden:{pathLength:d?10/100:90/100},visible:{pathLength:d?90/100:10/100},determinate:{pathLength:u/100}},transition:{pathLength:e==="circular-indeterminate"?{type:"tween",ease:"linear",duration:f(),bounce:0}:{type:"tween",ease:"easeInOut",duration:n/1e3}}})},e==="circular-indeterminate"?d+"":"static")]})};function Is(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const me=({variant:e="filled",disabled:t=!1,icon:n,href:s,label:r,disableTextMargins:u,className:c,iconPosition:a="left",loading:d=!1,shape:i="rounded",onClick:f,onToggle:x,activated:h,ref:m,size:p="medium",allowShapeTransformation:b=!0,transition:w,children:L,...E})=>{if(L&&(r=L),!r)throw new Error("Button component requires either a label prop or children content");e=Is(e);const g=s?"a":"button",F=o.useRef(null),I=m||F,[v,k]=o.useState(h);o.useEffect(()=>{k(h)},[h]),w={duration:.3,...w};const D=j=>{t&&j.preventDefault(),x?(k(!v),x(!v)):f&&f(j)},M=Nt({allowShapeTransformation:b,size:p,disableTextMargins:u,shape:i,href:s,disabled:t,icon:n,iconPosition:a,loading:d,variant:e,transition:w,className:c,isActive:v??!1,onToggle:x,activated:v,label:r,children:r}),T=n?l.jsx(le,{icon:n,className:M.icon}):l.jsx(l.Fragment,{});return l.jsxs(g,{ref:I,href:s,className:M.button,...E,onClick:D,disabled:t,"aria-pressed":x?v:void 0,style:{transition:w.duration+"s"},children:[l.jsx("div",{className:M.touchTarget}),l.jsx(ue,{style:{transition:w.duration+"s"},className:M.stateLayer,colorName:y(e==="filled"&&{"on-surface-variant":!v&&!!x,"on-primary":v||!x},e==="elevated"&&{"on-primary":v&&!!x,primary:!v||!x},e==="tonal"&&{"on-secondary":v&&!!x,"on-secondary-container":!v||!x},e==="outlined"&&{"inverse-on-surface":v&&!!x,"on-surface-variant":!v||!x},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),a==="left"&&T,d&&l.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:l.jsx(pn,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:y({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),l.jsx("span",{className:M.label,children:r}),a==="right"&&T]})},Cs=({variant:e="outlined",className:t,children:n,interactive:s=!1,ref:r,...u})=>{const c=jt({className:t,interactive:s,variant:e,children:n}),a=o.useRef(null),d=r||a;return l.jsxs("div",{...u,ref:d,className:c.card,children:[s&&l.jsx(ue,{className:c.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},ve=(e,t,n=[0,1])=>{const[s,r]=t,[u,c]=n,d=(Math.max(s,Math.min(e,r))-s)/(r-s);return u+d*(c-u)},yn=({className:e,children:t,width:n,index:s=0,outputRange:r,ref:u,...c})=>{const a=o.useRef(null),d=u||a,i=Lt({className:e,index:s,children:t});return l.jsx("div",{ref:d,style:{width:"var(--carousel-item-width, 100%)",maxWidth:r?r[1]+"px":void 0,minWidth:r?r[0]+"px":void 0},className:i.carouselItem,...c,children:t})},Rs=({variant:e="hero",className:t,children:n,ref:s,marginPourcent:r=0,inputRange:u=[.21,.65],outputRange:c=[42,300],gap:a=8,onChange:d,onMetricsChange:i,index:f,scrollSensitivity:x=1.25,...h})=>{const m=o.useRef(null),p=s||m,b=It({index:f,className:t,children:n,variant:e,inputRange:u,outputRange:c,marginPourcent:r,onChange:d,gap:a,scrollSensitivity:x,onMetricsChange:i}),w=o.Children.toArray(n).filter(A=>o.isValidElement(A)&&A.type===yn),L=o.useRef(null),E=o.useRef({scrollProgress:0,scrollTotal:0,scrollVisible:0,scroll:0}),g=o.useRef(0),F=o.useRef(null),I=o.useRef([]).current,[v,k]=o.useState(0);I.length!==w.length&&(I.length=0,w.forEach((A,W)=>{I[W]=o.createRef()}));const D=o.useCallback(()=>{if(!L.current||!p.current)return;const A=g.current,W=E.current.scrollVisible||p.current.clientWidth||0;function G(B,ee){return B.map((oe,pe)=>{const Se=(oe-ee)/Math.abs(B[1]-B[0]);return{itemScrollXCenter:oe,relativeIndex:Se,index:pe,width:0}})}const S=w.map((B,ee)=>{const oe=ee/Math.max(1,w.length-1);return ve(oe,[0,1],[0,1])}),N=G(S,A).sort((B,ee)=>B.index-ee.index);let C=W+a+c[0]+a,q=v;const U=N.sort((B,ee)=>Math.abs(B.relativeIndex)-Math.abs(ee.relativeIndex)).map((B,ee)=>{if(!(C<=0)){if(ee===0&&(q=B.index),B.width=ve(C-a,[c[0],c[1]],[c[0],c[1]]),C-=B.width+a,C!==0&&C<(c[0]+a)*2){const oe=B.width-((c[0]+a)*2-C);C+=B.width,B.width=oe,C-=B.width}else if(C===0&&B.width>=c[0]*2+a){const oe=B.width-(c[0]+a-C);C+=B.width,B.width=oe,C-=B.width}return B}}).filter(Boolean),J=[...U].reverse(),te=[...U].sort((B,ee)=>Math.abs(B.index)-Math.abs(ee.index));J.forEach((B,ee)=>{const oe=J[ee+1];if(!oe)return;const pe=1-(Math.abs(B.relativeIndex)-Math.abs(oe.relativeIndex)),Se=ve(pe,[0,2],[B.width+C,oe.width]);C+=B.width,B.width=Se,C-=B.width});const se=U.length/2,P=ve(Math.abs(te[0].relativeIndex),[te[0].index===0?0:se-1,se],[0,1]),_=ve(P,[0,1],[0,1])*-(c[0]+a);I.forEach((B,ee)=>{if(B.current){const oe=U.find(pe=>pe.index===ee);oe?(B.current.style.setProperty("--carousel-item-width",`${oe.width}px`),B.current.style.display="block"):(B.current.style.setProperty("--carousel-item-width",`${c[0]}px`),B.current.style.display="none")}}),L.current.style.transform=`translateX(${_}px)`,q!==v&&k(q)},[w.length,c,a,v]);o.useLayoutEffect(()=>{D()},[D,w.length]),o.useEffect(()=>{d&&d(v)},[v,d]);const[M,T]=o.useState(0);o.useEffect(()=>{T(v)},[v]);const j=(A,W={})=>{if(!w.length)return 0;const G=I[A];if(!G||!G.current||!L.current)return 0;const S=ve(A/Math.max(1,w.length-1),[0,1],[0,1]);return T(A),L.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:S,orientation:"horizontal",animate:W.animate!==!1}})),S};o.useEffect(()=>{typeof f=="number"&&w.length>0&&f!==v&&j(f)},[f,w.length]);const X=A=>{var W;if(E.current=A,A.scrollTotal>0){(W=F.current)==null||W.stop();const G=g.current??0,S=A.scrollProgress??0;F.current=Y.animate(G,S,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:N=>{g.current=N,requestAnimationFrame(()=>{D()})}})}},V=o.useRef(i);o.useEffect(()=>{V.current=i},[i]);const Q=o.useRef(null);o.useEffect(()=>{const A=V.current;if(!A||!(p!=null&&p.current)||w.length<=0)return;const W=w.length,G=p.current.clientWidth||0,S=c[1],N=g.current,C=(G+a)/(S+a),q=Math.max(1,Math.floor(C)),U=Math.max(1,Math.round(q*(2/3))),J=Math.min(Math.max(0,v),Math.max(0,W-1)),te={total:W,selectedIndex:J,visibleApprox:C,visibleFull:q,stepHalf:U,canPrev:J>0,canNext:J<W-1,scrollProgress:N,viewportWidth:G,itemMaxWidth:S,gap:a},se=Q.current;let P=!se;if(!P){for(const _ in te)if(te[_]!==se[_]){P=!0;break}}P&&(Q.current=te,A(te))},[p,w.length,v,a,c]),o.useEffect(()=>()=>{var A;(A=F.current)==null||A.stop()},[]);const[z,$]=o.useState(0);o.useLayoutEffect(()=>{let A=c[1];const W=E.current;W&&A>W.scrollVisible&&W.scrollVisible>0&&(A=W.scrollVisible);const G=(A+a)*w.length/x;$(G||400)},[p,w.length,a,c,x]);const R=A=>{if(!w.length)return;const W=M??v;switch(A.key){case"ArrowLeft":A.preventDefault(),j(Math.max(0,W-1));break;case"ArrowRight":A.preventDefault(),j(Math.min(w.length-1,W+1));break;case"Home":A.preventDefault(),j(0);break;case"End":A.preventDefault(),j(w.length-1);break;case"Enter":case" ":A.preventDefault(),j(W);break}};o.useEffect(()=>{const A=p.current;if(!A)return;const W=G=>{const S=G.detail;S&&typeof S.index=="number"&&j(S.index)};return A.addEventListener("udx:carousel:centerIndex",W),()=>{A.removeEventListener("udx:carousel:centerIndex",W)}},[p,w.length]);const O=w.map((A,W)=>{var N;const G=(N=A.props)==null?void 0:N.onClick,S=C=>{G==null||G(C)};return o.cloneElement(A,{outputRange:c,ref:I[W],key:W,index:W,role:"option","aria-selected":v===W,tabIndex:v===W?0:-1,onClick:S,onFocus:()=>T(W)})});return l.jsx("div",{className:b.carousel,ref:p,role:"listbox","aria-orientation":"horizontal",onKeyDown:R,...h,children:l.jsx(vt,{draggable:!0,orientation:"horizontal",onScroll:X,scrollSize:z,children:l.jsx("div",{className:b.track,ref:L,style:{gap:`${a}px`,willChange:"transform"},children:O})})})};/*!
|
|
1
|
+
"use strict";var Dn=Object.defineProperty;var An=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>An(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),Ve=require("react-dom"),Y=require("motion/react"),ht=require("clsx"),Fn=require("tailwind-merge"),we=require("@udixio/theme"),Oe=require("@udixio/tailwind"),Pn=require("react-textarea-autosize");var Pe=typeof document<"u"?document.currentScript:null;const mt=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[s,r]=o.useState(!0),[u,c]=o.useState(!1),[a,d]=o.useState({x:50,y:50});o.useEffect(()=>{u&&(r(!0),r(!1))},[u]),o.useEffect(()=>{const p=t==null?void 0:t.current;if(p)return p.addEventListener("mousedown",i),p.addEventListener("mouseup",x),p.addEventListener("mouseleave",f),()=>{p.removeEventListener("mousedown",i),p.removeEventListener("mouseup",x),p.removeEventListener("mouseleave",f)}},[t]);const i=p=>{const b=t==null?void 0:t.current,w=b.getBoundingClientRect();c(!0),d({x:(p.clientX-w.left)/b.clientWidth*100,y:(p.clientY-w.top)/b.clientHeight*100})},f=p=>{c(!1)},x=p=>{c(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={position:"absolute",inset:0,width:"100%",height:"100%","--x":a.x+"%","--y":a.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return l.jsx(Y.AnimatePresence,{mode:"wait",children:(u||!u&&!s)&&l.jsx(Y.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>r(!0)})})},pt=Fn.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),y=(...e)=>pt(ht.clsx(e)),yt=(...e)=>pt(ht.clsx(e));function $n(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const Re=e=>{const t={};e.classNameList.forEach(s=>{var r;if(s)if(typeof s=="string")(t[r=e.default]??(t[r]=[])).push(s);else{const u=s(e.states);Object.entries(u).map(c=>{const[a,d]=c;(t[a]??(t[a]=[])).push(d)})}});const n=t;return Object.entries(t).map(s=>{let[r,u]=s;u=u.reverse(),r==e.default&&u.unshift("relative"),u.unshift($n(r)),n[r]=yt(...u)}),n},ne=(e,t)=>n=>Re({classNameList:[n.className,t],default:e,states:n}),Z=(e,t)=>n=>o.useMemo(()=>Re({classNameList:[n.className,t],default:e,states:n}),[n]);function Wn(e,t,n){return o.useMemo(()=>Re({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const xt=ne("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:y("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":n,"[&::-webkit-scrollbar-thumb]:bg-transparent":!n},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!n,"cursor-grabbing":t&&n}),track:y("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function Tn(e,t){let n=0,s=null,r=null;const u=(c,a)=>{n=Date.now(),t(c,a)};return(c,a)=>{const d=Date.now(),i=e-(d-n);i<=0?(s&&(clearTimeout(s),s=null),u(c,a)):(r={v:c,o:a},s||(s=setTimeout(()=>{s=null;const f=r;r=null,f&&u(f.v,f.o)},i)))}}const vt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:s,className:r,draggable:u=!1,throttleDuration:c=75,scroll:a,setScroll:d})=>{var G,S;const i=o.useRef(null),f=o.useRef(null),[x,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const N=new ResizeObserver(C=>{for(const q of C)q.target===i.current&&h({width:q.contentRect.width,height:q.contentRect.height})});return N.observe(i.current),()=>{N.disconnect()}},[i]);const m=o.useRef(null),p=o.useRef(null),b=()=>{const N=f.current;return N?{width:n??N.scrollWidth,height:n??N.scrollHeight}:null},w=()=>{const N=i.current;return N?{width:N.clientWidth,height:N.clientHeight}:null},{scrollYProgress:L,scrollXProgress:E}=Y.useScroll({container:i}),g=o.useRef(null);g.current||(g.current=Tn(c,(N,C)=>{!p.current||!m.current||!i.current||(C===(t==="horizontal"?"x":"y")&&(d==null||d(N)),s&&(t==="horizontal"&&C==="x"&&s({scrollProgress:N,scroll:N*(m.current.width-i.current.clientWidth),scrollTotal:m.current.width-i.current.clientWidth,scrollVisible:p.current.width}),t==="vertical"&&C==="y"&&s({scrollProgress:N,scroll:N*(m.current.height-i.current.clientHeight),scrollTotal:m.current.height-i.current.clientHeight,scrollVisible:p.current.height})))}));const F=(N,C)=>{g.current&&g.current(N,C)};o.useEffect(()=>{x.width&&F(E.get(),"x"),x.height&&F(L.get(),"y")},[x]),o.useEffect(()=>{const N=i.current,C=f.current;if(!N||!C||typeof a!="number")return;const q=(U,J,te)=>Math.min(te,Math.max(J,U));if(t==="horizontal"){const U=Math.max(0,(n??C.scrollWidth)-N.clientWidth);N.scrollLeft=q(a*U,0,U)}else{const U=Math.max(0,(n??C.scrollHeight)-N.clientHeight);N.scrollTop=q(a*U,0,U)}},[a,t,n]),Y.useMotionValueEvent(E,"change",N=>{F(N,"x")}),Y.useMotionValueEvent(L,"change",N=>{F(N,"y")});const[I,v]=o.useState(!1);o.useLayoutEffect(()=>{I||!p.current||!m.current||!s||(s({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?p.current.height:p.current.width}),v(!0))},[p,m,s]),m.current=b(),p.current=w();const[k,D]=o.useState(!1),M=xt({isDragging:k,children:e,className:r,onScroll:s,orientation:t,scrollSize:n,draggable:u,throttleDuration:c}),[T,j]=o.useState(0),[X,V]=o.useState(0),Q=N=>{if(!u)return;const C=i.current;if(!C||T==null)return;const U=(N.pageX-C.offsetLeft-T)*1.5;C.scrollLeft=X-U},z=N=>{const C=i.current;C&&(D(!0),j(N.pageX-C.offsetLeft),V(C.scrollLeft))},$=N=>{k&&(N.preventDefault(),Q(N))},R=()=>{D(!1)},O=()=>{D(!1)},A=N=>{N.preventDefault()},W=o.useRef(null);return o.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]),o.useEffect(()=>{const N=i.current;if(!N)return;const C=q=>{var se,P,_,B;const U=q.detail,J=i.current;if(!J||!U)return;const te=U.orientation??t;if(typeof U.progress=="number")if(te==="horizontal"){const ee=Math.max(0,(((se=m.current)==null?void 0:se.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.progress*ee))}else{const ee=Math.max(0,(((P=m.current)==null?void 0:P.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.progress*ee))}else if(typeof U.scroll=="number")if(te==="horizontal"){const ee=Math.max(0,(((_=m.current)==null?void 0:_.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.scroll))}else{const ee=Math.max(0,(((B=m.current)==null?void 0:B.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.scroll))}};return N.addEventListener("udx:customScroll:set",C),()=>{N.removeEventListener("udx:customScroll:set",C)}},[t]),l.jsxs("div",{className:M.customScroll,ref:i,onMouseDown:z,onMouseMove:$,onMouseUp:R,onMouseLeave:O,onDragStart:A,onScroll:N=>{k||(j(null),D(!0),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{D(!1)},1e3))},children:[l.jsx("div",{ref:f,style:t==="vertical"?{height:((G=p==null?void 0:p.current)==null?void 0:G.height)??"100%"}:{width:((S=p==null?void 0:p.current)==null?void 0:S.width)??"100%"},className:M.track,children:e}),p.current&&m.current&&l.jsxs(l.Fragment,{children:[t==="vertical"&&m.current.height>p.current.height&&l.jsx(Y.motion.div,{className:"flex-none",style:{height:m.current.height-p.current.height}}),t==="horizontal"&&m.current.width>p.current.width&&l.jsx(Y.motion.div,{className:"flex-none",style:{width:m.current.width-p.current.width}})]})]})};var On="1.3.17";function gt(e,t,n){return Math.max(e,Math.min(t,n))}function Bn(e,t,n){return(1-n)*e+n*t}function Hn(e,t,n,s){return Bn(e,t,1-Math.exp(-n*s))}function Vn(e,t){return(e%t+t)%t}var zn=class{constructor(){H(this,"isRunning",!1);H(this,"value",0);H(this,"from",0);H(this,"to",0);H(this,"currentTime",0);H(this,"lerp");H(this,"duration");H(this,"easing");H(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const s=gt(0,this.currentTime/this.duration,1);t=s>=1;const r=t?1:this.easing(s);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=Hn(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:s,easing:r,onStart:u,onUpdate:c}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=s,this.easing=r,this.currentTime=0,this.isRunning=!0,u==null||u(),this.onUpdate=c}};function _n(e,t){let n;return function(...s){let r=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(r,s)},t)}}var Yn=class{constructor(e,t,{autoResize:n=!0,debounce:s=250}={}){H(this,"width",0);H(this,"height",0);H(this,"scrollHeight",0);H(this,"scrollWidth",0);H(this,"debouncedResize");H(this,"wrapperResizeObserver");H(this,"contentResizeObserver");H(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});H(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});H(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=_n(this.resize,s),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},wt=class{constructor(){H(this,"events",{})}emit(e,...t){var s;let n=this.events[e]||[];for(let r=0,u=n.length;r<u;r++)(s=n[r])==null||s.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var s;this.events[e]=(s=this.events[e])==null?void 0:s.filter(r=>t!==r)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(s=>t!==s)}destroy(){this.events={}}},ot=100/6,he={passive:!1},qn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){H(this,"touchStart",{x:0,y:0});H(this,"lastDelta",{x:0,y:0});H(this,"window",{width:0,height:0});H(this,"emitter",new wt);H(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});H(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,s=-(t-this.touchStart.x)*this.options.touchMultiplier,r=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:s,y:r},this.emitter.emit("scroll",{deltaX:s,deltaY:r,event:e})});H(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});H(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:s}=e;const r=s===1?ot:s===2?this.window.width:1,u=s===1?ot:s===2?this.window.height:1;t*=r,n*=u,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});H(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,he),this.element.addEventListener("touchstart",this.onTouchStart,he),this.element.addEventListener("touchmove",this.onTouchMove,he),this.element.addEventListener("touchend",this.onTouchEnd,he)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,he),this.element.removeEventListener("touchstart",this.onTouchStart,he),this.element.removeEventListener("touchmove",this.onTouchMove,he),this.element.removeEventListener("touchend",this.onTouchEnd,he)}},it=e=>Math.min(1,1.001-Math.pow(2,-10*e)),Un=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:s=!0,syncTouch:r=!1,syncTouchLerp:u=.075,touchInertiaExponent:c=1.7,duration:a,easing:d,lerp:i=.1,infinite:f=!1,orientation:x="vertical",gestureOrientation:h=x==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:p=1,autoResize:b=!0,prevent:w,virtualScroll:L,overscroll:E=!0,autoRaf:g=!1,anchors:F=!1,autoToggle:I=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:k=!1,naiveDimensions:D=k,stopInertiaOnNavigate:M=!1}={}){H(this,"_isScrolling",!1);H(this,"_isStopped",!1);H(this,"_isLocked",!1);H(this,"_preventNextNativeScrollEvent",!1);H(this,"_resetVelocityTimeout",null);H(this,"_rafId",null);H(this,"isTouching");H(this,"time",0);H(this,"userData",{});H(this,"lastVelocity",0);H(this,"velocity",0);H(this,"direction",0);H(this,"options");H(this,"targetScroll");H(this,"animatedScroll");H(this,"animate",new zn);H(this,"emitter",new wt);H(this,"dimensions");H(this,"virtualScroll");H(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});H(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});H(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});H(this,"onClick",e=>{const n=e.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.getAttribute("href"));if(this.options.anchors){const s=n.find(r=>{var u;return(u=r.getAttribute("href"))==null?void 0:u.includes("#")});if(s){const r=s.getAttribute("href");if(r){const u=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,c=`#${r.split("#")[1]}`;this.scrollTo(c,u)}}}this.options.stopInertiaOnNavigate&&n.find(r=>r.host===window.location.host)&&this.reset()});H(this,"onPointerDown",e=>{e.button===1&&this.reset()});H(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:s}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const r=s.type.includes("touch"),u=s.type.includes("wheel");this.isTouching=s.type==="touchstart"||s.type==="touchmove";const c=t===0&&n===0;if(this.options.syncTouch&&r&&s.type==="touchstart"&&c&&!this.isStopped&&!this.isLocked){this.reset();return}const d=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(c||d)return;let i=s.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(w=>{var L,E,g;return w instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(w))||((L=w.hasAttribute)==null?void 0:L.call(w,"data-lenis-prevent"))||r&&((E=w.hasAttribute)==null?void 0:E.call(w,"data-lenis-prevent-touch"))||u&&((g=w.hasAttribute)==null?void 0:g.call(w,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(w,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&r||this.options.smoothWheel&&u)){this.isScrolling="native",this.animate.stop(),s.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const m=r&&this.options.syncTouch,b=r&&s.type==="touchend";b&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:b?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});H(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});H(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=On,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof d!="function"?d=it:typeof d=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:s,syncTouch:r,syncTouchLerp:u,touchInertiaExponent:c,duration:a,easing:d,lerp:i,infinite:f,gestureOrientation:h,orientation:x,touchMultiplier:m,wheelMultiplier:p,autoResize:b,prevent:w,virtualScroll:L,overscroll:E,autoRaf:g,anchors:F,autoToggle:I,allowNestedScroll:v,naiveDimensions:D,stopInertiaOnNavigate:M},this.dimensions=new Yn(e,t,{autoResize:b}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new qn(n,{touchMultiplier:m,wheelMultiplier:p}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:s=!1,programmatic:r=!0,lerp:u=r?this.options.lerp:void 0,duration:c=r?this.options.duration:void 0,easing:a=r?this.options.easing:void 0,onStart:d,onComplete:i,force:f=!1,userData:x}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const p=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?p.left:p.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(r){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=gt(0,e,this.limit);if(e===this.targetScroll){d==null||d(this),i==null||i(this);return}if(this.userData=x??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}r||(this.targetScroll=e),typeof c=="number"&&typeof a!="function"?a=it:typeof a=="function"&&typeof c!="number"&&(c=1),this.animate.fromTo(this.animatedScroll,e,{duration:c,easing:a,lerp:u,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),r&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const s=Date.now(),r=e._lenis??(e._lenis={});let u,c,a,d,i,f,x,h;const m=this.options.gestureOrientation;if(s-(r.time??0)>2e3){r.time=Date.now();const I=window.getComputedStyle(e);r.computedStyle=I;const v=I.overflowX,k=I.overflowY;if(u=["auto","overlay","scroll"].includes(v),c=["auto","overlay","scroll"].includes(k),r.hasOverflowX=u,r.hasOverflowY=c,!u&&!c||m==="vertical"&&!c||m==="horizontal"&&!u)return!1;i=e.scrollWidth,f=e.scrollHeight,x=e.clientWidth,h=e.clientHeight,a=i>x,d=f>h,r.isScrollableX=a,r.isScrollableY=d,r.scrollWidth=i,r.scrollHeight=f,r.clientWidth=x,r.clientHeight=h}else a=r.isScrollableX,d=r.isScrollableY,u=r.hasOverflowX,c=r.hasOverflowY,i=r.scrollWidth,f=r.scrollHeight,x=r.clientWidth,h=r.clientHeight;if(!u&&!c||!a&&!d||m==="vertical"&&(!c||!d)||m==="horizontal"&&(!u||!a))return!1;let p;if(m==="horizontal")p="x";else if(m==="vertical")p="y";else{const I=t!==0,v=n!==0;I&&u&&a&&(p="x"),v&&c&&d&&(p="y")}if(!p)return!1;let b,w,L,E,g;if(p==="x")b=e.scrollLeft,w=i-x,L=t,E=u,g=a;else if(p==="y")b=e.scrollTop,w=f-h,L=n,E=c,g=d;else return!1;return(L>0?b<w:b>0)&&E&&g}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?Vn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const Xn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:s=!1,touchMultiplier:r=2,children:u})=>{const c=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let d;typeof e=="string"?e.endsWith("ms")?d=parseFloat(e)/1e3:e.endsWith("s")?d=parseFloat(e):d=parseFloat(e)||1.2:d=e;const i=x=>1-Math.pow(1-x,5);c.current=new Un({duration:d,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:r,syncTouch:s});const f=x=>{var h;(h=c.current)==null||h.raf(x),a.current=requestAnimationFrame(f)};return a.current=requestAnimationFrame(f),()=>{var x;a.current!==null&&cancelAnimationFrame(a.current),(x=c.current)==null||x.destroy(),c.current=null}},[e,t,n,s,r]),u?l.jsx(l.Fragment,{children:u}):null},ue=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:s,className:r})=>{const u=o.useRef(null),c=o.useRef(null),[a,d]=o.useState(!1),i=bt({isClient:a,stateClassName:n,className:r,colorName:t});return o.useEffect(()=>{if(u.current&&n!=="state-layer"){const x=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=u.current.closest(`.${x}:not(.${x} .${x})`);c.current=h}d(!0)},[]),l.jsxs("div",{ref:u,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&l.jsx(mt,{triggerRef:c}),s]})},Gn=({isClient:e,stateClassName:t})=>({stateLayer:y(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),bt=Z("stateLayer",Gn),St=({targetRef:e,children:t})=>{const[n,s]=o.useState(null),r=o.useRef(null),u=()=>{const c=e.current;if(!c)return;const a=c.getBoundingClientRect();s({position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"none",zIndex:999})};return o.useEffect(()=>{const c=e.current;if(c)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),r.current=new ResizeObserver(u),r.current.observe(c),()=>{var a;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(a=r.current)==null||a.disconnect()}},[e]),n?Ve.createPortal(l.jsx("div",{style:n,children:t}),document.body):null};function Kn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Jn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:s=!1})=>{const[r,u]=o.useState(null),[c,a]=o.useState(null),d=o.useRef(null),i=o.useRef(0),f=o.useRef(0),x=o.useRef(null),h=o.useRef(!1),m=o.useRef(n);o.useEffect(()=>{m.current=n},[n]),o.useEffect(()=>{let E=!1;return(async()=>{const g=await we.loader(e,s);if(E)return;x.current=g,u(g);const F=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/theme.worker.js").href:new URL("theme.worker.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:Pe&&Pe.tagName.toUpperCase()==="SCRIPT"&&Pe.src||new URL("index.cjs",document.baseURI).href),{type:"module"});d.current=F,F.onmessage=I=>{var v;I.data.id>f.current&&(f.current=I.data.id,h.current=!0,a(I.data.css),(v=m.current)==null||v.call(m,x.current))}})(),()=>{var g;E=!0,(g=d.current)==null||g.terminate(),d.current=null}},[]);const p=o.useRef(null),b=o.useRef(0),w=o.useRef(null);o.useEffect(()=>{if(!r)return;const E={...e,sourceColor:e.sourceColor},g=Date.now(),F=g-b.current,I=async v=>{await L(v)};if(b.current===0||F>=t)p.current&&(clearTimeout(p.current),p.current=null),w.current=null,b.current=g,I(E);else if(w.current=E,!p.current){const v=Math.max(0,t-F);p.current=setTimeout(async()=>{p.current=null;const k=w.current;w.current=null,k&&(b.current=Date.now(),await I(k))},v)}return()=>{}},[e,t,r]);const L=async E=>{if(typeof E.sourceColor=="string"&&!Kn(E.sourceColor))throw new Error("Invalid hex color");const g=x.current;if(!g)return;g.context.update(E),g.palettes.sync(E.palettes);const F=d.current;if(!F||!h.current){await g.load();const v=g.plugins.getPlugin(Oe.TailwindPlugin).getInstance().outputCss;a(v),h.current=!0,n==null||n(g);return}const I=++i.current;F.postMessage({id:I,snapshot:we.serializeThemeContext(g),tailwindOptions:g.plugins.getPlugin(Oe.TailwindPlugin).toSerializable(),fontOptions:g.plugins.getPlugin(we.FontPlugin).toSerializable()})};return o.useEffect(()=>()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),c?l.jsx("style",{dangerouslySetInnerHTML:{__html:c}}):null};function Zn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function Qn(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ze(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function lt(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function $e(e,t){if(!ze(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const c=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),a=c==="x"||c==="inline"?"inline":c==="y"||c==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(a==="inline"?e.classList.add(`${t}-timeline-inline`):a==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const s=e.getAttribute(`data-${t}-end`);s&&e.style.setProperty(`--${t}-range-end`,s);const r=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),u=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!r&&!u&&e.setAttribute(`data-${t}-run`,"")}function We(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(s=>ze(s))}function es(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),s=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(r=>{if(!(r instanceof HTMLElement))return!1;const u=r.classList;return u.contains(`${t}-in`)||u.contains(`${t}-out`)||Array.from(u).some(d=>d.startsWith(`${t}-`)&&!d.includes("scroll")&&!s.has(d))?!0:!ze(r)})}function ts(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function at(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function ct(e,t,n){const s=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=s}const ns=[0,.2],ut=new WeakSet;function dt(e,t){if(ut.has(e))return;ut.add(e);const n=r=>{r.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},s=r=>{r.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",s),e.addEventListener("animationcancel",s)}function _e(e={}){const{prefix:t="anim",once:n=!0}=e;if(Qn())return()=>{};const s=Zn(),r=new WeakSet;let u=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,c=!0;const a=()=>{const m=window.pageYOffset||window.scrollY||0;c=m>=u,u=m};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const d=new IntersectionObserver(m=>{for(const p of m){const b=p.target;if(!lt(b)||b.hasAttribute(`data-${t}-animating`))continue;const w=ts(b.classList,t);p.isIntersecting?(w&&ct(b,t,"out"),at(b,t,"in"),n&&d.unobserve(b)):n||(c||ct(b,t,"in"),w&&at(b,t,"out"))}},{threshold:ns}),i=m=>{const p=es(m||document,t);for(const b of p)r.has(b)||(r.add(b),d.observe(b),dt(b,t))};i();let f,x=null,h=null;if(s)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const p=We(void 0,t);for(const b of p)$e(b,t)}))})(),x=new MutationObserver(p=>{for(const b of p)if(b.type==="attributes"){const w=b.target;w instanceof HTMLElement&&($e(w,t),lt(w)&&(r.has(w)||(r.add(w),d.observe(w),dt(w,t))))}else if(b.type==="childList"&&b.addedNodes&&b.addedNodes.length){for(const w of Array.from(b.addedNodes))if(w instanceof HTMLElement){const L=We(w,t);for(const E of L)$e(E,t);i(w)}}}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),x&&x.disconnect()};else{let m;We(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven.js")).then(b=>{m=b.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),d.disconnect()}}const ss=_e,rs=_e,be=({anchorRef:e,position:t="bottom",children:n,style:s,...r})=>{const c=`--anchor-${o.useId().replace(/:/g,"")}`,[a,d]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&d(!0)},[]),o.useLayoutEffect(()=>{if(a&&e.current){const f=e.current;return f.style.anchorName=c,()=>{e.current&&(e.current.style.anchorName="")}}},[a,e,c]),a){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:c,positionArea:t,positionTryFallbacks:"flip-block, flip-inline",...s};return Ve.createPortal(l.jsx("div",{style:f,...r,children:n}),document.body)}const i={position:"absolute",pointerEvents:"auto",...s};switch(t){case"top":i.bottom="100%",i.left="50%",i.transform="translateX(-50%)";break;case"top-left":i.bottom="100%",i.left=0;break;case"top-right":i.bottom="100%",i.right=0;break;case"bottom":i.top="100%",i.left="50%",i.transform="translateX(-50%)";break;case"bottom-left":i.top="100%",i.left=0;break;case"bottom-right":i.top="100%",i.right=0;break;case"left":i.right="100%",i.top="50%",i.transform="translateY(-50%)";break;case"right":i.left="100%",i.top="50%",i.transform="translateY(-50%)";break}return l.jsx(St,{targetRef:e,children:l.jsx("div",{style:i,...r,children:n})})},Et=({variant:e,disableTextMargins:t,disabled:n,iconPosition:s,icon:r,isActive:u,loading:c,shape:a,onToggle:d,size:i,allowShapeTransformation:f})=>({button:y(" relative cursor-pointer group/button outline-none inline-block flex w-fit justify-center items-center ",i==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",i==="small"&&"text-label-large px-4 py-2.5 gap-2",i==="medium"&&"text-title-medium px-6 py-4 gap-2",i==="large"&&"text-headline-small px-12 py-8 gap-3",i==="xLarge"&&"text-headline-large px-16 py-12 gap-4",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&u)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"active:rounded-[12px]":i==="xSmall"||i=="small","active:rounded-[16px]":i==="medium","active:rounded-[28px]":i==="large"||i=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!u,"bg-primary text-on-primary":!n&&u,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!u&&d,"bg-primary text-on-primary":!n&&(u&&d||!d),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!u,"bg-secondary text-on-secondary":!n&&u,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!u,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&u}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[i==="xSmall"&&"-mx-3 ",i==="small"&&"-mx-4 ",i==="medium"&&"-mx-6 ",i==="large"&&"-mx-12",i==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:y("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:y("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&u)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":i==="xSmall"||i=="small","group-active/button:rounded-[16px]":i==="medium","group-active/button:rounded-[28px]":i==="large"||i=="xLarge"}),label:y({invisible:c}),icon:y({invisible:c},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),os=ne("button",Et),Nt=Z("button",Et),kt=({variant:e,interactive:t})=>({card:y(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card cursor-pointer":t})}),is=ne("card",kt),jt=Z("card",kt),Ye=()=>({carouselItem:y("rounded-[28px] overflow-hidden flex-none",{})}),ls=ne("carouselItem",Ye),Lt=Z("carouselItem",Ye),Mt=()=>({carousel:y(["w-full h-[400px]"]),track:y("flex h-full w-full")}),as=ne("carousel",Mt),It=Z("carousel",Mt),Ct=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:s,isFocused:r,isHovered:u})=>({checkbox:y("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:y("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:y("relative flex items-center justify-center w-[18px] h-[18px] "),box:y("absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200",!e&&!t&&{"border-on-surface-variant":!s&&!n,"border-error":s&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!s&&!n,"bg-error border-error":s&&!n,"bg-on-surface border-on-surface":n}),icon:y("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":s&&!n,"text-surface":n}),stateLayer:"size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),cs=ne("checkbox",Ct),Rt=Z("checkbox",Ct),Dt=({variant:e,disabled:t,trailingIcon:n,icon:s,isActive:r,isInteractive:u,activated:c,isFocused:a,isDragging:d,isEditing:i})=>({chip:y(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":s,"pr-2":n,"cursor-pointer":!t&&u},{" text-on-surface-variant":!c&&!a||i,"bg-secondary-container text-on-secondary-container":(c||a)&&!i},d&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:y("rounded-lg overflow-hidden",{}),label:y("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:y("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:y("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),us=ne("chip",Dt),At=Z("chip",Dt),Ft=({scrollable:e})=>({chips:y(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),ds=ne("chips",Ft),Pt=Z("chips",Ft),$t=({orientation:e})=>({divider:y("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),fs=ne("divider",$t),Wt=Z("divider",$t),Tt=({size:e,variant:t,extended:n})=>({fab:y("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:y({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:y("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),hs=ne("fab",Tt),Ot=Z("fab",Tt),Bt=({size:e,variant:t,open:n})=>({fabMenu:y("relative inline-flex flex-col items-end"),actions:y("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:y("text-nowrap")}),ms=ne("fabMenu",Bt),Ht=Z("fabMenu",Bt),Vt=({variant:e,disabled:t,onToggle:n,isActive:s,size:r,width:u,shape:c,allowShapeTransformation:a})=>({iconButton:y("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},c==="rounded"&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(c==="squared"||a&&s)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"active:rounded-[12px]":r==="xSmall"||r=="small","active:rounded-[16px]":r==="medium","active:rounded-[28px]":r==="large"||r=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!s&&!!n,"bg-primary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!s&&!!n,"bg-secondary text-on-secondary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!s,"border border-transparent bg-inverse-surface":s},!!t&&{"border border-on-surface/[0.12]":!s,"border border-transparent bg-on-surface/[0.12]":s}]),touchTarget:y("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:y("absolute top-0 left-0 h-full w-full overflow-hidden",(c==="rounded"||c==="squared"&&n&&!t&&s&&a)&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(c==="squared"||c==="rounded"&&n&&!t&&s&&a)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":r==="xSmall"||r=="small","group-active/icon-button:rounded-[16px]":r==="medium","group-active/icon-button:rounded-[28px]":r==="large"||r=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!s,"state-primary":s},e==="filled"&&{"state-primary":!s&&!!n,"state-inverse-on-surface":s||!n},e==="tonal"&&{"state-on-surface-variant":!s&&!!n,"state-on-secondary-container":s||!n},e==="outlined"&&{"state-on-surface-variant":!s,"state-on-primary":s}]),icon:y(" transition-all duration-300",{"size-5 p-1.5":r==="xSmall"},{"size-6 p-2":r==="small"},{"size-6 p-4":r==="medium"},{"size-8 p-8":r==="large"},{"size-10 p-12":r==="xLarge"},u=="narrow"&&[{"px-1":r==="xSmall"},{"px-1":r==="small"},{"px-3":r==="medium"},{"px-4":r==="large"},{"px-8":r==="xLarge"}],u=="wide"&&[{"px-2.5":r==="xSmall"},{"px-3.5":r==="small"},{"px-6":r==="medium"},{"px-12":r==="large"},{"px-[72px]":r==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!s,"text-primary":s},e==="filled"&&{"text-primary":!s&&!!n,"text-on-primary":s||!n},e==="outlined"&&{"text-on-surface-variant":!s,"text-inverse-on-surface":s}],!!t&&"text-on-surface/[0.38]")}),ps=ne("iconButton",Vt),zt=Z("iconButton",Vt),_t=({variant:e,hasGroups:t})=>({menu:y("z-50 min-w-[112px] max-w-[280px] max-h-[300px] ","flex flex-col",{"overflow-y-auto":!t},{"bg-surface-container":!e||e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant","py-0.5 shadow-2 px-1 rounded-2xl":!t,"bg-transparent ":t})}),ys=ne("menu",_t),Yt=Z("menu",_t),qt=({variant:e})=>({menuGroup:y("flex flex-col gap-0.5 mb-0.5 last:mb-0","rounded-lg py-0.5 px-1 shadow-2 first:rounded-t-2xl last:rounded-b-2xl",{"bg-surface-container":e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant"}),groupLabel:y("px-3 pt-2 text-label-small tracking-wide ",{"text-on-surface-variant":e==="standard","text-on-tertiary-container opacity-80":e==="vibrant"})}),xs=ne("menuGroup",qt),Ut=Z("menuGroup",qt),Xt=({variant:e,isVisible:t})=>({progressIndicator:y((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1",e==="linear-indeterminate"&&"relative overflow-hidden rounded-full"),firstTrack:y((e==="linear-determinate"||e==="linear-indeterminate")&&"h-full rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),activeIndicator:y("h-full rounded-full bg-primary",e==="linear-determinate"&&{"rounded-l-full":!0},(e==="linear-indeterminate"||e==="linear-determinate")&&{"max-h-0":!t,"max-h-full":t},(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),lastTrack:y((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),stop:y("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),vs=ne("progressIndicator",Xt),Gt=Z("progressIndicator",Xt),qe=({variant:e,position:t})=>({sideSheet:y("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:y("w-full overflow-hidden flex flex-col",{}),header:y("p-4 flex items-center gap-2"),content:y("flex-1 overflow-y-auto"),title:y("text-on-surface-variant text-title-large"),closeButton:y("ml-auto"),divider:y({hidden:e=="modal"}),overlay:y("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),Kt=ne("sideSheet",qe),gs=Z("sideSheet",qe),Ue=({isChanging:e})=>({slider:y(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:y(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:y(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:y(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:y(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:y(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),ws=ne("slider",Ue),Jt=Z("slider",Ue),Zt=()=>({snackbar:y(" rounded bg-inverse-surface "),container:y("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:y("text-body-medium text-inverse-on-surface "),icon:y(" ml-auto mr-0 text-inverse-on-surface block dark")}),bs=ne("snackbar",Zt),Qt=Z("snackbar",Zt),en=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:y("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:y("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:y("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:y("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:y("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),Ss=ne("switch",en),tn=Z("switch",en),nn=({isSelected:e,icon:t,label:n,variant:s})=>({tab:y("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&s==="primary"&&"h-16",!(t&&n&&s==="primary")&&"h-12"),stateLayer:y("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",s==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},s==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:y("flex gap-0.5 h-full justify-center",{relative:s=="primary"},{"":!!(n&&!t)},s==="primary"&&"flex-col items-center",s==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:y("h-6 w-6 p-0.5 !box-border",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:y("text-title-small text-nowrap",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:y("bg-primary absolute w-full left-0 bottom-0",s==="primary"&&"h-[3px] rounded-t",s==="secondary"&&"h-0.5")}),Es=ne("tab",nn),sn=Z("tab",nn),rn=({scrollable:e})=>({tabs:y("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),Ns=ne("tabs",rn),on=Z("tabs",rn),ln=()=>({tabPanels:y("overflow-hidden")}),ks=ne("tabPanels",ln),an=Z("tabPanels",ln),cn=()=>({tabPanel:y("")}),js=ne("tabPanel",cn),un=Z("tabPanel",cn),dn=({disabled:e,leadingIcon:t,trailingIcon:n,variant:s,errorText:r,isFocused:u,value:c,suffix:a,multiline:d})=>({textField:y({"opacity-[.38]":e}),content:y("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!d},{"border-on-surface-variant":!(r!=null&&r.length)&&!u&&s=="filled","border-outline":!(r!=null&&r.length)&&!u&&s=="outlined","border-primary":!(r!=null&&r.length)&&u,"border-error":!!(r!=null&&r.length)},{"bg-on-surface/[0.04]":e},s=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],s=="outlined"&&["border rounded box-border",{"border-[3px]":u}]),stateLayer:y("absolute -z-10 w-full h-full top-0 left-0",{hidden:s=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:y("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"text-error":!!(r!=null&&r.length)},{"text-primary":!(r!=null&&r.length)&&u}),input:y("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!a},s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10"),activeIndicator:y("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",s=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(r!=null&&r.length)},{"bg-error":!!(r!=null&&r.length)},{"!w-full":u}]),supportingText:y(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(r!=null&&r.length)}),leadingIcon:y(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:y("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:y("text-on-surface-variant pl-0 pr-4",s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10")}),Ls=ne("textField",dn),fn=Z("textField",dn),hn=({position:e,variant:t})=>({toolTip:y(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:y("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:y("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:y("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:y(""),content:y("w-full")}),Ms=ne("toolTip",hn),mn=Z("toolTip",hn),le=({icon:e,colors:t=[],className:n,...s})=>{if(typeof e=="string"){let f=e,x="";return t[0]&&(x=` fill="${t[0]}" color="${t[0]}"`,f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),f=f.replace(/<svg([^>]*)>/,(h,m)=>`<svg${m.replace(/\s+(width|height)=["'][^"']*["']/g,"")} width="100%" height="100%"${x}>`),l.jsx("div",{className:y("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||""},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return l.jsx("img",{src:f.src,width:f.width,height:f.height,className:y("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const r=e;if(!(r!=null&&r.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:u}=r,[c,a,,,d]=u||[],i=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return l.jsx("svg",{className:y("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${c} ${a}`,role:"img","aria-hidden":"true",...s,children:typeof d=="string"?l.jsx("path",{className:"fill-current",d}):d.map((f,x)=>l.jsx("path",{d:f},x))})},pn=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:s,...r})=>{const[u,c]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),c(t)},[t]);const[d,i]=o.useState(!0),f=()=>d?a:a*.5;o.useEffect(()=>{if(e==="circular-indeterminate"&&u!==100){const p=setInterval(()=>{c(d?20:40),i(!d)},f()*1e3);return()=>clearInterval(p)}},[e,d,u]);const[x,h]=o.useState(!1);o.useEffect(()=>{if(u>=100){const p=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(p)}}else h(!0)},[u,n]);const m=Gt({className:s,variant:e,value:t,transitionDuration:n,isVisible:x});return l.jsxs(l.Fragment,{children:[e==="linear-indeterminate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx(Y.motion.div,{animate:{width:["0%","0%","0%","20%"],marginLeft:["0px","0px","6px","6px"],marginRight:["0px","0px","6px","6px"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.499,.5,1]},style:{flexShrink:0},className:m.activeIndicator}),l.jsx(Y.motion.div,{animate:{width:["0%","40%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{flexShrink:0},className:m.firstTrack}),l.jsx(Y.motion.div,{animate:{width:["20%","60%","20%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.5,1]},style:{flexShrink:0,marginLeft:"6px"},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:"6px"},className:m.lastTrack})]}),e==="linear-determinate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx("div",{style:{width:`${u}%`,transition:`width ${n}ms ease-in-out ${u==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:u!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${u==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.lastTrack}),l.jsx("div",{style:{width:"4px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&l.jsx(Y.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:e==="circular-indeterminate"?270:-90},transition:e==="circular-indeterminate"?{repeat:1/0,duration:f(),ease:"linear"}:{duration:n/1e3},className:m.progressIndicator,...r,children:l.jsx(Y.motion.circle,{cx:"50%",cy:"50%",r:x?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:e==="circular-indeterminate"?"hidden":"determinate",animate:e==="circular-indeterminate"?"visible":"determinate",className:m.activeIndicator,variants:{hidden:{pathLength:d?10/100:90/100},visible:{pathLength:d?90/100:10/100},determinate:{pathLength:u/100}},transition:{pathLength:e==="circular-indeterminate"?{type:"tween",ease:"linear",duration:f(),bounce:0}:{type:"tween",ease:"easeInOut",duration:n/1e3}}})},e==="circular-indeterminate"?d+"":"static")]})};function Is(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const me=({variant:e="filled",disabled:t=!1,icon:n,href:s,label:r,disableTextMargins:u,className:c,iconPosition:a="left",loading:d=!1,shape:i="rounded",onClick:f,onToggle:x,activated:h,ref:m,size:p="medium",allowShapeTransformation:b=!0,transition:w,children:L,...E})=>{if(L&&(r=L),!r)throw new Error("Button component requires either a label prop or children content");e=Is(e);const g=s?"a":"button",F=o.useRef(null),I=m||F,[v,k]=o.useState(h);o.useEffect(()=>{k(h)},[h]),w={duration:.3,...w};const D=j=>{t&&j.preventDefault(),x?(k(!v),x(!v)):f&&f(j)},M=Nt({allowShapeTransformation:b,size:p,disableTextMargins:u,shape:i,href:s,disabled:t,icon:n,iconPosition:a,loading:d,variant:e,transition:w,className:c,isActive:v??!1,onToggle:x,activated:v,label:r,children:r}),T=n?l.jsx(le,{icon:n,className:M.icon}):l.jsx(l.Fragment,{});return l.jsxs(g,{ref:I,href:s,className:M.button,...E,onClick:D,disabled:t,"aria-pressed":x?v:void 0,style:{transition:w.duration+"s"},children:[l.jsx("div",{className:M.touchTarget}),l.jsx(ue,{style:{transition:w.duration+"s"},className:M.stateLayer,colorName:y(e==="filled"&&{"on-surface-variant":!v&&!!x,"on-primary":v||!x},e==="elevated"&&{"on-primary":v&&!!x,primary:!v||!x},e==="tonal"&&{"on-secondary":v&&!!x,"on-secondary-container":!v||!x},e==="outlined"&&{"inverse-on-surface":v&&!!x,"on-surface-variant":!v||!x},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),a==="left"&&T,d&&l.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:l.jsx(pn,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:y({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),l.jsx("span",{className:M.label,children:r}),a==="right"&&T]})},Cs=({variant:e="outlined",className:t,children:n,interactive:s=!1,ref:r,...u})=>{const c=jt({className:t,interactive:s,variant:e,children:n}),a=o.useRef(null),d=r||a;return l.jsxs("div",{...u,ref:d,className:c.card,children:[s&&l.jsx(ue,{className:c.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},ve=(e,t,n=[0,1])=>{const[s,r]=t,[u,c]=n,d=(Math.max(s,Math.min(e,r))-s)/(r-s);return u+d*(c-u)},yn=({className:e,children:t,width:n,index:s=0,outputRange:r,ref:u,...c})=>{const a=o.useRef(null),d=u||a,i=Lt({className:e,index:s,children:t});return l.jsx("div",{ref:d,style:{width:"var(--carousel-item-width, 100%)",maxWidth:r?r[1]+"px":void 0,minWidth:r?r[0]+"px":void 0},className:i.carouselItem,...c,children:t})},Rs=({variant:e="hero",className:t,children:n,ref:s,marginPourcent:r=0,inputRange:u=[.21,.65],outputRange:c=[42,300],gap:a=8,onChange:d,onMetricsChange:i,index:f,scrollSensitivity:x=1.25,...h})=>{const m=o.useRef(null),p=s||m,b=It({index:f,className:t,children:n,variant:e,inputRange:u,outputRange:c,marginPourcent:r,onChange:d,gap:a,scrollSensitivity:x,onMetricsChange:i}),w=o.Children.toArray(n).filter(A=>o.isValidElement(A)&&A.type===yn),L=o.useRef(null),E=o.useRef({scrollProgress:0,scrollTotal:0,scrollVisible:0,scroll:0}),g=o.useRef(0),F=o.useRef(null),I=o.useRef([]).current,[v,k]=o.useState(0);I.length!==w.length&&(I.length=0,w.forEach((A,W)=>{I[W]=o.createRef()}));const D=o.useCallback(()=>{if(!L.current||!p.current)return;const A=g.current,W=E.current.scrollVisible||p.current.clientWidth||0;function G(B,ee){return B.map((oe,pe)=>{const Se=(oe-ee)/Math.abs(B[1]-B[0]);return{itemScrollXCenter:oe,relativeIndex:Se,index:pe,width:0}})}const S=w.map((B,ee)=>{const oe=ee/Math.max(1,w.length-1);return ve(oe,[0,1],[0,1])}),N=G(S,A).sort((B,ee)=>B.index-ee.index);let C=W+a+c[0]+a,q=v;const U=N.sort((B,ee)=>Math.abs(B.relativeIndex)-Math.abs(ee.relativeIndex)).map((B,ee)=>{if(!(C<=0)){if(ee===0&&(q=B.index),B.width=ve(C-a,[c[0],c[1]],[c[0],c[1]]),C-=B.width+a,C!==0&&C<(c[0]+a)*2){const oe=B.width-((c[0]+a)*2-C);C+=B.width,B.width=oe,C-=B.width}else if(C===0&&B.width>=c[0]*2+a){const oe=B.width-(c[0]+a-C);C+=B.width,B.width=oe,C-=B.width}return B}}).filter(Boolean),J=[...U].reverse(),te=[...U].sort((B,ee)=>Math.abs(B.index)-Math.abs(ee.index));J.forEach((B,ee)=>{const oe=J[ee+1];if(!oe)return;const pe=1-(Math.abs(B.relativeIndex)-Math.abs(oe.relativeIndex)),Se=ve(pe,[0,2],[B.width+C,oe.width]);C+=B.width,B.width=Se,C-=B.width});const se=U.length/2,P=ve(Math.abs(te[0].relativeIndex),[te[0].index===0?0:se-1,se],[0,1]),_=ve(P,[0,1],[0,1])*-(c[0]+a);I.forEach((B,ee)=>{if(B.current){const oe=U.find(pe=>pe.index===ee);oe?(B.current.style.setProperty("--carousel-item-width",`${oe.width}px`),B.current.style.display="block"):(B.current.style.setProperty("--carousel-item-width",`${c[0]}px`),B.current.style.display="none")}}),L.current.style.transform=`translateX(${_}px)`,q!==v&&k(q)},[w.length,c,a,v]);o.useLayoutEffect(()=>{D()},[D,w.length]),o.useEffect(()=>{d&&d(v)},[v,d]);const[M,T]=o.useState(0);o.useEffect(()=>{T(v)},[v]);const j=(A,W={})=>{if(!w.length)return 0;const G=I[A];if(!G||!G.current||!L.current)return 0;const S=ve(A/Math.max(1,w.length-1),[0,1],[0,1]);return T(A),L.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:S,orientation:"horizontal",animate:W.animate!==!1}})),S};o.useEffect(()=>{typeof f=="number"&&w.length>0&&f!==v&&j(f)},[f,w.length]);const X=A=>{var W;if(E.current=A,A.scrollTotal>0){(W=F.current)==null||W.stop();const G=g.current??0,S=A.scrollProgress??0;F.current=Y.animate(G,S,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:N=>{g.current=N,requestAnimationFrame(()=>{D()})}})}},V=o.useRef(i);o.useEffect(()=>{V.current=i},[i]);const Q=o.useRef(null);o.useEffect(()=>{const A=V.current;if(!A||!(p!=null&&p.current)||w.length<=0)return;const W=w.length,G=p.current.clientWidth||0,S=c[1],N=g.current,C=(G+a)/(S+a),q=Math.max(1,Math.floor(C)),U=Math.max(1,Math.round(q*(2/3))),J=Math.min(Math.max(0,v),Math.max(0,W-1)),te={total:W,selectedIndex:J,visibleApprox:C,visibleFull:q,stepHalf:U,canPrev:J>0,canNext:J<W-1,scrollProgress:N,viewportWidth:G,itemMaxWidth:S,gap:a},se=Q.current;let P=!se;if(!P){for(const _ in te)if(te[_]!==se[_]){P=!0;break}}P&&(Q.current=te,A(te))},[p,w.length,v,a,c]),o.useEffect(()=>()=>{var A;(A=F.current)==null||A.stop()},[]);const[z,$]=o.useState(0);o.useLayoutEffect(()=>{let A=c[1];const W=E.current;W&&A>W.scrollVisible&&W.scrollVisible>0&&(A=W.scrollVisible);const G=(A+a)*w.length/x;$(G||400)},[p,w.length,a,c,x]);const R=A=>{if(!w.length)return;const W=M??v;switch(A.key){case"ArrowLeft":A.preventDefault(),j(Math.max(0,W-1));break;case"ArrowRight":A.preventDefault(),j(Math.min(w.length-1,W+1));break;case"Home":A.preventDefault(),j(0);break;case"End":A.preventDefault(),j(w.length-1);break;case"Enter":case" ":A.preventDefault(),j(W);break}};o.useEffect(()=>{const A=p.current;if(!A)return;const W=G=>{const S=G.detail;S&&typeof S.index=="number"&&j(S.index)};return A.addEventListener("udx:carousel:centerIndex",W),()=>{A.removeEventListener("udx:carousel:centerIndex",W)}},[p,w.length]);const O=w.map((A,W)=>{var N;const G=(N=A.props)==null?void 0:N.onClick,S=C=>{G==null||G(C)};return o.cloneElement(A,{outputRange:c,ref:I[W],key:W,index:W,role:"option","aria-selected":v===W,tabIndex:v===W?0:-1,onClick:S,onFocus:()=>T(W)})});return l.jsx("div",{className:b.carousel,ref:p,role:"listbox","aria-orientation":"horizontal",onKeyDown:R,...h,children:l.jsx(vt,{draggable:!0,orientation:"horizontal",onScroll:X,scrollSize:z,children:l.jsx("div",{className:b.track,ref:L,style:{gap:`${a}px`,willChange:"transform"},children:O})})})};/*!
|
|
2
2
|
* Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com
|
|
3
3
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
4
4
|
* Copyright 2026 Fonticons, Inc.
|
package/dist/index.js
CHANGED
|
@@ -1358,8 +1358,8 @@ const ns = ({
|
|
|
1358
1358
|
A.postMessage({
|
|
1359
1359
|
id: M,
|
|
1360
1360
|
snapshot: yn(g),
|
|
1361
|
-
tailwindOptions: g.plugins.getPlugin(Ue).
|
|
1362
|
-
fontOptions: g.plugins.getPlugin(wt).
|
|
1361
|
+
tailwindOptions: g.plugins.getPlugin(Ue).toSerializable(),
|
|
1362
|
+
fontOptions: g.plugins.getPlugin(wt).toSerializable()
|
|
1363
1363
|
});
|
|
1364
1364
|
};
|
|
1365
1365
|
return _(() => () => {
|