@zuzjs/ui 1.0.45 → 1.0.47
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/bin.cjs +4 -4
- package/dist/bin.js +1 -1
- package/dist/css/styles.css +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +44 -38
- package/dist/index.d.ts +44 -38
- package/dist/index.js +6 -6
- package/package.json +2 -2
- /package/dist/{chunk-75MTISHD.js → chunk-NWG6ZO7D.js} +0 -0
- /package/dist/{chunk-NM5LTE2K.cjs → chunk-RI5JB2KJ.cjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f,e,g,d,h,c}from'./chunk-
|
|
1
|
+
import {f,e,g,d,h,c}from'./chunk-NWG6ZO7D.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-NWG6ZO7D.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useImperativeHandle,useState,useCallback,createElement,isValidElement,useId,useLayoutEffect,useContext,useSyncExternalStore,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useIntersectionObserver,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts,useCommandActions}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {MD5,uuid,withPost,_,clamp,timeSince,checkPasswordStrength,removeDuplicateWords,PubSub,toHash,numberInRange,copyToClipboard}from'@zuzjs/core';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var hr={Circle:"CIRCLE",Square:"SQUARE"},ef={Default:"DEFAULT",Circle:"CIRCLE"},tf={Light:"light",Dark:"dark",System:"system"},Me={Default:"DEFAULT",Switch:"SWITCH"},pt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},he=pt,ut=AnchorType,of=ut,q={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},rf={Asc:"ASC",Desc:"DESC"},nf={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},sf={Dots:"DOTS"},Ze={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},Te={Success:"success",Error:"error",Warning:"warning",Info:"info"},Q={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},Y={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},af={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},Pe={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Je=Pe,ao={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},yr=ao,lf={Bar:"BAR",Ring:"RING"},io={Default:"range",Text:"number"},lo={Default:"DEFAULT",Card:"CARD"},Bt={Gooey:"gooey"},ve={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var xr=Symbol.for("zuz.global.map"),br=e=>{globalThis[xr]=e;},Na=()=>globalThis[xr]||{},co=e$1=>{let r=Array.isArray(e$1)?e$1.join(" "):e$1;if(!r||typeof r!="string")return "";let t=Na();return process.env.NODE_ENV==="development"&&Object.keys(t).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(r).filter(Boolean).map(o=>{let s=o.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,m,c]=s;return g(c).map(p=>{let f=`${m}(${p})`;return t[f]||p}).join(" ")}return t[o]||o}).join(" ")},If=e=>{let r=Array.isArray(e)?e.join(" "):e;return !r||typeof r!="string"?"":co(r)},vr=e=>{let r={};for(let t in e){let n=e[t];if(t.startsWith("--")){r[t]=n;continue}let o=d[t]?.toString()??t;if(o==="x"||o==="translateX"){let s=r.translate?.split(" ")??["0px","0px"];r.translate=`${h.addUnitsSafely(t,n)} ${s[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let s=r.translate?.split(" ")??["0px","0px"];r.translate=`${s[0]??"0px"} ${h.addUnitsSafely(t,n)}`;}else c.includes(o)?r[o]=h.addUnitsSafely(t,n):r[o]=n;}return r},mo=e=>{if(!e)return "linear";switch(e.toUpperCase()){case Q.Bounce:return "var(--bounce)";case Q.Liquid:return "var(--liquid)";case Q.Spring:return "var(--spring)";case Q.EaseInOut:return "ease-in-out";case Q.EaseOutBack:return "ease-out-back";default:return "linear"}},ft=(e,r=0,t=0)=>{let n={},o={},s=r||20,a=t||0;switch(e){case Y.SlideInLeft:case Y.SlideInRight:n={"--fx-x":e===Y.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},o={"--fx-x":`${a}px`,opacity:1};break;case Y.SlideInTop:case Y.SlideInBottom:n={"--fx-y":e===Y.SlideInTop?`-${s}px`:`${s}px`,opacity:0},o={"--fx-y":`${a}px`,opacity:1};break;case Y.ScaleIn:n={scale:0,opacity:0},o={scale:1,opacity:1};break;case Y.FadeIn:n={opacity:0},o={opacity:1};break}return {from:n,to:o}},Nf=(e,r,t)=>{let{from:n,to:o}=ft(e);return r?{...n,...o}:t?n:o};var Ea=(e,r)=>{let t=useRef([]),n=useRef(false);return useEffect(()=>{e?.when||(n.current=false);},[e?.transition]),useEffect(()=>{let o=r?.current;if(!o||!e||!e.clearAtEnd)return;let s=a=>{t.current.includes(a.propertyName)&&e.clearAtEnd===true&&(o.style.transform="",o.style.filter="",t.current.forEach(m=>o.style.removeProperty(m)));};return o.addEventListener("transitionend",s),()=>o.removeEventListener("transitionend",s)},[e,r]),useEffect(()=>{if(typeof window>"u"||!r?.current)return;let o=r.current;(e?.scroll||e?.mouse)&&(o.style.willChange="transform",o.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",o.style.transition=`translate 0.1s ${e.curve?mo(e.curve):"var(--spring)"}`);},[e,r]),useMemo(()=>{if(!e)return {style:{}};let{transition:o,from:s,to:a,exit:m,when:c,duration:p=.3,delay:f=0,curve:l,margin:i=0,offset:g=20,watch:C=[]}=e,P=c===false&&!n.current;c===true&&(n.current=true);let y={},{from:R,to:T}=o?ft(o,g,i):{from:s||{},to:a||{}};y=c===void 0?{...R,...T}:c?{...T}:m||R;let S=mo(l),d=[],x=vr(y);t.current=Object.keys(x);let h={...x};return Object.keys(x).forEach(b=>{let I=b.startsWith("--")?"all":b;d.includes(I)||d.push(`${I} ${p}s ${S} ${f}s`);}),C.forEach(b=>{d.includes(b)||d.push(`${b} 0.1s ${S} 0s`);}),{style:{...h,transition:P?"none":d.join(", "),opacity:P?0:h.opacity,pointerEvents:P?"none":h.pointerEvents}}},[e,e?.when,e?.watch])},ye=Ea;var Et=null,ka=(e,r)=>{let{as:t,fx:n,busy:o=false,transition:s,skeleton:a,className:m,propsToRemove:c,draggable:p,dragOptions:f$1,style:l,...i}=e||{},g=typeof window<"u",C={},P={};if(p&&g&&!Et&&(import('@zuzjs/hooks').then(d=>{Et=d.useDrag;}).catch(d=>{console.error("Error loading useDrag:",d);}),Et)){let d=Et(f$1);C={onMouseDown:d.onMouseDown},P={transform:`translate(${d.position.x}px, ${d.position.y}px)`};}let y=[m,o===true?"--is-busy":""].filter(Boolean).join(" "),R=s?{transition:s,duration:.3}:n||{},{style:T}=ye(R,r),S=co(t??"");return {style:{...l,...T,...P},className:[y,S||"",a?.enabled?"--skeleton":"",p?"--draggable":""].join(" ").trim(),rest:{...C,...f(i,c?[...c,"skeleton"]:["skeleton"])}}},E=ka;var Cr="(prefers-color-scheme: dark)",Oa=typeof window>"u",Pr=createContext(void 0),go=e=>{let r=useContext(Pr);if(!r){if(e===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return r},J=go,Da=({children:e,storageKey:r="--ucs",forceTheme:t,zuzMap:n,...o})=>(n&&br(n),jsx(Ha,{storageKey:r,forceTheme:t,...o,children:e})),Ha=({children:e,storageKey:r,forceTheme:t,...n})=>{let[o,s]=useState(()=>t||Tr(r,"system")),[a,m]=useState(()=>t||Tr(r)),c=i=>(i||(i=window.matchMedia(Cr)),i.matches?"dark":"light"),p=useCallback(i=>{let g=i=="system"?c():i,C=document.documentElement;C.setAttribute("color-scheme",g),C.style.colorScheme=g,m(g);},[c]),f=useCallback(i=>{s(i),localStorage.setItem(r,i),p(i);},[o]),l=useCallback(i=>{let g=c(i);m(g),o==="system"&&p("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(r);},[o]),useEffect(()=>{window.matchMedia(Cr).addEventListener("change",l);},[l]),useEffect(()=>{let i=g=>{g.key==r&&(g.newValue?f(g.newValue):f("system"));};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[f]),useEffect(()=>{p(t||o||"system");},[o]),jsxs(Pr,{value:{colorScheme:o,resolvedScheme:a,setColorScheme:f,...n},children:[t?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
2
2
|
const themes = ['light', 'dark']
|
|
3
|
-
let theme = localStorage.getItem(\`${
|
|
3
|
+
let theme = localStorage.getItem(\`${r}\`) || "system";
|
|
4
4
|
if (theme === "system") {
|
|
5
5
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
6
6
|
}
|
|
7
7
|
document.documentElement.setAttribute("color-scheme", theme);
|
|
8
|
-
document.documentElement.style.colorScheme = theme;`}}),jsx(fo,{children:e})]})},xr=(e,n)=>{if(Ea)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||n};var vr=({ref:e,...n})=>{let{style:t,...r}=n,{style:o,className:s,rest:a}=B(r);return jsx("span",{ref:e,style:t,className:s,...a})};vr.displayName="Zuz.Span";var ie=vr;var Sr=forwardRef((e,n)=>{let{name:t,pathCount:r,variant:o,color:s,size:a,...c}=e,{variant:f}=Y(true),{className:i,style:u,rest:m}=B(c);return jsx("div",{style:{color:s,...u,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${o||f||G.Small} ${i}`.trim(),ref:n,...m,children:Array(r||0).fill(0).map((l,d)=>jsx(ie,{className:`path${d+1}`},`${t}-layer-${d}`))})});Sr.displayName="Zuz.Icon";var J=Sr;var de={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Cr=e=>{let{type:n,variant:t,color:r,...o}=e,{className:s,style:a,rest:c}=B(o),{spinner:f}=Y(true),i=()=>{switch(n||f?.type||de.Simple){case de.Simple:return null;case de.Wave:return jsxs(Fragment$1,{children:[jsx(p,{as:"--bar --bar1"}),jsx(p,{as:"--bar --bar2"}),jsx(p,{as:"--bar --bar3"})]});case de.Roller:return null}};return jsx(p,{className:`${s} --spinner --${(n||f?.type||de.Simple).toLowerCase()} --${t||f?.variant||G.Small}`.trim(),style:{...a},...c,children:i()})};Cr.displayName="Zuz.Spinner";var Te=Cr;var kt={Loading:"loading",Normal:"normal"};var Pr=({ref:e,...n})=>{let{reset:t,kind:r="solid",variant:o,icon:s,iconSize:a,children:c,withLabel:f,spinner:i,state:u,disabled:m,...l}=n,{style:d,className:C,rest:T}=B(l),{variant:b}=Y(true);return jsxs("button",{className:removeDuplicateWords(`--button --${r} --${o||b} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${C}`).trim().replace(/\s+/g," "),style:d,ref:e,disabled:u==kt.Loading||n.skeleton?.enabled||m,...T,children:[u==kt.Loading&&jsx(Te,{variant:o||b,type:i||de.Simple}),(!u||u==kt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(J,{variant:a,name:s}),f===true?jsx(ie,{children:c}):c]})]})};Pr.displayName="Zuz.Button";var $=Pr;var Rr=forwardRef((e,n)=>{let{h:t,html:r,children:o,lines:s,...a}=e,{style:c,className:f,rest:i}=B(a),u=`h${e.h||1}`;return jsx(u,{ref:n,style:c,className:f,...i,children:r?jsx(ie,{dangerouslySetInnerHTML:{__html:r}}):o})});Rr.displayName="Zuz.Text";var z=Rr;var _a=e=>{let{label:n,labelColor:t,icon:r,iconColor:o,index:s,className:a,onSelect:c}=e;return n=="-"?jsx(p,{className:"--line"}):jsxs($,{reset:true,onClick:f=>c?.(e),className:`--item ${a||""}`.trim(),children:[jsx(p,{as:"--icon",children:jsx(J,{name:r,className:"--ico",style:o?{color:o}:{}})}),jsx(z,{className:"--lbl flex aic",style:t?{color:t}:{},children:n})]})},Nr=_a;var kr=({ref:e,...n})=>{let{id:t,as:r,fx:o,offsetX:s,offsetY:a,parent:c,event:f,arrow:i,when:u,items:m,header:l,footer:d,origin:C=pt.TopRight,...T}=n,[b,I]=useState(false),[R,P]=useState(m||[]),{position:g,targetRef:x,calculatedAnchor:h}=useAnchorPosition(c?.current,f,{offsetX:s,offsetY:a,preferredAnchor:C}),N=c&&g.top>c.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",D=useMemo(()=>{let W=h.toLowerCase();return W.includes("left")?"--arrow-left":W.includes("right")?"--arrow-right":"--arrow-center"},[h]),M=g.top!==0||g.left!==0;useEffect(()=>{u&&M?I(true):u||I(false);},[u,M]);let{className:A,style:E,rest:V}=B(T),_=fe({...o?.transition?{transition:o.transition??q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??X.EaseInOut,duration:o?.duration??.05,when:b&&M});return jsxs(p,{ref:x,className:`--contextmenu ${i||c!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!b,style:{...E,..._.style,top:g.top,left:g.left,visibility:M?"visible":"hidden",transformOrigin:h},...V,children:[typeof l=="function"?createElement(l):l,R.map((W,S)=>jsx(Nr,{...W,index:S},`context-${W.label.toLowerCase()}-${S}`)),typeof d=="function"?createElement(d):d]})};kr.displayName="Zuz.ContextMenu";var ho=kr;var Lr=forwardRef((e,n)=>{let{children:t,fx:r,when:o,fxDelay:s,fxStep:a,classToIgnore:c,...f}=e,i=Y(true),u=useDelayed(),m=r||i?.group?.fx,l=s||i?.group?.fxDelay,d=a||i?.group?.fxStep,C=c||i?.group?.classToIgnore||"-fx",T=useMemo(()=>m?addPropsToChildren(t,b=>{if(b.type===Fragment)return false;let I=b.props||{},R="fx"in I,P=I.as?Array.isArray(I.as)?I.as.join(" "):I.as:I.className||"",g=typeof P=="string"&&P.includes(C);return !R&&!g},b=>({fx:{...m,delay:(l||0)+b*(d||.1),when:o??(r?.when||u)}})):t,[t,o,u,m]);return jsx(p,{className:"--group",ref:n,...f,children:T})});Lr.displayName="Zuz.Group";var yo=Lr;var Or=forwardRef((e,n)=>{let{message:t,spinner:r,spinnerSize:o,color:s,when:a,hideMessage:c,...f}=e,{className:i,style:u,rest:m}=B(f),{spinner:l}=Y(true);return "when"in e&&e.when==false?null:jsxs(yo,{fx:{transition:q.SlideInBottom,curve:X.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${i}`.trim(),style:{...u,backgroundColor:"var(--cover-bg)"},...m,children:[jsx(Te,{variant:o||l?.variant||G.Small,type:r||l?.type||de.Simple}),!c&&jsx(z,{className:"--label",style:{color:"var(--cover-label)"},children:t||"loading"})]})});Or.displayName="Zuz.Cover";var Ne=Or;var xo=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(t=>t!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},Pe=new xo;var Dr=forwardRef((e,n)=>{let{when:t,...r}=e;return jsx(p,{ref:n,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:q.FadeIn,when:t},...r})});Dr.displayName="Zuz.Overlay";var Fe=Dr;var ni=({action:e,render:n=true,message:t=""})=>jsx(p,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:n?t:null}),Hr=ni;var ai=({action:e,actionPosition:n,dialogID:t,variant:r})=>jsx(p,{as:`--footer flex aic rel ${n?n==pr.Center?"jcc":"":"jce"}`.trim(),children:e.map((o,s)=>jsx($,{variant:r,onClick:a=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${t}-action-${o.key}`))}),Ar=ai;var ii={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[Se.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[Se.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[Se.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[Se.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},L=ii;var li=({title:e="Alert",onClose:n})=>jsxs(p,{as:"--head flex aic rel",children:[jsx(p,{as:`--${e?"title":"dot"} flex aic jcc rel`,children:e}),jsx($,{onClick:t=>n(),className:"--closer abs center-v",children:L.close})]}),zr=li;var Zr=({ref:e,...n})=>{let{index:t,id:r,title:o,message:s,transition:a,curve:c,speed:f,type:i,action:u,actionPosition:m,spinner:l,loadingMessage:d,variant:C,inBackground:T,forceClose:b,forceLoading:I,onClose:R,onShow:P,onHide:g,...x}=n,h=useMemo(()=>uuid(12),[]),[y,N]=useState(o||""),[D,M]=useState(s||""),[A,E]=useState(i||je.Dialog),[V,_]=useState(false),[W,S]=useState(true),[k,F]=useState(u||null),[K,oe]=useState(false),{variant:Z,spinner:Q,dialog:j}=Y(true),le=C||j?.variant||Z||G.Small,{style:se,className:re,rest:H}=B(x),U=useRef(null),ne=fe({when:V,duration:f||j?.speed||.3,delay:j?.delay||.1,transition:a||j?.transition||q.SlideInBottom,curve:c||j?.curve||X.EaseInOut,watch:["scale","filter","transform"]}),te=()=>{_(false),R(r);},ee=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(te)&&te();}}],[V]);useShortcuts(ee),useEffect(()=>{E(je.Dialog),M(s),N(y),k&&F(k.reduce((ce,we)=>(ce.push({...we,key:we.key||uuid(12)}),ce),[])),_(true),setTimeout(()=>P?P():()=>{},500);},[]),useEffect(()=>{b&&te();},[b]),useEffect(()=>{I!=null&&oe(I);},[I]),useEffect(()=>(V?Pe.push(te):Pe.pop(te),()=>Pe.pop(te)),[V]);let ae=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Fe,{style:{zIndex:ae},when:V}),jsxs(p,{as:`--dialog --${(i??je.Default).toLowerCase()} ${V?"--visible":""} ${re} fixed abc`.trim(),style:{...ne.style,zIndex:ae+1,pointerEvents:T==true?"none":"auto",...T==true?{scale:"0.92",filter:"blur(2px)"}:{}},...H,ref:U,children:[jsx(zr,{title:y,onClose:te}),jsx(Hr,{message:D,render:W,action:k}),k&&k.length>0&&jsx(Ar,{variant:le,action:k,dialogID:h,actionPosition:m}),jsx(Ne,{when:K,spinner:l||j?.spinner||Q?.type||de.Simple,message:d||j?.loadingMessage})]})]})};Zr.displayName="Zuz.Dialog";var vo=Zr;var Kr=forwardRef((e,n)=>{let{speed:t,smooth:r=false,breakpoints:o={},style:s,...a}=e,{rootRef:c,containerRef:f,thumbY:i,thumbX:u,onScrollY:m,onScrollX:l}=useScrollbar(t||1,o,r),{style:d,className:C,rest:T}=B(a);return useEffect(()=>{let b=f.current;if(!b)return;let I=()=>{window.dispatchEvent(new Event("resize"));},R=P=>{let g=P.target;if(g.closest(".--allow-scroll")){let h=g.closest(".--allow-scroll"),{scrollTop:y,scrollHeight:N,clientHeight:D}=h,M=P.deltaY<0,A=P.deltaY>0;(M&&y>0||A&&y+D<N)&&P.stopPropagation();}};return b.addEventListener("scroll",I),b.addEventListener("wheel",R,{passive:true}),()=>{b.removeEventListener("scroll",I),b.removeEventListener("wheel",R);}},[f]),jsxs(p,{ref:c,className:C.trim(),as:"--scrollview rel",children:[jsx(p,{as:`--scroll-content ${C}`.trim(),ref:f,style:s||{},children:T.children}),jsx(p,{as:"--scroll-track --track-y --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:i,onMouseDown:m})}),jsx(p,{as:"--scroll-track --track-x --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:u,onMouseDown:l})})]})});Kr.displayName="Zuz.ScrollView";var wo=Kr;var Wr=({ref:e,...n})=>{let{id:t,index:r,from:o,speed:s,children:a,margin:c,animation:f,prerender:i,inBackground:u,forceClose:m,forceLoading:l,onClose:d,...C}=n,{drawer:T}=Y(true),[b,I]=useState(a),[R,P]=useState(false),[g,x]=useState(i??(T?.prerender||true)),[h,y]=useState(false),N=()=>{P(false),d?.(t??-1);},{className:D,style:M,rest:A}=B(C),E=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(N)&&N();}}],[R]);useShortcuts(E),useEffect(()=>{I(a);},[a]),useEffect(()=>(R?Pe.push(N):Pe.pop(N),()=>Pe.pop(N)),[R]),useEffect(()=>{P(true);},[]),useEffect(()=>{m&&N();},[m]),useEffect(()=>{l!=null&&y(l);},[l]);let V=o||T?.from||ye.Left,_=useMemo(()=>{switch(V){case ye.Left:return {from:{x:"-100vw"},to:{x:0}};case ye.Right:return {from:{x:"100vw"},to:{x:0}};case ye.Top:return {from:{y:"-100vh"},to:{y:0}};case ye.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,T?.from]),W=fe({from:{..._.from,opacity:0},to:{..._.to,opacity:1},when:R,curve:f||T?.animation||X.EaseInOut,duration:s||T?.speed||.5,watch:["scale","filter"]}),S=useMemo(()=>1e4+(r||1)*10,[r]);return jsxs(Fragment$1,{children:[jsx(Fe,{onClick:k=>{R&&N();},when:R,style:{zIndex:S}}),jsxs(p,{ref:e,"aria-hidden":!R,className:`--drawer flex cols ${D} --${V.toLowerCase()} fixed`,style:{...M,...W.style,"--m":`${c||T?.margin||0}px`,zIndex:S+1,pointerEvents:u==true?"none":"auto",...u==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==ye.Top||o==ye.Bottom?jsx(p,{className:"--handle"}):null,jsx($,{as:"--close-drawer --abs",onClick:N,children:L.close}),jsxs(wo,{as:"rel",children:[g||R?b:null,jsx(Ne,{when:h})]})]})]})};Wr.displayName="Zuz.Drawer";var To=Wr;var Ur=forwardRef((e,n)=>{let{progress:t,type:r,animated:o,...s}=e,a=useRef(null);useImperativeHandle(n,()=>({setProgress:u=>{a.current.style.width=`${u*100}%`,a.current.setAttribute("data-value",u+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(o?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:c,style:f,rest:i}=B(s);return jsx(p,{className:`--progress ${o?"--animated":""} flex rel ${c}`.trim(),style:f,...i,children:jsx(p,{ref:a,className:"--bar rel"})})});Ur.displayName="Zuz.ProgressBar";var Ke=Ur;var Ht=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Ht||{}),Vt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Vt||{}),qr=(t=>(t.Stack="stack",t.Individual="individual",t))(qr||{}),Xr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Pi=e=>{let{index:n,id:t,type:r,icon:o,title:s,message:a,duration:c,sticky:f=false,actions:i=[],position:u,style:m,isHovered:l,total:d,progress:C,forceClose:T,variant:b,onClick:I,onClose:R}=e,[P,g]=useState(false),[x,h]=useState(false),{toast:y}=Y(true),N=x||T,D=u||y?.position||"TopCenter",M=r||y?.type||"default",A=m||y?.style||"stack",E=c||y?.duration||4,V=C||y?.progress||false,_=useRef(E*1e3),W=useRef(void 0),S=useRef(void 0),k=useRef(null),F=fe({when:P&&!N,duration:.3,transition:y?.transition||(D.includes("Top")?q.SlideInTop:D.includes("Bottom")?q.SlideInBottom:D.includes("Left")?q.SlideInLeft:q.SlideInRight),curve:y?.curve||X.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{g(true);let re=H=>{if(S.current!==void 0){let U=H-S.current;if(!l&&!f&&!N&&(_.current-=U,k.current)){let ne=Math.max(0,_.current/(E*1e3)*100);k.current?.setProgress?.(ne/100);}}S.current=H,_.current<=0?h(true):W.current=requestAnimationFrame(re);};return W.current=requestAnimationFrame(re),()=>{W.current&&cancelAnimationFrame(W.current);}},[l,f,N,E]),useEffect(()=>{if(N){let re=setTimeout(()=>{R?.(t);},350);return ()=>clearTimeout(re)}},[N,t]);let K=A==="stack",oe=l?n*65:n*8,Z=l?1:Math.max(.85,1-n*.05),Q=l?1:Math.max(.4,1-n*.2),j=()=>{I?I():(!i||i.length===0)&&h(true);},le=F.style.transform||"translate(0, 0)",se=N?le:`${le} translateY(${D.includes("Top")?oe:-oe}px) scale(${Z})`;return jsxs(p,{onClick:j,as:`--snack --${N?"hidden":"visible"} --${b||y?.variant||G.Medium} --${M} --${D.toLowerCase()} abs flex aic`,style:{...F.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?F.style.opacity:Q,transform:se,filter:!N&&K&&!l&&n>0?"blur(1px)":"none",cursor:!i||i.length===0?"pointer":"default",transition:`${F.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(p,{as:"--ico flex aic jcc",children:o?jsx(J,{name:o}):jsx(p,{as:"--no-icon"})}),jsxs(p,{as:"--meta flex cols",children:[jsx(z,{as:"--tt",children:s||Xr[r]}),jsx(z,{as:"--tm",children:a})]}),i&&i.length>0&&jsx(p,{as:"--actions flex gap:5",children:i.map((re,H)=>jsx($,{as:"--snack-btn bold",onClick:U=>{U.stopPropagation(),re.onClick();},children:re.label},H))}),V&&jsx(Ke,{as:"abs",ref:k})]})},Po=Pi;var xe=createContext(null),ki=({ref:e,...n})=>{let r=useContext(xe)?.depth??0,[o,s]=useState(null),[a,c]=useState(null),[f,i]=useState(false),[u,m]=useState([]),l=useDelayed(),d=useRef(0),C=()=>++d.current,T=()=>{i(false),setTimeout(()=>c(null),200);};useImperativeHandle(e,()=>({add(g){let x=C(),h={id:x,...g};return m(y=>[...y,h]),x},openMenu(g){i(false),setTimeout(()=>{c({id:C(),type:"menu",props:g}),i(true);},16);},remove(g){m(x=>x.map(h=>h.id===g?{...h,props:{...h.props,forceClose:true}}:h)),a?.id===g&&T();},loading(g,x){m(h=>h.map(y=>y.id===g?{...y,props:{...y.props,forceLoading:x}}:y)),a?.id===g&&T();},clear(g){m(u.filter(x=>x.type!=g));}})),useEffect(()=>{if(a&&f){let g=()=>T();return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}},[a,f,T]);let b=g=>{setTimeout(()=>{m(x=>x.filter(h=>h.id!==g)),a?.id===g&&c(null);},250);},I=useMemo(()=>[...u.filter(g=>g.type!="toast")],[u]);if(!l)return null;let R=u.filter(g=>g.type=="toast").reverse(),P=Object.values(Vt);return createPortal(jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[I.map((g,x)=>{let h=x<I.length-1;return g.type==="dialog"?jsx(vo,{onClose:b,index:x,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):g.type==="drawer"?jsx(To,{onClose:b,index:x,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):null}),P.map(g=>{let x=R.filter(h=>(h.props.position||"TopCenter")===g);return x.length===0?null:jsx(p,{onMouseEnter:()=>s(g),onMouseLeave:()=>s(null),as:`--toast-container fixed --${g.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:x.map((h,y)=>jsx(Po,{index:y,total:x.length,isHovered:o===g,onClose:b,id:h.id,...h.props},h.id))},g)}),a&&jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(ho,{onClose:T,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},Li=({children:e})=>{let n=useContext(xe),t=n?n.depth+1:0,r=useRef(null),o=useMemo(()=>({add:s=>r.current?.add(s),openMenu:s=>r.current?.openMenu(s),remove:s=>r.current?.remove(s),loading:(s,a)=>r.current?.loading(s,a),clear:s=>r.current?.clear(s),depth:t,isSubLayer:!!n}),[n]);return jsxs(xe.Provider,{value:o,children:[e,jsx(ki,{ref:r})]})},fo=Li;var Oi=()=>{let e=useContext(xe);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,o,s)=>{r.preventDefault(),e.openMenu({event:r,items:o,origin:s});},showMenu:(r,{items:o,origin:s,offsetX:a,offsetY:c,transition:f,curve:i,arrow:u,duration:m,header:l,footer:d})=>{e.openMenu({fx:{transition:f,curve:i,duration:m},parent:r,items:o,origin:s||pt.TopCenter,offsetX:a,offsetY:c,arrow:u,header:l,footer:d});},hide:e.clear}},Di=Oi;var Vi=()=>{let e=useContext(xe);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("dialog"),t=s=>e.remove(s),r=(s,a)=>e.loading(s,a);return {clearAll:n,show:s=>{let a=e.add({type:"dialog",props:{...s,type:je.Dialog}});return {id:a,setLoading:c=>r(a,c),hide:()=>t(a)}},hide:t}},Ai=Vi;var zi=()=>{let e=useContext(xe);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("drawer"),t=s=>e.remove(s),r=(s,a)=>e.loading(s,a),o=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:c=>r(a,c),close:()=>t(a)}};return {clearAll:n,open:s=>o({children:s}),right:s=>o({children:s,from:ye.Right}),left:s=>o({children:s,from:ye.Left}),top:s=>o({children:s,from:ye.Top}),bottom:s=>o({children:s,from:ye.Bottom}),close:t}},_i=zi;var Zi=(e,n,t={})=>{let[r,o]=useState(null),[s,a]=useState(false),{duration:c=.25,curve:f=X.EaseOutBack,borderRadius:i={from:40,to:24},targetWidth:u=320}=t;return useLayoutEffect(()=>{n&&e.current?(o(e.current.getBoundingClientRect()),a(true)):n||a(false);},[n,e]),{style:fe({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:i.from},to:{opacity:1,width:u,height:"auto",borderRadius:i.to},curve:f,duration:c,when:s&&n}).style,isMeasured:s,sourceRect:r}},Ki=Zi;var qi=(e,n={})=>{let{offset:t=8,direction:r="bottom",container:o=null,triggerRef:s=null}=n,a=useRef(null),c=useCallback(()=>{let f=e.current;if(!f)return;let i=s?.current||f.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let u=f.getBoundingClientRect(),m=i.getBoundingClientRect(),l,d;o?(l=o.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(f).position==="fixed"?d="fixed":d="absolute",d==="fixed"?l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==d&&(f.style.position=d),a.current=d;let b=0,I=0;switch(r){case "top":b=m.top-u.height-t,I=m.left,b<l.top&&m.bottom+u.height+t<=l.bottom&&(b=m.bottom+t);break;case "bottom":b=m.bottom+t,I=m.left,b+u.height>l.bottom&&m.top-u.height-t>=l.top&&(b=m.top-u.height-t);break;case "left":b=m.top,I=m.left-u.width-t,I<l.left&&m.right+u.width+t<=l.right&&(I=m.right+t);break;case "right":b=m.top,I=m.right+t,I+u.width>l.right&&m.left-u.width-t>=l.left&&(I=m.left-u.width-t);break}if(b=Math.max(l.top,Math.min(b,l.bottom-u.height)),I=Math.max(l.left,Math.min(I,l.right-u.width)),a.current==="fixed")f.style.top=`${b}px`,f.style.left=`${I}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let P=b-R.top+window.scrollY,g=I-R.left+window.scrollX;f.style.top=`${P}px`,f.style.left=`${g}px`;}},[e,s,t,r,o]);return useEffect(()=>{let f=e.current;if(!f)return;let i=s?.current||f.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let u=new ResizeObserver(c);return u.observe(f),i&&u.observe(i),c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,true),()=>{u.disconnect(),i&&u.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,true);}},[e,r,t,o,s]),{postion:a.current,reposition:c}},ht=qi;var Yi=()=>{let e=useContext(xe);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(m,l)=>e.add({type:"toast",props:{...l,type:m}}),r=m=>e.remove(m),i=(m,l,d)=>{let C=n(m,{...l,sticky:l.sticky??false,actions:[{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(C);}}]});return C},u=(m,l,d,C)=>{let T=n(m,{...l,sticky:true,actions:[{label:C?.label||"Cancel",onClick:()=>{C?.onClick?.(),r(T);}},{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(T);}}]});return T};return {ok:(m,l)=>i("default",m,l),success:(m,l)=>i("success",m,l),error:(m,l)=>i("error",m,l),confirm:(m,l,d)=>u("default",m,l,d),warn:(m,l)=>i("warn",m,l)}},ji=Yi;var Ji=()=>{let e=useContext(xe);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(i,u)=>e.add({type:"toast",props:{...u,type:i}});return {show:(i,u,m,l)=>n("default",{title:i,message:u,icon:m,duration:l}),hide:i=>e.remove(i),success:(i,u,m,l)=>n("success",{title:i,message:u,icon:m,duration:l}),error:(i,u,m,l)=>n("error",{title:i,message:u,icon:m,duration:l}),warn:(i,u,m,l)=>n("warn",{title:i,message:u,icon:m,duration:l}),promise:(i,u,m,l)=>n("promise",{title:i,message:u,icon:m,duration:l}),clearAll:()=>e.clear("toast")}},Io=Ji;var nn=({ref:e,style:n,...t})=>{let r=useRef(null),o=useMemo(()=>e&&typeof e!="function"&&e.current?e:r,[e]),{style:s,className:a,rest:c}=B(t,o);return jsx("div",{ref:e||r,style:{...s,...n||{}},className:a,...c})};nn.displayName="Zuz.Box";var p=nn;var an=forwardRef((e,n)=>{let{title:t,message:r,...o}=e,[s,a]=useState(false);return jsxs(p,{className:"--accordion flex cols",...o,children:[jsxs($,{onClick:c=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(z,{className:"--label flex",children:t}),jsx(p,{className:"--arrow flex",children:s?L.arrowUp:L.arrowDown})]}),s&&jsx(p,{className:"--detail",children:r})]})});an.displayName="Zuz.Accordion";var sl=an;var al=({label:e,icon:n,onClick:t,idx:r,selected:o})=>jsx($,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(J,{name:n}):n}),cn=al;var mn=forwardRef((e,n)=>{let{items:t,name:r,selected:o,position:s,...a}=e,c=useRef(null),[f,i]=useState(o||t[0].tag||0),u=useCallback(({x:b,y:I})=>{if(c.current){let R=c.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${b-R.left}`),document.documentElement.style.setProperty("--tip-y",`${I-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),m=useCallback(()=>{c.current&&(c.current.removeEventListener("pointerleave",m),c.current.removeEventListener("pointermove",u),document.documentElement.style.setProperty("--tip-s","0"));},[]),l=useCallback(()=>{c.current&&(c.current.addEventListener("pointerleave",m),c.current.addEventListener("pointermove",u));},[]);useEffect(()=>{c.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((b,I)=>I.label.length>b.length?I.label:b,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),c.current?.addEventListener("pointerenter",l));},[]);let{className:d,style:C,rest:T}=B(a);return jsxs(p,{ref:c,style:C,className:[`--actionbar flex aic ${d}`,`${!s||s==ue.Auto?"rel":`--${s}`}`].join(" ").trim(),...T,children:[t.map((b,I)=>jsx(cn,{selected:f===b.tag||o==I,...b,idx:I},`actionbar-action-${b.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(p,{className:"--tip abs",children:jsx(p,{className:"--track flex aic",children:t.map(({label:b})=>jsx(p,{className:"--lb",children:b},`tool-tip-${b.toLowerCase().replace(/\s+/g,"-")}`))})})]})});mn.displayName="Zuz.ActionBar";var pl=mn;var un=forwardRef((e,n)=>{let{type:t,icon:r,title:o,message:s,iconSize:a,...c}=e,{className:f,style:i,rest:u}=B(c);return jsxs(p,{className:`--alert --${t||Se.Info} flex aic ${f}`.trim(),style:i,...u,children:[jsx(p,{className:`--icon icon-${r||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!r&&L[t||Se.Info]}),jsxs(p,{className:"--meta flex cols",children:[jsx(z,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(z,{className:"--message",h:2,children:s})]})]})});un.displayName="Zuz.Alert";var dl=un;var Eo=createContext(null),hn=()=>{let e=useContext(Eo);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},yn=()=>useContext(Eo),xn=({children:e,initialValues:n={}})=>{let t=useRef({values:n,errors:{},touched:{}}),r=useRef(new Set),o=useCallback(()=>t.current,[]),s=useCallback(f=>(r.current.add(f),()=>r.current.delete(f)),[]),a=()=>r.current.forEach(f=>f()),c=useMemo(()=>({subscribe:s,getSnapshot:o,setFieldValue:(f,i)=>{t.current.values[f]!==i&&(t.current.values={...t.current.values,[f]:i},a());},setFieldError:(f,i)=>{t.current.errors={...t.current.errors,[f]:i},a();},reset:()=>{}}),[s,o]);return jsx(Eo.Provider,{value:c,children:e})};var bn=({ref:e,...n})=>{let{variant:t,numeric:r,name:o,onConfirm:s,...a}=n,{style:c,className:f,rest:i}=B(a),{variant:u}=Y(true),m=hn(),l=o?m?.errors[o]:null,d=C=>{r&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{name:o,className:`--input --${t||u} ${l?"--has-error":""} --flex ${f}`.trim(),style:c,onInput:d,onKeyDown:C=>{C.key=="Enter"&&s?.(C.currentTarget.value);},ref:e,...i})};bn.displayName="Zuz.Input";var me=bn;var wn=e=>{let{meta:n,children:t}=e,r=useDelayed(),{label:o,icon:s,...a}=isValidElement(n)?{}:n,{className:c,style:f,rest:i}=B({...a,...a.animate?{animate:{...a.animate,when:r}}:{}});return isValidElement(n)?jsx("li",{style:f,className:c,children:n}):jsxs("li",{style:f,className:c,...i,children:[t,typeof n=="string"?n:o]})};wn.displayName="Zuz.ListItem";var Sn=wn;var Tn=forwardRef((e,n)=>{let{items:t,variant:r,direction:o,seperator:s,ol:a,...c}=e,{className:f,style:i,rest:u}=B(c),m=a==true?"ol":"ul";return createElement(m,{className:`--list --${r||G.Small} flex ${o??"cols"} ${f}`.trim(),style:i,ref:n,...u,children:t.map((l,d,C)=>{let T=`${typeof l=="string"?`li-${String(l)}`:isValidElement(l)?`li-${l.key}`||`${d}-${MD5(l.toString())}`:l.label}-${d}`;return jsxs(Fragment,{children:[jsx(Sn,{meta:l}),s&&C[d+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${d+1}-${T}`):null]},T)})})});Tn.displayName="Zuz.List";var Ge=Tn;var In=forwardRef((e,n)=>{let{fx:t,action:r,data:o,withStyle:s,onChange:a,...c}=e,{className:f}=B({as:s||""}),{style:i}=B(c),[u,m]=useState(false),[l,d]=useState(o||[]),C=useRef(null),T=useRef(null),b=useRef(null),I=useMemo(()=>c.name||uuid(12),[]),[R,P]=useState(null),[g,x]=useState(null),[h,y]=useState([]),D=useDebounce(S=>{S.target.value==""?(m(false),d([])):r&&S.target.value.trim()!=""&&withPost(r,{query:S.target.value}).then(k=>{"items"in k&&_(k.items).isArray()?(d(k.items),x(S.target.value),y(k.items)):console.error("Action Response should contain items array"),P(null);}).catch(k=>{P(null),d([]);});},250),M=()=>{if(T.current){let S=T.current.getBoundingClientRect(),k=window.innerHeight-S.bottom,F=S.top;if(b.current){let K=b.current;k<K.offsetHeight&&F>k?(K.style.top="auto",K.style.bottom=`${S.height}px`,K.style.maxHeight=`${F-150}px`):(K.style.top=`${S.height+5}px`,K.style.bottom="auto",K.style.maxHeight=`${k-150}px`);}}},A=S=>{if(l.length>0){if((S.key==="ArrowDown"||S.key==="ArrowUp")&&(S.preventDefault(),S.stopPropagation()),S.key==="Escape")P(null),m(false),d([]);else if(S.key==="ArrowDown")P(k=>{let F=k===null||k===l.length-1?0:k+1;return V(F),F});else if(S.key==="ArrowUp")P(k=>{let F=k===null||k===0?l.length-1:k-1;return V(F),F});else if(S.key==="Enter"&&R!==null){let k=l[R];C.current&&(C.current.value=k,m(false),d([]));}}},E=S=>{C.current&&(C.current.value=S,m(false),d([]));},V=S=>{let k=l[S];if(k&&C.current&&(C.current.value=k,C.current.setSelectionRange(k.length,k.length)),b.current){let K=b.current.children[S];K&&K.scrollIntoView({block:"nearest"});}},_$1=S=>{T.current&&!T.current.contains(S.target)&&(m(false),d([]));},W=()=>{C.current&&C.current.value===g&&(d(h),P(null),M());};return useEffect(()=>(window.addEventListener("resize",M),window.addEventListener("scroll",M,true),document.addEventListener("mousedown",_$1),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true),document.removeEventListener("mousedown",_$1);}),[]),useEffect(()=>{M();},[l]),jsxs(p,{style:i,ref:T,className:`--autocomplete --${e.size||G.Small} flex aic rel ${f}`.trim(),children:[jsx(me,{ref:C,autoComplete:"off",onChange:D,onKeyDown:A,onFocus:W,...c}),jsx(p,{className:"--arrow rel flex aic jcc",children:l.length>0?L.arrowUp:L.arrowDown}),l.length>0&&jsx(Ge,{id:I,ref:b,className:"--suggestion-list flex cols abs",items:l.map((S,k)=>({label:S,onClick:F=>{F.preventDefault(),F.stopPropagation(),E(S);},className:R===k?"--current":"",animate:{transition:q.SlideInBottom,curve:X.EaseInOut,delay:clamp(.02*k,.02,.5)}}))})]})});In.displayName="Zuz.AutoComplete";var Hl=In;var Rn=forwardRef((e,n)=>{let t=useRef(null),r=useMemo(()=>n&&typeof n!="function"&&n.current?n:t,[n]),{style:o,className:s,rest:a}=B(e,r);return !a.src||a.src==""?null:jsx("img",{ref:r,style:o,className:`${s} flex`,...a})});Rn.displayName="Zuz.Image";var Ue=Rn;var Nn=forwardRef((e,n)=>{let{src:t,variant:r,type:o,crossOrigin:s,referrerPolicy:a,fx:c,as:f,alt:i,color:u,style:m,...l}=e,[d,C,T]=useImage(t??"",s,a),{className:b,style:I,rest:R}=B({fx:c,as:f});return jsx(p,{className:`--avatar --${r||G.Small} --${(o||mr.Circle).toLowerCase()} rel flex aic jcc ${b}`.trim(),style:{background:u||"var(--primary)",...m,...I},...R,children:t?jsx(Ue,{src:d,crossOrigin:s,referrerPolicy:a,...l}):jsx(z,{className:"--avatar-label",children:(i?i.charAt(0):"A").toUpperCase()})})});Nn.displayName="Zuz.Avatar";var Kl=Nn;var Wl=({size:e=5,type:n="dead",label:t="",variant:r=G.Small,loading:o=false,spinner:s,...a})=>{let{style:c,className:f,rest:i}=B(a);return jsxs(p,{style:{..._(t).isEmpty()?{"--badge-size":e}:{},...c},as:`--badge --${r} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(p,{fx:{transition:q.FadeIn,curve:X.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(Te,{type:s})}),_(t).isEmpty()?jsx(p,{as:`--dot --${n}`}):jsx(z,{as:"--label",children:t})]})},Gl=Wl;var ac=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let e=new Date,n=e.getDay();return addDays(e,(6-n)%7||6)},getDateFormat:()=>{let e=new Date,n=e.getDay();return format(addDays(e,(6-n)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],ic=e=>{let n=new Set;return e.filter(t=>{if(t.label=="Later")return true;let r=t.getDate().toISOString().split("T")[0];return n.has(r)?false:(n.add(r),true)})},En=forwardRef((e,n)=>{let{defaultValue:t,variant:r,onChange:o,...s}=e,{style:a,className:c,rest:f}=B(s),[i,u]=useState(t||new Date),m=startOfMonth(i),l=endOfMonth(i),d=startOfWeek(m),C=endOfWeek(l),T=useMemo(()=>eachDayOfInterval({start:d,end:C}),[d,C]),b=P=>{o?.(P),u(P);},I=()=>{u(P=>new Date(P.getFullYear(),P.getMonth()-1));},R=()=>{u(P=>new Date(P.getFullYear(),P.getMonth()+1));};return jsxs(p,{as:`--calendar flex --${r||"sm"} ${c}`,style:a,children:[jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:ic(ac).map(P=>{let g=P.getDate();return jsxs($,{onClick:()=>b(g),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(z,{as:"flex:1",children:P.label}),jsx(z,{as:"tar",children:P.getDateFormat()})]},`--dtp-option-label-${P.label}`)})}),jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(z,{as:"flex:1 --calendar-cm bold",children:format(i,"MMMM yyyy")}),jsx($,{onClick:I,as:"--calendar-chevron",children:L.chevronUpOutline}),jsx($,{onClick:R,as:"--calendar-chevron",children:L.chevronDownOutline})]}),jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(P=>jsx(z,{as:"--calendar-day",children:P},`--calendar-hd-${P}`)),T.map((P,g)=>{let x=isSameMonth(P,i),h=isSameDay(P,i),y=isToday(P);return jsx($,{disabled:!x,onClick:()=>b(P),as:["--calendar-day --calendar-dd",`${h?"--calendar-dd-selected":""}`,`${y?"--calendar-dd-current":""}`],children:format(P,"d")},`--calendar-day-${g}-${P.getFullYear()}-${P.getMonth()}-${P.getDay()}`)})]})]})]})});En.displayName="Zuz.Calendar";var Oo=En;var Zt=(t=>(t.Table="table",t.Gooey="gooey",t))(Zt||{});var On=({ref:e,...n})=>{let{itemCount:t,itemsPerPage:r,startPage:o,pageRange:s,paginationStyle:a,breakLabel:c,prevLabel:f,nextLabel:i,hash:u,loading:m,seperator:l,renderOnZeroPageCount:d,asDots:C,progressBar:T,onPageChange:b,...I}=n,R=useRef(null),P=useMemo(()=>toHash(numberInRange(4,8)),[]),g=useCallback(S=>`${toHash(S,u||6,P)}${l||""}${P}`,[P]),x=useMemo(()=>c||"...",[c]),h=useRef(null),[y,N]=useState({id:u?o?typeof o=="number"?g(o):o:1:o||1,label:o||1});useImperativeHandle(e,()=>({setPage:S=>N(S),getPage:S=>y,setProgress:S=>h.current?.setProgress?.(S),getProgress:()=>h.current?.getProgress?.()??0}),[h.current]);let{style:D,className:M,rest:A}=B(I),E=useCallback(S=>typeof S=="number"?S:+S.label,[]);if(!t)throw new Error('"itemCount" prop is required');let V=useMemo(()=>Math.ceil(t/r),[t,r]),_=useMemo(()=>{let S=[],k=Math.max(E(y)-(s||2),1),F=Math.min(E(y)+(s||2),V);k>1&&S.push({id:u?g(1):1,label:1}),k>2&&S.push({id:-1,label:x});for(let K=k;K<=F;K++)S.push({id:u?g(K):K,label:K});return F<V-1&&S.push({id:-1,label:x}),F<V&&S.push({id:u?g(V):V,label:V}),S},[y]),W=useCallback(S=>{let k=S;+k.label<1||+k.label>V||(N(k),b?.(k));},[t,r,y]);return _.length<=1&&(d??false)===false?null:jsxs(p,{ref:R,as:`--pagination ${C===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${M}`,children:[jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(_.length>1?_:[{id:1,label:1},{id:-1,label:x}]).map((S,k,F)=>{let K=(typeof S=="string"?S:S.label)==E(y);return jsx($,{disabled:S.id==-1||E(y)==+S.label,className:K?"--current-page":"",onClick:oe=>W(S),children:C===true?T===true&&K?jsx(Ke,{ref:h}):"":typeof S=="string"?S:S.label},`--pg-${k}-${S.id}`)})}),jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(y)-1)*r+1} - `,`${Math.min(E(y)*r,t)} of ${t} items`].join(" ")}),jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx($,{disabled:E(y)<=1,onClick:S=>W({id:u?g(E(y)-1):E(y)-1,label:E(y)-1}),children:L.chevronLeftOutline}),jsx($,{disabled:_.length<=1||E(y)==E(_[_.length-1]),onClick:S=>W({id:u?g(E(y)+1):E(y)+1,label:E(y)+1}),children:L.chevronRightOutline})]})]})};On.displayName="Zuz.Pagination";var bt=On;function gc(e,n){let{items:t,renderItem:r,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:c=0,useKeys:f=true,useWheel:i=true,spacing:u=160,rotation:m=20,scaleStep:l=.15,blur:d=4,animation:C="power",showDots:T=false,autoPlay:b=false,autoPlaySpeed:I=3,onChange:R,...P}=e,{className:g,style:x}=B(P),h=useRef(null),y=I/(I>=1e3?1e3:1),N=useCarousel({total:t.length,initialIndex:c,loop:s,useKeys:f,useWheel:i,onChange:V=>{h.current?.setPage({id:V+1,label:V+1}),h.current?.setProgress(0),R?.(V);}}),{pause:D,resume:M,reset:A}=useTimer({duration:y,autoStart:b===true,onProgress:V=>{b===true&&h.current?.setProgress(1-V);},onExpired:()=>{b===true&&N.next(),A();}}),E={...x,"--carousel-spacing":`${u}px`,"--carousel-rotation":`${m}deg`,"--carousel-blur":`${d}px`,"--carousel-scale-step":l,"--active-index":N.index,"--carousel-transition":`var(--${C})`};return jsxs(p,{ref:n,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${g}`.trim(),style:E,children:[jsx(p,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((V,_)=>{let W=_-N.index;if(a==="infinite"){let k=t.length;W=((W+k/2)%k+k)%k-k/2;}let S=_===N.index;return jsx(p,{onMouseEnter:()=>S&&D(),onMouseLeave:()=>S&&M(),className:`--carousel-item-wrapper abs ${S?"--is-active":""}`,style:{"--offset":W,zIndex:S?100:100-Math.abs(W),display:Math.abs(W)>5?"none":"flex"},children:r(V,_,N.index)},_)})}),T&&jsx(bt,{ref:h,itemCount:t.length,itemsPerPage:1,startPage:c+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:V=>N.goTo(+V.label-1),asDots:true,progressBar:true})]})}var hc=forwardRef(gc),yc=hc;var Dn=(n=>(n.Line="line",n))(Dn||{});var An=forwardRef((e,n)=>{let{data:t,width:r,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:c,gradientEndColor:f,animated:i,animDuration:u=2,animDelay:m=0,padding:l=0,type:d,...C}=e,{className:T,style:b,rest:I}=B(C),R=useRef(null),P=useResizeObserver(R.current?.parentElement||R),g=typeof r=="number"?r:P.width,x=typeof o=="number"?o:P.height,h={width:g,height:x},y=useId(),{pathD:N,areaPathD:D}=useLineChart(t,h,l+(a||2)),M=useRef(null),A=useRef(null),[E,V]=useState(0),[_,W]=useState(0);return useEffect(()=>{i&&(M.current&&V(M.current.getTotalLength()),A.current&&W(A.current.getTotalLength()));},[i,N,D,g,x]),jsx(p,{ref:R,as:`--chart --${d||"line"}-chart ${T}`.trim(),style:{...b,width:r,height:o},...I,children:g>0&&x>0&&jsxs("svg",{viewBox:`0 0 ${g} ${x}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:c}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:A,d:D,fill:`url(#${y})`,stroke:"none",style:i?{strokeDasharray:_,strokeDashoffset:_}:{},children:i&&jsx("animate",{attributeName:"stroke-dashoffset",from:_,to:"0",dur:`${u||2}s`,begin:`${m||0}s`,fill:"freeze"})}),jsx("path",{ref:M,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:i?{strokeDasharray:E,strokeDashoffset:E}:{},children:i&&jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${u||2}s`,begin:`${m||0}s`,fill:"freeze"})})]})})});An.displayName="Zuz.Chart";var Tc=An;var $n=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))($n||{}),zn=(i=>(i.Image="img",i.Video="vid",i.Audio="audio",i.Link="link",i.Document="doc",i.Location="loc",i.Contact="contact",i.Event="event",i.Poll="poll",i))(zn||{});var _n=forwardRef((e,n)=>{let{text:t,media:r,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:c=true,...f}=e,{className:i,style:u,rest:m}=B(f);return jsx(p,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(p,{className:`--bubble --bubble-${o} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${c==true?"--b-arrow":""} ${i}`.trim(),style:{...u},...m,children:[t&&jsx(z,{className:"--bubble-text",children:t}),r?r.type=="audio"?jsxs(p,{as:"flex aic --bubble-audio",children:[jsx(ie,{className:"--bm-action",children:L.play}),jsx(Ke,{progress:.7}),jsx(z,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(p,{as:"--bubble-image",children:jsx(Ue,{src:r.source})}):null:null,jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsx(z,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(ie,{className:`--bubble-status --bs-${s}`,children:s==0?L.pending:s==1?L.done:s==2?L.doneAll:L.doneAll})]})]})})});_n.displayName="Zuz.Bubble";var Rc=_n;var Fn=forwardRef((e,n)=>{let{style:t,className:r,rest:o}=B(e);return jsx("label",{ref:n,style:t,className:r,...o})});Fn.displayName="Zuz.Label";var vt=Fn;var Zn=forwardRef((e,n)=>{let{name:t,required:r,type:o,value:s,size:a,variant:c,checked:f,onSwitch:i,...u}=e,[m,l]=useState(f||false),d=useRef(null),{variant:C}=Y(true);return useImperativeHandle(n,()=>({setChecked(T,b=true){l(T),d.current&&(d.current.checked=T),b&&i&&i(T,s||"cb");},toggle(T=true){d.current&&(d.current.checked=!m),T&&i&&i&&i(!m,s||"cb"),l(!m);}})),jsxs(vt,{className:`--${(o||Le.Default).toLowerCase()} ${!o||o==Le.Default?"--checkbox":"--switch"} --${c||C||G.Small} flex aic jcc ${m?"is-checked":""} rel`.trim(),...u,children:[(!o||o==Le.Default)&&L.check,jsx(me,{ref:d,defaultChecked:m,value:s||"cb",type:"checkbox",className:"abs",name:t,required:r||false,onChange:T=>{i&&i(T.target.checked,s||"cb"),l(T.target.checked);}})]})});Zn.displayName="Zuz.CheckBox";var wt=Zn;var Ac=({ref:e,...n})=>{let{code:t,copy:r,lang:o="tsx",showLines:s=false,highlight:a="",as:c,fx:f,...i}=n,u=useRef(null),{className:m,style:l,rest:d}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${c}`,fx:f},u),C=useMemo(()=>{let b=new Set;return a.split(",").forEach(I=>{if(I.includes("-")){let[R,P]=I.split("-").map(Number);for(let g=R;g<=P;g++)b.add(g);}else I&&b.add(Number(I));}),b},[a]),T=useMemo(()=>{let b=t.split(`
|
|
9
|
-
`);for(;
|
|
8
|
+
document.documentElement.style.colorScheme = theme;`}}),jsx(ho,{children:e})]})},Tr=(e,r)=>{if(Oa)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||r};var Rr=({ref:e,...r})=>{let{style:t,...n}=r,{style:o,className:s,rest:a}=E(n);return jsx("span",{ref:e,style:t,className:s,...a})};Rr.displayName="Zuz.Span";var se=Rr;var Nr=forwardRef((e,r)=>{let{name:t,pathCount:n,variant:o,color:s,size:a,...m}=e,{variant:c}=J(true),{className:p,style:f,rest:l}=E(m);return jsx("div",{style:{color:s,...f,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${o||c||q.Small} ${p}`.trim(),ref:r,...l,children:Array(n||0).fill(0).map((i,g)=>jsx(se,{className:`path${g+1}`},`${t}-layer-${g}`))})});Nr.displayName="Zuz.Icon";var ee=Nr;var xe={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Br=e=>{let{type:r,variant:t,color:n,...o}=e,{className:s,style:a,rest:m}=E(o),{spinner:c}=J(true),p=()=>{switch(r||c?.type||xe.Simple){case xe.Simple:return null;case xe.Wave:return jsxs(Fragment$1,{children:[jsx(u,{as:"--bar --bar1"}),jsx(u,{as:"--bar --bar2"}),jsx(u,{as:"--bar --bar3"})]});case xe.Roller:return null}};return jsx(u,{className:`${s} --spinner --${(r||c?.type||xe.Simple).toLowerCase()} --${t||c?.variant||q.Small}`.trim(),style:{...a},...m,children:p()})};Br.displayName="Zuz.Spinner";var Re=Br;var Mt={Loading:"loading",Normal:"normal"};var kr=({ref:e,...r})=>{let{reset:t,kind:n="solid",variant:o,icon:s,iconSize:a,children:m,withLabel:c,spinner:p,state:f,disabled:l,...i}=r,{style:g,className:C,rest:P}=E(i),{variant:y}=J(true);return jsxs("button",{className:removeDuplicateWords(`--button --${n} --${o||y} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${C}`).trim().replace(/\s+/g," "),style:g,ref:e,disabled:f==Mt.Loading||r.skeleton?.enabled||l,...P,children:[f==Mt.Loading&&jsx(Re,{variant:o||y,type:p||xe.Simple}),(!f||f==Mt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(ee,{variant:a,name:s}),c===true?jsx(se,{children:m}):m]})]})};kr.displayName="Zuz.Button";var z=kr;var Lr=({ref:e,...r})=>{let{h:t,html:n,children:o,lines:s,tfx:a,duration:m=.5,stagger:c=.05,repeat:p=true,reveal:f=false,hover:l=false,...i}=r,{style:g,className:C,rest:P}=E(i),y=useRef(null),[R,T]=useState(false),[S]=useIntersectionObserver([y],{threshold:[1]}),d=useMemo(()=>{if(g?.opacity!==void 0)return g.opacity;if(typeof r.as=="string"){let I=r.as.match(/opacity:([\d.]+)/);if(I)return I[1]}return 1},[r.as,g?.opacity]),x=useMemo(()=>a?l?R:f?S===1:true:false,[a,l,R,f,S]);useEffect(()=>{e&&(typeof e=="function"?e(y.current):e.current=y.current);},[e]);let h=`h${r.h||1}`,b=useMemo(()=>n?jsx(se,{dangerouslySetInnerHTML:{__html:n}}):a&&typeof o=="string"?o.split("").map((I,V)=>{let M=I===" ",N=["typewriter","reveal","fog","slide","pop"].includes(a)?"1":p?"infinite":"1";return jsx(se,{"data-char":I,className:`--fx-char ${x?`--fx-${a}`:""}`,style:{"--delay":`${V*c}s`,"--duration":`${m}s`,"--iteration":N,"--target-opacity":d,display:M?"inline":"inline-block",whiteSpace:"pre",opacity:!x&&a==="typewriter"?0:void 0},children:I},V)}):o,[o,n,a,x,c,m,p]);return jsx(h,{ref:y,onMouseEnter:()=>l&&T(true),onMouseLeave:()=>l&&T(false),style:{...g,display:a?"flex":g?.display,flexWrap:a?"wrap":g?.flexWrap,opacity:a&&!x?0:a?1:g?.opacity,transition:a?"opacity 0.4s ease":void 0},className:`${C} ${a?"--text-fx":""}`.trim(),...P,children:b})};Lr.displayName="Zuz.Text";var F=Lr;var qa=e=>{let{label:r,labelColor:t,icon:n,iconColor:o,index:s,className:a,onSelect:m}=e;return r=="-"?jsx(u,{className:"--line"}):jsxs(z,{reset:true,onClick:c=>m?.(e),className:`--item ${a||""}`.trim(),children:[jsx(u,{as:"--icon",children:jsx(ee,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(F,{className:"--lbl flex aic",style:t?{color:t}:{},children:r})]})},Mr=qa;var Hr=({ref:e,...r})=>{let{id:t,as:n,fx:o,offsetX:s,offsetY:a,parent:m,event:c,arrow:p,when:f,items:l,header:i,footer:g,origin:C=ut.TopRight,...P}=r,[y,R]=useState(false),[T,S]=useState(l||[]),{position:d,targetRef:x,calculatedAnchor:h}=useAnchorPosition(m?.current,c,{offsetX:s,offsetY:a,preferredAnchor:C}),I=m&&d.top>m.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",V=useMemo(()=>{let K=h.toLowerCase();return K.includes("left")?"--arrow-left":K.includes("right")?"--arrow-right":"--arrow-center"},[h]),M=d.top!==0||d.left!==0;useEffect(()=>{f&&M?R(true):f||R(false);},[f,M]);let{className:_,style:N,rest:$}=E(P),A=ye({...o?.transition?{transition:o.transition??Y.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??Q.EaseInOut,duration:o?.duration??.05,when:y&&M});return jsxs(u,{ref:x,className:`--contextmenu ${p||m!=null?`--has-arrow ${I} ${V}`:""} abs flex cols ${_}`.trim(),"aria-hidden":!y,style:{...N,...A.style,top:d.top,left:d.left,visibility:M?"visible":"hidden",transformOrigin:h},...$,children:[typeof i=="function"?createElement(i):i,T.map((K,B)=>jsx(Mr,{...K,index:B},`context-${K.label.toLowerCase()}-${B}`)),typeof g=="function"?createElement(g):g]})};Hr.displayName="Zuz.ContextMenu";var vo=Hr;var Vr=forwardRef((e,r)=>{let{children:t,fx:n,when:o,fxDelay:s,fxStep:a,classToIgnore:m,...c}=e,p=J(true),f=useDelayed(),l=n||p?.group?.fx,i=s||p?.group?.fxDelay,g=a||p?.group?.fxStep,C=m||p?.group?.classToIgnore||"-fx",P=useMemo(()=>l?addPropsToChildren(t,y=>{if(y.type===Fragment)return false;let R=y.props||{},T="fx"in R,S=R.as?Array.isArray(R.as)?R.as.join(" "):R.as:R.className||"",d=typeof S=="string"&&S.includes(C);return !T&&!d},y=>({fx:{...l,delay:(i||0)+y*(g||.1),when:o??(n?.when||f)}})):t,[t,o,f,l]);return jsx(u,{className:"--group",ref:r,...c,children:P})});Vr.displayName="Zuz.Group";var wo=Vr;var Ar=forwardRef((e,r)=>{let{message:t,spinner:n,spinnerSize:o,color:s,when:a,hideMessage:m,...c}=e,{className:p,style:f,rest:l}=E(c),{spinner:i}=J(true);return "when"in e&&e.when==false?null:jsxs(wo,{fx:{transition:Y.SlideInBottom,curve:Q.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${p}`.trim(),style:{...f,backgroundColor:"var(--cover-bg)"},...l,children:[jsx(Re,{variant:o||i?.variant||q.Small,type:n||i?.type||xe.Simple}),!m&&jsx(F,{className:"--label",tfx:"bounce",style:{color:"var(--cover-label)"},children:t||"loading"})]})});Ar.displayName="Zuz.Cover";var Be=Ar;var So=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(r){return this.stack[this.stack.length-1]===r}push(r){this.stack.includes(r)||(this.stack.push(r),this.updateScrollLock());}pop(r){this.stack=this.stack.filter(t=>t!==r),this.updateScrollLock();}handleEscape(){let r=this.stack[this.stack.length-1];return r?(r(),true):false}get count(){return this.stack.length}},Ie=new So;var zr=forwardRef((e,r)=>{let{when:t,...n}=e;return jsx(u,{ref:r,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:Y.FadeIn,when:t},...n})});zr.displayName="Zuz.Overlay";var Ke=zr;var pi=({action:e,render:r=true,message:t=""})=>jsx(u,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:r?t:null}),Fr=pi;var fi=({action:e,actionPosition:r,dialogID:t,variant:n})=>jsx(u,{as:`--footer flex aic rel ${r?r==yr.Center?"jcc":"":"jce"}`.trim(),children:e.map((o,s)=>jsx(z,{variant:n,onClick:a=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${t}-action-${o.key}`))}),Zr=fi;var di={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[Te.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[Te.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[Te.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[Te.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},D=di;var gi=({title:e="Alert",onClose:r})=>jsxs(u,{as:"--head flex aic rel",children:[jsx(u,{as:`--${e?"title":"dot"} flex aic jcc rel`,children:e}),jsx(z,{onClick:t=>r(),className:"--closer abs center-v",children:D.close})]}),Wr=gi;var qr=({ref:e,...r})=>{let{index:t,id:n,title:o,message:s,transition:a,curve:m,speed:c,type:p,action:f,actionPosition:l,spinner:i,loadingMessage:g,variant:C,inBackground:P,forceClose:y,forceLoading:R,onClose:T,onShow:S,onHide:d,...x}=r,h=useMemo(()=>uuid(12),[]),[b,I]=useState(o||""),[V,M]=useState(s||""),[_,N]=useState(p||Je.Dialog),[$,A]=useState(false),[K,B]=useState(true),[L,W]=useState(f||null),[k,ne]=useState(false),{variant:Z,spinner:U,dialog:G}=J(true),j=C||G?.variant||Z||q.Small,{style:ie,className:te,rest:ue}=E(x),ae=useRef(null),ge=ye({when:$,duration:c||G?.speed||.3,delay:G?.delay||.1,transition:a||G?.transition||Y.SlideInBottom,curve:m||G?.curve||Q.EaseInOut,watch:["scale","filter","transform"]}),ce=()=>{A(false),T(n);},oe=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ie.isTop(ce)&&ce();}}],[$]);useShortcuts(oe),useEffect(()=>{N(Je.Dialog),M(s),I(b),L&&W(L.reduce((O,X)=>(O.push({...X,key:X.key||uuid(12)}),O),[])),A(true),setTimeout(()=>S?S():()=>{},500);},[]),useEffect(()=>{y&&ce();},[y]),useEffect(()=>{R!=null&&ne(R);},[R]),useEffect(()=>($?Ie.push(ce):Ie.pop(ce),()=>Ie.pop(ce)),[$]);let re=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Ke,{style:{zIndex:re},when:$}),jsxs(u,{as:`--dialog --${(p??Je.Default).toLowerCase()} ${$?"--visible":""} ${te} fixed abc`.trim(),style:{...ge.style,zIndex:re+1,pointerEvents:P==true?"none":"auto",...P==true?{scale:"0.92",filter:"blur(2px)"}:{}},...ue,ref:ae,children:[jsx(Wr,{title:b,onClose:ce}),jsx(Fr,{message:V,render:K,action:L}),L&&L.length>0&&jsx(Zr,{variant:j,action:L,dialogID:h,actionPosition:l}),jsx(Be,{when:k,spinner:i||G?.spinner||U?.type||xe.Simple,message:g||G?.loadingMessage})]})]})};qr.displayName="Zuz.Dialog";var To=qr;var Xr=forwardRef((e,r)=>{let{speed:t,smooth:n=false,breakpoints:o={},style:s,...a}=e,{rootRef:m,containerRef:c,thumbY:p,thumbX:f,onScrollY:l,onScrollX:i}=useScrollbar(t||1,o,n),{style:g,className:C,rest:P}=E(a);return useEffect(()=>{let y=c.current;if(!y)return;let R=()=>{window.dispatchEvent(new Event("resize"));},T=S=>{let d=S.target;if(d.closest(".--allow-scroll")){let h=d.closest(".--allow-scroll"),{scrollTop:b,scrollHeight:I,clientHeight:V}=h,M=S.deltaY<0,_=S.deltaY>0;(M&&b>0||_&&b+V<I)&&S.stopPropagation();}};return y.addEventListener("scroll",R),y.addEventListener("wheel",T,{passive:true}),()=>{y.removeEventListener("scroll",R),y.removeEventListener("wheel",T);}},[c]),jsxs(u,{ref:m,className:C.trim(),as:"--scrollview rel",children:[jsx(u,{as:`--scroll-content ${C}`.trim(),ref:c,style:s||{},children:P.children}),jsx(u,{as:"--scroll-track --track-y --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:p,onMouseDown:l})}),jsx(u,{as:"--scroll-track --track-x --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:f,onMouseDown:i})})]})});Xr.displayName="Zuz.ScrollView";var Po=Xr;var Yr=({ref:e,...r})=>{let{id:t,index:n,from:o,speed:s,children:a,margin:m,animation:c,prerender:p,inBackground:f,forceClose:l,forceLoading:i,onClose:g,...C}=r,{drawer:P}=J(true),[y,R]=useState(a),[T,S]=useState(false),[d,x]=useState(p??(P?.prerender||true)),[h,b]=useState(false),I=()=>{S(false),g?.(t??-1);},{className:V,style:M,rest:_}=E(C),N=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ie.isTop(I)&&I();}}],[T]);useShortcuts(N),useEffect(()=>{R(a);},[a]),useEffect(()=>(T?Ie.push(I):Ie.pop(I),()=>Ie.pop(I)),[T]),useEffect(()=>{S(true);},[]),useEffect(()=>{l&&I();},[l]),useEffect(()=>{i!=null&&b(i);},[i]);let $=o||P?.from||ve.Left,A=useMemo(()=>{switch($){case ve.Left:return {from:{x:"-100vw"},to:{x:0}};case ve.Right:return {from:{x:"100vw"},to:{x:0}};case ve.Top:return {from:{y:"-100vh"},to:{y:0}};case ve.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,P?.from]),K=ye({from:{...A.from,opacity:0},to:{...A.to,opacity:1},when:T,curve:c||P?.animation||Q.EaseInOut,duration:s||P?.speed||.5,watch:["scale","filter"]}),B=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(Ke,{onClick:L=>{T&&I();},when:T,style:{zIndex:B}}),jsxs(u,{ref:e,"aria-hidden":!T,className:`--drawer flex cols ${V} --${$.toLowerCase()} fixed`,style:{...M,...K.style,"--m":`${m||P?.margin||0}px`,zIndex:B+1,pointerEvents:f==true?"none":"auto",...f==true?{scale:"0.92",filter:"blur(2px)"}:{}},..._,children:[o==ve.Top||o==ve.Bottom?jsx(u,{className:"--handle"}):null,jsx(z,{as:"--close-drawer --abs",onClick:I,children:D.close}),jsxs(Po,{as:"rel",children:[d||T?y:null,jsx(Be,{when:h})]})]})]})};Yr.displayName="Zuz.Drawer";var No=Yr;var Qr=forwardRef((e,r)=>{let{progress:t,type:n,animated:o,...s}=e,a=useRef(null);useImperativeHandle(r,()=>({setProgress:f=>{a.current.style.width=`${f*100}%`,a.current.setAttribute("data-value",f+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(o?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:m,style:c,rest:p}=E(s);return jsx(u,{className:`--progress ${o?"--animated":""} flex rel ${m}`.trim(),style:c,...p,children:jsx(u,{ref:a,className:"--bar rel"})})});Qr.displayName="Zuz.ProgressBar";var Ge=Qr;var $t=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))($t||{}),At=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(At||{}),Jr=(t=>(t.Stack="stack",t.Individual="individual",t))(Jr||{}),en={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Li=e=>{let{index:r,id:t,type:n,icon:o,title:s,message:a,duration:m,sticky:c=false,actions:p=[],position:f,style:l,isHovered:i,total:g,progress:C,forceClose:P,variant:y,onClick:R,onClose:T}=e,[S,d]=useState(false),[x,h]=useState(false),{toast:b}=J(true),I=x||P,V=f||b?.position||"TopCenter",M=n||b?.type||"default",_=l||b?.style||"stack",N=m||b?.duration||4,$=C||b?.progress||false,A=useRef(N*1e3),K=useRef(void 0),B=useRef(void 0),L=useRef(null),W=ye({when:S&&!I,duration:.3,transition:b?.transition||(V.includes("Top")?Y.SlideInTop:V.includes("Bottom")?Y.SlideInBottom:V.includes("Left")?Y.SlideInLeft:Y.SlideInRight),curve:b?.curve||Q.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{d(true);let te=ue=>{if(B.current!==void 0){let ae=ue-B.current;if(!i&&!c&&!I&&(A.current-=ae,L.current)){let ge=Math.max(0,A.current/(N*1e3)*100);L.current?.setProgress?.(ge/100);}}B.current=ue,A.current<=0?h(true):K.current=requestAnimationFrame(te);};return K.current=requestAnimationFrame(te),()=>{K.current&&cancelAnimationFrame(K.current);}},[i,c,I,N]),useEffect(()=>{if(I){let te=setTimeout(()=>{T?.(t);},350);return ()=>clearTimeout(te)}},[I,t]);let k=_==="stack",ne=i?r*65:r*8,Z=i?1:Math.max(.85,1-r*.05),U=i?1:Math.max(.4,1-r*.2),G=()=>{R?R():(!p||p.length===0)&&h(true);},j=W.style.transform||"translate(0, 0)",ie=I?j:`${j} translateY(${V.includes("Top")?ne:-ne}px) scale(${Z})`;return jsxs(u,{onClick:G,as:`--snack --${I?"hidden":"visible"} --${y||b?.variant||q.Medium} --${M} --${V.toLowerCase()} abs flex aic`,style:{...W.style,zIndex:1e3-r,pointerEvents:I?"none":"auto",opacity:I?W.style.opacity:U,transform:ie,filter:!I&&k&&!i&&r>0?"blur(1px)":"none",cursor:!p||p.length===0?"pointer":"default",transition:`${W.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(u,{as:"--ico flex aic jcc",children:o?jsx(ee,{name:o}):jsx(u,{as:"--no-icon"})}),jsxs(u,{as:"--meta flex cols",children:[jsx(F,{as:"--tt",children:s||en[n]}),jsx(F,{as:"--tm",children:a})]}),p&&p.length>0&&jsx(u,{as:"--actions flex gap:5",children:p.map((te,ue)=>jsx(z,{as:"--snack-btn bold",onClick:ae=>{ae.stopPropagation(),te.onClick();},children:te.label},ue))}),$&&jsx(Ge,{as:"abs",ref:L})]})},Bo=Li;var we=createContext(null),$i=({ref:e,...r})=>{let n=useContext(we)?.depth??0,[o,s]=useState(null),[a,m]=useState(null),[c,p]=useState(false),[f,l]=useState([]),i=useDelayed(),g=useRef(0),C=()=>++g.current,P=()=>{p(false),setTimeout(()=>m(null),200);};useImperativeHandle(e,()=>({add(d){let x=C(),h={id:x,...d};return l(b=>[...b,h]),x},openMenu(d){p(false),setTimeout(()=>{m({id:C(),type:"menu",props:d}),p(true);},16);},remove(d){l(x=>x.map(h=>h.id===d?{...h,props:{...h.props,forceClose:true}}:h)),a?.id===d&&P();},loading(d,x){l(h=>h.map(b=>b.id===d?{...b,props:{...b.props,forceLoading:x}}:b)),a?.id===d&&P();},clear(d){l(f.filter(x=>x.type!=d));}})),useEffect(()=>{if(a&&c){let d=()=>P();return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}},[a,c,P]);let y=d=>{setTimeout(()=>{l(x=>x.filter(h=>h.id!==d)),a?.id===d&&m(null);},250);},R=useMemo(()=>[...f.filter(d=>d.type!="toast")],[f]);if(!i)return null;let T=f.filter(d=>d.type=="toast").reverse(),S=Object.values(At);return createPortal(jsxs(u,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[R.map((d,x)=>{let h=x<R.length-1;return d.type==="dialog"?jsx(To,{onClose:y,index:x,id:d.id,...d.props,inBackground:h},`layer-${d.type}-${d.id}`):d.type==="drawer"?jsx(No,{onClose:y,index:x,id:d.id,...d.props,inBackground:h},`layer-${d.type}-${d.id}`):null}),S.map(d=>{let x=T.filter(h=>(h.props.position||"TopCenter")===d);return x.length===0?null:jsx(u,{onMouseEnter:()=>s(d),onMouseLeave:()=>s(null),as:`--toast-container fixed --${d.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:x.map((h,b)=>jsx(Bo,{index:b,total:x.length,isHovered:o===d,onClose:y,id:h.id,...h.props},h.id))},d)}),a&&jsx(u,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(vo,{onClose:P,when:c,...a.props},`menu-${a.id}`)})]}),document.body)},Ai=({children:e})=>{let r=useContext(we),t=r?r.depth+1:0,n=useRef(null),o=useMemo(()=>({add:s=>n.current?.add(s),openMenu:s=>n.current?.openMenu(s),remove:s=>n.current?.remove(s),loading:(s,a)=>n.current?.loading(s,a),clear:s=>n.current?.clear(s),depth:t,isSubLayer:!!r}),[r]);return jsxs(we.Provider,{value:o,children:[e,jsx($i,{ref:n})]})},ho=Ai;var Fi=()=>{let e=useContext(we);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,s)=>{n.preventDefault(),e.openMenu({event:n,items:o,origin:s});},showMenu:(n,{items:o,origin:s,offsetX:a,offsetY:m,transition:c,curve:p,arrow:f,duration:l,header:i,footer:g})=>{e.openMenu({fx:{transition:c,curve:p,duration:l},parent:n,items:o,origin:s||ut.TopCenter,offsetX:a,offsetY:m,arrow:f,header:i,footer:g});},hide:e.clear}},_i=Fi;var Ki=()=>{let e=useContext(we);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("dialog"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a);return {clearAll:r,show:s=>{let a=e.add({type:"dialog",props:{...s,type:Je.Dialog}});return {id:a,setLoading:m=>n(a,m),hide:()=>t(a)}},hide:t}},Wi=Ki;var Ui=()=>{let e=useContext(we);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("drawer"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a),o=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:m=>n(a,m),close:()=>t(a)}};return {clearAll:r,open:s=>o({children:s}),right:s=>o({children:s,from:ve.Right}),left:s=>o({children:s,from:ve.Left}),top:s=>o({children:s,from:ve.Top}),bottom:s=>o({children:s,from:ve.Bottom}),close:t}},qi=Ui;var Yi=(e,r,t={})=>{let[n,o]=useState(null),[s,a]=useState(false),{duration:m=.25,curve:c=Q.EaseOutBack,borderRadius:p={from:40,to:24},targetWidth:f=320}=t;return useLayoutEffect(()=>{r&&e.current?(o(e.current.getBoundingClientRect()),a(true)):r||a(false);},[r,e]),{style:ye({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:p.from},to:{opacity:1,width:f,height:"auto",borderRadius:p.to},curve:c,duration:m,when:s&&r}).style,isMeasured:s,sourceRect:n}},ji=Yi;var tl=(e,r={})=>{let{offset:t=8,direction:n="bottom",container:o=null,triggerRef:s=null}=r,a=useRef(null),m=useCallback(()=>{let c=e.current;if(!c)return;let p=s?.current||c.parentElement;if(!p){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let f=c.getBoundingClientRect(),l=p.getBoundingClientRect(),i,g;o?(i=o.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(c).position==="fixed"?g="fixed":g="absolute",g==="fixed"?i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),c.style.position!==g&&(c.style.position=g),a.current=g;let y=0,R=0;switch(n){case "top":y=l.top-f.height-t,R=l.left,y<i.top&&l.bottom+f.height+t<=i.bottom&&(y=l.bottom+t);break;case "bottom":y=l.bottom+t,R=l.left,y+f.height>i.bottom&&l.top-f.height-t>=i.top&&(y=l.top-f.height-t);break;case "left":y=l.top,R=l.left-f.width-t,R<i.left&&l.right+f.width+t<=i.right&&(R=l.right+t);break;case "right":y=l.top,R=l.right+t,R+f.width>i.right&&l.left-f.width-t>=i.left&&(R=l.left-f.width-t);break}if(y=Math.max(i.top,Math.min(y,i.bottom-f.height)),R=Math.max(i.left,Math.min(R,i.right-f.width)),a.current==="fixed")c.style.top=`${y}px`,c.style.left=`${R}px`;else {let T;c.offsetParent?T=c.offsetParent.getBoundingClientRect():T={top:0,left:0};let S=y-T.top+window.scrollY,d=R-T.left+window.scrollX;c.style.top=`${S}px`,c.style.left=`${d}px`;}},[e,s,t,n,o]);return useEffect(()=>{let c=e.current;if(!c)return;let p=s?.current||c.parentElement;if(!p){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let f=new ResizeObserver(m);return f.observe(c),p&&f.observe(p),m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,true),()=>{f.disconnect(),p&&f.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,true);}},[e,n,t,o,s]),{postion:a.current,reposition:m}},yt=tl;var rl=()=>{let e=useContext(we);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(l,i)=>e.add({type:"toast",props:{...i,type:l}}),n=l=>e.remove(l),p=(l,i,g)=>{let C=r(l,{...i,sticky:i.sticky??false,actions:[{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),n(C);}}]});return C},f=(l,i,g,C)=>{let P=r(l,{...i,sticky:true,actions:[{label:C?.label||"Cancel",onClick:()=>{C?.onClick?.(),n(P);}},{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),n(P);}}]});return P};return {ok:(l,i)=>p("default",l,i),success:(l,i)=>p("success",l,i),error:(l,i)=>p("error",l,i),confirm:(l,i,g)=>f("default",l,i,g),warn:(l,i)=>p("warn",l,i)}},nl=rl;var al=()=>{let e=useContext(we);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(p,f)=>e.add({type:"toast",props:{...f,type:p}});return {show:(p,f,l,i)=>r("default",{title:p,message:f,icon:l,duration:i}),hide:p=>e.remove(p),success:(p,f,l,i)=>r("success",{title:p,message:f,icon:l,duration:i}),error:(p,f,l,i)=>r("error",{title:p,message:f,icon:l,duration:i}),warn:(p,f,l,i)=>r("warn",{title:p,message:f,icon:l,duration:i}),promise:(p,f,l,i)=>r("promise",{title:p,message:f,icon:l,duration:i}),clearAll:()=>e.clear("toast")}},Eo=al;var mn=({ref:e,style:r,...t})=>{let n=useRef(null),o=useMemo(()=>e&&typeof e!="function"&&e.current?e:n,[e]),{style:s,className:a,rest:m}=E(t,o);return jsx("div",{ref:e||n,style:{...s,...r||{}},className:a,...m})};mn.displayName="Zuz.Box";var u=mn;var un=forwardRef((e,r)=>{let{title:t,message:n,...o}=e,[s,a]=useState(false);return jsxs(u,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:m=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(F,{className:"--label flex",children:t}),jsx(u,{className:"--arrow flex",children:s?D.arrowUp:D.arrowDown})]}),s&&jsx(u,{className:"--detail",children:n})]})});un.displayName="Zuz.Accordion";var ul=un;var fl=({label:e,icon:r,onClick:t,idx:n,selected:o})=>jsx(z,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof r=="string"?jsx(ee,{name:r}):r}),dn=fl;var gn=forwardRef((e,r)=>{let{items:t,name:n,selected:o,position:s,...a}=e,m=useRef(null),[c,p]=useState(o||t[0].tag||0),f=useCallback(({x:y,y:R})=>{if(m.current){let T=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${y-T.left}`),document.documentElement.style.setProperty("--tip-y",`${R-T.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),l=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",l),m.current.removeEventListener("pointermove",f),document.documentElement.style.setProperty("--tip-s","0"));},[]),i=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",l),m.current.addEventListener("pointermove",f));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((y,R)=>R.label.length>y.length?R.label:y,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),m.current?.addEventListener("pointerenter",i));},[]);let{className:g,style:C,rest:P}=E(a);return jsxs(u,{ref:m,style:C,className:[`--actionbar flex aic ${g}`,`${!s||s==he.Auto?"rel":`--${s}`}`].join(" ").trim(),...P,children:[t.map((y,R)=>jsx(dn,{selected:c===y.tag||o==R,...y,idx:R},`actionbar-action-${y.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(u,{className:"--tip abs",children:jsx(u,{className:"--track flex aic",children:t.map(({label:y})=>jsx(u,{className:"--lb",children:y},`tool-tip-${y.toLowerCase().replace(/\s+/g,"-")}`))})})]})});gn.displayName="Zuz.ActionBar";var xl=gn;var yn=forwardRef((e,r)=>{let{type:t,icon:n,title:o,message:s,iconSize:a,...m}=e,{className:c,style:p,rest:f}=E(m);return jsxs(u,{className:`--alert --${t||Te.Info} flex aic ${c}`.trim(),style:p,...f,children:[jsx(u,{className:`--icon icon-${n||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!n&&D[t||Te.Info]}),jsxs(u,{className:"--meta flex cols",children:[jsx(F,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(F,{className:"--message",h:2,children:s})]})]})});yn.displayName="Zuz.Alert";var wl=yn;var Oo=createContext(null),Do=()=>{let e=useContext(Oo);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},Ho=()=>useContext(Oo),De=()=>{let e=Ho(),r=Do();return {...e,...r}},wn=({children:e,initialValues:r={}})=>{let t=useRef({values:r,errors:{},touched:{}}),n=useRef(new Set),o=useCallback(()=>t.current,[]),s=useCallback(c=>(n.current.add(c),()=>n.current.delete(c)),[]),a=()=>{n.current.forEach(c=>c());};useEffect(()=>{r&&Object.keys(r).length>0&&(t.current={...t.current,values:{...t.current.values,...r}},a());},[r]);let m=useMemo(()=>({subscribe:s,getSnapshot:o,setFieldValue:(c,p)=>{t.current.values[c]!==p&&(t.current={...t.current,values:{...t.current.values,[c]:p}},a());},setFieldError:(c,p)=>{t.current={...t.current,errors:{...t.current.errors,[c]:p}},a();},reset:()=>{t.current={values:{},errors:{},touched:{}},a();}}),[]);return jsx(Oo.Provider,{value:m,children:e})};var Sn=({ref:e,...r})=>{let{variant:t,numeric:n,name:o,onConfirm:s,...a}=r,{style:m,className:c,rest:p}=E(a),{variant:f}=J(true),l=useRef(null),i=De(),g=o?i.errors?.[o]:null,C=o&&i.values&&i.setFieldValue,P=C?i.values?.[o]:void 0,y=useDebounce(T=>{C&&i.setFieldValue?.(o,T);},500);useEffect(()=>{l.current&&o&&P!==void 0&&l.current.value!==String(P)&&(l.current.value=String(P));},[P,o]);let R=T=>{let S=T.currentTarget.value;n&&(S=S.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),T.currentTarget.value=S),y(S),r.onInput?.(T);};return jsx("input",{name:o,className:`--input --${t||f} ${g?"--has-error":""} --flex ${c}`.trim(),style:m,defaultValue:P??r.defaultValue??"",onInput:R,onKeyDown:T=>{T.key=="Enter"&&s?.(T.currentTarget.value);},ref:T=>{l.current=T,typeof e=="function"?e(T):e&&(e.current=T);},...p})};Sn.displayName="Zuz.Input";var pe=Sn;var Tn=e=>{let{meta:r,children:t}=e,n=useDelayed(),{label:o,icon:s,...a}=isValidElement(r)?{}:r,{className:m,style:c,rest:p}=E({...a,...a.animate?{animate:{...a.animate,when:n}}:{}});return isValidElement(r)?jsx("li",{style:c,className:m,children:r}):jsxs("li",{style:c,className:m,...p,children:[t,typeof r=="string"?r:o]})};Tn.displayName="Zuz.ListItem";var Pn=Tn;var In=forwardRef((e,r)=>{let{items:t,variant:n,direction:o,seperator:s,ol:a,...m}=e,{className:c,style:p,rest:f}=E(m),l=a==true?"ol":"ul";return createElement(l,{className:`--list --${n||q.Small} flex ${o??"cols"} ${c}`.trim(),style:p,ref:r,...f,children:t.map((i,g,C)=>{let P=`${typeof i=="string"?`li-${String(i)}`:isValidElement(i)?`li-${i.key}`||`${g}-${MD5(i.toString())}`:i.label}-${g}`;return jsxs(Fragment,{children:[jsx(Pn,{meta:i}),s&&C[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${P}`):null]},P)})})});In.displayName="Zuz.List";var qe=In;var Bn=forwardRef((e,r)=>{let{fx:t,action:n,data:o,withStyle:s,onChange:a,...m}=e,{className:c}=E({as:s||""}),{style:p}=E(m),[f,l]=useState(false),[i,g]=useState(o||[]),C=useRef(null),P=useRef(null),y=useRef(null),R=useMemo(()=>m.name||uuid(12),[]),[T,S]=useState(null),[d,x]=useState(null),[h,b]=useState([]),V=useDebounce(B=>{B.target.value==""?(l(false),g([])):n&&B.target.value.trim()!=""&&withPost(n,{query:B.target.value}).then(L=>{"items"in L&&_(L.items).isArray()?(g(L.items),x(B.target.value),b(L.items)):console.error("Action Response should contain items array"),S(null);}).catch(L=>{S(null),g([]);});},250),M=()=>{if(P.current){let B=P.current.getBoundingClientRect(),L=window.innerHeight-B.bottom,W=B.top;if(y.current){let k=y.current;L<k.offsetHeight&&W>L?(k.style.top="auto",k.style.bottom=`${B.height}px`,k.style.maxHeight=`${W-150}px`):(k.style.top=`${B.height+5}px`,k.style.bottom="auto",k.style.maxHeight=`${L-150}px`);}}},_$1=B=>{if(i.length>0){if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),B.stopPropagation()),B.key==="Escape")S(null),l(false),g([]);else if(B.key==="ArrowDown")S(L=>{let W=L===null||L===i.length-1?0:L+1;return $(W),W});else if(B.key==="ArrowUp")S(L=>{let W=L===null||L===0?i.length-1:L-1;return $(W),W});else if(B.key==="Enter"&&T!==null){let L=i[T];C.current&&(C.current.value=L,l(false),g([]));}}},N=B=>{C.current&&(C.current.value=B,l(false),g([]));},$=B=>{let L=i[B];if(L&&C.current&&(C.current.value=L,C.current.setSelectionRange(L.length,L.length)),y.current){let k=y.current.children[B];k&&k.scrollIntoView({block:"nearest"});}},A=B=>{P.current&&!P.current.contains(B.target)&&(l(false),g([]));},K=()=>{C.current&&C.current.value===d&&(g(h),S(null),M());};return useEffect(()=>(window.addEventListener("resize",M),window.addEventListener("scroll",M,true),document.addEventListener("mousedown",A),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true),document.removeEventListener("mousedown",A);}),[]),useEffect(()=>{M();},[i]),jsxs(u,{style:p,ref:P,className:`--autocomplete --${e.size||q.Small} flex aic rel ${c}`.trim(),children:[jsx(pe,{ref:C,autoComplete:"off",onChange:V,onKeyDown:_$1,onFocus:K,...m}),jsx(u,{className:"--arrow rel flex aic jcc",children:i.length>0?D.arrowUp:D.arrowDown}),i.length>0&&jsx(qe,{id:R,ref:y,className:"--suggestion-list flex cols abs",items:i.map((B,L)=>({label:B,onClick:W=>{W.preventDefault(),W.stopPropagation(),N(B);},className:T===L?"--current":"",animate:{transition:Y.SlideInBottom,curve:Q.EaseInOut,delay:clamp(.02*L,.02,.5)}}))})]})});Bn.displayName="Zuz.AutoComplete";var Ul=Bn;var En=forwardRef((e,r)=>{let t=useRef(null),n=useMemo(()=>r&&typeof r!="function"&&r.current?r:t,[r]),{style:o,className:s,rest:a}=E(e,n);return !a.src||a.src==""?null:jsx("img",{ref:n,style:o,className:`${s} flex`,...a})});En.displayName="Zuz.Image";var Xe=En;var kn=forwardRef((e,r)=>{let{src:t,variant:n,type:o,crossOrigin:s,referrerPolicy:a,fx:m,as:c,alt:p,color:f,style:l,...i}=e,[g,C,P]=useImage(t??"",s,a),{className:y,style:R,rest:T}=E({fx:m,as:c});return jsx(u,{className:`--avatar --${n||q.Small} --${(o||hr.Circle).toLowerCase()} rel flex aic jcc ${y}`.trim(),style:{background:f||"var(--primary)",...l,...R},...T,children:t?jsx(Xe,{src:g,crossOrigin:s,referrerPolicy:a,...i}):jsx(F,{className:"--avatar-label",children:(p?p.charAt(0):"A").toUpperCase()})})});kn.displayName="Zuz.Avatar";var tc=kn;var oc=({size:e=5,type:r="dead",label:t="",variant:n=q.Small,loading:o=false,spinner:s,...a})=>{let{style:m,className:c,rest:p}=E(a);return jsxs(u,{style:{..._(t).isEmpty()?{"--badge-size":e}:{},...m},as:`--badge --${n} --${r} rel flex aic jcc ${c}`.trim(),children:[jsx(u,{fx:{transition:Y.FadeIn,curve:Q.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(Re,{type:s})}),_(t).isEmpty()?jsx(u,{as:`--dot --${r}`}):jsx(F,{as:"--label",children:t})]})},rc=oc;var yc=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let e=new Date,r=e.getDay();return addDays(e,(6-r)%7||6)},getDateFormat:()=>{let e=new Date,r=e.getDay();return format(addDays(e,(6-r)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],xc=e=>{let r=new Set;return e.filter(t=>{if(t.label=="Later")return true;let n=t.getDate().toISOString().split("T")[0];return r.has(n)?false:(r.add(n),true)})},Mn=forwardRef((e,r)=>{let{defaultValue:t,variant:n,onChange:o,...s}=e,{style:a,className:m,rest:c}=E(s),[p,f]=useState(t||new Date),l=startOfMonth(p),i=endOfMonth(p),g=startOfWeek(l),C=endOfWeek(i),P=useMemo(()=>eachDayOfInterval({start:g,end:C}),[g,C]),y=S=>{o?.(S),f(S);},R=()=>{f(S=>new Date(S.getFullYear(),S.getMonth()-1));},T=()=>{f(S=>new Date(S.getFullYear(),S.getMonth()+1));};return jsxs(u,{as:`--calendar flex --${n||"sm"} ${m}`,style:a,children:[jsx(u,{as:"--calendar-quick-select flex cols flex:1",children:xc(yc).map(S=>{let d=S.getDate();return jsxs(z,{onClick:()=>y(d),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(F,{as:"flex:1",children:S.label}),jsx(F,{as:"tar",children:S.getDateFormat()})]},`--dtp-option-label-${S.label}`)})}),jsxs(u,{as:"--calendar-selector flex cols flex:1",children:[jsxs(u,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(F,{as:"flex:1 --calendar-cm bold",children:format(p,"MMMM yyyy")}),jsx(z,{onClick:R,as:"--calendar-chevron",children:D.chevronUpOutline}),jsx(z,{onClick:T,as:"--calendar-chevron",children:D.chevronDownOutline})]}),jsxs(u,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(S=>jsx(F,{as:"--calendar-day",children:S},`--calendar-hd-${S}`)),P.map((S,d)=>{let x=isSameMonth(S,p),h=isSameDay(S,p),b=isToday(S);return jsx(z,{disabled:!x,onClick:()=>y(S),as:["--calendar-day --calendar-dd",`${h?"--calendar-dd-selected":""}`,`${b?"--calendar-dd-current":""}`],children:format(S,"d")},`--calendar-day-${d}-${S.getFullYear()}-${S.getMonth()}-${S.getDay()}`)})]})]})]})});Mn.displayName="Zuz.Calendar";var zo=Mn;var Wt=(t=>(t.Table="table",t.Gooey="gooey",t))(Wt||{});var Vn=({ref:e,...r})=>{let{itemCount:t,itemsPerPage:n,startPage:o,pageRange:s,paginationStyle:a,breakLabel:m,prevLabel:c,nextLabel:p,hash:f,loading:l,seperator:i,renderOnZeroPageCount:g,asDots:C,progressBar:P,onPageChange:y,...R}=r,T=useRef(null),S=useMemo(()=>toHash(numberInRange(4,8)),[]),d=useCallback(B=>`${toHash(B,f||6,S)}${i||""}${S}`,[S]),x=useMemo(()=>m||"...",[m]),h=useRef(null),[b,I]=useState({id:f?o?typeof o=="number"?d(o):o:1:o||1,label:o||1});useImperativeHandle(e,()=>({setPage:B=>I(B),getPage:B=>b,setProgress:B=>h.current?.setProgress?.(B),getProgress:()=>h.current?.getProgress?.()??0}),[h.current]);let{style:V,className:M,rest:_}=E(R),N=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!t)throw new Error('"itemCount" prop is required');let $=useMemo(()=>Math.ceil(t/n),[t,n]),A=useMemo(()=>{let B=[],L=Math.max(N(b)-(s||2),1),W=Math.min(N(b)+(s||2),$);L>1&&B.push({id:f?d(1):1,label:1}),L>2&&B.push({id:-1,label:x});for(let k=L;k<=W;k++)B.push({id:f?d(k):k,label:k});return W<$-1&&B.push({id:-1,label:x}),W<$&&B.push({id:f?d($):$,label:$}),B},[b]),K=useCallback(B=>{let L=B;+L.label<1||+L.label>$||(I(L),y?.(L));},[t,n,b]);return A.length<=1&&(g??false)===false?null:jsxs(u,{ref:T,as:`--pagination ${C===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${M}`,children:[jsx(u,{as:"flex flex:1 aic --pgt-btns",children:(A.length>1?A:[{id:1,label:1},{id:-1,label:x}]).map((B,L,W)=>{let k=(typeof B=="string"?B:B.label)==N(b);return jsx(z,{disabled:B.id==-1||N(b)==+B.label,className:k?"--current-page":"",onClick:ne=>K(B),children:C===true?P===true&&k?jsx(Ge,{ref:h}):"":typeof B=="string"?B:B.label},`--pg-${L}-${B.id}`)})}),jsx(u,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(b)-1)*n+1} - `,`${Math.min(N(b)*n,t)} of ${t} items`].join(" ")}),jsxs(u,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:N(b)<=1,onClick:B=>K({id:f?d(N(b)-1):N(b)-1,label:N(b)-1}),children:D.chevronLeftOutline}),jsx(z,{disabled:A.length<=1||N(b)==N(A[A.length-1]),onClick:B=>K({id:f?d(N(b)+1):N(b)+1,label:N(b)+1}),children:D.chevronRightOutline})]})]})};Vn.displayName="Zuz.Pagination";var vt=Vn;function Rc(e,r){let{items:t,renderItem:n,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:m=0,useKeys:c=true,useWheel:p=true,spacing:f=160,rotation:l=20,scaleStep:i=.15,blur:g=4,animation:C="power",showDots:P=false,autoPlay:y=false,autoPlaySpeed:R=3,onChange:T,...S}=e,{className:d,style:x}=E(S),h=useRef(null),b=R/(R>=1e3?1e3:1),I=useCarousel({total:t.length,initialIndex:m,loop:s,useKeys:c,useWheel:p,onChange:$=>{h.current?.setPage({id:$+1,label:$+1}),h.current?.setProgress(0),T?.($);}}),{pause:V,resume:M,reset:_}=useTimer({duration:b,autoStart:y===true,onProgress:$=>{y===true&&h.current?.setProgress(1-$);},onExpired:()=>{y===true&&I.next(),_();}}),N={...x,"--carousel-spacing":`${f}px`,"--carousel-rotation":`${l}deg`,"--carousel-blur":`${g}px`,"--carousel-scale-step":i,"--active-index":I.index,"--carousel-transition":`var(--${C})`};return jsxs(u,{ref:r,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${d}`.trim(),style:N,children:[jsx(u,{className:"--carousel-stage rel fill flex aic jcc",children:t.map(($,A)=>{let K=A-I.index;if(a==="infinite"){let L=t.length;K=((K+L/2)%L+L)%L-L/2;}let B=A===I.index;return jsx(u,{onMouseEnter:()=>B&&V(),onMouseLeave:()=>B&&M(),className:`--carousel-item-wrapper abs ${B?"--is-active":""}`,style:{"--offset":K,zIndex:B?100:100-Math.abs(K),display:Math.abs(K)>5?"none":"flex"},children:n($,A,I.index)},A)})}),P&&jsx(vt,{ref:h,itemCount:t.length,itemsPerPage:1,startPage:m+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:$=>I.goTo(+$.label-1),asDots:true,progressBar:true})]})}var Ic=forwardRef(Rc),Nc=Ic;var $n=(r=>(r.Line="line",r))($n||{});var Fn=forwardRef((e,r)=>{let{data:t,width:n,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:m,gradientEndColor:c,animated:p,animDuration:f=2,animDelay:l=0,padding:i=0,type:g,...C}=e,{className:P,style:y,rest:R}=E(C),T=useRef(null),S=useResizeObserver(T.current?.parentElement||T),d=typeof n=="number"?n:S.width,x=typeof o=="number"?o:S.height,h={width:d,height:x},b=useId(),{pathD:I,areaPathD:V}=useLineChart(t,h,i+(a||2)),M=useRef(null),_=useRef(null),[N,$]=useState(0),[A,K]=useState(0);return useEffect(()=>{p&&(M.current&&$(M.current.getTotalLength()),_.current&&K(_.current.getTotalLength()));},[p,I,V,d,x]),jsx(u,{ref:T,as:`--chart --${g||"line"}-chart ${P}`.trim(),style:{...y,width:n,height:o},...R,children:d>0&&x>0&&jsxs("svg",{viewBox:`0 0 ${d} ${x}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:b,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:c})]})}),jsx("path",{ref:_,d:V,fill:`url(#${b})`,stroke:"none",style:p?{strokeDasharray:A,strokeDashoffset:A}:{},children:p&&jsx("animate",{attributeName:"stroke-dashoffset",from:A,to:"0",dur:`${f||2}s`,begin:`${l||0}s`,fill:"freeze"})}),jsx("path",{ref:M,d:I,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:p?{strokeDasharray:N,strokeDashoffset:N}:{},children:p&&jsx("animate",{attributeName:"stroke-dashoffset",from:N,to:"0",dur:`${f||2}s`,begin:`${l||0}s`,fill:"freeze"})})]})})});Fn.displayName="Zuz.Chart";var Dc=Fn;var _n=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(_n||{}),Zn=(p=>(p.Image="img",p.Video="vid",p.Audio="audio",p.Link="link",p.Document="doc",p.Location="loc",p.Contact="contact",p.Event="event",p.Poll="poll",p))(Zn||{});var Kn=forwardRef((e,r)=>{let{text:t,media:n,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:m=true,...c}=e,{className:p,style:f,rest:l}=E(c);return jsx(u,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(u,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${p}`.trim(),style:{...f},...l,children:[t&&jsx(F,{className:"--bubble-text",children:t}),n?n.type=="audio"?jsxs(u,{as:"flex aic --bubble-audio",children:[jsx(se,{className:"--bm-action",children:D.play}),jsx(Ge,{progress:.7}),jsx(F,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(u,{as:"--bubble-image",children:jsx(Xe,{src:n.source})}):null:null,jsxs(u,{as:"flex aie jce --bubble-stats",children:[jsx(F,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(se,{className:`--bubble-status --bs-${s}`,children:s==0?D.pending:s==1?D.done:s==2?D.doneAll:D.doneAll})]})]})})});Kn.displayName="Zuz.Bubble";var $c=Kn;var Wn=forwardRef((e,r)=>{let{style:t,className:n,rest:o}=E(e);return jsx("label",{ref:r,style:t,className:n,...o})});Wn.displayName="Zuz.Label";var wt=Wn;var Un=({ref:e,...r})=>{let {name:t,required:n,type:o,value:s,size:a,variant:m,checked:c,onSwitch:p,...f}=r,l=De(),i=!!(t&&l.values);i?l.errors?.[t]:null;let C=i?l.values?.[t]:void 0,[P,y]=useState(c||false),R=useRef(null),{variant:T}=J(true),S=useMemo(()=>i&&C!=null?typeof C=="string"?C.toLowerCase()!=="false"&&C!=="":!!C:P,[C,P,i]);useEffect(()=>{R.current&&R.current.checked!==S&&(R.current.checked=S);},[S]),useEffect(()=>{c!==void 0&&y(c);},[c]);let d=x=>{let h=!!x;i&&l.setFieldValue?.(t,h),y(h),p?.(h,s||"cb");};return useImperativeHandle(e,()=>({setChecked(x,h=true){d(x);},toggle(x=true){d(!S);}})),jsxs(wt,{className:`--${(o||Me.Default).toLowerCase()} ${!o||o===Me.Default?"--checkbox":"--switch"} --${m||T||q.Small} flex aic jcc ${S?"is-checked":""} rel`.trim(),...f,children:[(!o||o==Me.Default)&&D.check,jsx(pe,{ref:x=>{R.current=x,e&&(e.current=x);},defaultChecked:S,type:"checkbox",className:"abs",name:t,required:n||false,onChange:x=>{x.stopPropagation(),d(x.target.checked);}})]})};Un.displayName="Zuz.CheckBox";var St=Un;var Xc=({ref:e,...r})=>{let{code:t,copy:n,lang:o="tsx",showLines:s=false,highlight:a="",as:m,fx:c,...p}=r,f=useRef(null),{className:l,style:i,rest:g}=E({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${m}`,fx:c},f),C=useMemo(()=>{let y=new Set;return a.split(",").forEach(R=>{if(R.includes("-")){let[T,S]=R.split("-").map(Number);for(let d=T;d<=S;d++)y.add(d);}else R&&y.add(Number(R));}),y},[a]),P=useMemo(()=>{let y=t.split(`
|
|
9
|
+
`);for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();let R=y[0]?.match(/^\s*/)?.[0].length||0,T=y.map(d=>{let x=d.match(/^\s*/)?.[0].length||0,h=Math.min(x,R);return d.slice(h)}),S=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(<\/?[A-Z][\w\.]*|>)/g},{name:"var",re:/(?<!<\/|<)\b[A-Z]\w*\b/g},{name:"fn",re:/\b([a-z_]\w*)(?=\s*\()/gi},{name:"prop",re:/\.([a-z_]\w*)\b/gi},{name:"num",re:/\b\d+\b(?![#|A-Z|a-z|_|ZUZ])/g}];return T.map((d,x)=>{let h=d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),b=C.has(x+1);if(o!="plain"){let I=[];S.forEach(V=>{h=h.replace(V.re,M=>{let _=`ZUZ_ID_${I.length}_ZUZ`;return I.push(`<span class="--token-${V.name}">${M}</span>`),_});});for(let V=I.length-1;V>=0;V--)h=h.replace(`ZUZ_ID_${V}_ZUZ`,I[V]);}return `<div class="--code-line ${s==true?"--with-ln":""} ${b?"--is-highlighted":""}">
|
|
10
10
|
${s==true?`<span class="--line-number">${x+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${h||" "}</span>
|
|
12
|
-
</div>`}).join("")},[t,C]);return jsxs(p,{as:`--code-block rel ${m}`,style:l,...i,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:T}})}),r&&jsx($,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),r.onCopy?.();},children:"Copy"})]})},$c=Ac;var Wn=({onSelect:e,meta:n,selected:t,disabled:r=false})=>{let o=useRef(null),{index:s,icon:a,label:c}=n,[f,i]=useState({x:0,width:0}),u=useDelayed();return useLayoutEffect(()=>{if(u&&o.current){let{width:m,x:l}=o.current.getBoundingClientRect();i({x:l,width:m}),t&&e(s,m,l,n,true);}},[u,o.current]),useEffect(()=>{t&&e(s,f.width,f.x,n,false);},[t]),jsxs($,{disabled:r,onClick:()=>e(s,f.width,f.x,n,false),ref:o,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(J,{name:a,as:"--segment-icon"}):jsx(p,{as:"--segment-icon flex aic jcc",children:a}):null,c&&String(c).trim()!=""&&jsx(p,{className:"--segment-label",children:c||`Item ${s}`})]})};Wn.displayName="SelectTabItem";var Gn=Wn;var qn=forwardRef((e,n)=>{let{fx:t,items:r,selected:o,variant:s,disabled:a=false,onSwitch:c,...f}=e,[i,u]=useState(o||0),m=useDelayed(50),l=useRef(i),{className:d,style:C,rest:T}=B(f),b=useRef(null),I=useRef(null),{variant:R}=Y(true),P=(g,x,h,y,N)=>{if((N||i!=g&&i!=-2)&&(u(g),l.current=i,queueMicrotask(()=>{m&&c?.(y);})),b.current){let D=I.current?.getBoundingClientRect();b.current.style.setProperty("--w",`${x}px`),b.current.style.setProperty("--x",`${D?h-D.left:h}px`);}};return useImperativeHandle(n,()=>({setSelected:g=>{typeof g=="number"&&g!=i&&u(g);}}),[i]),jsxs(p,{ref:I,"data-selected":i,className:`${d} --segmented --${s||R||G.Medium} flex aic rel`,style:C,...T,children:[jsx(p,{ref:b,className:`--segment-tab --${a?"disabled":"abled"} abs`}),r.map((g,x)=>jsx(Gn,{disabled:a,onSelect:P,selected:i==x,meta:{...g,index:x}},`segment-${g.label}-${x}`))]})});qn.displayName="Zuz.SelectTabs";var St=qn;var jn=forwardRef((e,n)=>{let{type:t,...r}=e,o=useDelayed(),{colorScheme:s,setColorScheme:a}=uo(),c=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:i}=B(r),u=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:L.colorSchemeLight},{tag:"system",index:1,label:"",icon:L.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:L.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:L.colorSchemeLight},{tag:"dark",index:2,label:"",icon:L.colorSchemeDark}],[]),m=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !o||m==-1?null:t=="system"||t=="switch"?jsx(St,{className:`--color-scheme --${t}`,onSwitch:({tag:l})=>{a(l);},selected:m,items:u,...r}):jsx($,{onClick:c,style:i,as:`--color-scheme-switch --${r.variant||G.Small} ${f}`.trim(),children:s=="system"?L.colorSchemeSystem:s=="light"?L.colorSchemeLight:L.colorSchemeDark})});jn.displayName="Zuz.ColorScheme";var tm=jn;var Jn=forwardRef((e,n)=>{let[t,r]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:c,position:f}=e,i=async u=>{r(u==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(u));};return useEffect(()=>{let u=localStorage.getItem("--ccnt");r(u?u=="1"?"accepted":"rejected":"pending");},[]),jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:X.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${f||ue.Left} flex cols`,children:[jsx(z,{as:"--title",children:o||"This site uses cookies"}),jsx(z,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(p,{as:"--footer flex aic",children:[jsx($,{onClick:u=>i(1),as:"--accept",children:a||"Accept All"}),jsx($,{onClick:u=>i(0),as:"--reject",children:c||"Cancel"})]})]})});Jn.displayName="Zuz.CookiesConsent";var sm=Jn;var os=({ref:e,...n})=>{let {title:t,position:r,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:c,variant:f,...i}=n,{style:u,className:m,rest:l}=B(i),d=r||ue.Top;useRef(null);let [T,b]=useState(false);useRef(6);let R=c===true||T,g=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:x}=Y(true),h=useMemo(()=>{let N=false;return addPropsToChildren(a,D=>{let M=D.props.className?.includes(s);return M&&(N=true),M||!N},(D,M)=>{let A=M.props.className?.includes(s),E=D===0,V={};return (A||E)&&(V.style={...M.props.style,anchorName:g}),E&&(V.onMouseEnter=_=>{b(true),M.props.onMouseEnter?.(_);},V.onMouseLeave=_=>{b(false),M.props.onMouseLeave?.(_);}),V})},[a,s,g]),y=fe({transition:d==ue.Top?q.SlideInTop:d==ue.Bottom?q.SlideInBottom:d==ue.Left?q.SlideInLeft:q.SlideInRight,when:R,duration:.2,offset:o+6,margin:d==ue.Top||d==ue.Left?-o:o,curve:x?.curve||X.EaseInOut});return useImperativeHandle(e,()=>({show:()=>b(true),hide:()=>b(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[h,jsx(p,{style:{positionAnchor:g,...y.style,...d===ue.Top||d===ue.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${R} --${f||x?.variant||G.Small} --${d} abs ${m}`.trim(),children:typeof t=="string"?jsx(z,{as:"--text rel",children:t}):t})]})};os.displayName="Zuz.ToolTip";var Fo=os;var rs=({ref:e,...n})=>{let {type:t,value:r=0,min:o=0,max:s=1,step:a=.01,onChange:c,showGhostBar:f,showKnobOnHover:i,showToolTip:u,roundValue:m,formatValue:l,...d}=n,{className:C,style:T,rest:b}=B(d),I=useRef(a||.01).current,R=useRef(o||0).current,P=useRef(s||1).current,g=useRef(r||0).current,x=useRef(null),h=useRef(null),y=useRef(null),N=useRef(null);useRef(null);let M=useRef(null),A=useRef(null),E=useRef(null),V=useRef(null),_=(ae,ce,we)=>(ae-ce)/(we-ce)*100,W=ae=>{if(h.current){let ce=parseFloat(ae.currentTarget.value);le(ce);let we=_(ce,parseFloat(ae.currentTarget.min),parseFloat(ae.currentTarget.max));h.current.style.setProperty("--value",`${we}`),h.current.setAttribute("data-value",`${ce}`),c&&c(m?+ce.toFixed(2):ce);}},[S,k]=useState(false),[F,K]=useState(0),[oe,Z]=useState(0),[Q,j]=useState(false),le=async ae=>{let ce=l?l(+ae):m?(+ae).toFixed(2):Math.round(+ae);E.current&&(E.current.textContent=String(ce));},re=ae=>{if(S){let ce=ae.clientX-F,we=P-R,Re=ce/200*we,he=Math.max(R,Math.min(oe+Re,P));if(he=Math.round(he/I)*I,le(he),h.current){let ct=_(he,R,P);h.current.style.setProperty("--value",`${ct}`),h.current.setAttribute("data-value",`${he}`),A.current&&(A.current.textContent=m?he.toFixed(2):he.toString()),c&&c(he);}}},H=()=>{k(false),document.body.style.cursor="auto";},U=ae=>(ae-R)/(P-R)*100,ne=ae=>{if(!h.current)return;let ce=h.current.getBoundingClientRect(),we=ae.clientX-ce.left,lt=Math.max(0,Math.min(100,we/ce.width*100));if(u&&E.current){let Re=x.current?+x.current.value:r;le(Re*100);}if(f){let Re=U(x.current?+x.current.value:r),he=Math.min(Re,lt),ct=Math.abs(lt-Re);h.current.style.setProperty("--ghost-start",`${he}`),h.current.style.setProperty("--ghost-width",`${ct}`);}};useEffect(()=>{h.current&&h.current.style.setProperty("--value",x.current?`${_(parseFloat(x.current.value),parseFloat(x.current.min),parseFloat(x.current.max))}`:g.toString());},[]),useEffect(()=>(S?(document.addEventListener("mousemove",re),document.addEventListener("mouseup",H)):(document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",H)),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",H);}),[S]),useEffect(()=>{let ae=_(r,R,P);h.current?.style.setProperty("--value",`${ae}`),le(r);},[r,R,P,E.current]);let ee=()=>jsxs(p,{ref:h,onMouseEnter:()=>j(true),onMouseLeave:()=>j(false),onMouseMove:ne,className:`--slider --${t||so.Default} ${i?"--knob-hover":""} flex rel ${C}`.trim(),style:{...T},children:[jsx(p,{ref:M,className:"--slider-track abs fill"}),f&&jsx(p,{ref:N,className:"--slider-ghost abs fill"}),jsx(p,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(p,{ref:y,className:"--slider-knob --tooltip-knob abs"}),jsx(me,{ref:x,onInput:W,className:"abs fill",tabIndex:0,type:t||so.Default,defaultValue:g||0,step:I,max:P,min:R})]});if(u===true){let ae=l?l(r):m?r.toFixed(2):r;return jsx(Fo,{ref:V,show:S,position:mt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(ie,{ref:E,children:ae}),children:ee()})}return ee()};rs.displayName="Zuz.Slider";var Je=rs;var ss=forwardRef((e,n)=>{let{src:t,shape:r,size:o,...s}=e,{style:a,className:c,rest:f}=B(s),{canvasRef:i,crop:u,setScale:m,handleMouseDown:l,handleMouseUp:d,handleMouseMove:C}=useImageCropper(t,o||200,r||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return u()},setScale(T){m(T);}})),jsxs(p,{as:`--cropper --${r||CropShape.Circle} ${c}`,style:a,...f,children:[jsx("canvas",{ref:i,width:o||200,height:o||200,onMouseDown:l,onMouseUp:d,onMouseLeave:d,onMouseMove:C}),jsx(p,{as:"--cropper-slider",children:jsx(Je,{onChange:T=>m(T),min:0,max:1,step:.01,value:1})})]})});ss.displayName="Zuz.Cropper";var ym=ss;var bm=(t=>(t.Circle="circle",t.Square="square",t))(bm||{});var is=forwardRef((e,n)=>{let{items:t,maxItems:r}=e,o=useMemo(()=>{let c=typeof t=="string",f=c?[]:t;return c&&t.split(",").forEach(i=>{f.push({label:i});}),f},[t]),a=useMemo(()=>r&&r>0&&o.length>r-1,[o,r])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-r)]:o;return jsx(Ge,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(p,{as:"--crumb-chevron",children:L.chevronRightOutline}),items:a.map((c,f,i)=>c.ID=="."?jsx(p,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(p,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs($,{onClick:()=>c.action?.(),className:"--crumb-item",disabled:!i[f+1],children:[c.icon&&jsx(J,{as:"--crumb-icon",name:c.icon}),jsx(z,{as:"--crumb-label",children:c.label})]},`${c.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});is.displayName="Zuz.Crumb";var wm=is;var ms=forwardRef((e,n)=>{let{icon:t,defaultValue:r,value:o,size:s,variant:a,numeric:c,type:f,onConfirm:i,...u}=e,[m,l]=useState(false),[d,C]=useState(r||null),{style:T,className:b,rest:I}=B(u),R=useRef(null),P=useRef(null),{reposition:g}=ht(P,{direction:ue.Bottom,offset:2}),x=y=>{c&&(y.currentTarget.value=y.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let y=N=>{let D=N.target,M=R.current?.contains(D),A=P.current?.contains(D);!M&&!A&&l(false);};return m&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[m]),useEffect(()=>{let y=N=>{N.key==="Escape"&&m&&(l(false),R.current?.focus());};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[m]);let h=()=>{l(true);};return useEffect(()=>{m&&g();},[m,g]),jsx(Fragment$1,{children:jsxs(p,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${b}`,"data-value":d?d.toISOString():"",children:[t?typeof t=="string"?jsx(J,{as:"mr:10 c:#666",name:t}):t:jsx(ie,{as:"--date-picker-icon flex aic jcc",children:L.calendar}),jsx("input",{ref:R,value:d?format(d,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:T,onFocus:h,onInput:x,autoComplete:"new-password",onKeyDown:y=>{y.key=="Enter"&&i?.(y.currentTarget.value);},...I}),jsx(p,{"aria-hidden":!m,ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:m,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(Oo,{defaultValue:d,onChange:y=>{C(y),l(false);}})})]})})});ms.displayName="Zuz.DatePicker";var Pm=ms;var ps=forwardRef((e,n)=>{let{icon:t,variant:r,position:o}=e;return jsx($,{className:`--fab fixed --${r||G.Large} --${o||"bottomright"}`,children:t||L.plus})});ps.displayName="Zuz.Fab";var Bm=ps;var us=e=>{let{names:n,strength:t}=e,r={[Rt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${Rt.Gooey}`)};return useEffect(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[Rt.Gooey]).map(o=>r[o](t))})})};us.displayName="Zuz.Filters";var Lm=us;var fs=({cols:e,gap:n,ais:t,aic:r,aie:o,jcs:s,jcc:a,jce:c,className:f="",style:i,...u})=>{let m=["--flex",e?"--cols":"",t?"--ais":"",r?"--aic":"",o?"--aie":"",s?"--jcs":"",a?"--jcc":"",c?"--jce":"",f].filter(Boolean).join(" "),l={...i,gap:typeof n=="number"?`${n}px`:n};return jsx(p,{...u,className:m,style:l})};fs.displayName="Zuz.FlexBox";var Ve=fs;var Ae=null,ve=null,gs=forwardRef((e,n)=>{let{title:t,message:r,transition:o,curve:s,speed:a,type:c,actionPosition:f,spinner:i,loadingMessage:u,onShow:m,onHide:l,...d}=e,{className:C,style:T,rest:b}=B(d),[I,R]=useState(t||""),[P,g]=useState(r||""),[x,h]=useState(null),[y,N]=useState(c||Ce.Default),D=useMemo(()=>uuid(12),[]),[M,A]=useState(false),E=useRef(null),V=useRef(null),[_,W]=useState(false),[S,k]=useState(true),F=useRef(null),K=P;useImperativeHandle(n,()=>({setLoading(Z){W(Z);},showDialog(Z,Q,j,le){Ae&&(clearTimeout(Ae),ve&&clearTimeout(ve),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ve=setTimeout(()=>{E.current.classList.remove("--wobble"),ve=null;},500)),N(Ce.Dialog),Q&&g(Q),Z&&R(Z),j&&h(j.reduce((se,re)=>(se.push({...re,key:re.key||uuid(12)}),se),[])),A(true),setTimeout(()=>le?le():()=>{},1e3);},dialog(Z,Q,j,le){Ae&&(clearTimeout(Ae),ve&&clearTimeout(ve),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ve=setTimeout(()=>{E.current.classList.remove("--wobble"),ve=null;},500)),N(Ce.Dialog),g(Q),R(Z),j&&h(j.reduce((se,re)=>(se.push({...re,key:re.key||uuid(12)}),se),[])),A(true),setTimeout(()=>le?le():()=>{},1e3);},error(Z,Q){this.show(Z,Q,Ce.Error);},warn(Z,Q){this.show(Z,Q,Ce.Warn);},success(Z,Q){this.show(Z,Q,Ce.Success);},show(Z,Q,j){Ae&&(clearTimeout(Ae),ve&&clearTimeout(ve),V.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${V.current} scale(.9)`.trim();},50),ve=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=V.current||"",ve=null;},500)),Ae=setTimeout(()=>{A(false),Ae=null,ve=null;},(Q||4)*1e3),N(j||Ce.Default),g(Z),A(true),m?.();},hide(){A(false),l?.();}}));let oe=useMemo(()=>{let Z={when:M,duration:a||.3,delay:.1};if(y==Ce.Dialog){if(o){let{from:Q,to:j}=ut(o,20);return {from:Q,to:j,curve:s||X.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:X.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:X.Spring,...Z}},[M,y]);return useEffect(()=>{F.current&&clearTimeout(F.current),M?k(true):F.current=setTimeout(()=>k(false),1e3);},[M]),y==Ce.Dialog?jsxs(Fragment$1,{children:[jsx(Fe,{when:M}),jsxs(p,{className:`--sheet --sheet-${y.toLowerCase()} ${M?"is-visible":""} ${C} fixed`.trim(),style:T,fx:oe,...b,ref:E,children:[jsx(Ne,{when:_,spinner:i,message:u}),jsxs(p,{className:"--head flex aic rel",children:[jsx(p,{className:`--${I?"title":"dot"} flex aic rel`,children:I||""}),jsx($,{onClick:Z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(p,{className:`--body flex aic rel ${x?"":"--no-action"}`.trim(),children:S?K:null}),x&&jsx(p,{className:`--footer flex aic rel ${f?f==no.Center?"jcc":"":"jce"}`.trim(),children:x.map((Z,Q)=>jsx($,{onClick:j=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${D}-action-${Z.key}`))})]})]}):jsx(p,{className:`--sheet --sheet-${y.toLowerCase()} ${C} abs`.trim(),style:T,...b,fx:oe,ref:E,children:M?P:null})}),hs=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;gs.displayName="Zuz.Sheet";var Am=gs;var Um=e=>{let n={};for(let t in e){let r=t.split(/[\[\]]+/).filter(Boolean);r.reduce((o,s,a)=>{if(a===r.length-1)o[s]=e[t];else {let c=!isNaN(Number(r[a+1]));o[s]=o[s]||(c?[]:{});}return o[s]},n);}return n},ys=({ref:e,...n})=>{let{schema:t,name:r,cover:o,spinner:s,errors:a,action:c,children:f,withData:i,beforeSubmit:u,onSubmit:m,onError:l,onSuccess:d,resetOnSuccess:C,...T}=n,{className:b,style:I,rest:R}=B(T),[P,g]=useState(false),x=useRef(null),h=Io(),y=yn(),N=useCallback(S=>x.current?x.current.querySelectorAll(S):[],[x.current]),D=S=>({name:S.name||S.getAttribute("name")||S.getAttribute("data-name"),required:S.required?true:S.getAttribute("data-required")?S.getAttribute("data-required")=="true":false,with:S.with||S.getAttribute("with")}),M=S=>{let k=[];return S.querySelectorAll(".--input").forEach(F=>{k.push(F.value);}),k.join("")},A=S=>S.classList.contains("--otp")?M(S):S.classList.contains("--select")?S.querySelector("button.--selected")?.dataset.value:S.classList.contains("--checkbox")||S.getAttribute("type")==="checkbox"?S.checked:S.value,E=useCallback(S=>{let{name:k,required:F,with:K}=D(S),oe=A(S);if(t&&t[k]&&y?.getSnapshot()){let Z=t[k](oe,y.getSnapshot().values);if(Z===false||typeof Z=="string")return typeof Z=="string"&&y?.setFieldError(k,Z),false}if(F&&(S.type==="checkbox"&&!S.checked||S.classList.contains("--select")&&(oe==="-1"||!oe)||!oe||oe===""))return false;if(K)switch((K.includes("@")?K.split("@")[0]=="match"?_e.MatchField:K.split("@")[0]:K).toUpperCase()){case _e.IPV4:return _(oe).isIPv4();case _e.IPV6:return _(oe).isIPv6();case _e.Email:return _(oe).isEmail();case _e.Uri:try{return new URL(oe),!0}catch{return false}case _e.MatchField:let[Q,j,le]=K.split("@"),se=document.querySelector(`[name=${j.trim()}]`);if(!se)return false;switch(le||"direct-match"){case "if-not-empty":if(se&&!_(se.value).isEmpty()&&se.value!=S.value)return false;break;case "direct-match":if(se&&se.classList.contains("--otp")&&S.classList.contains("--otp")&&M(se)!=M(S))return false;if(se&&se.value!=S.value)return false;break}break}return true},[t,y]),V=useCallback(()=>{let S={},k={},F=null,K=null;if(N("[name]").forEach(Z=>{let{name:Q,required:j,with:le}=D(Z),se=j||le?E(Z):true,re=A(Z);S[Q]={valid:se,value:re},k[Q]=re,y?.setFieldError(Q,se?null:a?.[Q]||"Invalid"),se?Z.classList.remove("--with-error"):(Z.classList.add("--with-error"),F||(F=Z),K=a?.[Q]);}),F){let Z=F;if(Z.classList.contains("--otp"))for(let Q of Array.from(Z.querySelectorAll(".--input"))){let j=Q;if(j.value==""){j.focus();break}}else Z.focus();}let oe=Um(k);return {error:F!=null,errorMsg:K||"Fix errors to continue...",data:S,payload:oe}},[x.current]),_$1=useCallback(()=>{let{error:S,errorMsg:k,payload:F}=V();if(S){h.error(k);return}c?startTransition(async()=>{g(true),withPost(c,{...F,...i}).then(K=>{g(false),C&&y?.reset(),d?.(K),d||h.success(K.message||"Redirecting...");}).catch(K=>{g(false),l?l(K):h.error(K.message);});}):m?.(F);},[c,y,a]),W=useMemo(()=>addPropsToChildren(f,S=>S.props.name!==void 0||S.props.type==="submit",(S,k)=>k.props.type==="submit"?{onClick:_$1}:{onChange:F=>{let K=k.props.name,oe=F?.target?F.target.value:F;y?.setFieldValue(K,oe),k.props.onChange&&k.props.onChange(F);}}),[f,y]);return useImperativeHandle(e,()=>({setLoading:S=>g(S),submit:()=>_$1(),init:()=>{},hideError:()=>h.clearAll()})),jsxs(p,{ref:x,style:I,className:`--form flex rel ${b}`,children:[!hs(o)&&jsx(Ne,{when:P,spinner:s,...o}),W]})};ys.displayName="Zuz.FormInternal";var xs=e=>jsx(xn,{initialValues:e.withData,children:jsx(ys,{...e})});xs.displayName="Zuz.Form";var qm=xs;var bs=e=>{let {ref:n,cols:t,rows:r,gap:o,gapX:s,gapY:a,align:c,justify:f,inline:i,flow:u,autoCols:m,autoRows:l,template:d,...C}=e;useRef(null);let {className:b,style:I,rest:R}=B(C),P=x=>typeof x=="number"?`repeat(${x}, 1fr)`:x,g={display:i?"inline-grid":"grid",gridTemplateColumns:P(t),gridTemplateRows:P(r),gap:o,columnGap:s,rowGap:a,alignItems:c,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:u,gridAutoColumns:m,gridAutoRows:l,gridTemplateAreas:d,...I};return jsx(p,{ref:n,as:`--grid ${b}`.trim(),style:g,...R})};bs.displayName="Zuz.Grid";var jm=bs;var vs=e=>typeof e=="string"&&e.includes("+"),ws={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},Ss={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var Ts=forwardRef(({children:e,keys:n,as:t,className:r,variant:o},s)=>{let{variant:a}=Y(true),c=useMemo(()=>{if(vs(n)){let f=null;return {keys:String(n).split("+").reduce((u,m,l,d)=>(d[l+1]?u.push(m):f=m.toUpperCase(),u),[]),children:f}}return {keys:n,children:String(e).toUpperCase()}},[n]);return jsxs(p,{as:`--keyboard-keys --${o||a||G.Small} flex aic ${t} ${r}`.trim(),children:[(Array.isArray(c.keys)?c.keys:[c.keys]).map(f=>jsx("abbr",{title:Ss[f],children:ws[f]},f)),jsx(ie,{children:c?.children??e})]})});Ts.displayName="Zuz.KeyboardKeys";var Yo=Ts;var Rs=createContext(null),ot=()=>{let e=useContext(Rs);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},sp=({ref:e,icons:n,children:t,...r})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:c="No Track",defaultCover:f,onTrackChange:i,...u}=r,{className:m,style:l,rest:d}=B(u),C=useMediaPlayer(o,o[0]??void 0),T=useMemo(()=>({play:L.play,pause:L.pause,prev:L.prev,next:L.next,volumeHigh:L.volumeHigh,volumeMute:L.volumeMute,...n}),[n]),b=useMemo(()=>({...C,mode:s,icons:T}),[C,T]);return jsx(Rs.Provider,{value:b,children:jsx(p,{className:`--zuz-media-player ${m}`,style:l,children:t})})},Ns=sp;var Bs=e=>{if(!e||isNaN(e))return "0:00";let n=Math.floor(e/60),t=Math.floor(e%60);return `${n}:${t.toString().padStart(2,"0")}`},Xt=e=>typeof e=="string"?jsx(J,{name:e}):e,Es=()=>{let{mediaRef:e,state:n,controls:t,mode:r}=ot();return jsxs(p,{as:`--mediaplayer-stage rel --mode-${r}`,children:[r==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),n.isLoading&&jsx(p,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Te,{})})]})},ks=()=>{let{state:e,defaultArtist:n,defaultTitle:t,defaultCover:r}=ot();return jsxs(p,{as:"--track-info flex aic",children:[jsx(Ue,{src:e.currentItem?.cover||r||"",as:"--track-cover"}),jsxs(p,{as:"flex cols",children:[jsx(p,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(p,{as:"--track-artist",children:e.currentItem?.artist||n||"..."})]})]})},Ls=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(p,{as:"--mediaplayer-controls flex aic",children:[jsx($,{onClick:n.prev,as:"--prev",children:Xt(t?.prev??L.prev)}),jsx($,{onClick:n.togglePlay,as:"--play-pause",children:Xt(e.isPlaying?t?.pause??L.pause:t?.play??L.play)}),jsx($,{onClick:n.next,as:"--next",children:Xt(t?.next??L.next)})]})},Ms=()=>{let{state:e,controls:n,mediaRef:t}=ot(),r=e.progress*(e.duration||0);return jsxs(p,{as:"--track-progress flex aic",children:[jsx(p,{as:"--track-current-duration",children:Bs(r)}),jsx(Je,{value:e.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;n.seek(a);}}),jsx(p,{as:"--track-total-duration",children:Bs(e.duration)})]})},Os=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(p,{as:"--volume-control flex aic gap:8 w:120",children:[jsx($,{onClick:()=>n.setIsMuted(),children:Xt(e.isMuted?t?.volumeMute??L.volumeMute:t?.volumeHigh??L.volumeHigh)}),jsx(Je,{value:e.volume,className:"h:3 flex:1",onClick:r=>{let o=r.currentTarget.getBoundingClientRect();n.setVolume((r.clientX-o.left)/o.width);}})]})};var ap=({ref:e,...n})=>jsx(Ns,{...n,ref:e}),ip=Object.assign(ap,{Stage:Es,TrackInfo:ks,Controls:Ls,Progress:Ms,Volume:Os}),lp=ip;var Hs=forwardRef((e,n)=>{let t=useNetworkStatus(),{onlineMessage:r,offlineMessage:o,variant:s}=e;return jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:X.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||G.Small} fixed flex`,children:[jsx(p,{className:"--ico",children:t?L[Se.Success]:L[Se.Error]}),jsx(z,{as:"--message",children:t?r||"internet connection restored :)":o||"no internet connection"})]})});Hs.displayName="Zuz.NetWorkManager";var up=Hs;var As=forwardRef((e,n)=>{let{strenthMeter:t,onChange:r,...o}=e;"type"in o&&delete o.type;let{style:s,className:a,rest:c}=B(o),[f,i]=useState(false),[u,m]=useState(""),l=useMemo(()=>checkPasswordStrength(u),[u]),d=useDebounce(C=>{t&&m(C.target.value),r&&r(C);},100);return useEffect(()=>{},[]),jsxs(p,{as:"w:100% flex cols",children:[jsxs(p,{style:s,className:"--password flex aic rel",children:[jsx(me,{ref:n,type:f?"text":"password",className:a,onChange:d,...c}),jsx($,{tabIndex:-1,onClick:()=>i(C=>!C),className:"--toggle flex aic jcc abs",children:f?L.eye:L.eyeSlash})]}),t&&jsxs(p,{as:`flex aic --password-meter --pb-score-${l.score}`,style:s,children:[jsxs(p,{as:"--password-bars flex aic",children:[jsx(p,{as:`--pbar ${l.score>=1?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${l.score>=2?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${l.score>=3?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${l.score>=4?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${l.score>=5?"--pb-on":""}`.trim()})]}),jsx(z,{as:"--password-meter-label","aria-hidden":true,children:l.result})]})]})});As.displayName="Zuz.Password";var bp=As;var zs=forwardRef((e,n)=>{let{size:t,length:r,mask:o,...s}=e,a=useRef([]),c="pinput",f=false,i={};"with"in s&&(i={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(c=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:u}=B(s),m=l=>{let d=l.currentTarget,C=a.current[parseInt(d.dataset.index)+1],T=a.current[parseInt(d.dataset.index)-1];d.value.length===1&&C?C.focus():d.value.length===0&&T&&T.focus();};return useEffect(()=>{a.current=a.current.slice(0,t||r);},[t||r]),jsx(p,{name:c,style:u,className:"--otp flex aic rel","data-required":f,"data-size":t||r||4,...i,children:Array(t||r||4).fill(1).map((l,d)=>jsx(me,{autoComplete:"new-password","data-index":d,ref:C=>{a.current[d]=C;},numeric:true,onChange:m,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${d}`))})});zs.displayName="Zuz.PinInput";var Cp=zs;var _s=forwardRef((e,n)=>{let{children:t,className:r,name:o,required:s,type:a,value:c,variant:f,checked:i,onSwitch:u,...m}=e,[l,d]=useState(i||false),{variant:C}=Y(true),T=useRef(null);return jsxs(vt,{className:`${r} --${(a||ao.Default).toLowerCase()} --radio${!a||a==ao.Default?"":"card"} --${f||C||G.Small} flex aic rel`.trim(),...m,children:[jsx(me,{ref:T,defaultChecked:l,value:c||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:b=>{u&&u(b.target.checked,c||"cb"),d(b.target.checked);}}),jsx(p,{className:"--dot rel",children:jsx(p,{className:"--rod abs abc"})}),jsx(p,{className:"--value",children:t})]})});_s.displayName="Zuz.Radio";var Rp=_s;var Fs=forwardRef((e,n)=>{let{fx:t,withStyle:r,as:o,reverse:s=false,searchIcon:a=L.search,hideSearchIcon:c=false,clearIcon:f=L.close,hideClearIcon:i=false,onChange:u,onClear:m,...l}=e,{style:d,className:C}=B({as:e.as}),[T,b]=useState(""),{variant:I}=Y(true),R=useRef(null);"type"in e&&delete e.type;let P=x=>{b(x.target.value),u?.(x.target.value);},g=x=>{T.trim()!==""&&(b(""),u?.(""),R.current&&(R.current.value="",e.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(p,{style:d,className:`--search ${s?"--search-rev":""} --${e.variant||I||G.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${C}`.trim(),children:[jsx(me,{ref:R,onChange:P,...l}),e.shortcut&&jsx(Yo,{keys:e.shortcut,as:"abs"}),jsx($,{tabIndex:-1,onClick:x=>g(),className:"--send flex aic jcc",variant:e.variant||G.Medium,children:T!==""?!i&&(typeof f=="string"?jsx(J,{name:f,as:"--search-action"}):f):!c&&(typeof a=="string"?jsx(J,{name:a,as:"--search-action"}):a)})]})});Fs.displayName="Zuz.Search";var Op=Fs;var Ks=({checkIcon:e,selected:n,updateValue:t,o:r})=>{let o=e?typeof e=="string"?jsx(J,{name:"checkIcon"}):e:L.check,s=r.disabled===true;return jsxs($,{onClick:a=>{s||(a.stopPropagation(),t(r));},disabled:s,as:`--select-option-item --no-shrink ${n?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ve,{as:"--option-item-meta --aic",children:[r.icon&&jsx(J,{name:r.icon,as:`--select-option-icon --icon-${r.value}`,color:r.iconColor}),jsx(z,{suppressHydrationWarning:true,children:typeof r=="string"?r:r.label})]}),n&&jsx(Ve,{aic:true,jcc:true,as:"--select-option-check --abs",children:o})]})};Ks.displayName="Option";var Ws=Ks;var qs=({ref:e,...n})=>{let{selected:t,options:r,label:o,name:s,variant:a,search:c,searchPlaceholder:f,maxHeight:i,arrowDownIcon:u=L.arrowDown,arrowUpIcon:m=L.arrowUp,expanded:l,multiple:d,tokenizer:C,wrapTokens:T,disabled:b,checkIcon:I,closeIcon:R,onChange:P,...g}=n,[x,h]=useState(()=>{if(d||C)return t?(Array.isArray(t)?t:[t]).map(ne=>typeof ne=="string"?r.find(te=>te.value===ne):ne):[];if(t)return typeof t=="string"?r.find(U=>U.value===t):t;let H=r.find(U=>String(U.value)==="-1");return H||null}),[y,N]=useState(false),[D,M]=useState(null),A=useRef(null),E=useRef(null),V=useRef(null),_$1=useId(),W=useMemo(()=>s||_$1,[]),{reposition:S}=ht(V,{direction:mt.Bottom,offset:2}),{variant:k}=Y(true),F=R?typeof R=="string"?jsx(J,{name:R}):R:L.close,{className:K,style:oe,rest:Z}=B(g,void 0),Q=H=>Array.isArray(x)?x.some(U=>U.value===H.value):x?.value===H.value,j=H=>{if(!(b||H.disabled))if(d||C){let U=Array.isArray(x)?x:[],te=U.find(ee=>ee.value===H.value)?U.filter(ee=>ee.value!==H.value):[...U,H];h(te),P?.(te);}else h(H),N(false),P?.(H);},le=(H,U)=>{if(H.stopPropagation(),b)return;let ne=x.filter(te=>te.value!==U.value);h(ne),N(false),P?.(ne);},se=H=>{let U=H.currentTarget,ne=U.scrollTop===0&&H.deltaY<0,te=U.scrollHeight-U.scrollTop===U.clientHeight&&H.deltaY>0;!ne&&!te||H.preventDefault(),H.stopPropagation();};useImperativeHandle(e,()=>({setSelected:H=>{if(Array.isArray(H)){let U=H.map(ne=>typeof ne=="string"?r.find(te=>te.value===ne):ne).filter(Boolean);h(U);}else if(typeof H=="string"){let U=r.find(ne=>ne.value===H);U&&h(U);}else h(H);},getValue:()=>x||null}),[x,r]),useEffect(()=>{if(!y)return;let H=()=>{S();};return window.addEventListener("scroll",H,true),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,true),window.removeEventListener("resize",S);}},[y,S]),useEffect(()=>{if(!y){E.current&&(E.current.value=""),M(null);return}E.current?.focus(),S();let H=ne=>{V.current&&!V.current.contains(ne.target)&&N(false);},U=setTimeout(()=>{document.addEventListener("click",H);},0);return ()=>{clearTimeout(U),document.removeEventListener("click",H);}},[y,S]);let re=useMemo(()=>{if(x)return _(x).isArray()?x.length>0?x[0]:void 0:x},[x]);return jsxs(p,{className:`--select ${l==true?"--expanded":""} --${a||k} ${s?`--${s}`:""} ${b?"--disabled":""} rel`.trim(),name:W,children:[o&&jsx(z,{as:"--select-top-label",children:o}),jsxs($,{ref:A,disabled:b,"data-value":re?.value??"-1",className:`--select-display --selected flex aic rel ${K}`.trim(),withLabel:false,style:oe,onClick:H=>{H.stopPropagation(),b||N(U=>!U);},...Z,children:[re?.icon&&jsx(J,{as:"--selected-icon",name:re.icon}),jsx(Ve,{aic:true,as:"--label-wrapper",children:C&&Array.isArray(x)&&x.length>0?jsxs(Ve,{as:`--tokens-wrap${T===true?" --wrap":""}`,children:[x.map(H=>jsxs(Ve,{aic:true,as:"--token",children:[jsx(z,{as:"--token-label",children:H.label}),jsx(p,{as:"--token-remove",onClick:U=>le(U,H),children:F})]},H.value)),x.length<r.length&&jsx(z,{as:"--label",children:o||"Choose"})]}):jsx(z,{as:"--label",children:Array.isArray(x)?x.length>0?`${x.length} selected`:o||"Choose":x?.label||o||"Choose"})}),jsx(p,{className:"--svg-arrow rel flex aic jcc",children:y?typeof m=="string"?jsx(J,{name:m,as:"--search-action"}):m:typeof u=="string"?jsx(J,{name:u,as:"--search-action"}):u})]}),jsxs(p,{id:W,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!y,onWheel:se,style:{maxHeight:i||"auto"},ref:V,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:y,duration:.05},children:[c&&jsx(p,{as:"--select-search --sticky",children:jsx(me,{ref:E,onChange:H=>{M(H.target.value==""?null:H.target.value);},className:"--search-input",placeholder:f||"Search..."})}),r.filter(H=>!D||H.label.toLowerCase().includes(D.toLowerCase())).map(H=>jsx(Ws,{updateValue:j,checkIcon:I,selected:Q(H),o:H},`option-${(typeof H=="string"?H:H.label).replace(/\s+/g,"-")}-${typeof H=="string"?H:H.value}`))]})]})};qs.displayName="Zuz.Select";var $p=qs;var Xs=forwardRef((e,n)=>jsx(wt,{type:Le.Switch,...e,ref:n}));Xs.displayName="Zuz.Switch";var _p=Xs;var js=e=>{let{idx:n,id:t,as:r,weight:o,style:s,value:a,render:c,resize:f,sortBy:i,sortable:u,onSort:m}=e,[l,d]=useState(0),C=()=>{u&&(m?.(String(t),l==1?-1:1),d(T=>T==1?-1:1));};return jsxs(p,{style:{flex:o||1,...s},as:`--col flex aic ${r||""} ${u?"--sortable":""}`,onClick:C,children:[jsx(p,{children:a}),n==-1&&u&&i==t&&jsx(p,{as:"--arrow flex aib",children:l==1?L.arrowUp:L.arrowDown})]})};js.displayName="Zuz.Column";var Jt=js;var Js=e=>{let{index:n,pubsub:t,schema:r,data:o,ids:s,styles:a,animate:c,sortBy:f,selectable:i,tableRef:u,loading:m,rowClassName:l,onSort:d,onRowClick:C,onSelect:T,onContextMenu:b}=e,I=useDelayed(),R=useMemo(()=>({transition:q.SlideInBottom,curve:X.EaseInOut,delay:.02*(n+1)}),[]),P=useRef(null),g=(h,y)=>{n==-1?t.emit(`ALL_ROWS_${h?"CHECKED":"UNCHECKED"}`,h):(T&&T(o,h),t.emit(`ROW_${h?"CHECKED":"UNCHECKED"}`,h,y));},x=(h,y,N)=>jsx(Jt,{idx:h,id:y,as:"--selector",pubsub:t,value:jsx(wt,{value:N,ref:P,onSwitch:g,type:Le.Default})});return useEffect(()=>{let h=(M,A)=>{P.current?.setChecked(M,false);},y=(M,A)=>{let E=false;u?.current&&u.current.querySelectorAll(".--row").forEach(V=>{let _=V;if(!_.classList.contains("--row-head")){let W=_.querySelector(".--selector input[type=checkbox]");W&&W.checked&&!E&&(E=W.checked);}}),P.current.setChecked(E,false);},N=M=>{P.current?.setChecked(M,false),T&&T(o,M);},D=M=>{P.current?.setChecked(M,false),T&&T(o,M);};return n==-1?(t.on("ROW_CHECKED",h),t.on("ROW_UNCHECKED",y),()=>{t.off("ROW_CHECKED",h),t.off("ROW_UNCHECKED",y);}):(t.on("ALL_ROWS_CHECKED",N),t.on("ALL_ROWS_UNCHECKED",D),()=>{t.off("ALL_ROWS_CHECKED",N),t.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(p,{onContextMenu:h=>b?b(h,o):null,onClick:h=>C?C(h,e.data):()=>{},...c?{fx:{...R,when:I}}:{},as:`--row flex aic ${C?"--row-clickable":""} ${n==-1?"--row-head":""} ${l||""}`,children:[n==-1&&r.map((h,y)=>{let{renderWhenHeader:N,render:D,value:M,...A}=h;return jsxs(Fragment,{children:[i&&y==0&&x(-1,`--selector-${h.id}`,"all"),jsx(Jt,{idx:-1,onSort:d,sortBy:f,value:M,...A,pubsub:t,style:a[h.id]})]},`--col-${h.id}`)}),m&&n>-1&&jsx(p,{as:"--col",children:jsx(z,{as:"opacity:0",children:"..."})}),!m&&n>-1&&s&&o&&r.map((h,y)=>jsxs(Fragment,{children:[i&&y==0&&x(y,`--selector-${h.id}`,h.id.toString()),s.includes(String(h.id))?jsx(Jt,{pubsub:t,idx:y,id:String(h.id),style:a[String(h.id)],value:h.render?h.render(o,n):o[String(h.id).includes(".")?String(h.id).split(".").reverse()[0]:h.id]}):null]},`--${String(h.id)}-val-${y}`))]})};Js.displayName="Zuz.Row";var eo=Js;var ra=(e,n)=>{let{schema:t,rows:r,rowCount:o,rowsPerPage:s,currentPage:a,pagination:c,paginationHash:f,showPaginationOnZeroPageCount:i,animateRows:u,header:m,rowClassName:l,selectableRows:d,hoverable:C,sortBy:T,loading:b,loadingRowCount:I,loadingMessage:R,spinner:P,emptyMessage:g,onSort:x,onRowClick:h,onRowSelectToggle:y,onPageChange:N,onRowContextMenu:D,...M}=e,A=useRef(null),E=useMemo(()=>t.reduce((te,ee)=>(te[ee.id]={flex:ee.weight||1,...ee.w&&{width:ee.w},...ee.maxW&&{maxWidth:ee.maxW},...ee.minW&&{minWidth:ee.minW},...ee.h&&{height:ee.h},...ee.maxH&&{maxHeight:ee.maxH},...ee.minH&&{minHeight:ee.minH}},te),{}),[t]),V=useMemo(()=>Object.keys(E),[t]),_=useMemo(()=>m??true,[m]),{style:W,className:S,rest:k}=B(M),F=useRef(null),K=useMemo(()=>new PubSub,[]),oe=useRef(r.map(()=>uuid(8))),[Z,Q]=useState(T||null),[j,le]=useState(R||"loading"),se=useMemo(()=>!b&&r&&r.length==0,[b,r]),re=useCallback(()=>g?typeof g=="function"?jsx(g,{}):g:jsx(z,{as:"tac s:18 mt:75",children:"No Record Found"}),[b,r]);useEffect(()=>{oe.current=r.map(()=>uuid(8));},[r]);let H=(te,ee)=>{Q(te),x?.(te,ee);},U=(o||(r?r.length:0))/(s||10),ne=useMemo(()=>i||U>1?jsx(bt,{hash:f,ref:A,renderOnZeroPageCount:i,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:o||(r?r.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(n,()=>({setLoading(te){}})),jsxs(p,{as:`--table ${C??true?"--hoverable":""} flex cols rel ${S}`,ref:F,children:[_==true&&jsx(eo,{sortBy:Z,onSort:H,tableRef:F,pubsub:K,selectable:d,index:-1,schema:t,loading:true,styles:E}),b&&jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsx(Te,{type:P||de.Simple}),j&&jsx(z,{as:"--table-loading-message",children:j})]}),b&&Array(I||5).fill({}).map((te,ee)=>jsx(eo,{tableRef:F,index:ee,pubsub:K,schema:t,styles:E,loading:true,animate:u,onRowClick:h},`--trow-loading-${ee}-${t[0].id}`)),!b&&r&&r.map((te,ee)=>jsx(eo,{tableRef:F,pubsub:K,loading:false,index:ee,schema:t,ids:V,styles:E,animate:u,data:te,onRowClick:h,rowClassName:l,selectable:d,onSelect:y,onContextMenu:D},`--trow-${oe.current[ee]||ee}-${t[0].id}`)),se&&re(),c&&ne&&jsx(p,{"aria-hidden":!c||!ne,...u?{fx:{transition:q.SlideInBottom,curve:X.EaseInOut,delay:.02*(r.length+1),when:!b&&r&&c&&ne!=null}}:{},as:"--row flex aic --row-footer",children:ne})]})};ra.displayName="Zuz.Table";var eu=forwardRef(ra),tu=eu;var ru=({ref:e,...n})=>{let{title:t,items:r}=n,[o,s]=useState(0),a=(c,f,i)=>{c.preventDefault(),s(f),document.getElementById(i)?.scrollIntoView({behavior:"smooth"});};return jsxs(p,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(z,{as:"--toc-title",children:t}),jsx(Ge,{items:r.map((c,f)=>jsx("a",{className:o==f?"--toc-active":"",style:{anchorName:o===f?"--toc-active":"none",color:o==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:i=>a(i,f,c.tag),href:`#${c.tag}`,children:c.label}))})]})},nu=ru;var na=({isActive:e,transitionType:n,speed:t,width:r,render:o,content:s,onHeightChange:a})=>{let c=useRef(null),f=useResizeObserver(c);useEffect(()=>{e&&f.height>0&&a(f.height);},[e,f.height]);let u=useMemo(()=>{let m={width:r>0?`${r}px`:"100%",minWidth:r>0?`${r}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return n==="fade"?{...m,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:n==="scale"?{...m,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:m},[e,n,r,t]);return jsx(p,{ref:c,style:{...u},className:"--content",children:o||e?s:null})};na.displayName="Zuz.TabBody";var sa=na;var la=({ref:e,...n})=>{let{tabs:t,speed:r=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:c,transitionType:f="slide",...i}=n,[u,m]=useState(0),l=useRef(null),d=useResizeObserver(l),C=useMemo(()=>uuid(8),[]),[T,b]=useState("auto"),I=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(e,()=>({setTab:y=>m(y)}));let R=useMemo(()=>t.map(y=>({...y,key:y.key||uuid(8)})),[t]),{style:P,className:g,rest:x}=B({as:`flex cols w-full no-overflow ${i.as||""}`,...i}),h=()=>{if(!I)return {opacity:0};switch(f){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${R.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${u*d.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(p,{ref:l,style:P,className:`--tabview --${a} flex cols ${g}`,children:[jsx(St,{as:"--tabview-head",onSwitch:y=>{m(y.index);let N=R.find(D=>D.tag==y.tag);N&&N.onSelect&&(N.onSelect(N,y.index),c?.(N,y.index));},selected:u,items:R.reduce((y,N,D)=>(y.push({icon:N.icon,index:D,label:N.label,tag:N.tag}),y),[])}),jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:T,transition:I?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:I?1:0},children:jsx(p,{className:"--track",style:{...h()},children:R.map((y,N)=>jsx(sa,{isActive:N===u,transitionType:f,speed:r,width:d.width,render:o||N===u,onHeightChange:D=>N===u&&b(D),content:y.body},`tab-body-${y.key||N}-${C}`))})})]})};la.displayName="Zuz.TabView";var du=la;var xu=({ref:e,commands:n,onCommand:t,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[c,f]=useState([{type:"output",content:r}]),[i,u]=useState(""),m=useRef(null),l=useRef(null),{variant:d}=Y(true);useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight);},[c]);let C=g=>{let x=typeof g=="string"?{type:"output",content:g}:g;f(h=>{let y=[...h,x];return y.length>1e3?y.slice(-1e3):y});},T=()=>f([]);useImperativeHandle(e,()=>({write:C,clear:T}));let b=async g=>{let[x,...h]=g.split(" "),y=x.toLowerCase();return n&&n[y]?await n[y](h):t?await t(g):`command not found: ${x}`},I=g=>{let x=/\u001b\[(\d+)m/g,h=[],y={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",M=false,A;for(;(A=x.exec(g))!==null;){let V=g.slice(N,A.index);V&&h.push({text:V,color:D,bold:M});let _=A[1];_==="0"?(D="#d4d4d4",M=false):_==="1"?M=true:y[_]&&(D=y[_]),N=x.lastIndex;}let E=g.slice(N);return E&&h.push({text:E,color:D,bold:M}),h},R=(g,x)=>g.includes("\x1B")?I(g).map((h,y)=>jsx(ie,{style:{color:h.color||"#d4d4d4",fontWeight:h.bold?"bold":"normal"},children:h.text},`--terminal-msg-${y}-${h.text.replace(/\S+/g,"-")}`)):jsx(ie,{style:{color:x==="error"?"#ff5f56":x==="command"?"#00ff00":"#d4d4d4"},children:g}),P=async g=>{if(g.key==="Enter"&&i.trim()){let x=i.trim(),h=[...c,{type:"command",content:`${o}${x}`}];u(""),f(h);let y=await b(x);f(N=>[...N,{type:"output",content:y}]);}};return jsxs(p,{as:`--zuz-terminal --${s||d||G.Medium} flex cols ${a.className}`,onClick:()=>l.current?.focus(),children:[jsx(p,{ref:m,className:"--terminal-log",children:c.map((g,x)=>jsx(p,{children:jsx(z,{children:R(g.content,g.type)})},x))}),jsxs(p,{as:"flex aic --terminal-input",children:[jsx(z,{as:"--terminal-prompt",children:o}),jsx(me,{ref:l,className:"--zuz-term-input",autoFocus:true,value:i,variant:s||d||G.Medium,onChange:g=>u(g.target.value),onKeyDown:P})]})]})},bu=xu;var vu=({meta:e})=>jsxs($,{as:"flex aic --command-item",children:[e.icon&&jsx(J,{name:e.icon,as:"--command-icon"}),jsx(z,{children:e.label})]}),wu=({position:e,onSelect:n,commands:t,visible:r})=>jsx(p,{"aria-hidden":!r,fx:{transition:q.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...e},children:t.map(o=>jsx(vu,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),ua=wu;var ga=forwardRef((e,n)=>{let{autoResize:t,maxHeight:r,variant:o,resize:s="none",command:a,commands:c,onInput:f,cmd:i,renderDropdown:u,value:m,defaultValue:l,...d}=e,C=useRef(null),T=useRef(null),{variant:b}=Y(true),{style:I,className:R,rest:P}=B(d),{showDropdown:g,dropdownPosition:x,handleKeyDown:h,handleInput:y,handleCommandSelect:N}=useCommandActions({command:a,commands:c,cmd:i,ref:C}),D=useCallback(()=>{let A=C.current;!A||!t||(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{A.style.height="auto";let E=A.scrollHeight;if(r){let V=parseInt(r.toString(),10);isNaN(V)||(E=Math.min(E,V));}A.style.height=`${E}px`,A.style.overflowY=r&&E>=parseInt(r.toString(),10)?"auto":"hidden";}));},[t,r]),M=A=>{f?.(A),y(A),D();};return useEffect(()=>{D();},[m,l,D]),useEffect(()=>{t&&C.current&&D();},[t,D]),useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current);},[]),jsxs(p,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||b||G.Medium} flex ${R}`.trim(),style:{...I,resize:s,height:t?"auto":I?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:h,onInput:M,ref:A=>{typeof n=="function"?n(A):n&&(n.current=A),C.current=A;},value:m,defaultValue:l,...P}),u?u({show:g,position:x,commands:c||[],onSelect:N}):c&&c.length>0&&jsx(ua,{visible:g,commands:c,onSelect:N,position:x})]})});ga.displayName="Zuz.TextArea";var Iu=ga;var ya=forwardRef((e,n)=>{let{as:t,value:r,color:o,direction:s,...a}=e,c=useRef(null),[f,i]=useState(r||0);return useImperativeHandle(n,()=>({updateValue(u){f.toString().length!==u.toString().length&&i(u);},setValue(u){if(this.updateValue(u),c.current){let m=u.toString().split("");c.current.querySelectorAll(".--wheel-char").forEach((l,d)=>{let C=m[d];if(l instanceof HTMLElement){l.setAttribute("data-value",C);let T=l.querySelector(".--wheel-char-track");T instanceof HTMLElement&&(T.style.setProperty("--v",C),T.offsetWidth);}});}}})),useEffect(()=>{i(r||0);},[r]),jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:c,...a,children:[(f||0).toString().split("").map((u,m)=>isNaN(parseInt(u,10))?jsx(ie,{className:"--wheel-char wheel-char-symbol grid",children:u},`wheel-char-symbol-${m}`):jsx(ie,{"data-value":u,className:`--wheel-char grid ${m>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ie,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":u},children:[jsx(ie,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((l,d)=>jsx(ie,{children:l},`${m}--${d}`)),jsx(ie,{children:!s||s==="down"?9:0})]})},`wheel-char-${m}`)),o&&jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});ya.displayName="Zuz.TextWheel";var Mu=ya;var sr=forwardRef((e,n)=>{let{as:t,meta:r,nodes:o,icons:s,onSelect:a,treeTag:c,selected:f,roots:i,expanded:u,...m}=e,{tag:l,label:d,icon:C,under:T,isHead:b}=r,I=useMemo(()=>i.includes(l),[i]),[R,P]=useState(u),g=()=>{localStorage.setItem(`--tn${c}-${l}`,R?"0":"1"),P(!R);};useEffect(()=>{u||I&&!localStorage.getItem(`--tn${c}-${l}`)?(localStorage.setItem(`--tn${c}-${l}`,"1"),P(true)):P(localStorage.getItem(`--tn${c}-${l}`)=="1");},[]);let x=useMemo(()=>o.filter(h=>h.under==l),[o,l]);return jsxs(p,{className:`--treenode ${I?"--is-root":""} --treenode-${l} flex cols`,children:[jsxs(p,{className:`--node --node-${l} flex aic ${f==l?" --selected":""}`,children:[jsx($,{skeleton:m.skeleton,onClick:g,className:"--node-aro-btn",disabled:x.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(J,{skeleton:m.skeleton,className:"--node-aro-icon",name:x.length==0?s?.arrowDisabled||s?.arrowClose:R?s?.arrowOpen:s?.arrowClose}):x.length==0?L.chevronBottom:R?L.chevronBottom:L.chevronRight}),jsxs($,{className:"--node-meta flex aic",onClick:h=>a(l),children:[(s?.nodeOpen&&s?.nodeClose||I&&s?.rootOpen&&s?.rootClose)&&jsx(J,{skeleton:m.skeleton,className:`--node-icon ${I?"--icon-root":""}`,name:C||(R?I&&s?.rootOpen||s.nodeOpen:I&&s?.rootClose||s?.nodeClose)}),jsx(z,{className:`--node-label ${I?"--node-label-root":""}`.trim(),skeleton:m.skeleton,children:d})]})]}),R&&x.length>0&&jsx(p,{className:`--sub-node tree-sub-node-${l} flex cols`,children:x.map(h=>jsx(sr,{treeTag:c,selected:f,onSelect:a,icons:s,roots:i,expanded:h.expanded||false,meta:h,nodes:o},`--node-${h.tag}`))})]})});sr.displayName="TreeItem";var ba=sr;var wa=forwardRef((e,n)=>{let{as:t,nodes:r,onNodeSelect:o,tag:s,icons:a,roots:c,selected:f,...i}=e,[u,m]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>u}),[o]);let l=d=>{m(d),o&&o(d);};return useEffect(()=>{u!=f&&m(f);},[f]),jsx(p,{className:"--treeview flex cols",children:r.filter(d=>c.includes(d.tag)).map(d=>jsx(ba,{treeTag:s?`-${s}`:"",selected:u,onSelect:C=>l(C),icons:a,meta:d,roots:c,expanded:d.expanded||false,skeleton:i.skeleton,nodes:r},`--node-${d.tag}`))})});wa.displayName="Zuz.TreeView";var _u=wa;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
-
export{
|
|
12
|
+
</div>`}).join("")},[t,C]);return jsxs(u,{as:`--code-block rel ${l}`,style:i,...p,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:P}})}),n&&jsx(z,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),n.onCopy?.();},children:"Copy"})]})},Yc=Xc;var Xn=({onSelect:e,meta:r,selected:t,disabled:n=false})=>{let o=useRef(null),{index:s,icon:a,label:m}=r,[c,p]=useState({x:0,width:0}),f=useDelayed();return useLayoutEffect(()=>{if(f&&o.current){let{width:l,x:i}=o.current.getBoundingClientRect();p({x:i,width:l}),t&&e(s,l,i,r,true);}},[f,o.current]),useEffect(()=>{t&&e(s,c.width,c.x,r,false);},[t]),jsxs(z,{disabled:n,onClick:()=>e(s,c.width,c.x,r,false),ref:o,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(ee,{name:a,as:"--segment-icon"}):jsx(u,{as:"--segment-icon flex aic jcc",children:a}):null,m&&String(m).trim()!=""&&jsx(u,{className:"--segment-label",children:m||`Item ${s}`})]})};Xn.displayName="SelectTabItem";var Yn=Xn;var Qn=forwardRef((e,r)=>{let{fx:t,items:n,selected:o,variant:s,disabled:a=false,onSwitch:m,...c}=e,[p,f]=useState(o||0),l=useDelayed(50),i=useRef(p),{className:g,style:C,rest:P}=E(c),y=useRef(null),R=useRef(null),{variant:T}=J(true),S=(d,x,h,b,I)=>{if((I||p!=d&&p!=-2)&&(f(d),i.current=p,queueMicrotask(()=>{l&&m?.(b);})),y.current){let V=R.current?.getBoundingClientRect();y.current.style.setProperty("--w",`${x}px`),y.current.style.setProperty("--x",`${V?h-V.left:h}px`);}};return useImperativeHandle(r,()=>({setSelected:d=>{typeof d=="number"&&d!=p&&f(d);}}),[p]),jsxs(u,{ref:R,"data-selected":p,className:`${g} --segmented --${s||T||q.Medium} flex aic rel`,style:C,...P,children:[jsx(u,{ref:y,className:`--segment-tab --${a?"disabled":"abled"} abs`}),n.map((d,x)=>jsx(Yn,{disabled:a,onSelect:S,selected:p==x,meta:{...d,index:x}},`segment-${d.label}-${x}`))]})});Qn.displayName="Zuz.SelectTabs";var Ct=Qn;var ts=forwardRef((e,r)=>{let{type:t,...n}=e,o=useDelayed(),{colorScheme:s,setColorScheme:a}=go(),m=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:c,style:p}=E(n),f=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"system",index:1,label:"",icon:D.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}],[]),l=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !o||l==-1?null:t=="system"||t=="switch"?jsx(Ct,{className:`--color-scheme --${t}`,onSwitch:({tag:i})=>{a(i);},selected:l,items:f,...n}):jsx(z,{onClick:m,style:p,as:`--color-scheme-switch --${n.variant||q.Small} ${c}`.trim(),children:s=="system"?D.colorSchemeSystem:s=="light"?D.colorSchemeLight:D.colorSchemeDark})});ts.displayName="Zuz.ColorScheme";var um=ts;var rs=forwardRef((e,r)=>{let[t,n]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:m,position:c}=e,p=async f=>{n(f==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(f));};return useEffect(()=>{let f=localStorage.getItem("--ccnt");n(f?f=="1"?"accepted":"rejected":"pending");},[]),jsxs(u,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:Q.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${c||he.Left} flex cols`,children:[jsx(F,{as:"--title",children:o||"This site uses cookies"}),jsx(F,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(u,{as:"--footer flex aic",children:[jsx(z,{onClick:f=>p(1),as:"--accept",children:a||"Accept All"}),jsx(z,{onClick:f=>p(0),as:"--reject",children:m||"Cancel"})]})]})});rs.displayName="Zuz.CookiesConsent";var hm=rs;var as=({ref:e,...r})=>{let {title:t,position:n,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:m,variant:c,...p}=r,{style:f,className:l,rest:i}=E(p),g=n||he.Top;useRef(null);let [P,y]=useState(false);useRef(6);let T=m===true||P,d=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:x}=J(true),h=useMemo(()=>{let I=false;return addPropsToChildren(a,V=>{let M=V.props.className?.includes(s);return M&&(I=true),M||!I},(V,M)=>{let _=M.props.className?.includes(s),N=V===0,$={};return (_||N)&&($.style={...M.props.style,anchorName:d}),N&&($.onMouseEnter=A=>{y(true),M.props.onMouseEnter?.(A);},$.onMouseLeave=A=>{y(false),M.props.onMouseLeave?.(A);}),$})},[a,s,d]),b=ye({transition:g==he.Top?Y.SlideInTop:g==he.Bottom?Y.SlideInBottom:g==he.Left?Y.SlideInLeft:Y.SlideInRight,when:T,duration:.2,offset:o+6,margin:g==he.Top||g==he.Left?-o:o,curve:x?.curve||Q.EaseInOut});return useImperativeHandle(e,()=>({show:()=>y(true),hide:()=>y(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[h,jsx(u,{style:{positionAnchor:d,...b.style,...g===he.Top||g===he.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${T} --${c||x?.variant||q.Small} --${g} abs ${l}`.trim(),children:typeof t=="string"?jsx(F,{as:"--text rel",children:t}):t})]})};as.displayName="Zuz.ToolTip";var qo=as;var is=({ref:e,...r})=>{let {type:t,value:n=0,min:o=0,max:s=1,step:a=.01,onChange:m,showGhostBar:c,showKnobOnHover:p,showToolTip:f,roundValue:l,formatValue:i,...g}=r,{className:C,style:P,rest:y}=E(g),R=useRef(a||.01).current,T=useRef(o||0).current,S=useRef(s||1).current,d=useRef(n||0).current,x=useRef(null),h=useRef(null),b=useRef(null),I=useRef(null);useRef(null);let M=useRef(null),_=useRef(null),N=useRef(null),$=useRef(null),A=(re,O,X)=>(re-O)/(X-O)*100,K=re=>{if(h.current){let O=parseFloat(re.currentTarget.value);j(O);let X=A(O,parseFloat(re.currentTarget.min),parseFloat(re.currentTarget.max));h.current.style.setProperty("--value",`${X}`),h.current.setAttribute("data-value",`${O}`),m&&m(l?+O.toFixed(2):O);}},[B,L]=useState(false),[W,k]=useState(0),[ne,Z]=useState(0),[U,G]=useState(false),j=async re=>{let O=i?i(+re):l?(+re).toFixed(2):Math.round(+re);N.current&&(N.current.textContent=String(O));},te=re=>{if(B){let O=re.clientX-W,X=S-T,le=O/200*X,fe=Math.max(T,Math.min(ne+le,S));if(fe=Math.round(fe/R)*R,j(fe),h.current){let mt=A(fe,T,S);h.current.style.setProperty("--value",`${mt}`),h.current.setAttribute("data-value",`${fe}`),_.current&&(_.current.textContent=l?fe.toFixed(2):fe.toString()),m&&m(fe);}}},ue=()=>{L(false),document.body.style.cursor="auto";},ae=re=>(re-T)/(S-T)*100,ge=re=>{if(!h.current)return;let O=h.current.getBoundingClientRect(),X=re.clientX-O.left,me=Math.max(0,Math.min(100,X/O.width*100));if(f&&N.current){let le=x.current?+x.current.value:n;j(le*100);}if(c){let le=ae(x.current?+x.current.value:n),fe=Math.min(le,me),mt=Math.abs(me-le);h.current.style.setProperty("--ghost-start",`${fe}`),h.current.style.setProperty("--ghost-width",`${mt}`);}};useEffect(()=>{h.current&&h.current.style.setProperty("--value",x.current?`${A(parseFloat(x.current.value),parseFloat(x.current.min),parseFloat(x.current.max))}`:d.toString());},[]),useEffect(()=>(B?(document.addEventListener("mousemove",te),document.addEventListener("mouseup",ue)):(document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",ue)),()=>{document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",ue);}),[B]),useEffect(()=>{let re=A(n,T,S);h.current?.style.setProperty("--value",`${re}`),j(n);},[n,T,S,N.current]);let oe=()=>jsxs(u,{ref:h,onMouseEnter:()=>G(true),onMouseLeave:()=>G(false),onMouseMove:ge,className:`--slider --${t||io.Default} ${p?"--knob-hover":""} flex rel ${C}`.trim(),style:{...P},children:[jsx(u,{ref:M,className:"--slider-track abs fill"}),c&&jsx(u,{ref:I,className:"--slider-ghost abs fill"}),jsx(u,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(u,{ref:b,className:"--slider-knob --tooltip-knob abs"}),jsx(pe,{ref:x,onInput:K,className:"abs fill",tabIndex:0,type:t||io.Default,defaultValue:d||0,step:R,max:S,min:T})]});if(f===true){let re=i?i(n):l?n.toFixed(2):n;return jsx(qo,{ref:$,show:B,position:pt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(se,{ref:N,children:re}),children:oe()})}return oe()};is.displayName="Zuz.Slider";var tt=is;var cs=forwardRef((e,r)=>{let{src:t,shape:n,size:o,...s}=e,{style:a,className:m,rest:c}=E(s),{canvasRef:p,crop:f,setScale:l,handleMouseDown:i,handleMouseUp:g,handleMouseMove:C}=useImageCropper(t,o||200,n||CropShape.Circle);return useImperativeHandle(r,()=>({getCropped(){return f()},setScale(P){l(P);}})),jsxs(u,{as:`--cropper --${n||CropShape.Circle} ${m}`,style:a,...c,children:[jsx("canvas",{ref:p,width:o||200,height:o||200,onMouseDown:i,onMouseUp:g,onMouseLeave:g,onMouseMove:C}),jsx(u,{as:"--cropper-slider",children:jsx(tt,{onChange:P=>l(P),min:0,max:1,step:.01,value:1})})]})});cs.displayName="Zuz.Cropper";var Nm=cs;var Em=(t=>(t.Circle="circle",t.Square="square",t))(Em||{});var ps=forwardRef((e,r)=>{let{items:t,maxItems:n}=e,o=useMemo(()=>{let m=typeof t=="string",c=m?[]:t;return m&&t.split(",").forEach(p=>{c.push({label:p});}),c},[t]),a=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(qe,{ref:r,className:"--crumb flex aic",direction:"rows",seperator:jsx(u,{as:"--crumb-chevron",children:D.chevronRightOutline}),items:a.map((m,c,p)=>m.ID=="."?jsx(u,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(u,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${c}`))}):jsxs(z,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!p[c+1],children:[m.icon&&jsx(ee,{as:"--crumb-icon",name:m.icon}),jsx(F,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${c}`))})});ps.displayName="Zuz.Crumb";var Lm=ps;var ds=forwardRef((e,r)=>{let{icon:t,defaultValue:n,value:o,size:s,variant:a,numeric:m,type:c,onConfirm:p,...f}=e,[l,i]=useState(false),[g,C]=useState(n||null),{style:P,className:y,rest:R}=E(f),T=useRef(null),S=useRef(null),{reposition:d}=yt(S,{direction:he.Bottom,offset:2}),x=b=>{m&&(b.currentTarget.value=b.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let b=I=>{let V=I.target,M=T.current?.contains(V),_=S.current?.contains(V);!M&&!_&&i(false);};return l&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b);}},[l]),useEffect(()=>{let b=I=>{I.key==="Escape"&&l&&(i(false),T.current?.focus());};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[l]);let h=()=>{i(true);};return useEffect(()=>{l&&d();},[l,d]),jsx(Fragment$1,{children:jsxs(u,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${y}`,"data-value":g?g.toISOString():"",children:[t?typeof t=="string"?jsx(ee,{as:"mr:10 c:#666",name:t}):t:jsx(se,{as:"--date-picker-icon flex aic jcc",children:D.calendar}),jsx("input",{ref:T,value:g?format(g,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:P,onFocus:h,onInput:x,autoComplete:"new-password",onKeyDown:b=>{b.key=="Enter"&&p?.(b.currentTarget.value);},...R}),jsx(u,{"aria-hidden":!l,ref:S,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:l,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(zo,{defaultValue:g,onChange:b=>{C(b),i(false);}})})]})})});ds.displayName="Zuz.DatePicker";var Hm=ds;var gs=forwardRef((e,r)=>{let{icon:t,variant:n,position:o}=e;return jsx(z,{className:`--fab fixed --${n||q.Large} --${o||"bottomright"}`,children:t||D.plus})});gs.displayName="Zuz.Fab";var zm=gs;var hs=e=>{let{names:r,strength:t}=e,n={[Bt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${Bt.Gooey}`)};return useEffect(()=>{},[r]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(r||[Bt.Gooey]).map(o=>n[o](t))})})};hs.displayName="Zuz.Filters";var Zm=hs;var ys=({cols:e,gap:r,ais:t,aic:n,aie:o,jcs:s,jcc:a,jce:m,className:c="",style:p,...f})=>{let l=["--flex",e?"--cols":"",t?"--ais":"",n?"--aic":"",o?"--aie":"",s?"--jcs":"",a?"--jcc":"",m?"--jce":"",c].filter(Boolean).join(" "),i={...p,gap:typeof r=="number"?`${r}px`:r};return jsx(u,{...f,className:l,style:i})};ys.displayName="Zuz.FlexBox";var Ae=ys;var ze=null,Ce=null,bs=forwardRef((e,r)=>{let{title:t,message:n,transition:o,curve:s,speed:a,type:m,actionPosition:c,spinner:p,loadingMessage:f,onShow:l,onHide:i,...g}=e,{className:C,style:P,rest:y}=E(g),[R,T]=useState(t||""),[S,d]=useState(n||""),[x,h]=useState(null),[b,I]=useState(m||Pe.Default),V=useMemo(()=>uuid(12),[]),[M,_]=useState(false),N=useRef(null),$=useRef(null),[A,K]=useState(false),[B,L]=useState(true),W=useRef(null),k=S;useImperativeHandle(r,()=>({setLoading(Z){K(Z);},showDialog(Z,U,G,j){ze&&(clearTimeout(ze),Ce&&clearTimeout(Ce),N.current.classList.remove("--wobble"),setTimeout(()=>N.current.classList.add("--wobble"),50),Ce=setTimeout(()=>{N.current.classList.remove("--wobble"),Ce=null;},500)),I(Pe.Dialog),U&&d(U),Z&&T(Z),G&&h(G.reduce((ie,te)=>(ie.push({...te,key:te.key||uuid(12)}),ie),[])),_(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(Z,U,G,j){ze&&(clearTimeout(ze),Ce&&clearTimeout(Ce),N.current.classList.remove("--wobble"),setTimeout(()=>N.current.classList.add("--wobble"),50),Ce=setTimeout(()=>{N.current.classList.remove("--wobble"),Ce=null;},500)),I(Pe.Dialog),d(U),T(Z),G&&h(G.reduce((ie,te)=>(ie.push({...te,key:te.key||uuid(12)}),ie),[])),_(true),setTimeout(()=>j?j():()=>{},1e3);},error(Z,U){this.show(Z,U,Pe.Error);},warn(Z,U){this.show(Z,U,Pe.Warn);},success(Z,U){this.show(Z,U,Pe.Success);},show(Z,U,G){ze&&(clearTimeout(ze),Ce&&clearTimeout(Ce),$.current=N.current.style.transform,N.current.style.transform="",N.current.classList.remove("--wobble"),setTimeout(()=>{N.current.classList.add("--wobble"),N.current.style.transform=`${$.current} scale(.9)`.trim();},50),Ce=setTimeout(()=>{N.current.classList.remove("--wobble"),N.current.style.transform=$.current||"",Ce=null;},500)),ze=setTimeout(()=>{_(false),ze=null,Ce=null;},(U||4)*1e3),I(G||Pe.Default),d(Z),_(true),l?.();},hide(){_(false),i?.();}}));let ne=useMemo(()=>{let Z={when:M,duration:a||.3,delay:.1};if(b==Pe.Dialog){if(o){let{from:U,to:G}=ft(o,20);return {from:U,to:G,curve:s||Q.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Q.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Q.Spring,...Z}},[M,b]);return useEffect(()=>{W.current&&clearTimeout(W.current),M?L(true):W.current=setTimeout(()=>L(false),1e3);},[M]),b==Pe.Dialog?jsxs(Fragment$1,{children:[jsx(Ke,{when:M}),jsxs(u,{className:`--sheet --sheet-${b.toLowerCase()} ${M?"is-visible":""} ${C} fixed`.trim(),style:P,fx:ne,...y,ref:N,children:[jsx(Be,{when:A,spinner:p,message:f}),jsxs(u,{className:"--head flex aic rel",children:[jsx(u,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx(z,{onClick:Z=>_(false),className:"--closer abs",children:"\xD7"})]}),jsx(u,{className:`--body flex aic rel ${x?"":"--no-action"}`.trim(),children:B?k:null}),x&&jsx(u,{className:`--footer flex aic rel ${c?c==ao.Center?"jcc":"":"jce"}`.trim(),children:x.map((Z,U)=>jsx(z,{onClick:G=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${V}-action-${Z.key}`))})]})]}):jsx(u,{className:`--sheet --sheet-${b.toLowerCase()} ${C} abs`.trim(),style:P,...y,fx:ne,ref:N,children:M?S:null})}),vs=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;bs.displayName="Zuz.Sheet";var Xm=bs;var np=e=>{let r={};for(let t in e){let n=t.split(/[\[\]]+/).filter(Boolean);n.reduce((o,s,a)=>{if(a===n.length-1)o[s]=e[t];else {let m=!isNaN(Number(n[a+1]));o[s]=o[s]||(m?[]:{});}return o[s]},r);}return r},Ss=({ref:e,...r})=>{let {schema:t,name:n,cover:o,spinner:s,errors:a,action:m,children:c,withData:p,beforeSubmit:f,onSubmit:l,onError:i,onSuccess:g,resetOnSuccess:C,...P}=r,{className:y,style:R,rest:T}=E(P),[S,d]=useState(false),x=useRef(null),h=Eo(),b=Ho();Do();let V=useRef(null),M=useCallback(k=>x.current?x.current.querySelectorAll(k):[],[x.current]),_$1=k=>({name:k.name||k.getAttribute("name")||k.getAttribute("data-name"),required:k.required?true:k.getAttribute("data-required")?k.getAttribute("data-required")=="true":false,with:k.with||k.getAttribute("with")}),N=k=>{let ne=[];return k.querySelectorAll(".--input").forEach(Z=>{ne.push(Z.value);}),ne.join("")},$=k=>k.classList.contains("--otp")?N(k):k.classList.contains("--select")?k.querySelector("button.--selected")?.dataset.value:k.classList.contains("--checkbox")||k.getAttribute("type")==="checkbox"?k.checked:k.value,A=useCallback(k=>{let{name:ne,required:Z,with:U}=_$1(k),G=$(k);if(t&&t[ne]&&b?.getSnapshot()){let j=t[ne](G,b.getSnapshot().values);if(j===false||typeof j=="string")return typeof j=="string"&&b?.setFieldError(ne,j),false}if(Z&&(k.type==="checkbox"&&!k.checked||k.classList.contains("--select")&&(G==="-1"||!G)||!G||G===""))return false;if(U)switch((U.includes("@")?U.split("@")[0]=="match"?Ze.MatchField:U.split("@")[0]:U).toUpperCase()){case Ze.IPV4:return _(G).isIPv4();case Ze.IPV6:return _(G).isIPv6();case Ze.Email:return _(G).isEmail();case Ze.Uri:try{return new URL(G),!0}catch{return false}case Ze.MatchField:let[ie,te,ue]=U.split("@"),ae=document.querySelector(`[name=${te.trim()}]`);if(!ae)return false;switch(ue||"direct-match"){case "if-not-empty":if(ae&&!_(ae.value).isEmpty()&&ae.value!=k.value)return false;break;case "direct-match":if(ae&&ae.classList.contains("--otp")&&k.classList.contains("--otp")&&N(ae)!=N(k))return false;if(ae&&ae.value!=k.value)return false;break}break}return true},[t,b]),K=useCallback(()=>{let k={},ne={...b?.getSnapshot().values||{}},Z=null,U=null;if(M("[name]").forEach(j=>{let{name:ie,required:te,with:ue}=_$1(j),ae=te||ue?A(j):true,ge=$(j);k[ie]={valid:ae,value:ge},ne[ie]=ge,b?.setFieldError(ie,ae?null:a?.[ie]||"Invalid"),ae?j.classList.remove("--with-error"):(j.classList.add("--with-error"),Z||(Z=j),U=a?.[ie]);}),Z){let j=Z;if(j.classList.contains("--otp"))for(let ie of Array.from(j.querySelectorAll(".--input"))){let te=ie;if(te.value==""){te.focus();break}}else j.focus();}let G=np(ne);return {error:Z!=null,errorMsg:U||"Fix errors to continue...",data:k,payload:G}},[x.current,b]),B=useCallback(()=>{let{error:k,errorMsg:ne,payload:Z,data:U}=K();if(k){h.error(ne);return}m?startTransition(async()=>{d(true),withPost(m,{...p,...Z}).then(G=>{d(false),C&&b?.reset(),g?.(G),g||h.success(G.message||"Redirecting...");}).catch(G=>{d(false),i?i(G):h.error(G.message);});}):l?.(Z,U);},[m,b,a]),L=useCallback(()=>{let k=M("[type=submit]");!k||k.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):k.forEach(ne=>{ne.addEventListener("click",B);});},[x.current]),W=useMemo(()=>addPropsToChildren(c,k=>k.props.type=="submit",k=>({ref:V})),[c]);return useImperativeHandle(e,()=>({setLoading:k=>d(k),submit:()=>B(),init:L,hideError:()=>h.clearAll()})),useEffect(L,[]),jsxs(u,{ref:x,style:R,className:`--form flex rel ${y}`,children:[!vs(o)&&jsx(Be,{when:S,spinner:s,...o}),W]})};Ss.displayName="Zuz.FormInternal";var Cs=e=>jsx(wn,{initialValues:e.withData,children:jsx(Ss,{...e})});Cs.displayName="Zuz.Form";var sp=Cs;var Ts=e=>{let {ref:r,cols:t,rows:n,gap:o,gapX:s,gapY:a,align:m,justify:c,inline:p,flow:f,autoCols:l,autoRows:i,template:g,...C}=e;useRef(null);let {className:y,style:R,rest:T}=E(C),S=x=>typeof x=="number"?`repeat(${x}, 1fr)`:x,d={display:p?"inline-grid":"grid",gridTemplateColumns:S(t),gridTemplateRows:S(n),gap:o,columnGap:s,rowGap:a,alignItems:m,justifyContent:c==="between"?"space-between":c==="around"?"space-around":c,gridAutoFlow:f,gridAutoColumns:l,gridAutoRows:i,gridTemplateAreas:g,...R};return jsx(u,{ref:r,as:`--grid ${y}`.trim(),style:d,...T})};Ts.displayName="Zuz.Grid";var lp=Ts;var Ps=e=>typeof e=="string"&&e.includes("+"),Rs={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},Is={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var Bs=forwardRef(({children:e,keys:r,as:t,className:n,variant:o},s)=>{let{variant:a}=J(true),m=useMemo(()=>{if(Ps(r)){let c=null;return {keys:String(r).split("+").reduce((f,l,i,g)=>(g[i+1]?f.push(l):c=l.toUpperCase(),f),[]),children:c}}return {keys:r,children:String(e).toUpperCase()}},[r]);return jsxs(u,{as:`--keyboard-keys --${o||a||q.Small} flex aic ${t} ${n}`.trim(),children:[(Array.isArray(m.keys)?m.keys:[m.keys]).map(c=>jsx("abbr",{title:Is[c],children:Rs[c]},c)),jsx(se,{children:m?.children??e})]})});Bs.displayName="Zuz.KeyboardKeys";var or=Bs;var Ls=createContext(null),nt=()=>{let e=useContext(Ls);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},hp=({ref:e,icons:r,children:t,...n})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:m="No Track",defaultCover:c,onTrackChange:p,...f}=n,{className:l,style:i,rest:g}=E(f),C=useMediaPlayer(o,o[0]??void 0),P=useMemo(()=>({play:D.play,pause:D.pause,prev:D.prev,next:D.next,volumeHigh:D.volumeHigh,volumeMute:D.volumeMute,...r}),[r]),y=useMemo(()=>({...C,mode:s,icons:P}),[C,P]);return jsx(Ls.Provider,{value:y,children:jsx(u,{className:`--zuz-media-player ${l}`,style:i,children:t})})},Ms=hp;var Os=e=>{if(!e||isNaN(e))return "0:00";let r=Math.floor(e/60),t=Math.floor(e%60);return `${r}:${t.toString().padStart(2,"0")}`},Yt=e=>typeof e=="string"?jsx(ee,{name:e}):e,Ds=()=>{let{mediaRef:e,state:r,controls:t,mode:n}=nt();return jsxs(u,{as:`--mediaplayer-stage rel --mode-${n}`,children:[n==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),r.isLoading&&jsx(u,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Re,{})})]})},Hs=()=>{let{state:e,defaultArtist:r,defaultTitle:t,defaultCover:n}=nt();return jsxs(u,{as:"--track-info flex aic",children:[jsx(Xe,{src:e.currentItem?.cover||n||"",as:"--track-cover"}),jsxs(u,{as:"flex cols",children:[jsx(u,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(u,{as:"--track-artist",children:e.currentItem?.artist||r||"..."})]})]})},Vs=()=>{let{state:e,controls:r,icons:t}=nt();return jsxs(u,{as:"--mediaplayer-controls flex aic",children:[jsx(z,{onClick:r.prev,as:"--prev",children:Yt(t?.prev??D.prev)}),jsx(z,{onClick:r.togglePlay,as:"--play-pause",children:Yt(e.isPlaying?t?.pause??D.pause:t?.play??D.play)}),jsx(z,{onClick:r.next,as:"--next",children:Yt(t?.next??D.next)})]})},$s=()=>{let{state:e,controls:r,mediaRef:t}=nt(),n=e.progress*(e.duration||0);return jsxs(u,{as:"--track-progress flex aic",children:[jsx(u,{as:"--track-current-duration",children:Os(n)}),jsx(tt,{value:e.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;r.seek(a);}}),jsx(u,{as:"--track-total-duration",children:Os(e.duration)})]})},As=()=>{let{state:e,controls:r,icons:t}=nt();return jsxs(u,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(z,{onClick:()=>r.setIsMuted(),children:Yt(e.isMuted?t?.volumeMute??D.volumeMute:t?.volumeHigh??D.volumeHigh)}),jsx(tt,{value:e.volume,className:"h:3 flex:1",onClick:n=>{let o=n.currentTarget.getBoundingClientRect();r.setVolume((n.clientX-o.left)/o.width);}})]})};var yp=({ref:e,...r})=>jsx(Ms,{...r,ref:e}),xp=Object.assign(yp,{Stage:Ds,TrackInfo:Hs,Controls:Vs,Progress:$s,Volume:As}),bp=xp;var Fs=forwardRef((e,r)=>{let t=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:s}=e;return jsxs(u,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:Q.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||q.Small} fixed flex`,children:[jsx(u,{className:"--ico",children:t?D[Te.Success]:D[Te.Error]}),jsx(F,{as:"--message",children:t?n||"internet connection restored :)":o||"no internet connection"})]})});Fs.displayName="Zuz.NetWorkManager";var Cp=Fs;var Zs=forwardRef((e,r)=>{let{strenthMeter:t,onChange:n,...o}=e;"type"in o&&delete o.type;let{style:s,className:a,rest:m}=E(o),[c,p]=useState(false),[f,l]=useState(""),i=useMemo(()=>checkPasswordStrength(f),[f]),g=useDebounce(C=>{t&&l(C.target.value),n&&n(C);},100);return useEffect(()=>{},[]),jsxs(u,{as:"w:100% flex cols",children:[jsxs(u,{style:s,className:"--password flex aic rel",children:[jsx(pe,{ref:r,type:c?"text":"password",className:a,onChange:g,...m}),jsx(z,{tabIndex:-1,onClick:()=>p(C=>!C),className:"--toggle flex aic jcc abs",children:c?D.eye:D.eyeSlash})]}),t&&jsxs(u,{as:`flex aic --password-meter --pb-score-${i.score}`,style:s,children:[jsxs(u,{as:"--password-bars flex aic",children:[jsx(u,{as:`--pbar ${i.score>=1?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${i.score>=2?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${i.score>=3?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${i.score>=4?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${i.score>=5?"--pb-on":""}`.trim()})]}),jsx(F,{as:"--password-meter-label","aria-hidden":true,children:i.result})]})]})});Zs.displayName="Zuz.Password";var Ep=Zs;var Ws=forwardRef((e,r)=>{let{size:t,length:n,mask:o,...s}=e,a=useRef([]),m="pinput",c=false,p={};"with"in s&&(p={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(m=s.name,delete s.name),"required"in s&&(c=true,delete s.required);let{style:f}=E(s),l=i=>{let g=i.currentTarget,C=a.current[parseInt(g.dataset.index)+1],P=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&C?C.focus():g.value.length===0&&P&&P.focus();};return useEffect(()=>{a.current=a.current.slice(0,t||n);},[t||n]),jsx(u,{name:m,style:f,className:"--otp flex aic rel","data-required":c,"data-size":t||n||4,...p,children:Array(t||n||4).fill(1).map((i,g)=>jsx(pe,{autoComplete:"new-password","data-index":g,ref:C=>{a.current[g]=C;},numeric:true,onChange:l,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${g}`))})});Ws.displayName="Zuz.PinInput";var Op=Ws;var Gs=forwardRef((e,r)=>{let{children:t,className:n,name:o,required:s,type:a,value:m,variant:c,checked:p,onSwitch:f,...l}=e,[i,g]=useState(p||false),{variant:C}=J(true),P=useRef(null);return jsxs(wt,{className:`${n} --${(a||lo.Default).toLowerCase()} --radio${!a||a==lo.Default?"":"card"} --${c||C||q.Small} flex aic rel`.trim(),...l,children:[jsx(pe,{ref:P,defaultChecked:i,value:m||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:y=>{f&&f(y.target.checked,m||"cb"),g(y.target.checked);}}),jsx(u,{className:"--dot rel",children:jsx(u,{className:"--rod abs abc"})}),jsx(u,{className:"--value",children:t})]})});Gs.displayName="Zuz.Radio";var $p=Gs;var Us=forwardRef((e,r)=>{let{fx:t,withStyle:n,as:o,reverse:s=false,searchIcon:a=D.search,hideSearchIcon:m=false,clearIcon:c=D.close,hideClearIcon:p=false,onChange:f,onClear:l,...i}=e,{style:g,className:C}=E({as:e.as}),[P,y]=useState(""),{variant:R}=J(true),T=useRef(null);"type"in e&&delete e.type;let S=x=>{y(x.target.value),f?.(x.target.value);},d=x=>{P.trim()!==""&&(y(""),f?.(""),T.current&&(T.current.value="",e.onConfirm?.("")));};return useImperativeHandle(r,()=>({focus:()=>T.current?.focus(),value:()=>T.current?.value})),useEffect(()=>{},[]),jsxs(u,{style:g,className:`--search ${s?"--search-rev":""} --${e.variant||R||q.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${C}`.trim(),children:[jsx(pe,{ref:T,onChange:S,...i}),e.shortcut&&jsx(or,{keys:e.shortcut,as:"abs"}),jsx(z,{tabIndex:-1,onClick:x=>d(),className:"--send flex aic jcc",variant:e.variant||q.Medium,children:P!==""?!p&&(typeof c=="string"?jsx(ee,{name:c,as:"--search-action"}):c):!m&&(typeof a=="string"?jsx(ee,{name:a,as:"--search-action"}):a)})]})});Us.displayName="Zuz.Search";var Wp=Us;var Xs=({checkIcon:e,selected:r,updateValue:t,o:n})=>{let o=e?typeof e=="string"?jsx(ee,{name:"checkIcon"}):e:D.check,s=n.disabled===true;return jsxs(z,{onClick:a=>{s||(a.stopPropagation(),t(n));},disabled:s,as:`--select-option-item --no-shrink ${r?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ae,{as:"--option-item-meta --aic",children:[n.icon&&jsx(ee,{name:n.icon,as:`--select-option-icon --icon-${n.value}`,color:n.iconColor}),jsx(F,{suppressHydrationWarning:true,children:typeof n=="string"?n:n.label})]}),r&&jsx(Ae,{aic:true,jcc:true,as:"--select-option-check --abs",children:o})]})};Xs.displayName="Option";var Ys=Xs;var Qs=({ref:e,...r})=>{let {selected:t,options:n,label:o,name:s,variant:a,search:m,searchPlaceholder:c,maxHeight:p,arrowDownIcon:f=D.arrowDown,arrowUpIcon:l=D.arrowUp,expanded:i,multiple:g,tokenizer:C,wrapTokens:P,disabled:y,checkIcon:R,closeIcon:T,onChange:S,...d}=r,x=De(),h=s&&x.values&&x.setFieldValue;h?x.errors?.[s]:null;let I=h?x.values?.[s]:void 0,V=O=>!O&&O!==0?null:g||C?(Array.isArray(O)?O:[O]).map(me=>typeof me=="string"||typeof me=="number"?n.find(le=>String(le.value)===String(me)):me).filter(Boolean):typeof O=="string"||typeof O=="number"?n.find(X=>String(X.value)===String(O)):O,[M,_$1]=useState(()=>t?V(t):n.find(X=>String(X.value)==="-1")||null),N=useMemo(()=>I?V(I):M,[I,M]),[$,A]=useState(false),[K,B]=useState(null),L=useRef(null),W=useRef(null),k=useRef(null),ne=useId(),Z=useMemo(()=>s||ne,[]),{reposition:U}=yt(k,{direction:pt.Bottom,offset:2}),{variant:G}=J(true),j=T?typeof T=="string"?jsx(ee,{name:T}):T:D.close,{className:ie,style:te,rest:ue}=E(d,void 0),ae=O=>Array.isArray(N)?N.some(X=>X.value===O.value):N?.value===O.value,ge=O=>{if(!(y||O.disabled))if(g||C){let X=Array.isArray(N)?N:[],le=X.find(fe=>fe.value===O.value)?X.filter(fe=>fe.value!==O.value):[...X,O];_$1(le),S?.(le);}else _$1(O),A(false),S?.(O);},ce=(O,X)=>{if(O.stopPropagation(),y)return;let me=N.filter(le=>le.value!==X.value);h?x.setFieldValue?.(s,me.map(le=>le.value)):_$1(me),A(false),S?.(me);},oe=O=>{let X=O.currentTarget,me=X.scrollTop===0&&O.deltaY<0,le=X.scrollHeight-X.scrollTop===X.clientHeight&&O.deltaY>0;!me&&!le||O.preventDefault(),O.stopPropagation();};useImperativeHandle(e,()=>({setSelected:O=>{let X=V(O);if(h){let me=Array.isArray(X)?X.map(le=>le.value):X?.value;x.setFieldValue?.(s,me);}else _$1(X);},getValue:()=>N||null}),[N,n]),useEffect(()=>{if(!$)return;let O=()=>{U();};return window.addEventListener("scroll",O,true),window.addEventListener("resize",U),()=>{window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U);}},[$,U]),useEffect(()=>{if(!$){W.current&&(W.current.value=""),B(null);return}W.current?.focus(),U();let O=me=>{k.current&&!k.current.contains(me.target)&&A(false);},X=setTimeout(()=>{document.addEventListener("click",O);},0);return ()=>{clearTimeout(X),document.removeEventListener("click",O);}},[$,U]);let re=useMemo(()=>{if(N)return _(N).isArray()?N.length>0?N[0]:void 0:N},[N]);return jsxs(u,{className:`--select ${i==true?"--expanded":""} --${a||G} ${s?`--${s}`:""} ${y?"--disabled":""} rel`.trim(),name:Z,children:[o&&jsx(F,{as:"--select-top-label",children:o}),jsxs(z,{ref:L,disabled:y,"data-value":re?.value??"-1",className:`--select-display --selected flex aic rel ${ie}`.trim(),withLabel:false,style:te,onClick:O=>{O.stopPropagation(),y||A(X=>!X);},...ue,children:[re?.icon&&jsx(ee,{as:"--selected-icon",name:re.icon}),jsx(Ae,{aic:true,as:"--label-wrapper",children:C&&Array.isArray(N)&&N.length>0?jsxs(Ae,{as:`--tokens-wrap${P===true?" --wrap":""}`,children:[N.map(O=>jsxs(Ae,{aic:true,as:"--token",children:[jsx(F,{as:"--token-label",children:O.label}),jsx(u,{as:"--token-remove",onClick:X=>ce(X,O),children:j})]},O.value)),N.length<n.length&&jsx(F,{as:"--label",children:o||"Choose"})]}):jsx(F,{as:"--label",children:Array.isArray(N)?N.length>0?`${N.length} selected`:o||"Choose":N?.label||o||"Choose"})}),jsx(u,{className:"--svg-arrow rel flex aic jcc",children:$?typeof l=="string"?jsx(ee,{name:l,as:"--search-action"}):l:typeof f=="string"?jsx(ee,{name:f,as:"--search-action"}):f})]}),jsxs(u,{id:Z,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!$,onWheel:oe,style:{maxHeight:p||"auto"},ref:k,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:$,duration:.05},children:[m&&jsx(u,{as:"--select-search --sticky",children:jsx(pe,{ref:W,onChange:O=>{B(O.target.value==""?null:O.target.value);},className:"--search-input",placeholder:c||"Search..."})}),n.filter(O=>!K||O.label.toLowerCase().includes(K.toLowerCase())).map(O=>jsx(Ys,{updateValue:ge,checkIcon:R,selected:ae(O),o:O},`option-${(typeof O=="string"?O:O.label).replace(/\s+/g,"-")}-${typeof O=="string"?O:O.value}`))]})]})};Qs.displayName="Zuz.Select";var Yp=Qs;var Js=({ref:e,...r})=>jsx(St,{type:Me.Switch,...r,ref:e});Js.displayName="Zuz.Switch";var jp=Js;var ta=e=>{let{idx:r,id:t,as:n,weight:o,style:s,value:a,render:m,resize:c,sortBy:p,sortable:f,onSort:l}=e,[i,g]=useState(0),C=()=>{f&&(l?.(String(t),i==1?-1:1),g(P=>P==1?-1:1));};return jsxs(u,{style:{flex:o||1,...s},as:`--col flex aic ${n||""} ${f?"--sortable":""}`,onClick:C,children:[jsx(u,{children:a}),r==-1&&f&&p==t&&jsx(u,{as:"--arrow flex aib",children:i==1?D.arrowUp:D.arrowDown})]})};ta.displayName="Zuz.Column";var eo=ta;var ra=e=>{let{index:r,pubsub:t,schema:n,data:o,ids:s,styles:a,animate:m,sortBy:c,selectable:p,tableRef:f,loading:l,rowClassName:i,onSort:g,onRowClick:C,onSelect:P,onContextMenu:y}=e,R=useDelayed(),T=useMemo(()=>({transition:Y.SlideInBottom,curve:Q.EaseInOut,delay:.02*(r+1)}),[]),S=useRef(null),d=(h,b)=>{r==-1?t.emit(`ALL_ROWS_${h?"CHECKED":"UNCHECKED"}`,h):(P&&P(o,h),t.emit(`ROW_${h?"CHECKED":"UNCHECKED"}`,h,b));},x=(h,b,I)=>jsx(eo,{idx:h,id:b,as:"--selector",pubsub:t,value:jsx(St,{value:I,ref:S,onSwitch:d,type:Me.Default})});return useEffect(()=>{let h=(M,_)=>{S.current?.setChecked(M,false);},b=(M,_)=>{let N=false;f?.current&&f.current.querySelectorAll(".--row").forEach($=>{let A=$;if(!A.classList.contains("--row-head")){let K=A.querySelector(".--selector input[type=checkbox]");K&&K.checked&&!N&&(N=K.checked);}}),S.current.setChecked(N,false);},I=M=>{S.current?.setChecked(M,false),P&&P(o,M);},V=M=>{S.current?.setChecked(M,false),P&&P(o,M);};return r==-1?(t.on("ROW_CHECKED",h),t.on("ROW_UNCHECKED",b),()=>{t.off("ROW_CHECKED",h),t.off("ROW_UNCHECKED",b);}):(t.on("ALL_ROWS_CHECKED",I),t.on("ALL_ROWS_UNCHECKED",V),()=>{t.off("ALL_ROWS_CHECKED",I),t.off("ALL_ROWS_UNCHECKED",V);})},[]),jsxs(u,{onContextMenu:h=>y?y(h,o):null,onClick:h=>C?C(h,e.data):()=>{},...m?{fx:{...T,when:R}}:{},as:`--row flex aic ${C?"--row-clickable":""} ${r==-1?"--row-head":""} ${i||""}`,children:[r==-1&&n.map((h,b)=>{let{renderWhenHeader:I,render:V,value:M,..._}=h;return jsxs(Fragment,{children:[p&&b==0&&x(-1,`--selector-${h.id}`,"all"),jsx(eo,{idx:-1,onSort:g,sortBy:c,value:M,..._,pubsub:t,style:a[h.id]})]},`--col-${h.id}`)}),l&&r>-1&&jsx(u,{as:"--col",children:jsx(F,{as:"opacity:0",children:"..."})}),!l&&r>-1&&s&&o&&n.map((h,b)=>jsxs(Fragment,{children:[p&&b==0&&x(b,`--selector-${h.id}`,h.id.toString()),s.includes(String(h.id))?jsx(eo,{pubsub:t,idx:b,id:String(h.id),style:a[String(h.id)],value:h.render?h.render(o,r):o[String(h.id).includes(".")?String(h.id).split(".").reverse()[0]:h.id]}):null]},`--${String(h.id)}-val-${b}`))]})};ra.displayName="Zuz.Row";var to=ra;var ia=(e,r)=>{let{schema:t,rows:n,rowCount:o,rowsPerPage:s,currentPage:a,pagination:m,paginationHash:c,showPaginationOnZeroPageCount:p,animateRows:f,header:l,rowClassName:i,selectableRows:g,hoverable:C,sortBy:P,loading:y,loadingRowCount:R,loadingMessage:T,spinner:S,emptyMessage:d,onSort:x,onRowClick:h,onRowSelectToggle:b,onPageChange:I,onRowContextMenu:V,...M}=e,_=useRef(null),N=useMemo(()=>t.reduce((ce,oe)=>(ce[oe.id]={flex:oe.weight||1,...oe.w&&{width:oe.w},...oe.maxW&&{maxWidth:oe.maxW},...oe.minW&&{minWidth:oe.minW},...oe.h&&{height:oe.h},...oe.maxH&&{maxHeight:oe.maxH},...oe.minH&&{minHeight:oe.minH}},ce),{}),[t]),$=useMemo(()=>Object.keys(N),[t]),A=useMemo(()=>l??true,[l]),{style:K,className:B,rest:L}=E(M),W=useRef(null),k=useMemo(()=>new PubSub,[]),ne=useRef(n.map(()=>uuid(8))),[Z,U]=useState(P||null),[G,j]=useState(T||"loading"),ie=useMemo(()=>!y&&n&&n.length==0,[y,n]),te=useCallback(()=>d?typeof d=="function"?jsx(d,{}):d:jsx(F,{as:"tac s:18 mt:75",children:"No Record Found"}),[y,n]);useEffect(()=>{ne.current=n.map(()=>uuid(8));},[n]);let ue=(ce,oe)=>{U(ce),x?.(ce,oe);},ae=(o||(n?n.length:0))/(s||10),ge=useMemo(()=>p||ae>1?jsx(vt,{hash:c,ref:_,renderOnZeroPageCount:p,onPageChange:I,paginationStyle:"table",startPage:a,itemCount:o||(n?n.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(r,()=>({setLoading(ce){}})),jsxs(u,{as:`--table ${C??true?"--hoverable":""} flex cols rel ${B}`,ref:W,children:[A==true&&jsx(to,{sortBy:Z,onSort:ue,tableRef:W,pubsub:k,selectable:g,index:-1,schema:t,loading:true,styles:N}),y&&jsxs(u,{as:"center-x flex aic --table-spinner",children:[jsx(Re,{type:S||xe.Simple}),G&&jsx(F,{as:"--table-loading-message",children:G})]}),y&&Array(R||5).fill({}).map((ce,oe)=>jsx(to,{tableRef:W,index:oe,pubsub:k,schema:t,styles:N,loading:true,animate:f,onRowClick:h},`--trow-loading-${oe}-${t[0].id}`)),!y&&n&&n.map((ce,oe)=>jsx(to,{tableRef:W,pubsub:k,loading:false,index:oe,schema:t,ids:$,styles:N,animate:f,data:ce,onRowClick:h,rowClassName:i,selectable:g,onSelect:b,onContextMenu:V},`--trow-${ne.current[oe]||oe}-${t[0].id}`)),ie&&te(),m&&ge&&jsx(u,{"aria-hidden":!m||!ge,...f?{fx:{transition:Y.SlideInBottom,curve:Q.EaseInOut,delay:.02*(n.length+1),when:!y&&n&&m&&ge!=null}}:{},as:"--row flex aic --row-footer",children:ge})]})};ia.displayName="Zuz.Table";var mu=forwardRef(ia),pu=mu;var fu=({ref:e,...r})=>{let{title:t,items:n}=r,[o,s]=useState(0),a=(m,c,p)=>{m.preventDefault(),s(c),document.getElementById(p)?.scrollIntoView({behavior:"smooth"});};return jsxs(u,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(F,{as:"--toc-title",children:t}),jsx(qe,{items:n.map((m,c)=>jsx("a",{className:o==c?"--toc-active":"",style:{anchorName:o===c?"--toc-active":"none",color:o==c?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:p=>a(p,c,m.tag),href:`#${m.tag}`,children:m.label}))})]})},du=fu;var la=({isActive:e,transitionType:r,speed:t,width:n,render:o,content:s,onHeightChange:a})=>{let m=useRef(null),c=useResizeObserver(m);useEffect(()=>{e&&c.height>0&&a(c.height);},[e,c.height]);let f=useMemo(()=>{let l={width:n>0?`${n}px`:"100%",minWidth:n>0?`${n}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return r==="fade"?{...l,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:r==="scale"?{...l,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:l},[e,r,n,t]);return jsx(u,{ref:m,style:{...f},className:"--content",children:o||e?s:null})};la.displayName="Zuz.TabBody";var ca=la;var ua=({ref:e,...r})=>{let{tabs:t,speed:n=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:m,transitionType:c="slide",...p}=r,[f,l]=useState(0),i=useRef(null),g=useResizeObserver(i),C=useMemo(()=>uuid(8),[]),[P,y]=useState("auto"),R=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(e,()=>({setTab:b=>l(b)}));let T=useMemo(()=>t.map(b=>({...b,key:b.key||uuid(8)})),[t]),{style:S,className:d,rest:x}=E({as:`flex cols w-full no-overflow ${p.as||""}`,...p}),h=()=>{if(!R)return {opacity:0};switch(c){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${T.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${f*g.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(u,{ref:i,style:S,className:`--tabview --${a} flex cols ${d}`,children:[jsx(Ct,{as:"--tabview-head",onSwitch:b=>{l(b.index);let I=T.find(V=>V.tag==b.tag);I&&I.onSelect&&(I.onSelect(I,b.index),m?.(I,b.index));},selected:f,items:T.reduce((b,I,V)=>(b.push({icon:I.icon,index:V,label:I.label,tag:I.tag}),b),[])}),jsx(u,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:P,transition:R?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(u,{className:"--track",style:{...h()},children:T.map((b,I)=>jsx(ca,{isActive:I===f,transitionType:c,speed:n,width:g.width,render:o||I===f,onHeightChange:V=>I===f&&y(V),content:b.body},`tab-body-${b.key||I}-${C}`))})})]})};ua.displayName="Zuz.TabView";var Tu=ua;var Nu=({ref:e,commands:r,onCommand:t,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[m,c]=useState([{type:"output",content:n}]),[p,f]=useState(""),l=useRef(null),i=useRef(null),{variant:g}=J(true);useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight);},[m]);let C=d=>{let x=typeof d=="string"?{type:"output",content:d}:d;c(h=>{let b=[...h,x];return b.length>1e3?b.slice(-1e3):b});},P=()=>c([]);useImperativeHandle(e,()=>({write:C,clear:P}));let y=async d=>{let[x,...h]=d.split(" "),b=x.toLowerCase();return r&&r[b]?await r[b](h):t?await t(d):`command not found: ${x}`},R=d=>{let x=/\u001b\[(\d+)m/g,h=[],b={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},I=0,V="#d4d4d4",M=false,_;for(;(_=x.exec(d))!==null;){let $=d.slice(I,_.index);$&&h.push({text:$,color:V,bold:M});let A=_[1];A==="0"?(V="#d4d4d4",M=false):A==="1"?M=true:b[A]&&(V=b[A]),I=x.lastIndex;}let N=d.slice(I);return N&&h.push({text:N,color:V,bold:M}),h},T=(d,x)=>d.includes("\x1B")?R(d).map((h,b)=>jsx(se,{style:{color:h.color||"#d4d4d4",fontWeight:h.bold?"bold":"normal"},children:h.text},`--terminal-msg-${b}-${h.text.replace(/\S+/g,"-")}`)):jsx(se,{style:{color:x==="error"?"#ff5f56":x==="command"?"#00ff00":"#d4d4d4"},children:d}),S=async d=>{if(d.key==="Enter"&&p.trim()){let x=p.trim(),h=[...m,{type:"command",content:`${o}${x}`}];f(""),c(h);let b=await y(x);c(I=>[...I,{type:"output",content:b}]);}};return jsxs(u,{as:`--zuz-terminal --${s||g||q.Medium} flex cols ${a.className}`,onClick:()=>i.current?.focus(),children:[jsx(u,{ref:l,className:"--terminal-log",children:m.map((d,x)=>jsx(u,{children:jsx(F,{children:T(d.content,d.type)})},x))}),jsxs(u,{as:"flex aic --terminal-input",children:[jsx(F,{as:"--terminal-prompt",children:o}),jsx(pe,{ref:i,className:"--zuz-term-input",autoFocus:true,value:p,variant:s||g||q.Medium,onChange:d=>f(d.target.value),onKeyDown:S})]})]})},Bu=Nu;var Eu=({meta:e})=>jsxs(z,{as:"flex aic --command-item",children:[e.icon&&jsx(ee,{name:e.icon,as:"--command-icon"}),jsx(F,{children:e.label})]}),ku=({position:e,onSelect:r,commands:t,visible:n})=>jsx(u,{"aria-hidden":!n,fx:{transition:Y.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...e},children:t.map(o=>jsx(Eu,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),ha=ku;var ba=({ref:e,...r})=>{let {autoResize:t,maxHeight:n,variant:o,resize:s="none",command:a,commands:m,name:c,onInput:p,cmd:f,renderDropdown:l,value:i,defaultValue:g,...C}=r,P=useRef(null),y=useRef(null),{variant:R}=J(true),{style:T,className:S,rest:d}=E(C),x=De();c?x.errors?.[c]:null;let b=c&&x.values&&x.setFieldValue,I=b?x.values?.[c]:void 0,V=useDebounce(L=>{b&&x.setFieldValue?.(c,L);},500),{showDropdown:M,dropdownPosition:_,handleKeyDown:N,handleInput:$,handleCommandSelect:A}=useCommandActions({command:a,commands:m,cmd:f,ref:P}),K=useCallback(()=>{let L=P.current;!L||!t||(y.current&&cancelAnimationFrame(y.current),y.current=requestAnimationFrame(()=>{L.style.height="auto";let W=L.scrollHeight;if(n){let k=parseInt(n.toString(),10);isNaN(k)||(W=Math.min(W,k));}L.style.height=`${W}px`,L.style.overflowY=n&&W>=parseInt(n.toString(),10)?"auto":"hidden";}));},[t,n]),B=L=>{V(L.currentTarget.value),p?.(L),$(L),K();};return useEffect(()=>{P.current&&c&&I!==void 0&&P.current.value!==String(I)&&(P.current.value=String(I));},[I,c]),useEffect(()=>{K();},[i,g,K]),useEffect(()=>{t&&P.current&&K();},[t,K]),useEffect(()=>()=>{y.current&&cancelAnimationFrame(y.current);},[]),jsxs(u,{as:"rel",children:[jsx("textarea",{name:c,className:`--input --textarea --${o||R||q.Medium} flex ${S}`.trim(),style:{...T,resize:s,height:t?"auto":T?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:N,onInput:B,ref:L=>{P.current=L,typeof e=="function"?e(L):e&&(e.current=L);},value:i,defaultValue:g,...d}),l?l({show:M,position:_,commands:m||[],onSelect:A}):m&&m.length>0&&jsx(ha,{visible:M,commands:m,onSelect:A,position:_})]})};ba.displayName="Zuz.TextArea";var Hu=ba;var wa=forwardRef((e,r)=>{let{as:t,value:n,color:o,direction:s,...a}=e,m=useRef(null),[c,p]=useState(n||0);return useImperativeHandle(r,()=>({updateValue(f){c.toString().length!==f.toString().length&&p(f);},setValue(f){if(this.updateValue(f),m.current){let l=f.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((i,g)=>{let C=l[g];if(i instanceof HTMLElement){i.setAttribute("data-value",C);let P=i.querySelector(".--wheel-char-track");P instanceof HTMLElement&&(P.style.setProperty("--v",C),P.offsetWidth);}});}}})),useEffect(()=>{p(n||0);},[n]),jsxs(u,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:m,...a,children:[(c||0).toString().split("").map((f,l)=>isNaN(parseInt(f,10))?jsx(se,{className:"--wheel-char wheel-char-symbol grid",children:f},`wheel-char-symbol-${l}`):jsx(se,{"data-value":f,className:`--wheel-char grid ${l>(c||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(se,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":f},children:[jsx(se,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((i,g)=>jsx(se,{children:i},`${l}--${g}`)),jsx(se,{children:!s||s==="down"?9:0})]})},`wheel-char-${l}`)),o&&jsx(u,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});wa.displayName="Zuz.TextWheel";var Zu=wa;var pr=forwardRef((e,r)=>{let{as:t,meta:n,nodes:o,icons:s,onSelect:a,treeTag:m,selected:c,roots:p,expanded:f,...l}=e,{tag:i,label:g,icon:C,under:P,isHead:y}=n,R=useMemo(()=>p.includes(i),[p]),[T,S]=useState(f),d=()=>{localStorage.setItem(`--tn${m}-${i}`,T?"0":"1"),S(!T);};useEffect(()=>{f||R&&!localStorage.getItem(`--tn${m}-${i}`)?(localStorage.setItem(`--tn${m}-${i}`,"1"),S(true)):S(localStorage.getItem(`--tn${m}-${i}`)=="1");},[]);let x=useMemo(()=>o.filter(h=>h.under==i),[o,i]);return jsxs(u,{className:`--treenode ${R?"--is-root":""} --treenode-${i} flex cols`,children:[jsxs(u,{className:`--node --node-${i} flex aic ${c==i?" --selected":""}`,children:[jsx(z,{skeleton:l.skeleton,onClick:d,className:"--node-aro-btn",disabled:x.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(ee,{skeleton:l.skeleton,className:"--node-aro-icon",name:x.length==0?s?.arrowDisabled||s?.arrowClose:T?s?.arrowOpen:s?.arrowClose}):x.length==0?D.chevronBottom:T?D.chevronBottom:D.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:h=>a(i),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(ee,{skeleton:l.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:C||(T?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx(F,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:l.skeleton,children:g})]})]}),T&&x.length>0&&jsx(u,{className:`--sub-node tree-sub-node-${i} flex cols`,children:x.map(h=>jsx(pr,{treeTag:m,selected:c,onSelect:a,icons:s,roots:p,expanded:h.expanded||false,meta:h,nodes:o},`--node-${h.tag}`))})]})});pr.displayName="TreeItem";var Ca=pr;var Pa=forwardRef((e,r)=>{let{as:t,nodes:n,onNodeSelect:o,tag:s,icons:a,roots:m,selected:c,...p}=e,[f,l]=useState(c);useImperativeHandle(r,()=>({getSelected:()=>f}),[o]);let i=g=>{l(g),o&&o(g);};return useEffect(()=>{f!=c&&l(c);},[c]),jsx(u,{className:"--treeview flex cols",children:n.filter(g=>m.includes(g.tag)).map(g=>jsx(Ca,{treeTag:s?`-${s}`:"",selected:f,onSelect:C=>i(C),icons:a,meta:g,roots:m,expanded:g.expanded||false,skeleton:p.skeleton,nodes:n},`--node-${g.tag}`))})});Pa.displayName="Zuz.TreeView";var ju=Pa;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
+
export{Te as ALERT,hr as AVATAR,ul as Accordion,xl as ActionBar,wl as Alert,Ul as AutoComplete,tc as Avatar,rc as Badge,u as Box,$c as Bubble,Zn as BubbleMediaType,_n as BubbleStatus,z as Button,$n as CHART,Me as CHECKBOX,tf as COLORTHEME,zo as Calendar,Nc as Carousel,Dc as Chart,St as CheckBox,Yc as CodeBlock,um as ColorScheme,vo as ContextMenu,hm as CookiesConsent,Be as Cover,Em as CropShape,Nm as Cropper,Lm as Crumb,nf as DATATYPE,Je as DIALOG,yr as DIALOG_ACTION_POSITION,ve as DRAWER_SIDE,Hm as DatePicker,To as Dialog,No as Drawer,Bt as FILTER,Ze as FORMVALIDATION,sf as FORMVALIDATION_STYLE,zm as Fab,Zm as Filters,Ae as Flex,sp as Form,lp as Grid,wo as Group,ee as Icon,Xe as Image,pe as Input,or as KeyboardKeys,Is as KeysLabelMap,Rs as KeysMap,wt as Label,ho as LayersProvider,qe as List,bp as MediaPlayer,Cp as NetworkStatus,ut as ORIGIN,of as OriginType,Ke as Overlay,pt as POSITION,lf as PROGRESS,vt as Pagination,Wt as PaginationStyle,Ep as Password,Op as PinInput,he as Position,Ge as ProgressBar,lo as RADIO,$p as Radio,Pe as SHEET,ao as SHEET_ACTION_POSITION,ef as SKELETON,io as SLIDER,rf as SORT,xe as SPINNER,Po as ScrollView,Wp as Search,Yp as Select,Ct as SelectTabs,Xm as Sheet,tt as Slider,At as SnackPosition,Jr as SnackStyle,$t as SnackType,se as Span,Re as Spinner,af as Status,jp as Switch,Y as TRANSITIONS,Q as TRANSITION_CURVES,Tu as TabView,pu as Table,du as TableOfContents,Bu as Terminal,F as Text,Zu as TextWheel,Hu as Textarea,Da as ThemeProvider,en as ToastDefaultTitle,At as ToastPosition,Bo as ToastProvider,Jr as ToastStyle,$t as ToastType,qo as ToolTip,ju as TreeView,q as Variant,ft as animationTransition,co as buildClassString,vr as buildWithStyles,If as css,mo as getAnimationCurve,Nf as getAnimationTransition,Na as getZuzMap,Ps as isKeyCombination,br as setZuzMap,E as useBase,_i as useContextMenu,Wi as useDialog,qi as useDrawer,ye as useFx,ji as useMorph,yt as usePosition,nl as useSnack,Eo as useToast};
|