@zuzjs/ui 1.0.44 → 1.0.46
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 +8 -8
- package/dist/index.d.cts +47 -48
- package/dist/index.d.ts +47 -48
- package/dist/index.js +7 -7
- package/package.json +3 -3
- /package/dist/{chunk-AQS4AW4P.js → chunk-GB67P3F3.js} +0 -0
- /package/dist/{chunk-ABY4WJNX.cjs → chunk-VPTE2LT2.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-GB67P3F3.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-GB67P3F3.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(go,{children:e})]})},xr=(e,n)=>{if(Sa)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||n};var vr=({ref:e,...n})=>{let{style:t,...o}=n,{style:r,className:s,rest:a}=B(o);return jsx("span",{ref:e,style:t,className:s,...a})};vr.displayName="Zuz.Span";var ae=vr;var Sr=forwardRef((e,n)=>{let{name:t,pathCount:o,variant:r,color:s,size:a,...u}=e,{variant:f}=j(true),{className:c,style:m,rest:i}=B(u);return jsx("div",{style:{color:s,...m,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${r||f||U.Small} ${c}`.trim(),ref:n,...i,children:Array(o||0).fill(0).map((l,g)=>jsx(ae,{className:`path${g+1}`},`${t}-layer-${g}`))})});Sr.displayName="Zuz.Icon";var J=Sr;var fe={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Cr=e=>{let{type:n,variant:t,color:o,...r}=e,{className:s,style:a,rest:u}=B(r),{spinner:f}=j(true),c=()=>{switch(n||f?.type||fe.Simple){case fe.Simple:return null;case fe.Wave:return jsxs(Fragment$1,{children:[jsx(p,{as:"--bar --bar1"}),jsx(p,{as:"--bar --bar2"}),jsx(p,{as:"--bar --bar3"})]});case fe.Roller:return null}};return jsx(p,{className:`${s} --spinner --${(n||f?.type||fe.Simple).toLowerCase()} --${t||f?.variant||U.Small}`.trim(),style:{...a},...u,children:c()})};Cr.displayName="Zuz.Spinner";var Te=Cr;var Mt={Loading:"loading",Normal:"normal"};var Pr=({ref:e,...n})=>{let{reset:t,kind:o="solid",variant:r,icon:s,iconSize:a,children:u,withLabel:f,spinner:c,state:m,disabled:i,...l}=n,{style:g,className:T,rest:C}=B(l),{variant:b}=j(true);return jsxs("button",{className:removeDuplicateWords(`--button --${o} --${r||b} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${T}`).trim().replace(/\s+/g," "),style:g,ref:e,disabled:m==Mt.Loading||n.skeleton?.enabled||i,...C,children:[m==Mt.Loading&&jsx(Te,{variant:r||b,type:c||fe.Simple}),(!m||m==Mt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(J,{variant:a,name:s}),f===true?jsx(ae,{children:u}):u]})]})};Pr.displayName="Zuz.Button";var $=Pr;var Rr=forwardRef((e,n)=>{let{h:t,html:o,children:r,lines:s,...a}=e,{style:u,className:f,rest:c}=B(a),m=`h${e.h||1}`;return jsx(m,{ref:n,style:u,className:f,...c,children:o?jsx(ae,{dangerouslySetInnerHTML:{__html:o}}):r})});Rr.displayName="Zuz.Text";var _=Rr;var Ma=e=>{let{label:n,labelColor:t,icon:o,iconColor:r,index:s,className:a,onSelect:u}=e;return n=="-"?jsx(p,{className:"--line"}):jsxs($,{reset:true,onClick:f=>u?.(e),className:`--item ${a||""}`.trim(),children:[jsx(p,{as:"--icon",children:jsx(J,{name:o,className:"--ico",style:r?{color:r}:{}})}),jsx(_,{className:"--lbl flex aic",style:t?{color:t}:{},children:n})]})},Nr=Ma;var kr=({ref:e,...n})=>{let{id:t,as:o,fx:r,offsetX:s,offsetY:a,parent:u,event:f,arrow:c,when:m,items:i,header:l,footer:g,origin:T=pt.TopRight,...C}=n,[b,R]=useState(false),[I,P]=useState(i||[]),{position:d,targetRef:v,calculatedAnchor:h}=useAnchorPosition(u?.current,f,{offsetX:s,offsetY:a,preferredAnchor:T}),N=u&&d.top>u.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]),k=d.top!==0||d.left!==0;useEffect(()=>{m&&k?R(true):m||R(false);},[m,k]);let{className:V,style:E,rest:H}=B(C),z=ue({...r?.transition?{transition:r.transition??X.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:r?.curve??Y.EaseInOut,duration:r?.duration??.05,when:b&&k});return jsxs(p,{ref:v,className:`--contextmenu ${c||u!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${V}`.trim(),"aria-hidden":!b,style:{...E,...z.style,top:d.top,left:d.left,visibility:k?"visible":"hidden",transformOrigin:h},...H,children:[typeof l=="function"?createElement(l):l,I.map((W,x)=>jsx(Nr,{...W,index:x},`context-${W.label.toLowerCase()}-${x}`)),typeof g=="function"?createElement(g):g]})};kr.displayName="Zuz.ContextMenu";var yo=kr;var Lr=forwardRef((e,n)=>{let{children:t,fx:o,when:r,fxDelay:s,fxStep:a,classToIgnore:u,...f}=e,c=j(true),m=useDelayed(),i=o||c?.group?.fx,l=s||c?.group?.fxDelay,g=a||c?.group?.fxStep,T=u||c?.group?.classToIgnore||"-fx",C=useMemo(()=>i?addPropsToChildren(t,b=>{if(b.type===Fragment)return false;let R=b.props||{},I="fx"in R,P=R.as?Array.isArray(R.as)?R.as.join(" "):R.as:R.className||"",d=typeof P=="string"&&P.includes(T);return !I&&!d},b=>({fx:{...i,delay:(l||0)+b*(g||.1),when:r??(o?.when||m)}})):t,[t,r,m,i]);return jsx(p,{className:"--group",ref:n,...f,children:C})});Lr.displayName="Zuz.Group";var xo=Lr;var Or=forwardRef((e,n)=>{let{message:t,spinner:o,spinnerSize:r,color:s,when:a,hideMessage:u,...f}=e,{className:c,style:m,rest:i}=B(f),{spinner:l}=j(true);return "when"in e&&e.when==false?null:jsxs(xo,{fx:{transition:X.SlideInBottom,curve:Y.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${c}`.trim(),style:{...m,backgroundColor:"var(--cover-bg)"},...i,children:[jsx(Te,{variant:r||l?.variant||U.Small,type:o||l?.type||fe.Simple}),!u&&jsx(_,{className:"--label",style:{color:"var(--cover-label)"},children:t||"loading"})]})});Or.displayName="Zuz.Cover";var Ne=Or;var bo=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 bo;var Dr=forwardRef((e,n)=>{let{when:t,...o}=e;return jsx(p,{ref:n,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:X.FadeIn,when:t},...o})});Dr.displayName="Zuz.Overlay";var Fe=Dr;var Ya=({action:e,render:n=true,message:t=""})=>jsx(p,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:n?t:null}),Hr=Ya;var Qa=({action:e,actionPosition:n,dialogID:t,variant:o})=>jsx(p,{as:`--footer flex aic rel ${n?n==pr.Center?"jcc":"":"jce"}`.trim(),children:e.map((r,s)=>jsx($,{variant:o,onClick:a=>r.handler?r.handler():r.onClick?r.onClick():console.log("onClick Handler missing"),as:"--action",children:r.label},`dialog-${t}-action-${r.key}`))}),Vr=Qa;var Ja={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"})]})},M=Ja;var ei=({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:M.close})]}),zr=ei;var Zr=({ref:e,...n})=>{let{index:t,id:o,title:r,message:s,transition:a,curve:u,speed:f,type:c,action:m,actionPosition:i,spinner:l,loadingMessage:g,variant:T,inBackground:C,forceClose:b,forceLoading:R,onClose:I,onShow:P,onHide:d,...v}=n,h=useMemo(()=>uuid(12),[]),[y,N]=useState(r||""),[D,k]=useState(s||""),[V,E]=useState(c||je.Dialog),[H,z]=useState(false),[W,x]=useState(true),[L,Z]=useState(m||null),[G,F]=useState(false),{variant:K,spinner:oe,dialog:ee}=j(true),Q=T||ee?.variant||K||U.Small,{style:de,className:ie,rest:A}=B(v),q=useRef(null),ne=ue({when:H,duration:f||ee?.speed||.3,delay:ee?.delay||.1,transition:a||ee?.transition||X.SlideInBottom,curve:u||ee?.curve||Y.EaseInOut,watch:["scale","filter","transform"]}),re=()=>{z(false),I(o);},te=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(re)&&re();}}],[H]);useShortcuts(te),useEffect(()=>{E(je.Dialog),k(s),N(y),L&&Z(L.reduce((le,we)=>(le.push({...we,key:we.key||uuid(12)}),le),[])),z(true),setTimeout(()=>P?P():()=>{},500);},[]),useEffect(()=>{b&&re();},[b]),useEffect(()=>{R!=null&&F(R);},[R]),useEffect(()=>(H?Pe.push(re):Pe.pop(re),()=>Pe.pop(re)),[H]);let se=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Fe,{style:{zIndex:se},when:H}),jsxs(p,{as:`--dialog --${(c??je.Default).toLowerCase()} ${H?"--visible":""} ${ie} fixed abc`.trim(),style:{...ne.style,zIndex:se+1,pointerEvents:C==true?"none":"auto",...C==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,ref:q,children:[jsx(zr,{title:y,onClose:re}),jsx(Hr,{message:D,render:W,action:L}),L&&L.length>0&&jsx(Vr,{variant:Q,action:L,dialogID:h,actionPosition:i}),jsx(Ne,{when:G,spinner:l||ee?.spinner||oe?.type||fe.Simple,message:g||ee?.loadingMessage})]})]})};Zr.displayName="Zuz.Dialog";var wo=Zr;var Kr=forwardRef((e,n)=>{let{speed:t,smooth:o=false,breakpoints:r={},style:s,...a}=e,{rootRef:u,containerRef:f,thumbY:c,thumbX:m,onScrollY:i,onScrollX:l}=useScrollbar(t||1,r,o),{style:g,className:T,rest:C}=B(a);return useEffect(()=>{let b=f.current;if(!b)return;let R=()=>{window.dispatchEvent(new Event("resize"));},I=P=>{let d=P.target;if(d.closest(".--allow-scroll")){let h=d.closest(".--allow-scroll"),{scrollTop:y,scrollHeight:N,clientHeight:D}=h,k=P.deltaY<0,V=P.deltaY>0;(k&&y>0||V&&y+D<N)&&P.stopPropagation();}};return b.addEventListener("scroll",R),b.addEventListener("wheel",I,{passive:true}),()=>{b.removeEventListener("scroll",R),b.removeEventListener("wheel",I);}},[f]),jsxs(p,{ref:u,className:T.trim(),as:"--scrollview rel",children:[jsx(p,{as:`--scroll-content ${T}`.trim(),ref:f,style:s||{},children:C.children}),jsx(p,{as:"--scroll-track --track-y --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:c,onMouseDown:i})}),jsx(p,{as:"--scroll-track --track-x --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:m,onMouseDown:l})})]})});Kr.displayName="Zuz.ScrollView";var So=Kr;var Wr=({ref:e,...n})=>{let{id:t,index:o,from:r,speed:s,children:a,margin:u,animation:f,prerender:c,inBackground:m,forceClose:i,forceLoading:l,onClose:g,...T}=n,{drawer:C}=j(true),[b,R]=useState(a),[I,P]=useState(false),[d,v]=useState(c??(C?.prerender||true)),[h,y]=useState(false),N=()=>{P(false),g?.(t??-1);},{className:D,style:k,rest:V}=B(T),E=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(N)&&N();}}],[I]);useShortcuts(E),useEffect(()=>{R(a);},[a]),useEffect(()=>(I?Pe.push(N):Pe.pop(N),()=>Pe.pop(N)),[I]),useEffect(()=>{P(true);},[]),useEffect(()=>{i&&N();},[i]),useEffect(()=>{l!=null&&y(l);},[l]);let H=r||C?.from||he.Left,z=useMemo(()=>{switch(H){case he.Left:return {from:{x:"-100vw"},to:{x:0}};case he.Right:return {from:{x:"100vw"},to:{x:0}};case he.Top:return {from:{y:"-100vh"},to:{y:0}};case he.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[r,C?.from]),W=ue({from:{...z.from,opacity:0},to:{...z.to,opacity:1},when:I,curve:f||C?.animation||Y.EaseInOut,duration:s||C?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(o||1)*10,[o]);return jsxs(Fragment$1,{children:[jsx(Fe,{onClick:L=>{I&&N();},when:I,style:{zIndex:x}}),jsxs(p,{ref:e,"aria-hidden":!I,className:`--drawer flex cols ${D} --${H.toLowerCase()} fixed`,style:{...k,...W.style,"--m":`${u||C?.margin||0}px`,zIndex:x+1,pointerEvents:m==true?"none":"auto",...m==true?{scale:"0.92",filter:"blur(2px)"}:{}},...V,children:[r==he.Top||r==he.Bottom?jsx(p,{className:"--handle"}):null,jsx($,{as:"--close-drawer --abs",onClick:N,children:M.close}),jsxs(So,{as:"rel",children:[d||I?b:null,jsx(Ne,{when:h})]})]})]})};Wr.displayName="Zuz.Drawer";var Po=Wr;var Ur=forwardRef((e,n)=>{let{progress:t,type:o,animated:r,...s}=e,a=useRef(null);useImperativeHandle(n,()=>({setProgress:m=>{a.current.style.width=`${m*100}%`,a.current.setAttribute("data-value",m+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(r?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:u,style:f,rest:c}=B(s);return jsx(p,{className:`--progress ${r?"--animated":""} flex rel ${u}`.trim(),style:f,...c,children:jsx(p,{ref:a,className:"--bar rel"})})});Ur.displayName="Zuz.ProgressBar";var Ke=Ur;var Vt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Vt||{}),$t=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))($t||{}),qr=(t=>(t.Stack="stack",t.Individual="individual",t))(qr||{}),Xr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var yi=e=>{let{index:n,id:t,type:o,icon:r,title:s,message:a,duration:u,sticky:f=false,actions:c=[],position:m,style:i,isHovered:l,total:g,progress:T,forceClose:C,variant:b,onClick:R,onClose:I}=e,[P,d]=useState(false),[v,h]=useState(false),{toast:y}=j(true),N=v||C,D=m||y?.position||"TopCenter",k=o||y?.type||"default",V=i||y?.style||"stack",E=u||y?.duration||4,H=T||y?.progress||false,z=useRef(E*1e3),W=useRef(void 0),x=useRef(void 0),L=useRef(null),Z=ue({when:P&&!N,duration:.3,transition:y?.transition||(D.includes("Top")?X.SlideInTop:D.includes("Bottom")?X.SlideInBottom:D.includes("Left")?X.SlideInLeft:X.SlideInRight),curve:y?.curve||Y.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{d(true);let ie=A=>{if(x.current!==void 0){let q=A-x.current;if(!l&&!f&&!N&&(z.current-=q,L.current)){let ne=Math.max(0,z.current/(E*1e3)*100);L.current?.setProgress?.(ne/100);}}x.current=A,z.current<=0?h(true):W.current=requestAnimationFrame(ie);};return W.current=requestAnimationFrame(ie),()=>{W.current&&cancelAnimationFrame(W.current);}},[l,f,N,E]),useEffect(()=>{if(N){let ie=setTimeout(()=>{I?.(t);},350);return ()=>clearTimeout(ie)}},[N,t]);let G=V==="stack",F=l?n*65:n*8,K=l?1:Math.max(.85,1-n*.05),oe=l?1:Math.max(.4,1-n*.2),ee=()=>{R?R():(!c||c.length===0)&&h(true);},Q=Z.style.transform||"translate(0, 0)",de=N?Q:`${Q} translateY(${D.includes("Top")?F:-F}px) scale(${K})`;return jsxs(p,{onClick:ee,as:`--snack --${N?"hidden":"visible"} --${b||y?.variant||U.Medium} --${k} --${D.toLowerCase()} abs flex aic`,style:{...Z.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?Z.style.opacity:oe,transform:de,filter:!N&&G&&!l&&n>0?"blur(1px)":"none",cursor:!c||c.length===0?"pointer":"default",transition:`${Z.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(p,{as:"--ico flex aic jcc",children:r?jsx(J,{name:r}):jsx(p,{as:"--no-icon"})}),jsxs(p,{as:"--meta flex cols",children:[jsx(_,{as:"--tt",children:s||Xr[o]}),jsx(_,{as:"--tm",children:a})]}),c&&c.length>0&&jsx(p,{as:"--actions flex gap:5",children:c.map((ie,A)=>jsx($,{as:"--snack-btn bold",onClick:q=>{q.stopPropagation(),ie.onClick();},children:ie.label},A))}),H&&jsx(Ke,{as:"abs",ref:L})]})},Io=yi;var ye=createContext(null),Ci=({ref:e,...n})=>{let o=useContext(ye)?.depth??0,[r,s]=useState(null),[a,u]=useState(null),[f,c]=useState(false),[m,i]=useState([]),l=useDelayed(),g=useRef(0),T=()=>++g.current,C=()=>{c(false),setTimeout(()=>u(null),200);};useImperativeHandle(e,()=>({add(d){let v=T(),h={id:v,...d};return i(y=>[...y,h]),v},openMenu(d){c(false),setTimeout(()=>{u({id:T(),type:"menu",props:d}),c(true);},16);},remove(d){i(v=>v.map(h=>h.id===d?{...h,props:{...h.props,forceClose:true}}:h)),a?.id===d&&C();},loading(d,v){i(h=>h.map(y=>y.id===d?{...y,props:{...y.props,forceLoading:v}}:y)),a?.id===d&&C();},clear(d){i(m.filter(v=>v.type!=d));}})),useEffect(()=>{if(a&&f){let d=()=>C();return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}},[a,f,C]);let b=d=>{setTimeout(()=>{i(v=>v.filter(h=>h.id!==d)),a?.id===d&&u(null);},250);},R=useMemo(()=>[...m.filter(d=>d.type!="toast")],[m]);if(!l)return null;let I=m.filter(d=>d.type=="toast").reverse(),P=Object.values($t);return createPortal(jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+o},children:[R.map((d,v)=>{let h=v<R.length-1;return d.type==="dialog"?jsx(wo,{onClose:b,index:v,id:d.id,...d.props,inBackground:h},`layer-${d.type}-${d.id}`):d.type==="drawer"?jsx(Po,{onClose:b,index:v,id:d.id,...d.props,inBackground:h},`layer-${d.type}-${d.id}`):null}),P.map(d=>{let v=I.filter(h=>(h.props.position||"TopCenter")===d);return v.length===0?null:jsx(p,{onMouseEnter:()=>s(d),onMouseLeave:()=>s(null),as:`--toast-container fixed --${d.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:v.map((h,y)=>jsx(Io,{index:y,total:v.length,isHovered:r===d,onClose:b,id:h.id,...h.props},h.id))},d)}),a&&jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(yo,{onClose:C,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},Ti=({children:e})=>{let n=useContext(ye),t=n?n.depth+1:0,o=useRef(null),r=useMemo(()=>({add:s=>o.current?.add(s),openMenu:s=>o.current?.openMenu(s),remove:s=>o.current?.remove(s),loading:(s,a)=>o.current?.loading(s,a),clear:s=>o.current?.clear(s),depth:t,isSubLayer:!!n}),[n]);return jsxs(ye.Provider,{value:r,children:[e,jsx(Ci,{ref:o})]})},go=Ti;var Ii=()=>{let e=useContext(ye);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(o,r,s)=>{o.preventDefault(),e.openMenu({event:o,items:r,origin:s});},showMenu:(o,{items:r,origin:s,offsetX:a,offsetY:u,transition:f,curve:c,arrow:m,duration:i,header:l,footer:g})=>{e.openMenu({fx:{transition:f,curve:c,duration:i},parent:o,items:r,origin:s||pt.TopCenter,offsetX:a,offsetY:u,arrow:m,header:l,footer:g});},hide:e.clear}},Ri=Ii;var Bi=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("dialog"),t=s=>e.remove(s),o=(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:u=>o(a,u),hide:()=>t(a)}},hide:t}},Ei=Bi;var Li=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("drawer"),t=s=>e.remove(s),o=(s,a)=>e.loading(s,a),r=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:u=>o(a,u),close:()=>t(a)}};return {clearAll:n,open:s=>r({children:s}),right:s=>r({children:s,from:he.Right}),left:s=>r({children:s,from:he.Left}),top:s=>r({children:s,from:he.Top}),bottom:s=>r({children:s,from:he.Bottom}),close:t}},Mi=Li;var Di=(e,n,t={})=>{let[o,r]=useState(null),[s,a]=useState(false),{duration:u=.25,curve:f=Y.EaseOutBack,borderRadius:c={from:40,to:24},targetWidth:m=320}=t;return useLayoutEffect(()=>{n&&e.current?(r(e.current.getBoundingClientRect()),a(true)):n||a(false);},[n,e]),{style:ue({from:{opacity:0,width:o?.width,height:o?.height,borderRadius:c.from},to:{opacity:1,width:m,height:"auto",borderRadius:c.to},curve:f,duration:u,when:s&&n}).style,isMeasured:s,sourceRect:o}},Hi=Di;var zi=(e,n={})=>{let{offset:t=8,direction:o="bottom",container:r=null,triggerRef:s=null}=n,a=useRef(null),u=useCallback(()=>{let f=e.current;if(!f)return;let c=s?.current||f.parentElement;if(!c){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let m=f.getBoundingClientRect(),i=c.getBoundingClientRect(),l,g;r?(l=r.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(f).position==="fixed"?g="fixed":g="absolute",g==="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!==g&&(f.style.position=g),a.current=g;let b=0,R=0;switch(o){case "top":b=i.top-m.height-t,R=i.left,b<l.top&&i.bottom+m.height+t<=l.bottom&&(b=i.bottom+t);break;case "bottom":b=i.bottom+t,R=i.left,b+m.height>l.bottom&&i.top-m.height-t>=l.top&&(b=i.top-m.height-t);break;case "left":b=i.top,R=i.left-m.width-t,R<l.left&&i.right+m.width+t<=l.right&&(R=i.right+t);break;case "right":b=i.top,R=i.right+t,R+m.width>l.right&&i.left-m.width-t>=l.left&&(R=i.left-m.width-t);break}if(b=Math.max(l.top,Math.min(b,l.bottom-m.height)),R=Math.max(l.left,Math.min(R,l.right-m.width)),a.current==="fixed")f.style.top=`${b}px`,f.style.left=`${R}px`;else {let I;f.offsetParent?I=f.offsetParent.getBoundingClientRect():I={top:0,left:0};let P=b-I.top+window.scrollY,d=R-I.left+window.scrollX;f.style.top=`${P}px`,f.style.left=`${d}px`;}},[e,s,t,o,r]);return useEffect(()=>{let f=e.current;if(!f)return;let c=s?.current||f.parentElement;if(!c){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let m=new ResizeObserver(u);return m.observe(f),c&&m.observe(c),u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,true),()=>{m.disconnect(),c&&m.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true);}},[e,o,t,r,s]),{postion:a.current,reposition:u}},ht=zi;var Fi=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(i,l)=>e.add({type:"toast",props:{...l,type:i}}),o=i=>e.remove(i),c=(i,l,g)=>{let T=n(i,{...l,sticky:l.sticky??false,actions:[{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),o(T);}}]});return T},m=(i,l,g,T)=>{let C=n(i,{...l,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),o(C);}},{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),o(C);}}]});return C};return {ok:(i,l)=>c("default",i,l),success:(i,l)=>c("success",i,l),error:(i,l)=>c("error",i,l),confirm:(i,l,g)=>m("default",i,l,g),warn:(i,l)=>c("warn",i,l)}},Zi=Fi;var Wi=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(c,m)=>e.add({type:"toast",props:{...m,type:c}});return {show:(c,m,i,l)=>n("default",{title:c,message:m,icon:i,duration:l}),hide:c=>e.remove(c),success:(c,m,i,l)=>n("success",{title:c,message:m,icon:i,duration:l}),error:(c,m,i,l)=>n("error",{title:c,message:m,icon:i,duration:l}),warn:(c,m,i,l)=>n("warn",{title:c,message:m,icon:i,duration:l}),promise:(c,m,i,l)=>n("promise",{title:c,message:m,icon:i,duration:l}),clearAll:()=>e.clear("toast")}},Ro=Wi;var nn=({ref:e,style:n,...t})=>{let o=useRef(null),r=useMemo(()=>e&&typeof e!="function"&&e.current?e:o,[e]),{style:s,className:a,rest:u}=B(t,r);return jsx("div",{ref:e||o,style:{...s,...n||{}},className:a,...u})};nn.displayName="Zuz.Box";var p=nn;var an=forwardRef((e,n)=>{let{title:t,message:o,...r}=e,[s,a]=useState(false);return jsxs(p,{className:"--accordion flex cols",...r,children:[jsxs($,{onClick:u=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(_,{className:"--label flex",children:t}),jsx(p,{className:"--arrow flex",children:s?M.arrowUp:M.arrowDown})]}),s&&jsx(p,{className:"--detail",children:o})]})});an.displayName="Zuz.Accordion";var ji=an;var Qi=({label:e,icon:n,onClick:t,idx:o,selected:r})=>jsx($,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${o}`),className:`--action ${r?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(J,{name:n}):n}),cn=Qi;var mn=forwardRef((e,n)=>{let{items:t,name:o,selected:r,position:s,...a}=e,u=useRef(null),[f,c]=useState(r||t[0].tag||0),m=useCallback(({x:b,y:R})=>{if(u.current){let I=u.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${b-I.left}`),document.documentElement.style.setProperty("--tip-y",`${R-I.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),i=useCallback(()=>{u.current&&(u.current.removeEventListener("pointerleave",i),u.current.removeEventListener("pointermove",m),document.documentElement.style.setProperty("--tip-s","0"));},[]),l=useCallback(()=>{u.current&&(u.current.addEventListener("pointerleave",i),u.current.addEventListener("pointermove",m));},[]);useEffect(()=>{u.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((b,R)=>R.label.length>b.length?R.label:b,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),u.current?.addEventListener("pointerenter",l));},[]);let{className:g,style:T,rest:C}=B(a);return jsxs(p,{ref:u,style:T,className:[`--actionbar flex aic ${g}`,`${!s||s==pe.Auto?"rel":`--${s}`}`].join(" ").trim(),...C,children:[t.map((b,R)=>jsx(cn,{selected:f===b.tag||r==R,...b,idx:R},`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 rl=mn;var un=forwardRef((e,n)=>{let{type:t,icon:o,title:r,message:s,iconSize:a,...u}=e,{className:f,style:c,rest:m}=B(u);return jsxs(p,{className:`--alert --${t||Se.Info} flex aic ${f}`.trim(),style:c,...m,children:[jsx(p,{className:`--icon icon-${o||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!o&&M[t||Se.Info]}),jsxs(p,{className:"--meta flex cols",children:[jsx(_,{className:`--title ${s?"--tm":""}`,children:r||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(_,{className:"--message",h:2,children:s})]})]})});un.displayName="Zuz.Alert";var al=un;var fn=({ref:e,...n})=>{let{variant:t,numeric:o,onConfirm:r,...s}=n,{style:a,className:u,rest:f}=B(s),{variant:c}=j(true),m=i=>{o&&(i.currentTarget.value=i.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${t||c} flex ${u}`.trim(),style:a,onInput:m,onKeyDown:i=>{i.key=="Enter"&&r?.(i.currentTarget.value);},ref:e,...f})};fn.displayName="Zuz.Input";var ce=fn;var gn=e=>{let{meta:n,children:t}=e,o=useDelayed(),{label:r,icon:s,...a}=isValidElement(n)?{}:n,{className:u,style:f,rest:c}=B({...a,...a.animate?{animate:{...a.animate,when:o}}:{}});return isValidElement(n)?jsx("li",{style:f,className:u,children:n}):jsxs("li",{style:f,className:u,...c,children:[t,typeof n=="string"?n:r]})};gn.displayName="Zuz.ListItem";var hn=gn;var xn=forwardRef((e,n)=>{let{items:t,variant:o,direction:r,seperator:s,ol:a,...u}=e,{className:f,style:c,rest:m}=B(u),i=a==true?"ol":"ul";return createElement(i,{className:`--list --${o||U.Small} flex ${r??"cols"} ${f}`.trim(),style:c,ref:n,...m,children:t.map((l,g,T)=>{let C=`${typeof l=="string"?`li-${String(l)}`:isValidElement(l)?`li-${l.key}`||`${g}-${MD5(l.toString())}`:l.label}-${g}`;return jsxs(Fragment,{children:[jsx(hn,{meta:l}),s&&T[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${C}`):null]},C)})})});xn.displayName="Zuz.List";var Ge=xn;var vn=forwardRef((e,n)=>{let{fx:t,action:o,data:r,withStyle:s,onChange:a,...u}=e,{className:f}=B({as:s||""}),{style:c}=B(u),[m,i]=useState(false),[l,g]=useState(r||[]),T=useRef(null),C=useRef(null),b=useRef(null),R=useMemo(()=>u.name||uuid(12),[]),[I,P]=useState(null),[d,v]=useState(null),[h,y]=useState([]),D=useDebounce(x=>{x.target.value==""?(i(false),g([])):o&&x.target.value.trim()!=""&&withPost(o,{query:x.target.value}).then(L=>{"items"in L&&_$1(L.items).isArray()?(g(L.items),v(x.target.value),y(L.items)):console.error("Action Response should contain items array"),P(null);}).catch(L=>{P(null),g([]);});},250),k=()=>{if(C.current){let x=C.current.getBoundingClientRect(),L=window.innerHeight-x.bottom,Z=x.top;if(b.current){let G=b.current;L<G.offsetHeight&&Z>L?(G.style.top="auto",G.style.bottom=`${x.height}px`,G.style.maxHeight=`${Z-150}px`):(G.style.top=`${x.height+5}px`,G.style.bottom="auto",G.style.maxHeight=`${L-150}px`);}}},V=x=>{if(l.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")P(null),i(false),g([]);else if(x.key==="ArrowDown")P(L=>{let Z=L===null||L===l.length-1?0:L+1;return H(Z),Z});else if(x.key==="ArrowUp")P(L=>{let Z=L===null||L===0?l.length-1:L-1;return H(Z),Z});else if(x.key==="Enter"&&I!==null){let L=l[I];T.current&&(T.current.value=L,i(false),g([]));}}},E=x=>{T.current&&(T.current.value=x,i(false),g([]));},H=x=>{let L=l[x];if(L&&T.current&&(T.current.value=L,T.current.setSelectionRange(L.length,L.length)),b.current){let G=b.current.children[x];G&&G.scrollIntoView({block:"nearest"});}},z=x=>{C.current&&!C.current.contains(x.target)&&(i(false),g([]));},W=()=>{T.current&&T.current.value===d&&(g(h),P(null),k());};return useEffect(()=>(window.addEventListener("resize",k),window.addEventListener("scroll",k,true),document.addEventListener("mousedown",z),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true),document.removeEventListener("mousedown",z);}),[]),useEffect(()=>{k();},[l]),jsxs(p,{style:c,ref:C,className:`--autocomplete --${e.size||U.Small} flex aic rel ${f}`.trim(),children:[jsx(ce,{ref:T,autoComplete:"off",onChange:D,onKeyDown:V,onFocus:W,...u}),jsx(p,{className:"--arrow rel flex aic jcc",children:l.length>0?M.arrowUp:M.arrowDown}),l.length>0&&jsx(Ge,{id:R,ref:b,className:"--suggestion-list flex cols abs",items:l.map((x,L)=>({label:x,onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),E(x);},className:I===L?"--current":"",animate:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:clamp(.02*L,.02,.5)}}))})]})});vn.displayName="Zuz.AutoComplete";var Tl=vn;var wn=forwardRef((e,n)=>{let t=useRef(null),o=useMemo(()=>n&&typeof n!="function"&&n.current?n:t,[n]),{style:r,className:s,rest:a}=B(e,o);return !a.src||a.src==""?null:jsx("img",{ref:o,style:r,className:`${s} flex`,...a})});wn.displayName="Zuz.Image";var Ue=wn;var Sn=forwardRef((e,n)=>{let{src:t,variant:o,type:r,crossOrigin:s,referrerPolicy:a,fx:u,as:f,alt:c,color:m,style:i,...l}=e,[g,T,C]=useImage(t??"",s,a),{className:b,style:R,rest:I}=B({fx:u,as:f});return jsx(p,{className:`--avatar --${o||U.Small} --${(r||mr.Circle).toLowerCase()} rel flex aic jcc ${b}`.trim(),style:{background:m||"var(--primary)",...i,...R},...I,children:t?jsx(Ue,{src:g,crossOrigin:s,referrerPolicy:a,...l}):jsx(_,{className:"--avatar-label",children:(c?c.charAt(0):"A").toUpperCase()})})});Sn.displayName="Zuz.Avatar";var Ll=Sn;var Ml=({size:e=5,type:n="dead",label:t="",variant:o=U.Small,loading:r=false,spinner:s,...a})=>{let{style:u,className:f,rest:c}=B(a);return jsxs(p,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...u},as:`--badge --${o} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(p,{fx:{transition:X.FadeIn,curve:Y.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(Te,{type:s})}),_$1(t).isEmpty()?jsx(p,{as:`--dot --${n}`}):jsx(_,{as:"--label",children:t})]})},Ol=Ml;var ql=[{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)}],Xl=e=>{let n=new Set;return e.filter(t=>{if(t.label=="Later")return true;let o=t.getDate().toISOString().split("T")[0];return n.has(o)?false:(n.add(o),true)})},Tn=forwardRef((e,n)=>{let{defaultValue:t,variant:o,onChange:r,...s}=e,{style:a,className:u,rest:f}=B(s),[c,m]=useState(t||new Date),i=startOfMonth(c),l=endOfMonth(c),g=startOfWeek(i),T=endOfWeek(l),C=useMemo(()=>eachDayOfInterval({start:g,end:T}),[g,T]),b=P=>{r?.(P),m(P);},R=()=>{m(P=>new Date(P.getFullYear(),P.getMonth()-1));},I=()=>{m(P=>new Date(P.getFullYear(),P.getMonth()+1));};return jsxs(p,{as:`--calendar flex --${o||"sm"} ${u}`,style:a,children:[jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:Xl(ql).map(P=>{let d=P.getDate();return jsxs($,{onClick:()=>b(d),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(_,{as:"flex:1",children:P.label}),jsx(_,{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(_,{as:"flex:1 --calendar-cm bold",children:format(c,"MMMM yyyy")}),jsx($,{onClick:R,as:"--calendar-chevron",children:M.chevronUpOutline}),jsx($,{onClick:I,as:"--calendar-chevron",children:M.chevronDownOutline})]}),jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(P=>jsx(_,{as:"--calendar-day",children:P},`--calendar-hd-${P}`)),C.map((P,d)=>{let v=isSameMonth(P,c),h=isSameDay(P,c),y=isToday(P);return jsx($,{disabled:!v,onClick:()=>b(P),as:["--calendar-day --calendar-dd",`${h?"--calendar-dd-selected":""}`,`${y?"--calendar-dd-current":""}`],children:format(P,"d")},`--calendar-day-${d}-${P.getFullYear()}-${P.getMonth()}-${P.getDay()}`)})]})]})]})});Tn.displayName="Zuz.Calendar";var Oo=Tn;var Wt=(t=>(t.Table="table",t.Gooey="gooey",t))(Wt||{});var Nn=({ref:e,...n})=>{let{itemCount:t,itemsPerPage:o,startPage:r,pageRange:s,paginationStyle:a,breakLabel:u,prevLabel:f,nextLabel:c,hash:m,loading:i,seperator:l,renderOnZeroPageCount:g,asDots:T,progressBar:C,onPageChange:b,...R}=n,I=useRef(null),P=useMemo(()=>toHash(numberInRange(4,8)),[]),d=useCallback(x=>`${toHash(x,m||6,P)}${l||""}${P}`,[P]),v=useMemo(()=>u||"...",[u]),h=useRef(null),[y,N]=useState({id:m?r?typeof r=="number"?d(r):r:1:r||1,label:r||1});useImperativeHandle(e,()=>({setPage:x=>N(x),getPage:x=>y,setProgress:x=>h.current?.setProgress?.(x),getProgress:()=>h.current?.getProgress?.()??0}),[h.current]);let{style:D,className:k,rest:V}=B(R),E=useCallback(x=>typeof x=="number"?x:+x.label,[]);if(!t)throw new Error('"itemCount" prop is required');let H=useMemo(()=>Math.ceil(t/o),[t,o]),z=useMemo(()=>{let x=[],L=Math.max(E(y)-(s||2),1),Z=Math.min(E(y)+(s||2),H);L>1&&x.push({id:m?d(1):1,label:1}),L>2&&x.push({id:-1,label:v});for(let G=L;G<=Z;G++)x.push({id:m?d(G):G,label:G});return Z<H-1&&x.push({id:-1,label:v}),Z<H&&x.push({id:m?d(H):H,label:H}),x},[y]),W=useCallback(x=>{let L=x;+L.label<1||+L.label>H||(N(L),b?.(L));},[t,o,y]);return z.length<=1&&(g??false)===false?null:jsxs(p,{ref:I,as:`--pagination ${T===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${k}`,children:[jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(z.length>1?z:[{id:1,label:1},{id:-1,label:v}]).map((x,L,Z)=>{let G=(typeof x=="string"?x:x.label)==E(y);return jsx($,{disabled:x.id==-1||E(y)==+x.label,className:G?"--current-page":"",onClick:F=>W(x),children:T===true?C===true&&G?jsx(Ke,{ref:h}):"":typeof x=="string"?x:x.label},`--pg-${L}-${x.id}`)})}),jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(y)-1)*o+1} - `,`${Math.min(E(y)*o,t)} of ${t} items`].join(" ")}),jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx($,{disabled:E(y)<=1,onClick:x=>W({id:m?d(E(y)-1):E(y)-1,label:E(y)-1}),children:M.chevronLeftOutline}),jsx($,{disabled:z.length<=1||E(y)==E(z[z.length-1]),onClick:x=>W({id:m?d(E(y)+1):E(y)+1,label:E(y)+1}),children:M.chevronRightOutline})]})]})};Nn.displayName="Zuz.Pagination";var bt=Nn;function rc(e,n){let{items:t,renderItem:o,effect:r="slide",loop:s=true,loopMode:a="infinite",startIndex:u=0,useKeys:f=true,useWheel:c=true,spacing:m=160,rotation:i=20,scaleStep:l=.15,blur:g=4,animation:T="power",showDots:C=false,autoPlay:b=false,autoPlaySpeed:R=3,onChange:I,...P}=e,{className:d,style:v}=B(P),h=useRef(null),y=R/(R>=1e3?1e3:1),N=useCarousel({total:t.length,initialIndex:u,loop:s,useKeys:f,useWheel:c,onChange:H=>{h.current?.setPage({id:H+1,label:H+1}),h.current?.setProgress(0),I?.(H);}}),{pause:D,resume:k,reset:V}=useTimer({duration:y,autoStart:b===true,onProgress:H=>{b===true&&h.current?.setProgress(1-H);},onExpired:()=>{b===true&&N.next(),V();}}),E={...v,"--carousel-spacing":`${m}px`,"--carousel-rotation":`${i}deg`,"--carousel-blur":`${g}px`,"--carousel-scale-step":l,"--active-index":N.index,"--carousel-transition":`var(--${T})`};return jsxs(p,{ref:n,className:`--carousel --effect-${r} --loop-${a} flex cols aic jcc ${d}`.trim(),style:E,children:[jsx(p,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((H,z)=>{let W=z-N.index;if(a==="infinite"){let L=t.length;W=((W+L/2)%L+L)%L-L/2;}let x=z===N.index;return jsx(p,{onMouseEnter:()=>x&&D(),onMouseLeave:()=>x&&k(),className:`--carousel-item-wrapper abs ${x?"--is-active":""}`,style:{"--offset":W,zIndex:x?100:100-Math.abs(W),display:Math.abs(W)>5?"none":"flex"},children:o(H,z,N.index)},z)})}),C&&jsx(bt,{ref:h,itemCount:t.length,itemsPerPage:1,startPage:u+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:H=>N.goTo(+H.label-1),asDots:true,progressBar:true})]})}var nc=forwardRef(rc),sc=nc;var Bn=(n=>(n.Line="line",n))(Bn||{});var Ln=forwardRef((e,n)=>{let{data:t,width:o,height:r,lineColor:s,strokeWidth:a=2,gradientStartColor:u,gradientEndColor:f,animated:c,animDuration:m=2,animDelay:i=0,padding:l=0,type:g,...T}=e,{className:C,style:b,rest:R}=B(T),I=useRef(null),P=useResizeObserver(I.current?.parentElement||I),d=typeof o=="number"?o:P.width,v=typeof r=="number"?r:P.height,h={width:d,height:v},y=useId(),{pathD:N,areaPathD:D}=useLineChart(t,h,l+(a||2)),k=useRef(null),V=useRef(null),[E,H]=useState(0),[z,W]=useState(0);return useEffect(()=>{c&&(k.current&&H(k.current.getTotalLength()),V.current&&W(V.current.getTotalLength()));},[c,N,D,d,v]),jsx(p,{ref:I,as:`--chart --${g||"line"}-chart ${C}`.trim(),style:{...b,width:o,height:r},...R,children:d>0&&v>0&&jsxs("svg",{viewBox:`0 0 ${d} ${v}`,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:u}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:V,d:D,fill:`url(#${y})`,stroke:"none",style:c?{strokeDasharray:z,strokeDashoffset:z}:{},children:c&&jsx("animate",{attributeName:"stroke-dashoffset",from:z,to:"0",dur:`${m||2}s`,begin:`${i||0}s`,fill:"freeze"})}),jsx("path",{ref:k,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:c?{strokeDasharray:E,strokeDashoffset:E}:{},children:c&&jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${m||2}s`,begin:`${i||0}s`,fill:"freeze"})})]})})});Ln.displayName="Zuz.Chart";var uc=Ln;var Mn=(r=>(r[r.Sending=0]="Sending",r[r.Sent=1]="Sent",r[r.Delivered=2]="Delivered",r[r.Read=3]="Read",r))(Mn||{}),On=(c=>(c.Image="img",c.Video="vid",c.Audio="audio",c.Link="link",c.Document="doc",c.Location="loc",c.Contact="contact",c.Event="event",c.Poll="poll",c))(On||{});var Dn=forwardRef((e,n)=>{let{text:t,media:o,side:r="me",status:s=1,timeStamp:a=Date.now(),arrow:u=true,...f}=e,{className:c,style:m,rest:i}=B(f);return jsx(p,{className:`--bubble-wrapper flex --bw-${r}`.trim(),children:jsxs(p,{className:`--bubble --bubble-${r} ${o?`--with-media --bma-${o.type}`:""} rel flex cols ${u==true?"--b-arrow":""} ${c}`.trim(),style:{...m},...i,children:[t&&jsx(_,{className:"--bubble-text",children:t}),o?o.type=="audio"?jsxs(p,{as:"flex aic --bubble-audio",children:[jsx(ae,{className:"--bm-action",children:M.play}),jsx(Ke,{progress:.7}),jsx(_,{className:"--bm-dur",children:o.duration??"00:13"})]}):o.type=="img"?jsx(p,{as:"--bubble-image",children:jsx(Ue,{src:o.source})}):null:null,jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsx(_,{className:"--bubble-stamp tar",children:timeSince(a)}),r=="me"&&jsx(ae,{className:`--bubble-status --bs-${s}`,children:s==0?M.pending:s==1?M.done:s==2?M.doneAll:M.doneAll})]})]})})});Dn.displayName="Zuz.Bubble";var gc=Dn;var Hn=forwardRef((e,n)=>{let{style:t,className:o,rest:r}=B(e);return jsx("label",{ref:n,style:t,className:o,...r})});Hn.displayName="Zuz.Label";var vt=Hn;var An=forwardRef((e,n)=>{let{name:t,required:o,type:r,value:s,size:a,variant:u,checked:f,onSwitch:c,...m}=e,[i,l]=useState(f||false),g=useRef(null),{variant:T}=j(true);return useImperativeHandle(n,()=>({setChecked(C,b=true){l(C),g.current&&(g.current.checked=C),b&&c&&c(C,s||"cb");},toggle(C=true){g.current&&(g.current.checked=!i),C&&c&&c&&c(!i,s||"cb"),l(!i);}})),jsxs(vt,{className:`--${(r||Le.Default).toLowerCase()} ${!r||r==Le.Default?"--checkbox":"--switch"} --${u||T||U.Small} flex aic jcc ${i?"is-checked":""} rel`.trim(),...m,children:[(!r||r==Le.Default)&&M.check,jsx(ce,{ref:g,defaultChecked:i,value:s||"cb",type:"checkbox",className:"abs",name:t,required:o||false,onChange:C=>{c&&c(C.target.checked,s||"cb"),l(C.target.checked);}})]})});An.displayName="Zuz.CheckBox";var wt=An;var Ic=({ref:e,...n})=>{let{code:t,copy:o,lang:r="tsx",showLines:s=false,highlight:a="",as:u,fx:f,...c}=n,m=useRef(null),{className:i,style:l,rest:g}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:f},m),T=useMemo(()=>{let b=new Set;return a.split(",").forEach(R=>{if(R.includes("-")){let[I,P]=R.split("-").map(Number);for(let d=I;d<=P;d++)b.add(d);}else R&&b.add(Number(R));}),b},[a]),C=useMemo(()=>{let b=t.split(`
|
|
9
|
-
`);for(;
|
|
10
|
-
${s==true?`<span class="--line-number">${
|
|
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
|
+
${s==true?`<span class="--line-number">${x+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${h||" "}</span>
|
|
12
|
-
</div>`}).join("")},[t,T]);return jsxs(p,{as:`--code-block rel ${i}`,style:l,...c,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:C}})}),o&&jsx($,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),o.onCopy?.();},children:"Copy"})]})},Rc=Ic;var $n=({onSelect:e,meta:n,selected:t,disabled:o=false})=>{let r=useRef(null),{index:s,icon:a,label:u}=n,[f,c]=useState({x:0,width:0}),m=useDelayed();return useLayoutEffect(()=>{if(m&&r.current){let{width:i,x:l}=r.current.getBoundingClientRect();c({x:l,width:i}),t&&e(s,i,l,n,true);}},[m,r.current]),useEffect(()=>{t&&e(s,f.width,f.x,n,false);},[t]),jsxs($,{disabled:o,onClick:()=>e(s,f.width,f.x,n,false),ref:r,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,u&&String(u).trim()!=""&&jsx(p,{className:"--segment-label",children:u||`Item ${s}`})]})};$n.displayName="SelectTabItem";var zn=$n;var Fn=forwardRef((e,n)=>{let{fx:t,items:o,selected:r,variant:s,disabled:a=false,onSwitch:u,...f}=e,[c,m]=useState(r||0),i=useDelayed(50),l=useRef(c),{className:g,style:T,rest:C}=B(f),b=useRef(null),R=useRef(null),{variant:I}=j(true),P=(d,v,h,y,N)=>{if((N||c!=d&&c!=-2)&&(m(d),l.current=c,queueMicrotask(()=>{i&&u?.(y);})),b.current){let D=R.current?.getBoundingClientRect();b.current.style.setProperty("--w",`${v}px`),b.current.style.setProperty("--x",`${D?h-D.left:h}px`);}};return useImperativeHandle(n,()=>({setSelected:d=>{typeof d=="number"&&d!=c&&m(d);}}),[c]),jsxs(p,{ref:R,"data-selected":c,className:`${g} --segmented --${s||I||U.Medium} flex aic rel`,style:T,...C,children:[jsx(p,{ref:b,className:`--segment-tab --${a?"disabled":"abled"} abs`}),o.map((d,v)=>jsx(zn,{disabled:a,onSelect:P,selected:c==v,meta:{...d,index:v}},`segment-${d.label}-${v}`))]})});Fn.displayName="Zuz.SelectTabs";var St=Fn;var Wn=forwardRef((e,n)=>{let{type:t,...o}=e,r=useDelayed(),{colorScheme:s,setColorScheme:a}=fo(),u=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:c}=B(o),m=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:M.colorSchemeLight},{tag:"system",index:1,label:"",icon:M.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:M.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:M.colorSchemeLight},{tag:"dark",index:2,label:"",icon:M.colorSchemeDark}],[]),i=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !r||i==-1?null:t=="system"||t=="switch"?jsx(St,{className:`--color-scheme --${t}`,onSwitch:({tag:l})=>{a(l);},selected:i,items:m,...o}):jsx($,{onClick:u,style:c,as:`--color-scheme-switch --${o.variant||U.Small} ${f}`.trim(),children:s=="system"?M.colorSchemeSystem:s=="light"?M.colorSchemeLight:M.colorSchemeDark})});Wn.displayName="Zuz.ColorScheme";var Zc=Wn;var Un=forwardRef((e,n)=>{let[t,o]=useState("wait"),{title:r,message:s,acceptLabel:a,rejectLabel:u,position:f}=e,c=async m=>{o(m==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(m));};return useEffect(()=>{let m=localStorage.getItem("--ccnt");o(m?m=="1"?"accepted":"rejected":"pending");},[]),jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:Y.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${f||pe.Left} flex cols`,children:[jsx(_,{as:"--title",children:r||"This site uses cookies"}),jsx(_,{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:m=>c(1),as:"--accept",children:a||"Accept All"}),jsx($,{onClick:m=>c(0),as:"--reject",children:u||"Cancel"})]})]})});Un.displayName="Zuz.CookiesConsent";var Uc=Un;var Yn=({ref:e,...n})=>{let {title:t,position:o,margin:r=4,anchorName:s="--tooltip-anchor",children:a,show:u,variant:f,...c}=n,{style:m,className:i,rest:l}=B(c),g=o||pe.Top;useRef(null);let [C,b]=useState(false);useRef(6);let I=u===true||C,d=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:v}=j(true),h=useMemo(()=>{let N=false;return addPropsToChildren(a,D=>{let k=D.props.className?.includes(s);return k&&(N=true),k||!N},(D,k)=>{let V=k.props.className?.includes(s),E=D===0,H={};return (V||E)&&(H.style={...k.props.style,anchorName:d}),E&&(H.onMouseEnter=z=>{b(true),k.props.onMouseEnter?.(z);},H.onMouseLeave=z=>{b(false),k.props.onMouseLeave?.(z);}),H})},[a,s,d]),y=ue({transition:g==pe.Top?X.SlideInTop:g==pe.Bottom?X.SlideInBottom:g==pe.Left?X.SlideInLeft:X.SlideInRight,when:I,duration:.2,offset:r+6,margin:g==pe.Top||g==pe.Left?-r:r,curve:v?.curve||Y.EaseInOut});return useImperativeHandle(e,()=>({show:()=>b(true),hide:()=>b(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[h,jsx(p,{style:{positionAnchor:d,...y.style,...g===pe.Top||g===pe.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${I} --${f||v?.variant||U.Small} --${g} abs ${i}`.trim(),children:typeof t=="string"?jsx(_,{as:"--text rel",children:t}):t})]})};Yn.displayName="Zuz.ToolTip";var Fo=Yn;var jn=({ref:e,...n})=>{let {type:t,value:o=0,min:r=0,max:s=1,step:a=.01,onChange:u,showGhostBar:f,showKnobOnHover:c,showToolTip:m,roundValue:i,formatValue:l,...g}=n,{className:T,style:C,rest:b}=B(g),R=useRef(a||.01).current,I=useRef(r||0).current,P=useRef(s||1).current,d=useRef(o||0).current,v=useRef(null),h=useRef(null),y=useRef(null),N=useRef(null);useRef(null);let k=useRef(null),V=useRef(null),E=useRef(null),H=useRef(null),z=(se,le,we)=>(se-le)/(we-le)*100,W=se=>{if(h.current){let le=parseFloat(se.currentTarget.value);Q(le);let we=z(le,parseFloat(se.currentTarget.min),parseFloat(se.currentTarget.max));h.current.style.setProperty("--value",`${we}`),h.current.setAttribute("data-value",`${le}`),u&&u(i?+le.toFixed(2):le);}},[x,L]=useState(false),[Z,G]=useState(0),[F,K]=useState(0),[oe,ee]=useState(false),Q=async se=>{let le=l?l(+se):i?(+se).toFixed(2):Math.round(+se);E.current&&(E.current.textContent=String(le));},ie=se=>{if(x){let le=se.clientX-Z,we=P-I,Re=le/200*we,ge=Math.max(I,Math.min(F+Re,P));if(ge=Math.round(ge/R)*R,Q(ge),h.current){let ct=z(ge,I,P);h.current.style.setProperty("--value",`${ct}`),h.current.setAttribute("data-value",`${ge}`),V.current&&(V.current.textContent=i?ge.toFixed(2):ge.toString()),u&&u(ge);}}},A=()=>{L(false),document.body.style.cursor="auto";},q=se=>(se-I)/(P-I)*100,ne=se=>{if(!h.current)return;let le=h.current.getBoundingClientRect(),we=se.clientX-le.left,lt=Math.max(0,Math.min(100,we/le.width*100));if(m&&E.current){let Re=v.current?+v.current.value:o;Q(Re*100);}if(f){let Re=q(v.current?+v.current.value:o),ge=Math.min(Re,lt),ct=Math.abs(lt-Re);h.current.style.setProperty("--ghost-start",`${ge}`),h.current.style.setProperty("--ghost-width",`${ct}`);}};useEffect(()=>{h.current&&h.current.style.setProperty("--value",v.current?`${z(parseFloat(v.current.value),parseFloat(v.current.min),parseFloat(v.current.max))}`:d.toString());},[]),useEffect(()=>(x?(document.addEventListener("mousemove",ie),document.addEventListener("mouseup",A)):(document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",A);}),[x]),useEffect(()=>{let se=z(o,I,P);h.current?.style.setProperty("--value",`${se}`),Q(o);},[o,I,P,E.current]);let te=()=>jsxs(p,{ref:h,onMouseEnter:()=>ee(true),onMouseLeave:()=>ee(false),onMouseMove:ne,className:`--slider --${t||ao.Default} ${c?"--knob-hover":""} flex rel ${T}`.trim(),style:{...C},children:[jsx(p,{ref:k,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(ce,{ref:v,onInput:W,className:"abs fill",tabIndex:0,type:t||ao.Default,defaultValue:d||0,step:R,max:P,min:I})]});if(m===true){let se=l?l(o):i?o.toFixed(2):o;return jsx(Fo,{ref:H,show:x,position:mt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(ae,{ref:E,children:se}),children:te()})}return te()};jn.displayName="Zuz.Slider";var Je=jn;var Jn=forwardRef((e,n)=>{let{src:t,shape:o,size:r,...s}=e,{style:a,className:u,rest:f}=B(s),{canvasRef:c,crop:m,setScale:i,handleMouseDown:l,handleMouseUp:g,handleMouseMove:T}=useImageCropper(t,r||200,o||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return m()},setScale(C){i(C);}})),jsxs(p,{as:`--cropper --${o||CropShape.Circle} ${u}`,style:a,...f,children:[jsx("canvas",{ref:c,width:r||200,height:r||200,onMouseDown:l,onMouseUp:g,onMouseLeave:g,onMouseMove:T}),jsx(p,{as:"--cropper-slider",children:jsx(Je,{onChange:C=>i(C),min:0,max:1,step:.01,value:1})})]})});Jn.displayName="Zuz.Cropper";var sm=Jn;var im=(t=>(t.Circle="circle",t.Square="square",t))(im||{});var ts=forwardRef((e,n)=>{let{items:t,maxItems:o}=e,r=useMemo(()=>{let u=typeof t=="string",f=u?[]:t;return u&&t.split(",").forEach(c=>{f.push({label:c});}),f},[t]),a=useMemo(()=>o&&o>0&&r.length>o-1,[r,o])?[...r.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...r.slice(-o)]:r;return jsx(Ge,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(p,{as:"--crumb-chevron",children:M.chevronRightOutline}),items:a.map((u,f,c)=>u.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:()=>u.action?.(),className:"--crumb-item",disabled:!c[f+1],children:[u.icon&&jsx(J,{as:"--crumb-icon",name:u.icon}),jsx(_,{as:"--crumb-label",children:u.label})]},`${u.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});ts.displayName="Zuz.Crumb";var cm=ts;var ns=forwardRef((e,n)=>{let{icon:t,defaultValue:o,value:r,size:s,variant:a,numeric:u,type:f,onConfirm:c,...m}=e,[i,l]=useState(false),[g,T]=useState(o||null),{style:C,className:b,rest:R}=B(m),I=useRef(null),P=useRef(null),{reposition:d}=ht(P,{direction:pe.Bottom,offset:2}),v=y=>{u&&(y.currentTarget.value=y.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let y=N=>{let D=N.target,k=I.current?.contains(D),V=P.current?.contains(D);!k&&!V&&l(false);};return i&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[i]),useEffect(()=>{let y=N=>{N.key==="Escape"&&i&&(l(false),I.current?.focus());};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[i]);let h=()=>{l(true);};return useEffect(()=>{i&&d();},[i,d]),jsx(Fragment$1,{children:jsxs(p,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${b}`,"data-value":g?g.toISOString():"",children:[t?typeof t=="string"?jsx(J,{as:"mr:10 c:#666",name:t}):t:jsx(ae,{as:"--date-picker-icon flex aic jcc",children:M.calendar}),jsx("input",{ref:I,value:g?format(g,"EEE, MMM d YYY hh:mm a"):r||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:C,onFocus:h,onInput:v,autoComplete:"new-password",onKeyDown:y=>{y.key=="Enter"&&c?.(y.currentTarget.value);},...R}),jsx(p,{"aria-hidden":!i,ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:i,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(Oo,{defaultValue:g,onChange:y=>{T(y),l(false);}})})]})})});ns.displayName="Zuz.DatePicker";var fm=ns;var ss=forwardRef((e,n)=>{let{icon:t,variant:o,position:r}=e;return jsx($,{className:`--fab fixed --${o||U.Large} --${r||"bottomright"}`,children:t||M.plus})});ss.displayName="Zuz.Fab";var ym=ss;var as=e=>{let{names:n,strength:t}=e,o={[Bt.Gooey]:r=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:r||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(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[Bt.Gooey]).map(r=>o[r](t))})})};as.displayName="Zuz.Filters";var vm=as;var is=({cols:e,gap:n,ais:t,aic:o,aie:r,jcs:s,jcc:a,jce:u,className:f="",style:c,...m})=>{let i=["--flex",e?"--cols":"",t?"--ais":"",o?"--aic":"",r?"--aie":"",s?"--jcs":"",a?"--jcc":"",u?"--jce":"",f].filter(Boolean).join(" "),l={...c,gap:typeof n=="number"?`${n}px`:n};return jsx(p,{...m,className:i,style:l})};is.displayName="Zuz.FlexBox";var Ve=is;var $e=null,be=null,cs=forwardRef((e,n)=>{let{title:t,message:o,transition:r,curve:s,speed:a,type:u,actionPosition:f,spinner:c,loadingMessage:m,onShow:i,onHide:l,...g}=e,{className:T,style:C,rest:b}=B(g),[R,I]=useState(t||""),[P,d]=useState(o||""),[v,h]=useState(null),[y,N]=useState(u||Ce.Default),D=useMemo(()=>uuid(12),[]),[k,V]=useState(false),E=useRef(null),H=useRef(null),[z,W]=useState(false),[x,L]=useState(true),Z=useRef(null),G=P;useImperativeHandle(n,()=>({setLoading(K){W(K);},showDialog(K,oe,ee,Q){$e&&(clearTimeout($e),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),oe&&d(oe),K&&I(K),ee&&h(ee.reduce((de,ie)=>(de.push({...ie,key:ie.key||uuid(12)}),de),[])),V(true),setTimeout(()=>Q?Q():()=>{},1e3);},dialog(K,oe,ee,Q){$e&&(clearTimeout($e),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),d(oe),I(K),ee&&h(ee.reduce((de,ie)=>(de.push({...ie,key:ie.key||uuid(12)}),de),[])),V(true),setTimeout(()=>Q?Q():()=>{},1e3);},error(K,oe){this.show(K,oe,Ce.Error);},warn(K,oe){this.show(K,oe,Ce.Warn);},success(K,oe){this.show(K,oe,Ce.Success);},show(K,oe,ee){$e&&(clearTimeout($e),be&&clearTimeout(be),H.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${H.current} scale(.9)`.trim();},50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=H.current||"",be=null;},500)),$e=setTimeout(()=>{V(false),$e=null,be=null;},(oe||4)*1e3),N(ee||Ce.Default),d(K),V(true),i?.();},hide(){V(false),l?.();}}));let F=useMemo(()=>{let K={when:k,duration:a||.3,delay:.1};if(y==Ce.Dialog){if(r){let{from:oe,to:ee}=ut(r,20);return {from:oe,to:ee,curve:s||Y.EaseInOut,...K}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Y.Spring,...K}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Y.Spring,...K}},[k,y]);return useEffect(()=>{Z.current&&clearTimeout(Z.current),k?L(true):Z.current=setTimeout(()=>L(false),1e3);},[k]),y==Ce.Dialog?jsxs(Fragment$1,{children:[jsx(Fe,{when:k}),jsxs(p,{className:`--sheet --sheet-${y.toLowerCase()} ${k?"is-visible":""} ${T} fixed`.trim(),style:C,fx:F,...b,ref:E,children:[jsx(Ne,{when:z,spinner:c,message:m}),jsxs(p,{className:"--head flex aic rel",children:[jsx(p,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx($,{onClick:K=>V(false),className:"--closer abs",children:"\xD7"})]}),jsx(p,{className:`--body flex aic rel ${v?"":"--no-action"}`.trim(),children:x?G:null}),v&&jsx(p,{className:`--footer flex aic rel ${f?f==so.Center?"jcc":"":"jce"}`.trim(),children:v.map((K,oe)=>jsx($,{onClick:ee=>K.handler?K.handler():K.onClick?K.onClick():console.log("onClick Handler missing"),className:"--action",children:K.label},`sheet-${D}-action-${K.key}`))})]})]}):jsx(p,{className:`--sheet --sheet-${y.toLowerCase()} ${T} abs`.trim(),style:C,...b,fx:F,ref:E,children:k?P:null})}),Tt=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;cs.displayName="Zuz.Sheet";var Im=cs;var ms=({ref:e,...n})=>{let{name:t,cover:o,spinner:r,errors:s,action:a,children:u,withData:f,beforeSubmit:c,onSubmit:m,onError:i,onSuccess:l,resetOnSuccess:g,...T}=n,{className:C,style:b,rest:R}=B(T),[I,P]=useState(false),d=useRef(null),v=useRef(null),h=useRef(null),y=Ro(),N=useCallback(x=>d.current?d.current.querySelectorAll(x):[],[d.current]),D=x=>({name:x.name||x.getAttribute("name")||x.getAttribute("data-name"),required:x.required?true:x.getAttribute("data-required")?x.getAttribute("data-required")=="true":false,with:x.with||x.getAttribute("with")}),k=x=>{let L=[];return x.querySelectorAll(".--input").forEach(Z=>{L.push(Z.value);}),L.join("")},V=useCallback(x=>{let{required:Z}=D(x);if(Z){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let F=k(x);if(F==""||F.length<parseInt(x.getAttribute("data-size")))return false}if(x.classList.contains("--select")&&x.querySelector("button.--selected").dataset.value=="-1"||x.value=="")return false}if(x.getAttribute("with")){let F=x.getAttribute("with");switch(F.includes("@")&&(F=F.split("@")[0],F=="match"&&(F=Me.MatchField)),F.toUpperCase()){case Me.IPV4:return _$1(x.value).isIPv4();case Me.IPV6:return _$1(x.value).isIPv6();case Me.Email:return _$1(x.value).isEmail();case Me.Uri:try{return new URL(x.value),!0}catch{return false}case Me.Password:return console.log("Add FORMVALIDATION.Password"),false;case Me.MatchField:let[K,oe,ee]=x.getAttribute("with").split("@"),Q=document.querySelector(`[name=${oe.trim()}]`);if(!Q)return false;switch(ee||"direct-match"){case "if-not-empty":if(Q&&!_$1(Q.value).isEmpty()&&Q.value!=x.value)return false;break;case "direct-match":if(Q&&Q.classList.contains("--otp")&&x.classList.contains("--otp")&&k(Q)!=k(x))return false;if(Q&&Q.value!=x.value)return false;break}break;default:return true}}return true},[d.current]),E=useCallback(()=>{let x={},L={},Z=null,G=null;if(Array.from(N("[name]")).forEach(F=>{let{name:K,required:oe,with:ee}=D(F),Q=true;(oe||ee)&&(Q=V(F)),x[K]={valid:Q,value:F.type=="checkbox"?F.checked==true?F.value:false:F.classList.contains("--otp")?k(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value},L[K]=F.type=="checkbox"?F.checked==true:F.classList.contains("--otp")?k(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value,Q?F.classList.remove("input-with-error"):(Z==null&&s&&(Z=F,G=s[K]),F.classList.add("input-with-error"));}),Z){let F=Z;if(F.classList.contains("--otp"))for(let K of Array.from(F.querySelectorAll(".--input"))){let oe=K;if(oe.value==""){oe.focus();break}}else F.focus();}return {error:Z!=null,errorMsg:G||"Fix errors to continue...",data:x,payload:L}},[d.current]),H=useCallback(()=>{let{error:x,errorMsg:L,payload:Z}=E();x?y.error(L):a?startTransition(async()=>{c&&c(Z),Tt(o)?o.setLoading(true):P(true),y.clearAll(),withPost(a,{...Z,...f||{}}).then(G=>{let F=G;Tt(o)?o.setLoading(false):P(false),g&&Array.from(N("[name]")).forEach(K=>{K instanceof HTMLInputElement&&(K.value="");}),l?l(F):(y.clearAll(),y.success(F.message||"Redirecting..."));}).catch(G=>{Tt(o)?o.setLoading(false):P(false),i?i(G):y.error(G.message||"We cannot process your request at this time.");});}):m&&m(Z);},[a,v.current,d.current]),z=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(L=>{L.addEventListener("click",H);});},[d.current]),W=useMemo(()=>addPropsToChildren(u,x=>x.props.type=="submit",x=>({ref:h})),[u]);return useImperativeHandle(e,()=>({setLoading(x){if(x){v.current?.hide();try{y.clearAll();}catch{}}P(x);},showError(x){typeof x=="string"?y.error(x):v.current.error(x,4);},hideError(){v.current.hide();try{y.clearAll();}catch{}},init(){z();},submit(){H();}})),useEffect(z,[]),jsxs(p,{ref:d,style:b,className:`--form flex rel ${C} ${t?`--form-${t.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!Tt(o)&&jsx(Ne,{message:o?o.message||void 0:"working",spinner:r,color:o&&"color"in o?o.color:"#ffffff",when:I}),W]})};ms.displayName="Zuz.Form";var Dm=ms;var ps=e=>{let {ref:n,cols:t,rows:o,gap:r,gapX:s,gapY:a,align:u,justify:f,inline:c,flow:m,autoCols:i,autoRows:l,template:g,...T}=e;useRef(null);let {className:b,style:R,rest:I}=B(T),P=v=>typeof v=="number"?`repeat(${v}, 1fr)`:v,d={display:c?"inline-grid":"grid",gridTemplateColumns:P(t),gridTemplateRows:P(o),gap:r,columnGap:s,rowGap:a,alignItems:u,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:m,gridAutoColumns:i,gridAutoRows:l,gridTemplateAreas:g,...R};return jsx(p,{ref:n,as:`--grid ${b}`.trim(),style:d,...I})};ps.displayName="Zuz.Grid";var $m=ps;var us=e=>typeof e=="string"&&e.includes("+"),fs={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"},ds={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 hs=forwardRef(({children:e,keys:n,as:t,className:o,variant:r},s)=>{let{variant:a}=j(true),u=useMemo(()=>{if(us(n)){let f=null;return {keys:String(n).split("+").reduce((m,i,l,g)=>(g[l+1]?m.push(i):f=i.toUpperCase(),m),[]),children:f}}return {keys:n,children:String(e).toUpperCase()}},[n]);return jsxs(p,{as:`--keyboard-keys --${r||a||U.Small} flex aic ${t} ${o}`.trim(),children:[(Array.isArray(u.keys)?u.keys:[u.keys]).map(f=>jsx("abbr",{title:ds[f],children:fs[f]},f)),jsx(ae,{children:u?.children??e})]})});hs.displayName="Zuz.KeyboardKeys";var Yo=hs;var bs=createContext(null),ot=()=>{let e=useContext(bs);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},Um=({ref:e,icons:n,children:t,...o})=>{let{playlist:r=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:u="No Track",defaultCover:f,onTrackChange:c,...m}=o,{className:i,style:l,rest:g}=B(m),T=useMediaPlayer(r,r[0]??void 0),C=useMemo(()=>({play:M.play,pause:M.pause,prev:M.prev,next:M.next,volumeHigh:M.volumeHigh,volumeMute:M.volumeMute,...n}),[n]),b=useMemo(()=>({...T,mode:s,icons:C}),[T,C]);return jsx(bs.Provider,{value:b,children:jsx(p,{className:`--zuz-media-player ${i}`,style:l,children:t})})},vs=Um;var ws=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")}`},Yt=e=>typeof e=="string"?jsx(J,{name:e}):e,Ss=()=>{let{mediaRef:e,state:n,controls:t,mode:o}=ot();return jsxs(p,{as:`--mediaplayer-stage rel --mode-${o}`,children:[o==="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,{})})]})},Cs=()=>{let{state:e,defaultArtist:n,defaultTitle:t,defaultCover:o}=ot();return jsxs(p,{as:"--track-info flex aic",children:[jsx(Ue,{src:e.currentItem?.cover||o||"",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||"..."})]})]})},Ts=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(p,{as:"--mediaplayer-controls flex aic",children:[jsx($,{onClick:n.prev,as:"--prev",children:Yt(t?.prev??M.prev)}),jsx($,{onClick:n.togglePlay,as:"--play-pause",children:Yt(e.isPlaying?t?.pause??M.pause:t?.play??M.play)}),jsx($,{onClick:n.next,as:"--next",children:Yt(t?.next??M.next)})]})},Ps=()=>{let{state:e,controls:n,mediaRef:t}=ot(),o=e.progress*(e.duration||0);return jsxs(p,{as:"--track-progress flex aic",children:[jsx(p,{as:"--track-current-duration",children:ws(o)}),jsx(Je,{value:e.progress,onClick:r=>{let s=r.currentTarget.getBoundingClientRect(),a=(r.clientX-s.left)/s.width;n.seek(a);}}),jsx(p,{as:"--track-total-duration",children:ws(e.duration)})]})},Is=()=>{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:Yt(e.isMuted?t?.volumeMute??M.volumeMute:t?.volumeHigh??M.volumeHigh)}),jsx(Je,{value:e.volume,className:"h:3 flex:1",onClick:o=>{let r=o.currentTarget.getBoundingClientRect();n.setVolume((o.clientX-r.left)/r.width);}})]})};var qm=({ref:e,...n})=>jsx(vs,{...n,ref:e}),Xm=Object.assign(qm,{Stage:Ss,TrackInfo:Cs,Controls:Ts,Progress:Ps,Volume:Is}),Ym=Xm;var Ns=forwardRef((e,n)=>{let t=useNetworkStatus(),{onlineMessage:o,offlineMessage:r,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:Y.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||U.Small} fixed flex`,children:[jsx(p,{className:"--ico",children:t?M[Se.Success]:M[Se.Error]}),jsx(_,{as:"--message",children:t?o||"internet connection restored :)":r||"no internet connection"})]})});Ns.displayName="Zuz.NetWorkManager";var ep=Ns;var Es=forwardRef((e,n)=>{let{strenthMeter:t,onChange:o,...r}=e;"type"in r&&delete r.type;let{style:s,className:a,rest:u}=B(r),[f,c]=useState(false),[m,i]=useState(""),l=useMemo(()=>checkPasswordStrength(m),[m]),g=useDebounce(T=>{t&&i(T.target.value),o&&o(T);},100);return useEffect(()=>{},[]),jsxs(p,{as:"w:100% flex cols",children:[jsxs(p,{style:s,className:"--password flex aic rel",children:[jsx(ce,{ref:n,type:f?"text":"password",className:a,onChange:g,...u}),jsx($,{tabIndex:-1,onClick:()=>c(T=>!T),className:"--toggle flex aic jcc abs",children:f?M.eye:M.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(_,{as:"--password-meter-label","aria-hidden":true,children:l.result})]})]})});Es.displayName="Zuz.Password";var ip=Es;var Ls=forwardRef((e,n)=>{let{size:t,length:o,mask:r,...s}=e,a=useRef([]),u="pinput",f=false,c={};"with"in s&&(c={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(u=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:m}=B(s),i=l=>{let g=l.currentTarget,T=a.current[parseInt(g.dataset.index)+1],C=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&T?T.focus():g.value.length===0&&C&&C.focus();};return useEffect(()=>{a.current=a.current.slice(0,t||o);},[t||o]),jsx(p,{name:u,style:m,className:"--otp flex aic rel","data-required":f,"data-size":t||o||4,...c,children:Array(t||o||4).fill(1).map((l,g)=>jsx(ce,{autoComplete:"new-password","data-index":g,ref:T=>{a.current[g]=T;},numeric:true,onChange:i,maxLength:1,placeholder:r?"\xB7":"0",type:r?"password":"text",...s},`pin-${g}`))})});Ls.displayName="Zuz.PinInput";var pp=Ls;var Ms=forwardRef((e,n)=>{let{children:t,className:o,name:r,required:s,type:a,value:u,variant:f,checked:c,onSwitch:m,...i}=e,[l,g]=useState(c||false),{variant:T}=j(true),C=useRef(null);return jsxs(vt,{className:`${o} --${(a||io.Default).toLowerCase()} --radio${!a||a==io.Default?"":"card"} --${f||T||U.Small} flex aic rel`.trim(),...i,children:[jsx(ce,{ref:C,defaultChecked:l,value:u||"rd",type:"radio",className:"abs",name:r,required:s||false,onChange:b=>{m&&m(b.target.checked,u||"cb"),g(b.target.checked);}}),jsx(p,{className:"--dot rel",children:jsx(p,{className:"--rod abs abc"})}),jsx(p,{className:"--value",children:t})]})});Ms.displayName="Zuz.Radio";var gp=Ms;var Os=forwardRef((e,n)=>{let{fx:t,withStyle:o,as:r,reverse:s=false,searchIcon:a=M.search,hideSearchIcon:u=false,clearIcon:f=M.close,hideClearIcon:c=false,onChange:m,onClear:i,...l}=e,{style:g,className:T}=B({as:e.as}),[C,b]=useState(""),{variant:R}=j(true),I=useRef(null);"type"in e&&delete e.type;let P=v=>{b(v.target.value),m?.(v.target.value);},d=v=>{C.trim()!==""&&(b(""),m?.(""),I.current&&(I.current.value="",e.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>I.current?.focus(),value:()=>I.current?.value})),useEffect(()=>{},[]),jsxs(p,{style:g,className:`--search ${s?"--search-rev":""} --${e.variant||R||U.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[jsx(ce,{ref:I,onChange:P,...l}),e.shortcut&&jsx(Yo,{keys:e.shortcut,as:"abs"}),jsx($,{tabIndex:-1,onClick:v=>d(),className:"--send flex aic jcc",variant:e.variant||U.Medium,children:C!==""?!c&&(typeof f=="string"?jsx(J,{name:f,as:"--search-action"}):f):!u&&(typeof a=="string"?jsx(J,{name:a,as:"--search-action"}):a)})]})});Os.displayName="Zuz.Search";var Sp=Os;var Hs=({checkIcon:e,selected:n,updateValue:t,o})=>{let r=e?typeof e=="string"?jsx(J,{name:"checkIcon"}):e:M.check,s=o.disabled===true;return jsxs($,{onClick:a=>{s||(a.stopPropagation(),t(o));},disabled:s,as:`--select-option-item --no-shrink ${n?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ve,{as:"--option-item-meta --aic",children:[o.icon&&jsx(J,{name:o.icon,as:`--select-option-icon --icon-${o.value}`,color:o.iconColor}),jsx(_,{suppressHydrationWarning:true,children:typeof o=="string"?o:o.label})]}),n&&jsx(Ve,{aic:true,jcc:true,as:"--select-option-check --abs",children:r})]})};Hs.displayName="Option";var As=Hs;var zs=({ref:e,...n})=>{let{selected:t,options:o,label:r,name:s,variant:a,search:u,searchPlaceholder:f,maxHeight:c,arrowDownIcon:m=M.arrowDown,arrowUpIcon:i=M.arrowUp,expanded:l,multiple:g,tokenizer:T,wrapTokens:C,disabled:b,checkIcon:R,closeIcon:I,onChange:P,...d}=n,[v,h]=useState(()=>g||T?t?(Array.isArray(t)?t:[t]).map(q=>typeof q=="string"?o.find(ne=>ne.value===q):q):[]:t?typeof t=="string"?o.find(A=>A.value===t):t:o[0]),[y,N]=useState(false),[D,k]=useState(null),V=useRef(null),E=useRef(null),H=useRef(null),z=useId(),W=useMemo(()=>s||z,[]),{reposition:x}=ht(H,{direction:mt.Bottom,offset:2}),{variant:L}=j(true),Z=I?typeof I=="string"?jsx(J,{name:I}):I:M.close,{className:G,style:F,rest:K}=B(d,void 0),oe=A=>Array.isArray(v)?v.some(q=>q.value===A.value):v?.value===A.value,ee=A=>{if(!(b||A.disabled))if(g||T){let q=Array.isArray(v)?v:[],re=q.find(te=>te.value===A.value)?q.filter(te=>te.value!==A.value):[...q,A];h(re),P?.(re);}else h(A),N(false),P?.(A);},Q=(A,q)=>{if(A.stopPropagation(),b)return;let ne=v.filter(re=>re.value!==q.value);h(ne),N(false),P?.(ne);},de=A=>{let q=A.currentTarget,ne=q.scrollTop===0&&A.deltaY<0,re=q.scrollHeight-q.scrollTop===q.clientHeight&&A.deltaY>0;!ne&&!re||A.preventDefault(),A.stopPropagation();};useImperativeHandle(e,()=>({setSelected:A=>{if(Array.isArray(A)){let q=A.map(ne=>typeof ne=="string"?o.find(re=>re.value===ne):ne).filter(Boolean);h(q);}else if(typeof A=="string"){let q=o.find(ne=>ne.value===A);q&&h(q);}else h(A);},getValue:()=>v||null}),[v,o]),useEffect(()=>{if(!y)return;let A=()=>{x();};return window.addEventListener("scroll",A,true),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,true),window.removeEventListener("resize",x);}},[y,x]),useEffect(()=>{if(!y){E.current&&(E.current.value=""),k(null);return}E.current?.focus(),x();let A=ne=>{H.current&&!H.current.contains(ne.target)&&N(false);},q=setTimeout(()=>{document.addEventListener("click",A);},0);return ()=>{clearTimeout(q),document.removeEventListener("click",A);}},[y,x]);let ie=useMemo(()=>_$1(v).isArray()?v.length>0?v[0]:void 0:v,[v]);return jsxs(p,{className:`--select ${l==true?"--expanded":""} --${a||L} ${s?`--${s}`:""} ${b?"--disabled":""} rel`.trim(),name:W,children:[jsxs($,{ref:V,disabled:b,"data-value":ie?.value??"-1",className:`--select-display --selected flex aic rel ${G}`.trim(),withLabel:false,style:F,onClick:A=>{A.stopPropagation(),b||N(q=>!q);},...K,children:[ie?.icon&&jsx(J,{as:"--selected-icon",name:ie.icon}),jsx(Ve,{aic:true,as:"--label-wrapper",children:T&&Array.isArray(v)&&v.length>0?jsxs(Ve,{as:`--tokens-wrap${C===true?" --wrap":""}`,children:[v.map(A=>jsxs(Ve,{aic:true,as:"--token",children:[jsx(_,{as:"--token-label",children:A.label}),jsx(p,{as:"--token-remove",onClick:q=>Q(q,A),children:Z})]},A.value)),v.length<o.length&&jsx(_,{as:"--label",children:r||"Choose"})]}):jsx(_,{as:"--label",children:Array.isArray(v)?v.length>0?`${v.length} selected`:r||"Choose":v?.label||r||"Choose"})}),jsx(p,{className:"--svg-arrow rel flex aic jcc",children:y?typeof i=="string"?jsx(J,{name:i,as:"--search-action"}):i:typeof m=="string"?jsx(J,{name:m,as:"--search-action"}):m})]}),jsxs(p,{id:W,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!y,onWheel:de,style:{maxHeight:c||"auto"},ref:H,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:y,duration:.05},children:[u&&jsx(p,{as:"--select-search --sticky",children:jsx(ce,{ref:E,onChange:A=>{k(A.target.value==""?null:A.target.value);},className:"--search-input",placeholder:f||"Search..."})}),o.filter(A=>!D||A.label.toLowerCase().includes(D.toLowerCase())).map(A=>jsx(As,{updateValue:ee,checkIcon:R,selected:oe(A),o:A},`option-${(typeof A=="string"?A:A.label).replace(/\s+/g,"-")}-${typeof A=="string"?A:A.value}`))]})]})};zs.displayName="Zuz.Select";var Rp=zs;var _s=forwardRef((e,n)=>jsx(wt,{type:Le.Switch,...e,ref:n}));_s.displayName="Zuz.Switch";var Bp=_s;var Zs=e=>{let{idx:n,id:t,as:o,weight:r,style:s,value:a,render:u,resize:f,sortBy:c,sortable:m,onSort:i}=e,[l,g]=useState(0),T=()=>{m&&(i?.(String(t),l==1?-1:1),g(C=>C==1?-1:1));};return jsxs(p,{style:{flex:r||1,...s},as:`--col flex aic ${o||""} ${m?"--sortable":""}`,onClick:T,children:[jsx(p,{children:a}),n==-1&&m&&c==t&&jsx(p,{as:"--arrow flex aib",children:l==1?M.arrowUp:M.arrowDown})]})};Zs.displayName="Zuz.Column";var eo=Zs;var Ws=e=>{let{index:n,pubsub:t,schema:o,data:r,ids:s,styles:a,animate:u,sortBy:f,selectable:c,tableRef:m,loading:i,rowClassName:l,onSort:g,onRowClick:T,onSelect:C,onContextMenu:b}=e,R=useDelayed(),I=useMemo(()=>({transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(n+1)}),[]),P=useRef(null),d=(h,y)=>{n==-1?t.emit(`ALL_ROWS_${h?"CHECKED":"UNCHECKED"}`,h):(C&&C(r,h),t.emit(`ROW_${h?"CHECKED":"UNCHECKED"}`,h,y));},v=(h,y,N)=>jsx(eo,{idx:h,id:y,as:"--selector",pubsub:t,value:jsx(wt,{value:N,ref:P,onSwitch:d,type:Le.Default})});return useEffect(()=>{let h=(k,V)=>{P.current?.setChecked(k,false);},y=(k,V)=>{let E=false;m?.current&&m.current.querySelectorAll(".--row").forEach(H=>{let z=H;if(!z.classList.contains("--row-head")){let W=z.querySelector(".--selector input[type=checkbox]");W&&W.checked&&!E&&(E=W.checked);}}),P.current.setChecked(E,false);},N=k=>{P.current?.setChecked(k,false),C&&C(r,k);},D=k=>{P.current?.setChecked(k,false),C&&C(r,k);};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,r):null,onClick:h=>T?T(h,e.data):()=>{},...u?{fx:{...I,when:R}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${n==-1?"--row-head":""} ${l||""}`,children:[n==-1&&o.map((h,y)=>{let{renderWhenHeader:N,render:D,value:k,...V}=h;return jsxs(Fragment,{children:[c&&y==0&&v(-1,`--selector-${h.id}`,"all"),jsx(eo,{idx:-1,onSort:g,sortBy:f,value:k,...V,pubsub:t,style:a[h.id]})]},`--col-${h.id}`)}),i&&n>-1&&jsx(p,{as:"--col",children:jsx(_,{as:"opacity:0",children:"..."})}),!i&&n>-1&&s&&r&&o.map((h,y)=>jsxs(Fragment,{children:[c&&y==0&&v(y,`--selector-${h.id}`,h.id.toString()),s.includes(String(h.id))?jsx(eo,{pubsub:t,idx:y,id:String(h.id),style:a[String(h.id)],value:h.render?h.render(r,n):r[String(h.id).includes(".")?String(h.id).split(".").reverse()[0]:h.id]}):null]},`--${String(h.id)}-val-${y}`))]})};Ws.displayName="Zuz.Row";var to=Ws;var Xs=(e,n)=>{let{schema:t,rows:o,rowCount:r,rowsPerPage:s,currentPage:a,pagination:u,paginationHash:f,showPaginationOnZeroPageCount:c,animateRows:m,header:i,rowClassName:l,selectableRows:g,hoverable:T,sortBy:C,loading:b,loadingRowCount:R,loadingMessage:I,spinner:P,emptyMessage:d,onSort:v,onRowClick:h,onRowSelectToggle:y,onPageChange:N,onRowContextMenu:D,...k}=e,V=useRef(null),E=useMemo(()=>t.reduce((re,te)=>(re[te.id]={flex:te.weight||1,...te.w&&{width:te.w},...te.maxW&&{maxWidth:te.maxW},...te.minW&&{minWidth:te.minW},...te.h&&{height:te.h},...te.maxH&&{maxHeight:te.maxH},...te.minH&&{minHeight:te.minH}},re),{}),[t]),H=useMemo(()=>Object.keys(E),[t]),z=useMemo(()=>i??true,[i]),{style:W,className:x,rest:L}=B(k),Z=useRef(null),G=useMemo(()=>new PubSub,[]),F=useRef(o.map(()=>uuid(8))),[K,oe]=useState(C||null),[ee,Q]=useState(I||"loading"),de=useMemo(()=>!b&&o&&o.length==0,[b,o]),ie=useCallback(()=>d?typeof d=="function"?jsx(d,{}):d:jsx(_,{as:"tac s:18 mt:75",children:"No Record Found"}),[b,o]);useEffect(()=>{F.current=o.map(()=>uuid(8));},[o]);let A=(re,te)=>{oe(re),v?.(re,te);},q=(r||(o?o.length:0))/(s||10),ne=useMemo(()=>c||q>1?jsx(bt,{hash:f,ref:V,renderOnZeroPageCount:c,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:r||(o?o.length:0),itemsPerPage:s||10}):null,[a,r]);return useImperativeHandle(n,()=>({setLoading(re){}})),jsxs(p,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${x}`,ref:Z,children:[z==true&&jsx(to,{sortBy:K,onSort:A,tableRef:Z,pubsub:G,selectable:g,index:-1,schema:t,loading:true,styles:E}),b&&jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsx(Te,{type:P||fe.Simple}),ee&&jsx(_,{as:"--table-loading-message",children:ee})]}),b&&Array(R||5).fill({}).map((re,te)=>jsx(to,{tableRef:Z,index:te,pubsub:G,schema:t,styles:E,loading:true,animate:m,onRowClick:h},`--trow-loading-${te}-${t[0].id}`)),!b&&o&&o.map((re,te)=>jsx(to,{tableRef:Z,pubsub:G,loading:false,index:te,schema:t,ids:H,styles:E,animate:m,data:re,onRowClick:h,rowClassName:l,selectable:g,onSelect:y,onContextMenu:D},`--trow-${F.current[te]||te}-${t[0].id}`)),de&&ie(),u&&ne&&jsx(p,{"aria-hidden":!u||!ne,...m?{fx:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(o.length+1),when:!b&&o&&u&&ne!=null}}:{},as:"--row flex aic --row-footer",children:ne})]})};Xs.displayName="Zuz.Table";var Fp=forwardRef(Xs),Zp=Fp;var Wp=({ref:e,...n})=>{let{title:t,items:o}=n,[r,s]=useState(0),a=(u,f,c)=>{u.preventDefault(),s(f),document.getElementById(c)?.scrollIntoView({behavior:"smooth"});};return jsxs(p,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(_,{as:"--toc-title",children:t}),jsx(Ge,{items:o.map((u,f)=>jsx("a",{className:r==f?"--toc-active":"",style:{anchorName:r===f?"--toc-active":"none",color:r==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:c=>a(c,f,u.tag),href:`#${u.tag}`,children:u.label}))})]})},Gp=Wp;var Ys=({isActive:e,transitionType:n,speed:t,width:o,render:r,content:s,onHeightChange:a})=>{let u=useRef(null),f=useResizeObserver(u);useEffect(()=>{e&&f.height>0&&a(f.height);},[e,f.height]);let m=useMemo(()=>{let i={width:o>0?`${o}px`:"100%",minWidth:o>0?`${o}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return n==="fade"?{...i,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"?{...i,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}:i},[e,n,o,t]);return jsx(p,{ref:u,style:{...m},className:"--content",children:r||e?s:null})};Ys.displayName="Zuz.TabBody";var js=Ys;var ea=({ref:e,...n})=>{let{tabs:t,speed:o=.3,prerender:r=true,variant:s,tabStyle:a="fixed",onChange:u,transitionType:f="slide",...c}=n,[m,i]=useState(0),l=useRef(null),g=useResizeObserver(l),T=useMemo(()=>uuid(8),[]),[C,b]=useState("auto"),R=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(e,()=>({setTab:y=>i(y)}));let I=useMemo(()=>t.map(y=>({...y,key:y.key||uuid(8)})),[t]),{style:P,className:d,rest:v}=B({as:`flex cols w-full no-overflow ${c.as||""}`,...c}),h=()=>{if(!R)return {opacity:0};switch(f){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${I.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${m*g.width}px, 0, 0)`,transition:`transform ${o}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(p,{ref:l,style:P,className:`--tabview --${a} flex cols ${d}`,children:[jsx(St,{as:"--tabview-head",onSwitch:y=>{i(y.index);let N=I.find(D=>D.tag==y.tag);N&&N.onSelect&&(N.onSelect(N,y.index),u?.(N,y.index));},selected:m,items:I.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:C,transition:R?`height ${o}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(p,{className:"--track",style:{...h()},children:I.map((y,N)=>jsx(js,{isActive:N===m,transitionType:f,speed:o,width:g.width,render:r||N===m,onHeightChange:D=>N===m&&b(D),content:y.body},`tab-body-${y.key||N}-${T}`))})})]})};ea.displayName="Zuz.TabView";var ou=ea;var au=({ref:e,commands:n,onCommand:t,welcomeMessage:o="Welcome to Zuz Terminal v1.0.0",prompt:r="zuz ~ ",variant:s,...a})=>{let[u,f]=useState([{type:"output",content:o}]),[c,m]=useState(""),i=useRef(null),l=useRef(null),{variant:g}=j(true);useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight);},[u]);let T=d=>{let v=typeof d=="string"?{type:"output",content:d}:d;f(h=>{let y=[...h,v];return y.length>1e3?y.slice(-1e3):y});},C=()=>f([]);useImperativeHandle(e,()=>({write:T,clear:C}));let b=async d=>{let[v,...h]=d.split(" "),y=v.toLowerCase();return n&&n[y]?await n[y](h):t?await t(d):`command not found: ${v}`},R=d=>{let v=/\u001b\[(\d+)m/g,h=[],y={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",k=false,V;for(;(V=v.exec(d))!==null;){let H=d.slice(N,V.index);H&&h.push({text:H,color:D,bold:k});let z=V[1];z==="0"?(D="#d4d4d4",k=false):z==="1"?k=true:y[z]&&(D=y[z]),N=v.lastIndex;}let E=d.slice(N);return E&&h.push({text:E,color:D,bold:k}),h},I=(d,v)=>d.includes("\x1B")?R(d).map((h,y)=>jsx(ae,{style:{color:h.color||"#d4d4d4",fontWeight:h.bold?"bold":"normal"},children:h.text},`--terminal-msg-${y}-${h.text.replace(/\S+/g,"-")}`)):jsx(ae,{style:{color:v==="error"?"#ff5f56":v==="command"?"#00ff00":"#d4d4d4"},children:d}),P=async d=>{if(d.key==="Enter"&&c.trim()){let v=c.trim(),h=[...u,{type:"command",content:`${r}${v}`}];m(""),f(h);let y=await b(v);f(N=>[...N,{type:"output",content:y}]);}};return jsxs(p,{as:`--zuz-terminal --${s||g||U.Medium} flex cols ${a.className}`,onClick:()=>l.current?.focus(),children:[jsx(p,{ref:i,className:"--terminal-log",children:u.map((d,v)=>jsx(p,{children:jsx(_,{children:I(d.content,d.type)})},v))}),jsxs(p,{as:"flex aic --terminal-input",children:[jsx(_,{as:"--terminal-prompt",children:r}),jsx(ce,{ref:l,className:"--zuz-term-input",autoFocus:true,value:c,variant:s||g||U.Medium,onChange:d=>m(d.target.value),onKeyDown:P})]})]})},iu=au;var lu=({meta:e})=>jsxs($,{as:"flex aic --command-item",children:[e.icon&&jsx(J,{name:e.icon,as:"--command-icon"}),jsx(_,{children:e.label})]}),cu=({position:e,onSelect:n,commands:t,visible:o})=>jsx(p,{"aria-hidden":!o,fx:{transition:X.SlideInBottom,duration:.1,when:o},className:"--command-box abs grid",style:{...e},children:t.map(r=>jsx(lu,{meta:r},`cmd-${r.label.replace(/\s+/,"-")}`))}),na=cu;var ia=forwardRef((e,n)=>{let{autoResize:t,maxHeight:o,variant:r,resize:s="none",command:a,commands:u,onInput:f,cmd:c,renderDropdown:m,value:i,defaultValue:l,...g}=e,T=useRef(null),C=useRef(null),{variant:b}=j(true),{style:R,className:I,rest:P}=B(g),{showDropdown:d,dropdownPosition:v,handleKeyDown:h,handleInput:y,handleCommandSelect:N}=useCommandActions({command:a,commands:u,cmd:c,ref:T}),D=useCallback(()=>{let V=T.current;!V||!t||(C.current&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(()=>{V.style.height="auto";let E=V.scrollHeight;if(o){let H=parseInt(o.toString(),10);isNaN(H)||(E=Math.min(E,H));}V.style.height=`${E}px`,V.style.overflowY=o&&E>=parseInt(o.toString(),10)?"auto":"hidden";}));},[t,o]),k=V=>{f?.(V),y(V),D();};return useEffect(()=>{D();},[i,l,D]),useEffect(()=>{t&&T.current&&D();},[t,D]),useEffect(()=>()=>{C.current&&cancelAnimationFrame(C.current);},[]),jsxs(p,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${r||b||U.Medium} flex ${I}`.trim(),style:{...R,resize:s,height:t?"auto":R?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:h,onInput:k,ref:V=>{typeof n=="function"?n(V):n&&(n.current=V),T.current=V;},value:i,defaultValue:l,...P}),m?m({show:d,position:v,commands:u||[],onSelect:N}):u&&u.length>0&&jsx(na,{visible:d,commands:u,onSelect:N,position:v})]})});ia.displayName="Zuz.TextArea";var du=ia;var ca=forwardRef((e,n)=>{let{as:t,value:o,color:r,direction:s,...a}=e,u=useRef(null),[f,c]=useState(o||0);return useImperativeHandle(n,()=>({updateValue(m){f.toString().length!==m.toString().length&&c(m);},setValue(m){if(this.updateValue(m),u.current){let i=m.toString().split("");u.current.querySelectorAll(".--wheel-char").forEach((l,g)=>{let T=i[g];if(l instanceof HTMLElement){l.setAttribute("data-value",T);let C=l.querySelector(".--wheel-char-track");C instanceof HTMLElement&&(C.style.setProperty("--v",T),C.offsetWidth);}});}}})),useEffect(()=>{c(o||0);},[o]),jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:u,...a,children:[(f||0).toString().split("").map((m,i)=>isNaN(parseInt(m,10))?jsx(ae,{className:"--wheel-char wheel-char-symbol grid",children:m},`wheel-char-symbol-${i}`):jsx(ae,{"data-value":m,className:`--wheel-char grid ${i>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ae,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":m},children:[jsx(ae,{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,g)=>jsx(ae,{children:l},`${i}--${g}`)),jsx(ae,{children:!s||s==="down"?9:0})]})},`wheel-char-${i}`)),r&&jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${r}, transparent, transparent, transparent, ${r})`}})]})});ca.displayName="Zuz.TextWheel";var wu=ca;var sr=forwardRef((e,n)=>{let{as:t,meta:o,nodes:r,icons:s,onSelect:a,treeTag:u,selected:f,roots:c,expanded:m,...i}=e,{tag:l,label:g,icon:T,under:C,isHead:b}=o,R=useMemo(()=>c.includes(l),[c]),[I,P]=useState(m),d=()=>{localStorage.setItem(`--tn${u}-${l}`,I?"0":"1"),P(!I);};useEffect(()=>{m||R&&!localStorage.getItem(`--tn${u}-${l}`)?(localStorage.setItem(`--tn${u}-${l}`,"1"),P(true)):P(localStorage.getItem(`--tn${u}-${l}`)=="1");},[]);let v=useMemo(()=>r.filter(h=>h.under==l),[r,l]);return jsxs(p,{className:`--treenode ${R?"--is-root":""} --treenode-${l} flex cols`,children:[jsxs(p,{className:`--node --node-${l} flex aic ${f==l?" --selected":""}`,children:[jsx($,{skeleton:i.skeleton,onClick:d,className:"--node-aro-btn",disabled:v.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(J,{skeleton:i.skeleton,className:"--node-aro-icon",name:v.length==0?s?.arrowDisabled||s?.arrowClose:I?s?.arrowOpen:s?.arrowClose}):v.length==0?M.chevronBottom:I?M.chevronBottom:M.chevronRight}),jsxs($,{className:"--node-meta flex aic",onClick:h=>a(l),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(J,{skeleton:i.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:T||(I?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx(_,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:i.skeleton,children:g})]})]}),I&&v.length>0&&jsx(p,{className:`--sub-node tree-sub-node-${l} flex cols`,children:v.map(h=>jsx(sr,{treeTag:u,selected:f,onSelect:a,icons:s,roots:c,expanded:h.expanded||false,meta:h,nodes:r},`--node-${h.tag}`))})]})});sr.displayName="TreeItem";var pa=sr;var fa=forwardRef((e,n)=>{let{as:t,nodes:o,onNodeSelect:r,tag:s,icons:a,roots:u,selected:f,...c}=e,[m,i]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>m}),[r]);let l=g=>{i(g),r&&r(g);};return useEffect(()=>{m!=f&&i(f);},[f]),jsx(p,{className:"--treeview flex cols",children:o.filter(g=>u.includes(g.tag)).map(g=>jsx(pa,{treeTag:s?`-${s}`:"",selected:m,onSelect:T=>l(T),icons:a,meta:g,roots:u,expanded:g.expanded||false,skeleton:c.skeleton,nodes:o},`--node-${g.tag}`))})});fa.displayName="Zuz.TreeView";var Bu=fa;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};
|