ikon-react-components-lib 1.0.4 → 1.0.5
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("lucide-react"),Zn=require("@radix-ui/react-accordion"),es=require("clsx"),ts=require("tailwind-merge"),as=require("@radix-ui/react-alert-dialog"),H=require("class-variance-authority"),rs=require("@radix-ui/react-aspect-ratio"),ns=require("@radix-ui/react-avatar"),ss=require("@radix-ui/react-checkbox"),os=require("@radix-ui/react-dialog"),is=require("@radix-ui/react-dropdown-menu"),ls=require("@radix-ui/react-hover-card"),ds=require("@radix-ui/react-label"),cs=require("@radix-ui/react-navigation-menu"),us=require("@radix-ui/react-popover"),ms=require("@radix-ui/react-progress"),xs=require("@radix-ui/react-radio-group"),fs=require("@radix-ui/react-scroll-area"),gs=require("@radix-ui/react-select"),ps=require("@radix-ui/react-separator"),hs=require("@radix-ui/react-slider"),$t=require("@radix-ui/react-slot"),bs=require("@radix-ui/react-switch"),vs=require("@radix-ui/react-tabs"),js=require("@radix-ui/react-toggle"),ws=require("@radix-ui/react-toggle-group"),Ns=require("@radix-ui/react-tooltip"),m=require("react"),Tt=require("react-day-picker"),Be=require("cmdk"),ba=require("sonner");require("react-dom");const Ae=require("vaul"),$e=require("react-hook-form"),va=require("input-otp"),L=require("@tanstack/react-table"),ae=require("react-router-dom"),ys=require("use-debounce"),Me=require("echarts"),ct=require("motion/react"),Cs=require("zxcvbn"),Ss=require("countries-list"),ks=require("country-flag-icons/react/3x2"),qe=require("date-fns"),W=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const Is=require("date-fns/locale"),be=require("react-router"),ja=require("axios"),qt=require("js-cookie"),Ts=require("jwt-decode"),Oe=require("@tanstack/react-query"),wa=require("react-cropper"),z=require("@assistant-ui/react"),Ds=require("motion/react-m"),Dt=require("@assistant-ui/react-markdown"),Ps=require("remark-gfm"),As=require("@assistant-ui/react-ai-sdk"),la=require("uuid");function B(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const Rs=B(f),Xe=B(Zn),Ce=B(as),zs=B(rs),Wt=B(ns),da=B(ss),G=B(os),q=B(is),xt=B(ls),_s=B(ds),Re=B(cs),Qe=B(us),ca=B(ms),Pt=B(xs),Ye=B(fs),Y=B(gs),Fs=B(ps),it=B(hs),Se=B($t),ua=B(bs),bt=B(vs),Ms=B(js),Na=B(ws),Ge=B(Ns),k=B(m),Es=B(ks),At=B(Ds);function l(...t){return ts.twMerge(es.clsx(t))}function Ls({...t}){return e.jsx(Xe.Root,{"data-slot":"accordion",...t})}function Os({className:t,...a}){return e.jsx(Xe.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",t),...a})}function Bs({className:t,children:a,...r}){return e.jsx(Xe.Header,{className:"flex",children:e.jsxs(Xe.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(f.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Us({className:t,children:a,...r}){return e.jsx(Xe.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:e.jsx("div",{className:l("pt-0 pb-4",t),children:a})})}function Vs(t,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}function Gs(t,a=[]){let r=[];function n(o,i){const c=k.createContext(i),u=r.length;r=[...r,i];const d=p=>{const{scope:w,children:N,...v}=p,y=w?.[t]?.[u]||c,b=k.useMemo(()=>v,Object.values(v));return e.jsx(y.Provider,{value:b,children:N})};d.displayName=o+"Provider";function x(p,w){const N=w?.[t]?.[u]||c,v=k.useContext(N);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,x]}const s=()=>{const o=r.map(i=>k.createContext(i));return function(c){const u=c?.[t]||o;return k.useMemo(()=>({[`__scope${t}`]:{...c,[t]:u}}),[c,u])}};return s.scopeName=t,[n,$s(s,...a)]}function $s(...t){const a=t[0];if(t.length===1)return a;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((c,{useScope:u,scopeName:d})=>{const p=u(o)[`__scope${d}`];return{...c,...p}},{});return k.useMemo(()=>({[`__scope${a.scopeName}`]:i}),[i])}};return r.scopeName=a.scopeName,r}var Je=globalThis?.document?k.useLayoutEffect:()=>{},qs=k[" useInsertionEffect ".trim().toString()]||Je;function Ws({prop:t,defaultProp:a,onChange:r=()=>{},caller:n}){const[s,o,i]=Hs({defaultProp:a,onChange:r}),c=t!==void 0,u=c?t:s;{const x=k.useRef(t!==void 0);k.useEffect(()=>{const p=x.current;p!==c&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=c},[c,n])}const d=k.useCallback(x=>{if(c){const p=Ks(x)?x(t):x;p!==t&&i.current?.(p)}else o(x)},[c,t,o,i]);return[u,d]}function Hs({defaultProp:t,onChange:a}){const[r,n]=k.useState(t),s=k.useRef(r),o=k.useRef(a);return qs(()=>{o.current=a},[a]),k.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function Ks(t){return typeof t=="function"}function ma(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function Ys(...t){return a=>{let r=!1;const n=t.map(s=>{const o=ma(s,a);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ma(t[s],null)}}}}function ya(...t){return k.useCallback(Ys(...t),t)}var Xs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ht=Xs.reduce((t,a)=>{const r=$t.createSlot(`Primitive.${a}`),n=k.forwardRef((s,o)=>{const{asChild:i,...c}=s,u=i?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(u,{...c,ref:o})});return n.displayName=`Primitive.${a}`,{...t,[a]:n}},{});function Qs(t,a){return k.useReducer((r,n)=>a[r][n]??r,t)}var Ca=t=>{const{present:a,children:r}=t,n=Js(a),s=typeof r=="function"?r({present:n.isPresent}):k.Children.only(r),o=ya(n.ref,Zs(s));return typeof r=="function"||n.isPresent?k.cloneElement(s,{ref:o}):null};Ca.displayName="Presence";function Js(t){const[a,r]=k.useState(),n=k.useRef(null),s=k.useRef(t),o=k.useRef("none"),i=t?"mounted":"unmounted",[c,u]=Qs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const d=lt(n.current);o.current=c==="mounted"?d:"none"},[c]),Je(()=>{const d=n.current,x=s.current;if(x!==t){const w=o.current,N=lt(d);t?u("MOUNT"):N==="none"||d?.display==="none"?u("UNMOUNT"):u(x&&w!==N?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),Je(()=>{if(a){let d;const x=a.ownerDocument.defaultView??window,p=N=>{const y=lt(n.current).includes(CSS.escape(N.animationName));if(N.target===a&&y&&(u("ANIMATION_END"),!s.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",d=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},w=N=>{N.target===a&&(o.current=lt(n.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",p),a.addEventListener("animationend",p),()=>{x.clearTimeout(d),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",p),a.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[a,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:k.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function lt(t){return t?.animationName||"none"}function Zs(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var eo=k[" useId ".trim().toString()]||(()=>{}),to=0;function ao(t){const[a,r]=k.useState(eo());return Je(()=>{r(n=>n??String(to++))},[t]),t||(a?`radix-${a}`:"")}var vt="Collapsible",[ro]=Gs(vt),[no,Kt]=ro(vt),Sa=k.forwardRef((t,a)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...c}=t,[u,d]=Ws({prop:n,defaultProp:s??!1,onChange:i,caller:vt});return e.jsx(no,{scope:r,disabled:o,contentId:ao(),open:u,onOpenToggle:k.useCallback(()=>d(x=>!x),[d]),children:e.jsx(Ht.div,{"data-state":Xt(u),"data-disabled":o?"":void 0,...c,ref:a})})});Sa.displayName=vt;var ka="CollapsibleTrigger",Ia=k.forwardRef((t,a)=>{const{__scopeCollapsible:r,...n}=t,s=Kt(ka,r);return e.jsx(Ht.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Xt(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:Vs(t.onClick,s.onOpenToggle)})});Ia.displayName=ka;var Yt="CollapsibleContent",Ta=k.forwardRef((t,a)=>{const{forceMount:r,...n}=t,s=Kt(Yt,t.__scopeCollapsible);return e.jsx(Ca,{present:r||s.open,children:({present:o})=>e.jsx(so,{...n,ref:a,present:o})})});Ta.displayName=Yt;var so=k.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,i=Kt(Yt,r),[c,u]=k.useState(n),d=k.useRef(null),x=ya(a,d),p=k.useRef(0),w=p.current,N=k.useRef(0),v=N.current,y=i.open||c,b=k.useRef(y),C=k.useRef(void 0);return k.useEffect(()=>{const g=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(g)},[]),Je(()=>{const g=d.current;if(g){C.current=C.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const S=g.getBoundingClientRect();p.current=S.height,N.current=S.width,b.current||(g.style.transitionDuration=C.current.transitionDuration,g.style.animationName=C.current.animationName),u(n)}},[i.open,n]),e.jsx(Ht.div,{"data-state":Xt(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:y&&s})});function Xt(t){return t?"open":"closed"}var oo=Sa;const ft=H.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",dashed:"border border-dashed bg-background shadow-sm hover:bg-accent hover:text-accent-foreground ",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function R({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?Se.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:l(ft({variant:a,size:r,className:t})),...s})}function Da({...t}){return e.jsx(Ce.Root,{"data-slot":"alert-dialog",...t})}function io({...t}){return e.jsx(Ce.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Pa({...t}){return e.jsx(Ce.Portal,{"data-slot":"alert-dialog-portal",...t})}function Aa({className:t,...a}){return e.jsx(Ce.Overlay,{"data-slot":"alert-dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Ra({className:t,size:a="default",...r}){return e.jsxs(Pa,{children:[e.jsx(Aa,{}),e.jsx(Ce.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...r})]})}function za({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function _a({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function Fa({className:t,...a}){return e.jsx(Ce.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function Ma({className:t,...a}){return e.jsx(Ce.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function lo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-media",className:l("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",t),...a})}function Rt({className:t,variant:a="default",size:r="default",...n}){return e.jsx(R,{variant:a,size:r,asChild:!0,children:e.jsx(Ce.Action,{"data-slot":"alert-dialog-action",className:l(t),...n})})}function Ea({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(R,{variant:a,size:r,asChild:!0,children:e.jsx(Ce.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...n})})}const co=H.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function uo({className:t,variant:a,...r}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:l(co({variant:a}),t),...r})}function mo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function xo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}function La({className:t,size:a="default",...r}){return e.jsx(Wt.Root,{"data-slot":"avatar","data-size":a,className:l("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...r})}function Oa({className:t,...a}){return e.jsx(Wt.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",t),...a})}function Ba({className:t,...a}){return e.jsx(Wt.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}function fo({className:t,...a}){return e.jsx("span",{"data-slot":"avatar-badge",className:l("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",t),...a})}function go({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group",className:l("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",t),...a})}function po({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group-count",className:l("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",t),...a})}const Ua=H.cva("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ut({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?Se.Root:"span";return e.jsx(s,{"data-slot":"badge","data-variant":a,className:l(Ua({variant:a}),t),...n})}function Va({className:t,classNames:a,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:o,components:i,...c}){const u=Tt.getDefaultClassNames();return e.jsx(Tt.DayPicker,{showOutsideDays:r,className:l("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...o},classNames:{root:l("w-fit",u.root),months:l("flex gap-4 flex-col md:flex-row relative",u.months),month:l("flex flex-col w-full gap-4",u.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",u.nav),button_previous:l(ft({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_previous),button_next:l(ft({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",u.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",u.dropdowns),dropdown_root:l("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",u.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",u.dropdown),caption_label:l("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:l("flex",u.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",u.weekday),week:l("flex w-full mt-2",u.week),week_number_header:l("select-none w-(--cell-size)",u.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",u.week_number),day:l("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",c.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",u.day),range_start:l("rounded-l-md bg-accent",u.range_start),range_middle:l("rounded-none",u.range_middle),range_end:l("rounded-r-md bg-accent",u.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:l("text-muted-foreground opacity-50",u.disabled),hidden:l("invisible",u.hidden),...a},components:{Root:({className:d,rootRef:x,...p})=>e.jsx("div",{"data-slot":"calendar",ref:x,className:l(d),...p}),Chevron:({className:d,orientation:x,...p})=>x==="left"?e.jsx(f.ChevronLeftIcon,{className:l("size-4",d),...p}):x==="right"?e.jsx(f.ChevronRightIcon,{className:l("size-4",d),...p}):e.jsx(f.ChevronDownIcon,{className:l("size-4",d),...p}),DayButton:Ga,WeekNumber:({children:d,...x})=>e.jsx("td",{...x,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...i},...c})}function Ga({className:t,day:a,modifiers:r,...n}){const s=Tt.getDefaultClassNames(),o=k.useRef(null);return k.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(R,{ref:o,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:l("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,t),...n})}function gt({className:t,...a}){return e.jsx("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function ho({className:t,...a}){return e.jsx("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function bo({className:t,...a}){return e.jsx("div",{"data-slot":"card-title",className:l("leading-none font-semibold",t),...a})}function vo({className:t,...a}){return e.jsx("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",t),...a})}function jo({className:t,...a}){return e.jsx("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function $a({className:t,...a}){return e.jsx("div",{"data-slot":"card-content",className:l("px-6",t),...a})}function wo({className:t,...a}){return e.jsx("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",t),...a})}function Ze({className:t,...a}){return e.jsx(da.Root,{"data-slot":"checkbox",className:l("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(da.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(f.CheckIcon,{className:"size-3.5"})})})}function jt({...t}){return e.jsx(G.Root,{"data-slot":"dialog",...t})}function qa({...t}){return e.jsx(G.Trigger,{"data-slot":"dialog-trigger",...t})}function Wa({...t}){return e.jsx(G.Portal,{"data-slot":"dialog-portal",...t})}function No({...t}){return e.jsx(G.Close,{"data-slot":"dialog-close",...t})}function Ha({className:t,...a}){return e.jsx(G.Overlay,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function wt({className:t,children:a,showCloseButton:r=!0,...n}){return e.jsxs(Wa,{"data-slot":"dialog-portal",children:[e.jsx(Ha,{}),e.jsxs(G.Content,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...n,children:[a,r&&e.jsxs(G.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(f.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function Ka({className:t,showCloseButton:a=!1,children:r,...n}){return e.jsxs("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...n,children:[r,a&&e.jsx(G.Close,{asChild:!0,children:e.jsx(R,{variant:"outline",children:"Close"})})]})}function Nt({className:t,...a}){return e.jsx(G.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function Ya({className:t,...a}){return e.jsx(G.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function Q({className:t,...a}){return e.jsx(Be.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function yo({title:t="Command Palette",description:a="Search for a command to run...",children:r,className:n,showCloseButton:s=!0,...o}){return e.jsxs(jt,{...o,children:[e.jsxs(Qt,{className:"sr-only",children:[e.jsx(Nt,{children:t}),e.jsx(Ya,{children:a})]}),e.jsx(wt,{className:l("overflow-hidden p-0",n),showCloseButton:s,children:e.jsx(Q,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function ie({className:t,...a}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(f.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx(Be.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function le({className:t,...a}){return e.jsx(Be.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function de({...t}){return e.jsx(Be.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function re({className:t,...a}){return e.jsx(Be.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function Xa({className:t,...a}){return e.jsx(Be.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",t),...a})}function X({className:t,...a}){return e.jsx(Be.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Co({className:t,...a}){return e.jsx("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function ze({...t}){return e.jsx(q.Root,{"data-slot":"dropdown-menu",...t})}function Qa({...t}){return e.jsx(q.Portal,{"data-slot":"dropdown-menu-portal",...t})}function _e({...t}){return e.jsx(q.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Fe({className:t,sideOffset:a=4,...r}){return e.jsx(q.Portal,{children:e.jsx(q.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})})}function Jt({...t}){return e.jsx(q.Group,{"data-slot":"dropdown-menu-group",...t})}function ue({className:t,inset:a,variant:r="default",...n}){return e.jsx(q.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:l("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function So({className:t,children:a,checked:r,...n}){return e.jsxs(q.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...n,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(q.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),a]})}function ko({...t}){return e.jsx(q.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function Io({className:t,children:a,...r}){return e.jsxs(q.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(q.ItemIndicator,{children:e.jsx(f.CircleIcon,{className:"size-2 fill-current"})})}),a]})}function Zt({className:t,inset:a,...r}){return e.jsx(q.Label,{"data-slot":"dropdown-menu-label","data-inset":a,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r})}function yt({className:t,...a}){return e.jsx(q.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",t),...a})}function To({className:t,...a}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function Ja({...t}){return e.jsx(q.Sub,{"data-slot":"dropdown-menu-sub",...t})}function Za({className:t,inset:a,children:r,...n}){return e.jsxs(q.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(f.ChevronRightIcon,{className:"ml-auto size-4"})]})}function er({className:t,...a}){return e.jsx(q.SubContent,{"data-slot":"dropdown-menu-sub-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...a})}function Do({...t}){return e.jsx(xt.Root,{"data-slot":"hover-card",...t})}function Po({...t}){return e.jsx(xt.Trigger,{"data-slot":"hover-card-trigger",...t})}function Ao({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(xt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(xt.Content,{"data-slot":"hover-card-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function K({className:t,type:a,...r}){return e.jsx("input",{type:a,"data-slot":"input",className:l("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function Ne({className:t,...a}){return e.jsx(_s.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function Ro({className:t,children:a,viewport:r=!0,...n}){return e.jsxs(Re.Root,{"data-slot":"navigation-menu","data-viewport":r,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...n,children:[a,r&&e.jsx(ar,{})]})}function zo({className:t,...a}){return e.jsx(Re.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function _o({className:t,...a}){return e.jsx(Re.Item,{"data-slot":"navigation-menu-item",className:l("relative",t),...a})}const tr=H.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function Fo({className:t,children:a,...r}){return e.jsxs(Re.Trigger,{"data-slot":"navigation-menu-trigger",className:l(tr(),"group",t),...r,children:[a," ",e.jsx(f.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Mo({className:t,...a}){return e.jsx(Re.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function ar({className:t,...a}){return e.jsx("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(Re.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function Eo({className:t,...a}){return e.jsx(Re.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Lo({className:t,...a}){return e.jsx(Re.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function J({...t}){return e.jsx(Qe.Root,{"data-slot":"popover",...t})}function Z({...t}){return e.jsx(Qe.Trigger,{"data-slot":"popover-trigger",...t})}function ee({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(Qe.Portal,{children:e.jsx(Qe.Content,{"data-slot":"popover-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function Oo({...t}){return e.jsx(Qe.Anchor,{"data-slot":"popover-anchor",...t})}function Bo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-header",className:l("flex flex-col gap-1 text-sm",t),...a})}function Uo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-title",className:l("font-medium",t),...a})}function Vo({className:t,...a}){return e.jsx("p",{"data-slot":"popover-description",className:l("text-muted-foreground",t),...a})}function Ct({className:t,value:a,...r}){return e.jsx(ca.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...r,children:e.jsx(ca.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})})}function Go({className:t,...a}){return e.jsx(Pt.Root,{"data-slot":"radio-group",className:l("grid gap-3",t),...a})}function $o({className:t,...a}){return e.jsx(Pt.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Pt.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(f.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function qo({className:t,children:a,...r}){return e.jsxs(Ye.Root,{"data-slot":"scroll-area",className:l("relative",t),...r,children:[e.jsx(Ye.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),e.jsx(rr,{}),e.jsx(Ye.Corner,{})]})}function rr({className:t,orientation:a="vertical",...r}){return e.jsx(Ye.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:l("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...r,children:e.jsx(Ye.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function nr({...t}){return e.jsx(Y.Root,{"data-slot":"select",...t})}function Wo({...t}){return e.jsx(Y.Group,{"data-slot":"select-group",...t})}function sr({...t}){return e.jsx(Y.Value,{"data-slot":"select-value",...t})}function or({className:t,size:a="default",children:r,...n}){return e.jsxs(Y.Trigger,{"data-slot":"select-trigger","data-size":a,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(Y.Icon,{asChild:!0,children:e.jsx(f.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function ir({className:t,children:a,position:r="item-aligned",align:n="center",...s}){return e.jsx(Y.Portal,{children:e.jsxs(Y.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...s,children:[e.jsx(dr,{}),e.jsx(Y.Viewport,{className:l("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(cr,{})]})})}function Ho({className:t,...a}){return e.jsx(Y.Label,{"data-slot":"select-label",className:l("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function lr({className:t,children:a,...r}){return e.jsxs(Y.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(Y.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),e.jsx(Y.ItemText,{children:a})]})}function Ko({className:t,...a}){return e.jsx(Y.Separator,{"data-slot":"select-separator",className:l("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function dr({className:t,...a}){return e.jsx(Y.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronUpIcon,{className:"size-4"})})}function cr({className:t,...a}){return e.jsx(Y.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronDownIcon,{className:"size-4"})})}function St({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Fs.Root,{"data-slot":"separator",decorative:r,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function ea({...t}){return e.jsx(G.Root,{"data-slot":"sheet",...t})}function ur({...t}){return e.jsx(G.Trigger,{"data-slot":"sheet-trigger",...t})}function Yo({...t}){return e.jsx(G.Close,{"data-slot":"sheet-close",...t})}function Xo({...t}){return e.jsx(G.Portal,{"data-slot":"sheet-portal",...t})}function Qo({className:t,...a}){return e.jsx(G.Overlay,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function ta({className:t,children:a,side:r="right",showCloseButton:n=!0,...s}){return e.jsxs(Xo,{children:[e.jsx(Qo,{}),e.jsxs(G.Content,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,n&&e.jsxs(G.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(f.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function mr({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Jo({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function aa({className:t,...a}){return e.jsx(G.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function xr({className:t,...a}){return e.jsx(G.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}const It=768;function kt(){const[t,a]=k.useState(void 0);return k.useEffect(()=>{const r=window.matchMedia(`(max-width: ${It-1}px)`),n=()=>{a(window.innerWidth<It)};return r.addEventListener("change",n),a(window.innerWidth<It),()=>r.removeEventListener("change",n)},[]),!!t}function Le({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:l("bg-accent animate-pulse rounded-md",t),...a})}function Te({delayDuration:t=0,...a}){return e.jsx(Ge.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function ne({...t}){return e.jsx(Ge.Root,{"data-slot":"tooltip",...t})}function se({...t}){return e.jsx(Ge.Trigger,{"data-slot":"tooltip-trigger",...t})}function oe({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(Ge.Portal,{children:e.jsxs(Ge.Content,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,e.jsx(Ge.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Zo="sidebar_state",ei=3600*24*7,ti="16rem",ai="18rem",ri="3rem",ni="b",fr=k.createContext(null);function et(){const t=k.useContext(fr);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function gr({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...i}){const c=kt(),[u,d]=k.useState(!1),[x,p]=k.useState(t),w=a??x,N=k.useCallback(C=>{const g=typeof C=="function"?C(w):C;r?r(g):p(g),document.cookie=`${Zo}=${g}; path=/; max-age=${ei}`},[r,w]),v=k.useCallback(()=>c?d(C=>!C):N(C=>!C),[c,N,d]);k.useEffect(()=>{const C=g=>{g.key===ni&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),v())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[v]);const y=w?"expanded":"collapsed",b=k.useMemo(()=>({state:y,open:w,setOpen:N,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[y,w,N,c,u,d,v]);return e.jsx(fr.Provider,{value:b,children:e.jsx(Te,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ti,"--sidebar-width-icon":ri,...s},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...i,children:o})})})}function pr({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:i,state:c,openMobile:u,setOpenMobile:d}=et();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):i?e.jsx(ea,{open:u,onOpenChange:d,...o,children:e.jsxs(ta,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":ai},side:t,children:[e.jsxs(mr,{className:"sr-only",children:[e.jsx(aa,{children:"Sidebar"}),e.jsx(xr,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function hr({className:t,onClick:a,...r}){const{toggleSidebar:n}=et();return e.jsxs(R,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:s=>{a?.(s),n()},...r,children:[e.jsx(f.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function br({className:t,...a}){const{toggleSidebar:r}=et();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...a})}function vr({className:t,...a}){return e.jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function si({className:t,...a}){return e.jsx(K,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",t),...a})}function jr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function wr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function oi({className:t,...a}){return e.jsx(St,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Nr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function yr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function ii({className:t,asChild:a=!1,...r}){const n=a?Se.Root:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function li({className:t,asChild:a=!1,...r}){const n=a?Se.Root:"button";return e.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...r})}function di({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function Cr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function zt({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const ci=H.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function _t({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){const c=t?Se.Root:"button",{isMobile:u,state:d}=et(),x=e.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:l(ci({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:x}),e.jsx(oe,{side:"right",align:"center",hidden:d!=="collapsed"||u,...s})]})):x}function ui({className:t,asChild:a=!1,showOnHover:r=!1,...n}){const s=a?Se.Root:"button";return e.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...n})}function mi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...a})}function xi({className:t,showIcon:a=!1,...r}){const n=k.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[a&&e.jsx(Le,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Le,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function Sr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function kr({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",t),...a})}function Ir({asChild:t=!1,size:a="md",isActive:r=!1,className:n,...s}){const o=t?Se.Root:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}function fi({className:t,defaultValue:a,value:r,min:n=0,max:s=100,...o}){const i=k.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(it.Root,{"data-slot":"slider",defaultValue:a,value:r,min:n,max:s,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[e.jsx(it.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:e.jsx(it.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:i.length},(c,u)=>e.jsx(it.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const Tr=k.createContext(void 0),Dr=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=k.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=k.useState(()=>r==="system"?a():r),i=k.useCallback(u=>{const d=document.documentElement;d.classList.remove("dark","blue-dark");let x;u==="system"?x=a():x=u,x==="dark"&&d.classList.add("dark"),x==="blue-dark"&&d.classList.add("blue-dark"),o(x)},[]);k.useEffect(()=>{i(r),localStorage.setItem("theme",r)},[r,i]),k.useEffect(()=>{if(r!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{i("system")};return u.addEventListener("change",d),()=>u.removeEventListener("change",d)},[r,i]);const c=k.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(Tr.Provider,{value:c,children:t})},Pr=()=>{const t=k.useContext(Tr);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},gi=({...t})=>{const{theme:a="system"}=Pr();return e.jsx(ba.Toaster,{theme:a,className:"toaster group",icons:{success:e.jsx(f.CircleCheckIcon,{className:"size-4"}),info:e.jsx(f.InfoIcon,{className:"size-4"}),warning:e.jsx(f.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(f.OctagonXIcon,{className:"size-4"}),loading:e.jsx(f.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function pi({className:t,size:a="default",...r}){return e.jsx(ua.Root,{"data-slot":"switch","data-size":a,className:l("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",t),...r,children:e.jsx(ua.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ar({className:t,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",t),...a})})}function Rr({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",t),...a})}function zr({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",t),...a})}function _r({className:t,...a}){return e.jsx("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...a})}function Ue({className:t,...a}){return e.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function Ft({className:t,...a}){return e.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function We({className:t,...a}){return e.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function hi({className:t,...a}){return e.jsx("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",t),...a})}function Fr({className:t,orientation:a="horizontal",...r}){return e.jsx(bt.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:l("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const Mr=H.cva("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Er({className:t,variant:a="default",...r}){return e.jsx(bt.List,{"data-slot":"tabs-list","data-variant":a,className:l(Mr({variant:a}),t),...r})}function Lr({className:t,...a}){return e.jsx(bt.Trigger,{"data-slot":"tabs-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function Mt({className:t,...a}){return e.jsx(bt.Content,{"data-slot":"tabs-content",className:l("flex-1 outline-none",t),...a})}function Or({className:t,...a}){return e.jsx("textarea",{"data-slot":"textarea",className:l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}function Et({...t}){return e.jsx(zs.Root,{"data-slot":"aspect-ratio",...t})}function Br({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Ur({className:t,...a}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...a})}function Ve({className:t,...a}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",t),...a})}function Lt({asChild:t,className:a,...r}){const n=t?Se.Root:"a";return e.jsx(n,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",a),...r})}function He({className:t,...a}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",t),...a})}function mt({children:t,className:a,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",a),...r,children:t??e.jsx(f.ChevronRight,{})})}function Ot({className:t,...a}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",t),...a,children:[e.jsx(f.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Vr({...t}){return e.jsx(oo,{"data-slot":"collapsible",...t})}function Gr({...t}){return e.jsx(Ia,{"data-slot":"collapsible-trigger",...t})}function $r({...t}){return e.jsx(Ta,{"data-slot":"collapsible-content",...t})}function qr({...t}){return e.jsx(Ae.Drawer.Root,{"data-slot":"drawer",...t})}function Wr({...t}){return e.jsx(Ae.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Hr({...t}){return e.jsx(Ae.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function Kr({...t}){return e.jsx(Ae.Drawer.Close,{"data-slot":"drawer-close",...t})}function Yr({className:t,...a}){return e.jsx(Ae.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Xr({className:t,children:a,...r}){return e.jsxs(Hr,{"data-slot":"drawer-portal",children:[e.jsx(Yr,{}),e.jsxs(Ae.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...r,children:[e.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function Qr({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...a})}function Jr({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function Zr({className:t,...a}){return e.jsx(Ae.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",t),...a})}function en({className:t,...a}){return e.jsx(Ae.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",t),...a})}const tn=$e.FormProvider,an=k.createContext({}),xe=({...t})=>e.jsx(an.Provider,{value:{name:t.name},children:e.jsx($e.Controller,{...t})}),tt=()=>{const t=k.useContext(an),a=k.useContext(rn),{getFieldState:r}=$e.useFormContext(),n=$e.useFormState({name:t.name}),s=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},rn=k.createContext({});function fe({className:t,...a}){const r=k.useId();return e.jsx(rn.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:l("grid gap-2",t),...a})})}function ve({className:t,...a}){const{error:r,formItemId:n}=tt();return e.jsx(Ne,{"data-slot":"form-label","data-error":!!r,className:l("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function ge({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=tt();return e.jsx(Se.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function je({className:t,...a}){const{formDescriptionId:r}=tt();return e.jsx("p",{"data-slot":"form-description",id:r,className:l("text-muted-foreground text-sm",t),...a})}function pe({className:t,...a}){const{error:r,formMessageId:n}=tt(),s=r?String(r?.message??""):a.children;return s?e.jsx("p",{"data-slot":"form-message",id:n,className:l("text-destructive text-sm",t),...a,children:s}):null}function nn({className:t,containerClassName:a,...r}){return e.jsx(va.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",a),className:l("disabled:cursor-not-allowed",t),...r})}function sn({className:t,...a}){return e.jsx("div",{"data-slot":"input-otp-group",className:l("flex items-center",t),...a})}function Ke({index:t,className:a,...r}){const n=k.useContext(va.OTPInputContext),{char:s,hasFakeCaret:o,isActive:i}=n?.slots[t]??{};return e.jsxs("div",{"data-slot":"input-otp-slot","data-active":i,className:l("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...r,children:[s,o&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function bi({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(f.MinusIcon,{})})}const ra=H.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function vi({className:t,variant:a,size:r,...n}){return e.jsx(Ms.Root,{"data-slot":"toggle",className:l(ra({variant:a,size:r,className:t})),...n})}const on=k.createContext({size:"default",variant:"default",spacing:0});function Ee({className:t,variant:a,size:r,spacing:n=0,children:s,...o}){return e.jsx(Na.Root,{"data-slot":"toggle-group","data-variant":a,"data-size":r,"data-spacing":n,style:{"--gap":n},className:l("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",t),...o,children:e.jsx(on.Provider,{value:{variant:a,size:r,spacing:n},children:s})})}function $({className:t,children:a,variant:r,size:n,...s}){const o=k.useContext(on);return e.jsx(Na.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||r,"data-size":o.size||n,"data-spacing":o.spacing,className:l(ra({variant:o.variant||r,size:o.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...s,children:a})}function De({tooltipContent:t,children:a}){return e.jsx(Te,{children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:a}),e.jsx(oe,{children:t})]})})}function at({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(R,{variant:a,size:n,...s,asChild:r,children:t})}function ji({children:t,variant:a,asChild:r=!1,size:n,tooltipContent:s,...o}){return e.jsx(De,{tooltipContent:s,children:e.jsx(at,{variant:a,size:n,...o,asChild:r,children:t})})}function rt({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(R,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function ln({children:t,variant:a,size:r,asChild:n=!1,tooltipContent:s,...o}){return e.jsx(De,{tooltipContent:s,children:e.jsx(rt,{variant:a,size:r,...o,asChild:n,children:t})})}function dn({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(R,{variant:a||"outline",size:r||"icon",...s,asChild:n,children:t})}function Ie({children:t,tooltipContent:a,asChild:r=!1,variant:n,size:s,...o}){return e.jsx(De,{tooltipContent:a,children:e.jsx(dn,{variant:n,size:s,...o,asChild:r,children:t})})}function Bt({actionMenus:t,extraActionParams:a}){const r=n=>(n=n.filter(s=>s?.visibility===void 0||s.visibility===!0||s.visibility&&s.visibility(...a?.arguments||[])),n.length===0?e.jsx(ue,{className:"text-center",children:"No action available."}):n.map((s,o)=>{if(s.type==="label")return e.jsx(Zt,{children:String(s.label)},o);if(s.type==="separator")return e.jsx(yt,{},o);if(s.type==="group"&&s.items)return e.jsx(Jt,{children:r(s.items)},o);if(s.items)return e.jsxs(Ja,{children:[e.jsx(Za,{children:String(s.label)}),e.jsx(Qa,{children:e.jsx(er,{children:r(s.items)})})]},o);let i="";return typeof s.label=="function"?i=s.label(...a?.arguments||[]):i=s.label,e.jsxs(ue,{disabled:s.disabled,onClick:()=>s.onClick&&s.onClick(...a?.arguments||[]),children:[s.icon&&e.jsx(s.icon,{}),i]},o)}));return e.jsxs(ze,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(Ie,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(f.MoreHorizontal,{})})}),e.jsx(Fe,{className:"w-56",align:"end",children:r(t)})]})}const cn=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:i,onConfirm:c,onThird:u})=>e.jsx(Da,{open:!0,children:e.jsxs(Ra,{children:[e.jsxs(za,{children:[e.jsx(Fa,{className:r,children:t}),e.jsx(Ma,{className:r,children:a})]}),e.jsxs(_a,{children:[n!=""&&e.jsx(Ea,{onClick:()=>{i&&i()},children:n}),o!=""&&e.jsx(Rt,{className:"bg-blue-500",color:"black",onClick:()=>{u&&u()},children:o}),s!=""&&e.jsx(Rt,{onClick:()=>{c&&c()},children:s})]})]})}),un=m.createContext(void 0),wi=()=>{const t=m.useContext(un);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},mn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(un.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(cn,{title:a.title,description:a.description,fontSize:a.fontSize||"text-base",cancelText:a.cancelText||"",confirmText:a.confirmText||"",thirdOptionText:a.thirdOptionText||"",onConfirm:()=>{a.onConfirm&&a.onConfirm(),s()},onCancel:()=>{a.onCancel&&a.onCancel(),s()},onThird:()=>{a.onThird&&a.onThird(),s()}})]})};function Ni({placeholder:t,items:a,disabled:r,onSelect:n,defaultValue:s}){const[o,i]=m.useState(s??"");return e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsxs(R,{variant:"outline",role:"combobox",className:l("justify-between",!o&&"text-muted-foreground","bg-secondary"),disabled:r===!0||typeof r=="function"&&r(),children:[o?a.find(c=>c.value===o)?.label||o:t,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(ee,{className:"p-0",align:"start",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:a.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled===!0||typeof c.disabled=="function"&&c.disabled(c),onSelect:u=>{const d=a.find(x=>x.value.toLowerCase()===u.toLowerCase())?.value??u;i(d),n?.(d)},children:[c?.label||c.value,e.jsx(f.Check,{className:l("ml-auto",c.value===o?"opacity-100":"opacity-0")})]},c.value))})]})]})})]})}const ye=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function xn({table:t}){return e.jsxs(J,{children:[e.jsx(De,{tooltipContent:"Column View",children:e.jsx(Z,{asChild:!0,children:e.jsxs(rt,{children:[e.jsx(f.Settings2,{}),"View"]})})}),e.jsx(ee,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>{const r=a.getIsVisible();return e.jsxs(X,{onSelect:()=>{a.toggleVisibility(!r)},disabled:a.getIsGrouped(),children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",r?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ye(a),children:ye(a)})]},a.id)})})]})]})})]})}function fn({column:t}){const a=t?.getFacetedUniqueValues(),r=new Set(t?.getFilterValue()),n=k.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs(ln,{variant:"dashed",tooltipContent:ye(t),children:[r?.size>0?e.jsx(f.X,{}):e.jsx(f.Plus,{}),ye(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(St,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(ut,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(ut,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(ut,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:s},s))})]})]})}),e.jsx(ee,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:ye(t)}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:n.map(s=>{const o=r.has(s);return e.jsxs(X,{onSelect:()=>{o?r.delete(s):r.add(s);const i=Array.from(r);t?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:s,children:s}),a?.get(s)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:a.get(s)})]},s)})})]}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Xa,{}),e.jsx(re,{children:e.jsx(X,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function gn({table:t}){const[a,r]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(J,{children:[e.jsx(De,{tooltipContent:"Filter",children:e.jsx(Z,{asChild:!0,children:e.jsxs(rt,{children:[e.jsx(f.Filter,{}),"Filter"]})})}),e.jsx(ee,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>{const s=new Set(a),o=s.has(n.id);return e.jsxs(X,{onSelect:()=>{o?s.delete(n.id):s.add(n.id),r([...s])},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ye(n),children:ye(n)})]},n.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:a.map(n=>{const s=t.getColumn(n);if(s)return e.jsx(fn,{column:s},n)})})]})}const pn=async t=>new Promise((a,r)=>{const n=new FileReader;n.onload=()=>{const o=n.result.split(",")[1];a({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},n.onerror=()=>r(n.error),n.readAsDataURL(t)});function yi(t){const a=atob(t.base64),r=new Array(a.length).fill(0).map((o,i)=>a.charCodeAt(i)),n=new Uint8Array(r),s=new Blob([n],{type:t.type});return URL.createObjectURL(s)}function Ci({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async x=>{if(!x)return;const p=await pn(x);await r(p)},i=x=>{if(!a)return;x.preventDefault(),s(!1);const p=x.dataTransfer.files?.[0];p&&o(p)},c=x=>{a&&(x.preventDefault(),s(!0))},u=()=>{a&&s(!1)},d=x=>{const p=x.target.files?.[0];p&&o(p)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:d}),a?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("lucide-react"),ns=require("@radix-ui/react-accordion"),ss=require("clsx"),os=require("tailwind-merge"),is=require("@radix-ui/react-alert-dialog"),W=require("class-variance-authority"),ls=require("@radix-ui/react-aspect-ratio"),ds=require("@radix-ui/react-avatar"),cs=require("@radix-ui/react-checkbox"),us=require("@radix-ui/react-dialog"),ms=require("@radix-ui/react-dropdown-menu"),xs=require("@radix-ui/react-hover-card"),fs=require("@radix-ui/react-label"),gs=require("@radix-ui/react-navigation-menu"),ps=require("@radix-ui/react-popover"),hs=require("@radix-ui/react-progress"),bs=require("@radix-ui/react-radio-group"),vs=require("@radix-ui/react-scroll-area"),js=require("@radix-ui/react-select"),ws=require("@radix-ui/react-separator"),Ns=require("@radix-ui/react-slider"),Yt=require("@radix-ui/react-slot"),ys=require("@radix-ui/react-switch"),Cs=require("@radix-ui/react-tabs"),Ss=require("@radix-ui/react-toggle"),ks=require("@radix-ui/react-toggle-group"),Is=require("@radix-ui/react-tooltip"),m=require("react"),zt=require("react-day-picker"),$e=require("cmdk"),Ca=require("sonner");require("react-dom");const Me=require("vaul"),Ke=require("react-hook-form"),Sa=require("input-otp"),E=require("@tanstack/react-table"),Le=require("echarts"),pt=require("motion/react"),Ds=require("zxcvbn"),As=require("countries-list"),Ps=require("country-flag-icons/react/3x2"),Xe=require("date-fns"),q=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const Ts=require("date-fns/locale"),be=require("react-router"),ka=require("axios"),Qt=require("js-cookie"),Rs=require("jwt-decode"),Ue=require("@tanstack/react-query"),Ia=require("react-cropper"),_=require("@assistant-ui/react"),_s=require("motion/react-m"),Ft=require("@assistant-ui/react-markdown"),zs=require("remark-gfm"),Fs=require("@assistant-ui/react-ai-sdk"),fa=require("uuid"),Ms=require("xlsx"),ae=require("react-router-dom"),Es=require("use-debounce");function L(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const Ls=L(f),et=L(ns),Ie=L(is),Os=L(ls),Jt=L(ds),ga=L(cs),U=L(us),$=L(ms),vt=L(xs),Bs=L(fs),Ee=L(gs),tt=L(ps),pa=L(hs),Mt=L(bs),Ze=L(vs),K=L(js),Us=L(ws),mt=L(Ns),De=L(Yt),ha=L(ys),Ct=L(Cs),Vs=L(Ss),Da=L(ks),He=L(Is),D=L(m),$s=L(Ps),Et=L(_s),xt=L(Ms);function l(...t){return os.twMerge(ss.clsx(t))}function Gs({...t}){return e.jsx(et.Root,{"data-slot":"accordion",...t})}function qs({className:t,...a}){return e.jsx(et.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",t),...a})}function Ws({className:t,children:a,...r}){return e.jsx(et.Header,{className:"flex",children:e.jsxs(et.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(f.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Hs({className:t,children:a,...r}){return e.jsx(et.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:e.jsx("div",{className:l("pt-0 pb-4",t),children:a})})}function Ks(t,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}function Xs(t,a=[]){let r=[];function n(o,i){const d=D.createContext(i),u=r.length;r=[...r,i];const c=g=>{const{scope:w,children:N,...v}=g,C=w?.[t]?.[u]||d,b=D.useMemo(()=>v,Object.values(v));return e.jsx(C.Provider,{value:b,children:N})};c.displayName=o+"Provider";function x(g,w){const N=w?.[t]?.[u]||d,v=D.useContext(N);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[c,x]}const s=()=>{const o=r.map(i=>D.createContext(i));return function(d){const u=d?.[t]||o;return D.useMemo(()=>({[`__scope${t}`]:{...d,[t]:u}}),[d,u])}};return s.scopeName=t,[n,Ys(s,...a)]}function Ys(...t){const a=t[0];if(t.length===1)return a;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((d,{useScope:u,scopeName:c})=>{const g=u(o)[`__scope${c}`];return{...d,...g}},{});return D.useMemo(()=>({[`__scope${a.scopeName}`]:i}),[i])}};return r.scopeName=a.scopeName,r}var at=globalThis?.document?D.useLayoutEffect:()=>{},Qs=D[" useInsertionEffect ".trim().toString()]||at;function Js({prop:t,defaultProp:a,onChange:r=()=>{},caller:n}){const[s,o,i]=Zs({defaultProp:a,onChange:r}),d=t!==void 0,u=d?t:s;{const x=D.useRef(t!==void 0);D.useEffect(()=>{const g=x.current;g!==d&&console.warn(`${n} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=d},[d,n])}const c=D.useCallback(x=>{if(d){const g=eo(x)?x(t):x;g!==t&&i.current?.(g)}else o(x)},[d,t,o,i]);return[u,c]}function Zs({defaultProp:t,onChange:a}){const[r,n]=D.useState(t),s=D.useRef(r),o=D.useRef(a);return Qs(()=>{o.current=a},[a]),D.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function eo(t){return typeof t=="function"}function ba(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function to(...t){return a=>{let r=!1;const n=t.map(s=>{const o=ba(s,a);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ba(t[s],null)}}}}function Aa(...t){return D.useCallback(to(...t),t)}var ao=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=ao.reduce((t,a)=>{const r=Yt.createSlot(`Primitive.${a}`),n=D.forwardRef((s,o)=>{const{asChild:i,...d}=s,u=i?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(u,{...d,ref:o})});return n.displayName=`Primitive.${a}`,{...t,[a]:n}},{});function ro(t,a){return D.useReducer((r,n)=>a[r][n]??r,t)}var Pa=t=>{const{present:a,children:r}=t,n=no(a),s=typeof r=="function"?r({present:n.isPresent}):D.Children.only(r),o=Aa(n.ref,so(s));return typeof r=="function"||n.isPresent?D.cloneElement(s,{ref:o}):null};Pa.displayName="Presence";function no(t){const[a,r]=D.useState(),n=D.useRef(null),s=D.useRef(t),o=D.useRef("none"),i=t?"mounted":"unmounted",[d,u]=ro(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const c=ft(n.current);o.current=d==="mounted"?c:"none"},[d]),at(()=>{const c=n.current,x=s.current;if(x!==t){const w=o.current,N=ft(c);t?u("MOUNT"):N==="none"||c?.display==="none"?u("UNMOUNT"):u(x&&w!==N?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),at(()=>{if(a){let c;const x=a.ownerDocument.defaultView??window,g=N=>{const C=ft(n.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(u("ANIMATION_END"),!s.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",c=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},w=N=>{N.target===a&&(o.current=ft(n.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{x.clearTimeout(c),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[a,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:D.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ft(t){return t?.animationName||"none"}function so(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var oo=D[" useId ".trim().toString()]||(()=>{}),io=0;function lo(t){const[a,r]=D.useState(oo());return at(()=>{r(n=>n??String(io++))},[t]),t||(a?`radix-${a}`:"")}var St="Collapsible",[co]=Xs(St),[uo,ea]=co(St),Ta=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...d}=t,[u,c]=Js({prop:n,defaultProp:s??!1,onChange:i,caller:St});return e.jsx(uo,{scope:r,disabled:o,contentId:lo(),open:u,onOpenToggle:D.useCallback(()=>c(x=>!x),[c]),children:e.jsx(Zt.div,{"data-state":aa(u),"data-disabled":o?"":void 0,...d,ref:a})})});Ta.displayName=St;var Ra="CollapsibleTrigger",_a=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,...n}=t,s=ea(Ra,r);return e.jsx(Zt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":aa(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:Ks(t.onClick,s.onOpenToggle)})});_a.displayName=Ra;var ta="CollapsibleContent",za=D.forwardRef((t,a)=>{const{forceMount:r,...n}=t,s=ea(ta,t.__scopeCollapsible);return e.jsx(Pa,{present:r||s.open,children:({present:o})=>e.jsx(mo,{...n,ref:a,present:o})})});za.displayName=ta;var mo=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,i=ea(ta,r),[d,u]=D.useState(n),c=D.useRef(null),x=Aa(a,c),g=D.useRef(0),w=g.current,N=D.useRef(0),v=N.current,C=i.open||d,b=D.useRef(C),S=D.useRef(void 0);return D.useEffect(()=>{const p=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(p)},[]),at(()=>{const p=c.current;if(p){S.current=S.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const I=p.getBoundingClientRect();g.current=I.height,N.current=I.width,b.current||(p.style.transitionDuration=S.current.transitionDuration,p.style.animationName=S.current.animationName),u(n)}},[i.open,n]),e.jsx(Zt.div,{"data-state":aa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...o,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:C&&s})});function aa(t){return t?"open":"closed"}var xo=Ta;const jt=W.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",dashed:"border border-dashed bg-background shadow-sm hover:bg-accent hover:text-accent-foreground ",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function T({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?De.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:l(jt({variant:a,size:r,className:t})),...s})}function Fa({...t}){return e.jsx(Ie.Root,{"data-slot":"alert-dialog",...t})}function fo({...t}){return e.jsx(Ie.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Ma({...t}){return e.jsx(Ie.Portal,{"data-slot":"alert-dialog-portal",...t})}function Ea({className:t,...a}){return e.jsx(Ie.Overlay,{"data-slot":"alert-dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function La({className:t,size:a="default",...r}){return e.jsxs(Ma,{children:[e.jsx(Ea,{}),e.jsx(Ie.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...r})]})}function Oa({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function Ba({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function Ua({className:t,...a}){return e.jsx(Ie.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function Va({className:t,...a}){return e.jsx(Ie.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function go({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-media",className:l("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",t),...a})}function Lt({className:t,variant:a="default",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Action,{"data-slot":"alert-dialog-action",className:l(t),...n})})}function $a({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...n})})}const po=W.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function ho({className:t,variant:a,...r}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:l(po({variant:a}),t),...r})}function bo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function vo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}function Ga({className:t,size:a="default",...r}){return e.jsx(Jt.Root,{"data-slot":"avatar","data-size":a,className:l("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...r})}function qa({className:t,...a}){return e.jsx(Jt.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",t),...a})}function Wa({className:t,...a}){return e.jsx(Jt.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}function jo({className:t,...a}){return e.jsx("span",{"data-slot":"avatar-badge",className:l("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",t),...a})}function wo({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group",className:l("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",t),...a})}function No({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group-count",className:l("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",t),...a})}const Ha=W.cva("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ht({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?De.Root:"span";return e.jsx(s,{"data-slot":"badge","data-variant":a,className:l(Ha({variant:a}),t),...n})}function Ka({className:t,classNames:a,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:o,components:i,...d}){const u=zt.getDefaultClassNames();return e.jsx(zt.DayPicker,{showOutsideDays:r,className:l("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...o},classNames:{root:l("w-fit",u.root),months:l("flex gap-4 flex-col md:flex-row relative",u.months),month:l("flex flex-col w-full gap-4",u.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",u.nav),button_previous:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_previous),button_next:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",u.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",u.dropdowns),dropdown_root:l("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",u.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",u.dropdown),caption_label:l("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:l("flex",u.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",u.weekday),week:l("flex w-full mt-2",u.week),week_number_header:l("select-none w-(--cell-size)",u.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",u.week_number),day:l("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",u.day),range_start:l("rounded-l-md bg-accent",u.range_start),range_middle:l("rounded-none",u.range_middle),range_end:l("rounded-r-md bg-accent",u.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:l("text-muted-foreground opacity-50",u.disabled),hidden:l("invisible",u.hidden),...a},components:{Root:({className:c,rootRef:x,...g})=>e.jsx("div",{"data-slot":"calendar",ref:x,className:l(c),...g}),Chevron:({className:c,orientation:x,...g})=>x==="left"?e.jsx(f.ChevronLeftIcon,{className:l("size-4",c),...g}):x==="right"?e.jsx(f.ChevronRightIcon,{className:l("size-4",c),...g}):e.jsx(f.ChevronDownIcon,{className:l("size-4",c),...g}),DayButton:Xa,WeekNumber:({children:c,...x})=>e.jsx("td",{...x,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:c})}),...i},...d})}function Xa({className:t,day:a,modifiers:r,...n}){const s=zt.getDefaultClassNames(),o=D.useRef(null);return D.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(T,{ref:o,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:l("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,t),...n})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function yo({className:t,...a}){return e.jsx("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function Co({className:t,...a}){return e.jsx("div",{"data-slot":"card-title",className:l("leading-none font-semibold",t),...a})}function So({className:t,...a}){return e.jsx("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",t),...a})}function ko({className:t,...a}){return e.jsx("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function Ya({className:t,...a}){return e.jsx("div",{"data-slot":"card-content",className:l("px-6",t),...a})}function Io({className:t,...a}){return e.jsx("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",t),...a})}function Ve({className:t,...a}){return e.jsx(ga.Root,{"data-slot":"checkbox",className:l("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(ga.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(f.CheckIcon,{className:"size-3.5"})})})}function kt({...t}){return e.jsx(U.Root,{"data-slot":"dialog",...t})}function Qa({...t}){return e.jsx(U.Trigger,{"data-slot":"dialog-trigger",...t})}function Ja({...t}){return e.jsx(U.Portal,{"data-slot":"dialog-portal",...t})}function Do({...t}){return e.jsx(U.Close,{"data-slot":"dialog-close",...t})}function Za({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function It({className:t,children:a,showCloseButton:r=!0,...n}){return e.jsxs(Ja,{"data-slot":"dialog-portal",children:[e.jsx(Za,{}),e.jsxs(U.Content,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...n,children:[a,r&&e.jsxs(U.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(f.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ra({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function er({className:t,showCloseButton:a=!1,children:r,...n}){return e.jsxs("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...n,children:[r,a&&e.jsx(U.Close,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})]})}function Dt({className:t,...a}){return e.jsx(U.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function tr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function Y({className:t,...a}){return e.jsx($e.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function Ao({title:t="Command Palette",description:a="Search for a command to run...",children:r,className:n,showCloseButton:s=!0,...o}){return e.jsxs(kt,{...o,children:[e.jsxs(ra,{className:"sr-only",children:[e.jsx(Dt,{children:t}),e.jsx(tr,{children:a})]}),e.jsx(It,{className:l("overflow-hidden p-0",n),showCloseButton:s,children:e.jsx(Y,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function ie({className:t,...a}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(f.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx($e.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function le({className:t,...a}){return e.jsx($e.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function de({...t}){return e.jsx($e.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function re({className:t,...a}){return e.jsx($e.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function ar({className:t,...a}){return e.jsx($e.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",t),...a})}function X({className:t,...a}){return e.jsx($e.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Po({className:t,...a}){return e.jsx("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function ve({...t}){return e.jsx($.Root,{"data-slot":"dropdown-menu",...t})}function rr({...t}){return e.jsx($.Portal,{"data-slot":"dropdown-menu-portal",...t})}function je({...t}){return e.jsx($.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function we({className:t,sideOffset:a=4,...r}){return e.jsx($.Portal,{children:e.jsx($.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})})}function na({...t}){return e.jsx($.Group,{"data-slot":"dropdown-menu-group",...t})}function ue({className:t,inset:a,variant:r="default",...n}){return e.jsx($.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:l("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function To({className:t,children:a,checked:r,...n}){return e.jsxs($.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...n,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),a]})}function Ro({...t}){return e.jsx($.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function _o({className:t,children:a,...r}){return e.jsxs($.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CircleIcon,{className:"size-2 fill-current"})})}),a]})}function At({className:t,inset:a,...r}){return e.jsx($.Label,{"data-slot":"dropdown-menu-label","data-inset":a,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r})}function rt({className:t,...a}){return e.jsx($.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",t),...a})}function zo({className:t,...a}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function nr({...t}){return e.jsx($.Sub,{"data-slot":"dropdown-menu-sub",...t})}function sr({className:t,inset:a,children:r,...n}){return e.jsxs($.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(f.ChevronRightIcon,{className:"ml-auto size-4"})]})}function or({className:t,...a}){return e.jsx($.SubContent,{"data-slot":"dropdown-menu-sub-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...a})}function Fo({...t}){return e.jsx(vt.Root,{"data-slot":"hover-card",...t})}function Mo({...t}){return e.jsx(vt.Trigger,{"data-slot":"hover-card-trigger",...t})}function Eo({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(vt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(vt.Content,{"data-slot":"hover-card-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function H({className:t,type:a,...r}){return e.jsx("input",{type:a,"data-slot":"input",className:l("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function Se({className:t,...a}){return e.jsx(Bs.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function Lo({className:t,children:a,viewport:r=!0,...n}){return e.jsxs(Ee.Root,{"data-slot":"navigation-menu","data-viewport":r,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...n,children:[a,r&&e.jsx(lr,{})]})}function Oo({className:t,...a}){return e.jsx(Ee.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function Bo({className:t,...a}){return e.jsx(Ee.Item,{"data-slot":"navigation-menu-item",className:l("relative",t),...a})}const ir=W.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function Uo({className:t,children:a,...r}){return e.jsxs(Ee.Trigger,{"data-slot":"navigation-menu-trigger",className:l(ir(),"group",t),...r,children:[a," ",e.jsx(f.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Vo({className:t,...a}){return e.jsx(Ee.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function lr({className:t,...a}){return e.jsx("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(Ee.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function $o({className:t,...a}){return e.jsx(Ee.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Go({className:t,...a}){return e.jsx(Ee.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function Q({...t}){return e.jsx(tt.Root,{"data-slot":"popover",...t})}function J({...t}){return e.jsx(tt.Trigger,{"data-slot":"popover-trigger",...t})}function Z({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(tt.Portal,{children:e.jsx(tt.Content,{"data-slot":"popover-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function qo({...t}){return e.jsx(tt.Anchor,{"data-slot":"popover-anchor",...t})}function Wo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-header",className:l("flex flex-col gap-1 text-sm",t),...a})}function Ho({className:t,...a}){return e.jsx("div",{"data-slot":"popover-title",className:l("font-medium",t),...a})}function Ko({className:t,...a}){return e.jsx("p",{"data-slot":"popover-description",className:l("text-muted-foreground",t),...a})}function Pt({className:t,value:a,...r}){return e.jsx(pa.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...r,children:e.jsx(pa.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})})}function Xo({className:t,...a}){return e.jsx(Mt.Root,{"data-slot":"radio-group",className:l("grid gap-3",t),...a})}function Yo({className:t,...a}){return e.jsx(Mt.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Mt.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(f.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qo({className:t,children:a,...r}){return e.jsxs(Ze.Root,{"data-slot":"scroll-area",className:l("relative",t),...r,children:[e.jsx(Ze.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),e.jsx(dr,{}),e.jsx(Ze.Corner,{})]})}function dr({className:t,orientation:a="vertical",...r}){return e.jsx(Ze.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:l("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...r,children:e.jsx(Ze.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function cr({...t}){return e.jsx(K.Root,{"data-slot":"select",...t})}function Jo({...t}){return e.jsx(K.Group,{"data-slot":"select-group",...t})}function ur({...t}){return e.jsx(K.Value,{"data-slot":"select-value",...t})}function mr({className:t,size:a="default",children:r,...n}){return e.jsxs(K.Trigger,{"data-slot":"select-trigger","data-size":a,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(K.Icon,{asChild:!0,children:e.jsx(f.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function xr({className:t,children:a,position:r="item-aligned",align:n="center",...s}){return e.jsx(K.Portal,{children:e.jsxs(K.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...s,children:[e.jsx(gr,{}),e.jsx(K.Viewport,{className:l("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(pr,{})]})})}function Zo({className:t,...a}){return e.jsx(K.Label,{"data-slot":"select-label",className:l("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function fr({className:t,children:a,...r}){return e.jsxs(K.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(K.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),e.jsx(K.ItemText,{children:a})]})}function ei({className:t,...a}){return e.jsx(K.Separator,{"data-slot":"select-separator",className:l("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function gr({className:t,...a}){return e.jsx(K.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronUpIcon,{className:"size-4"})})}function pr({className:t,...a}){return e.jsx(K.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronDownIcon,{className:"size-4"})})}function Tt({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Us.Root,{"data-slot":"separator",decorative:r,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function sa({...t}){return e.jsx(U.Root,{"data-slot":"sheet",...t})}function hr({...t}){return e.jsx(U.Trigger,{"data-slot":"sheet-trigger",...t})}function ti({...t}){return e.jsx(U.Close,{"data-slot":"sheet-close",...t})}function ai({...t}){return e.jsx(U.Portal,{"data-slot":"sheet-portal",...t})}function ri({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function oa({className:t,children:a,side:r="right",showCloseButton:n=!0,...s}){return e.jsxs(ai,{children:[e.jsx(ri,{}),e.jsxs(U.Content,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,n&&e.jsxs(U.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(f.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function br({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function ni({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function ia({className:t,...a}){return e.jsx(U.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function vr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}const _t=768;function Rt(){const[t,a]=D.useState(void 0);return D.useEffect(()=>{const r=window.matchMedia(`(max-width: ${_t-1}px)`),n=()=>{a(window.innerWidth<_t)};return r.addEventListener("change",n),a(window.innerWidth<_t),()=>r.removeEventListener("change",n)},[]),!!t}function Be({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:l("bg-accent animate-pulse rounded-md",t),...a})}function _e({delayDuration:t=0,...a}){return e.jsx(He.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function ne({...t}){return e.jsx(He.Root,{"data-slot":"tooltip",...t})}function se({...t}){return e.jsx(He.Trigger,{"data-slot":"tooltip-trigger",...t})}function oe({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(He.Portal,{children:e.jsxs(He.Content,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,e.jsx(He.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const si="sidebar_state",oi=3600*24*7,ii="16rem",li="18rem",di="3rem",ci="b",jr=D.createContext(null);function nt(){const t=D.useContext(jr);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function wr({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...i}){const d=Rt(),[u,c]=D.useState(!1),[x,g]=D.useState(t),w=a??x,N=D.useCallback(S=>{const p=typeof S=="function"?S(w):S;r?r(p):g(p),document.cookie=`${si}=${p}; path=/; max-age=${oi}`},[r,w]),v=D.useCallback(()=>d?c(S=>!S):N(S=>!S),[d,N,c]);D.useEffect(()=>{const S=p=>{p.key===ci&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),v())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[v]);const C=w?"expanded":"collapsed",b=D.useMemo(()=>({state:C,open:w,setOpen:N,isMobile:d,openMobile:u,setOpenMobile:c,toggleSidebar:v}),[C,w,N,d,u,c,v]);return e.jsx(jr.Provider,{value:b,children:e.jsx(_e,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ii,"--sidebar-width-icon":di,...s},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...i,children:o})})})}function Nr({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:i,state:d,openMobile:u,setOpenMobile:c}=nt();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):i?e.jsx(sa,{open:u,onOpenChange:c,...o,children:e.jsxs(oa,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":li},side:t,children:[e.jsxs(br,{className:"sr-only",children:[e.jsx(ia,{children:"Sidebar"}),e.jsx(vr,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function yr({className:t,onClick:a,...r}){const{toggleSidebar:n}=nt();return e.jsxs(T,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:s=>{a?.(s),n()},...r,children:[e.jsx(f.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Cr({className:t,...a}){const{toggleSidebar:r}=nt();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...a})}function Sr({className:t,...a}){return e.jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function ui({className:t,...a}){return e.jsx(H,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",t),...a})}function kr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Ir({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function mi({className:t,...a}){return e.jsx(Tt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Dr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function Ar({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function xi({className:t,asChild:a=!1,...r}){const n=a?De.Root:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function fi({className:t,asChild:a=!1,...r}){const n=a?De.Root:"button";return e.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...r})}function gi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function Pr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function Ot({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const pi=W.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bt({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){const d=t?De.Root:"button",{isMobile:u,state:c}=nt(),x=e.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:l(pi({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:x}),e.jsx(oe,{side:"right",align:"center",hidden:c!=="collapsed"||u,...s})]})):x}function hi({className:t,asChild:a=!1,showOnHover:r=!1,...n}){const s=a?De.Root:"button";return e.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...n})}function bi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...a})}function vi({className:t,showIcon:a=!1,...r}){const n=D.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[a&&e.jsx(Be,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Be,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function Tr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Rr({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",t),...a})}function _r({asChild:t=!1,size:a="md",isActive:r=!1,className:n,...s}){const o=t?De.Root:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}function ji({className:t,defaultValue:a,value:r,min:n=0,max:s=100,...o}){const i=D.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(mt.Root,{"data-slot":"slider",defaultValue:a,value:r,min:n,max:s,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[e.jsx(mt.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:e.jsx(mt.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:i.length},(d,u)=>e.jsx(mt.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const zr=D.createContext(void 0),Fr=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=D.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=D.useState(()=>r==="system"?a():r),i=D.useCallback(u=>{const c=document.documentElement;c.classList.remove("dark","blue-dark");let x;u==="system"?x=a():x=u,x==="dark"&&c.classList.add("dark"),x==="blue-dark"&&c.classList.add("blue-dark"),o(x)},[]);D.useEffect(()=>{i(r),localStorage.setItem("theme",r)},[r,i]),D.useEffect(()=>{if(r!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),c=()=>{i("system")};return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[r,i]);const d=D.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(zr.Provider,{value:d,children:t})},Mr=()=>{const t=D.useContext(zr);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},wi=({...t})=>{const{theme:a="system"}=Mr();return e.jsx(Ca.Toaster,{theme:a,className:"toaster group",icons:{success:e.jsx(f.CircleCheckIcon,{className:"size-4"}),info:e.jsx(f.InfoIcon,{className:"size-4"}),warning:e.jsx(f.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(f.OctagonXIcon,{className:"size-4"}),loading:e.jsx(f.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function Ni({className:t,size:a="default",...r}){return e.jsx(ha.Root,{"data-slot":"switch","data-size":a,className:l("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",t),...r,children:e.jsx(ha.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Er({className:t,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",t),...a})})}function Lr({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",t),...a})}function Or({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",t),...a})}function Br({className:t,...a}){return e.jsx("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...a})}function qe({className:t,...a}){return e.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function Ut({className:t,...a}){return e.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function Ye({className:t,...a}){return e.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function yi({className:t,...a}){return e.jsx("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",t),...a})}function Ur({className:t,orientation:a="horizontal",...r}){return e.jsx(Ct.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:l("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const Vr=W.cva("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function $r({className:t,variant:a="default",...r}){return e.jsx(Ct.List,{"data-slot":"tabs-list","data-variant":a,className:l(Vr({variant:a}),t),...r})}function Gr({className:t,...a}){return e.jsx(Ct.Trigger,{"data-slot":"tabs-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function Vt({className:t,...a}){return e.jsx(Ct.Content,{"data-slot":"tabs-content",className:l("flex-1 outline-none",t),...a})}function qr({className:t,...a}){return e.jsx("textarea",{"data-slot":"textarea",className:l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}function $t({...t}){return e.jsx(Os.Root,{"data-slot":"aspect-ratio",...t})}function Wr({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Hr({className:t,...a}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...a})}function We({className:t,...a}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",t),...a})}function Gt({asChild:t,className:a,...r}){const n=t?De.Root:"a";return e.jsx(n,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",a),...r})}function Qe({className:t,...a}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",t),...a})}function bt({children:t,className:a,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",a),...r,children:t??e.jsx(f.ChevronRight,{})})}function qt({className:t,...a}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",t),...a,children:[e.jsx(f.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Kr({...t}){return e.jsx(xo,{"data-slot":"collapsible",...t})}function Xr({...t}){return e.jsx(_a,{"data-slot":"collapsible-trigger",...t})}function Yr({...t}){return e.jsx(za,{"data-slot":"collapsible-content",...t})}function Qr({...t}){return e.jsx(Me.Drawer.Root,{"data-slot":"drawer",...t})}function Jr({...t}){return e.jsx(Me.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Zr({...t}){return e.jsx(Me.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function en({...t}){return e.jsx(Me.Drawer.Close,{"data-slot":"drawer-close",...t})}function tn({className:t,...a}){return e.jsx(Me.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function an({className:t,children:a,...r}){return e.jsxs(Zr,{"data-slot":"drawer-portal",children:[e.jsx(tn,{}),e.jsxs(Me.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...r,children:[e.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function rn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...a})}function nn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function sn({className:t,...a}){return e.jsx(Me.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",t),...a})}function on({className:t,...a}){return e.jsx(Me.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",t),...a})}const ln=Ke.FormProvider,dn=D.createContext({}),xe=({...t})=>e.jsx(dn.Provider,{value:{name:t.name},children:e.jsx(Ke.Controller,{...t})}),st=()=>{const t=D.useContext(dn),a=D.useContext(cn),{getFieldState:r}=Ke.useFormContext(),n=Ke.useFormState({name:t.name}),s=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},cn=D.createContext({});function fe({className:t,...a}){const r=D.useId();return e.jsx(cn.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:l("grid gap-2",t),...a})})}function Ne({className:t,...a}){const{error:r,formItemId:n}=st();return e.jsx(Se,{"data-slot":"form-label","data-error":!!r,className:l("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function ge({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=st();return e.jsx(De.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function ye({className:t,...a}){const{formDescriptionId:r}=st();return e.jsx("p",{"data-slot":"form-description",id:r,className:l("text-muted-foreground text-sm",t),...a})}function pe({className:t,...a}){const{error:r,formMessageId:n}=st(),s=r?String(r?.message??""):a.children;return s?e.jsx("p",{"data-slot":"form-message",id:n,className:l("text-destructive text-sm",t),...a,children:s}):null}function un({className:t,containerClassName:a,...r}){return e.jsx(Sa.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",a),className:l("disabled:cursor-not-allowed",t),...r})}function mn({className:t,...a}){return e.jsx("div",{"data-slot":"input-otp-group",className:l("flex items-center",t),...a})}function Je({index:t,className:a,...r}){const n=D.useContext(Sa.OTPInputContext),{char:s,hasFakeCaret:o,isActive:i}=n?.slots[t]??{};return e.jsxs("div",{"data-slot":"input-otp-slot","data-active":i,className:l("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...r,children:[s,o&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Ci({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(f.MinusIcon,{})})}const la=W.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Si({className:t,variant:a,size:r,...n}){return e.jsx(Vs.Root,{"data-slot":"toggle",className:l(la({variant:a,size:r,className:t})),...n})}const xn=D.createContext({size:"default",variant:"default",spacing:0});function Oe({className:t,variant:a,size:r,spacing:n=0,children:s,...o}){return e.jsx(Da.Root,{"data-slot":"toggle-group","data-variant":a,"data-size":r,"data-spacing":n,style:{"--gap":n},className:l("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",t),...o,children:e.jsx(xn.Provider,{value:{variant:a,size:r,spacing:n},children:s})})}function V({className:t,children:a,variant:r,size:n,...s}){const o=D.useContext(xn);return e.jsx(Da.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||r,"data-size":o.size||n,"data-spacing":o.spacing,className:l(la({variant:o.variant||r,size:o.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...s,children:a})}function ze({tooltipContent:t,children:a}){return e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:a}),e.jsx(oe,{children:t})]})})}function ot({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a,size:n,...s,asChild:r,children:t})}function ki({children:t,variant:a,asChild:r=!1,size:n,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(ot,{variant:a,size:n,...o,asChild:r,children:t})})}function it({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function fn({children:t,variant:a,size:r,asChild:n=!1,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(it,{variant:a,size:r,...o,asChild:n,children:t})})}function gn({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(T,{variant:a||"outline",size:r||"icon",...s,asChild:n,children:t})}function Re({children:t,tooltipContent:a,asChild:r=!1,variant:n,size:s,...o}){return e.jsx(ze,{tooltipContent:a,children:e.jsx(gn,{variant:n,size:s,...o,asChild:r,children:t})})}function Wt({actionMenus:t,extraActionParams:a}){const r=n=>(n=n.filter(s=>s?.visibility===void 0||s.visibility===!0||s.visibility&&s.visibility(...a?.arguments||[])),n.length===0?e.jsx(ue,{className:"text-center",children:"No action available."}):n.map((s,o)=>{if(s.type==="label")return e.jsx(At,{children:String(s.label)},o);if(s.type==="separator")return e.jsx(rt,{},o);if(s.type==="group"&&s.items)return e.jsx(na,{children:r(s.items)},o);if(s.items)return e.jsxs(nr,{children:[e.jsx(sr,{children:String(s.label)}),e.jsx(rr,{children:e.jsx(or,{children:r(s.items)})})]},o);let i="";return typeof s.label=="function"?i=s.label(...a?.arguments||[]):i=s.label,e.jsxs(ue,{disabled:s.disabled,onClick:()=>s.onClick&&s.onClick(...a?.arguments||[]),children:[s.icon&&e.jsx(s.icon,{}),i]},o)}));return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(Re,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(f.MoreHorizontal,{})})}),e.jsx(we,{className:"w-56",align:"end",children:r(t)})]})}const pn=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:i,onConfirm:d,onThird:u})=>e.jsx(Fa,{open:!0,children:e.jsxs(La,{children:[e.jsxs(Oa,{children:[e.jsx(Ua,{className:r,children:t}),e.jsx(Va,{className:r,children:a})]}),e.jsxs(Ba,{children:[n!=""&&e.jsx($a,{onClick:()=>{i&&i()},children:n}),o!=""&&e.jsx(Lt,{className:"bg-blue-500",color:"black",onClick:()=>{u&&u()},children:o}),s!=""&&e.jsx(Lt,{onClick:()=>{d&&d()},children:s})]})]})}),hn=m.createContext(void 0),Ii=()=>{const t=m.useContext(hn);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},bn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(hn.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(pn,{title:a.title,description:a.description,fontSize:a.fontSize||"text-base",cancelText:a.cancelText||"",confirmText:a.confirmText||"",thirdOptionText:a.thirdOptionText||"",onConfirm:()=>{a.onConfirm&&a.onConfirm(),s()},onCancel:()=>{a.onCancel&&a.onCancel(),s()},onThird:()=>{a.onThird&&a.onThird(),s()}})]})};function Di({placeholder:t,items:a,disabled:r,onSelect:n,defaultValue:s}){const[o,i]=m.useState(s??"");return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!o&&"text-muted-foreground","bg-secondary"),disabled:r===!0||typeof r=="function"&&r(),children:[o?a.find(d=>d.value===o)?.label||o:t,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:a.map(d=>e.jsxs(X,{value:d.value,disabled:d.disabled===!0||typeof d.disabled=="function"&&d.disabled(d),onSelect:u=>{const c=a.find(x=>x.value.toLowerCase()===u.toLowerCase())?.value??u;i(c),n?.(c)},children:[d?.label||d.value,e.jsx(f.Check,{className:l("ml-auto",d.value===o?"opacity-100":"opacity-0")})]},d.value))})]})]})})]})}const ke=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function vn({table:t}){return e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Column View",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Settings2,{}),"View"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>{const r=a.getIsVisible();return e.jsxs(X,{onSelect:()=>{a.toggleVisibility(!r)},disabled:a.getIsGrouped(),children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",r?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(a),children:ke(a)})]},a.id)})})]})]})})]})}function jn({column:t}){const a=t?.getFacetedUniqueValues(),r=new Set(t?.getFilterValue()),n=D.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(fn,{variant:"dashed",tooltipContent:ke(t),children:[r?.size>0?e.jsx(f.X,{}):e.jsx(f.Plus,{}),ke(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:s},s))})]})]})}),e.jsx(Z,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:ke(t)}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:n.map(s=>{const o=r.has(s);return e.jsxs(X,{onSelect:()=>{o?r.delete(s):r.add(s);const i=Array.from(r);t?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:s,children:s}),a?.get(s)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:a.get(s)})]},s)})})]}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(ar,{}),e.jsx(re,{children:e.jsx(X,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function wn({table:t}){const[a,r]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Filter",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Filter,{}),"Filter"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>{const s=new Set(a),o=s.has(n.id);return e.jsxs(X,{onSelect:()=>{o?s.delete(n.id):s.add(n.id),r([...s])},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(n),children:ke(n)})]},n.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:a.map(n=>{const s=t.getColumn(n);if(s)return e.jsx(jn,{column:s},n)})})]})}const Nn=async t=>new Promise((a,r)=>{const n=new FileReader;n.onload=()=>{const o=n.result.split(",")[1];a({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},n.onerror=()=>r(n.error),n.readAsDataURL(t)});function Ai(t){const a=atob(t.base64),r=new Array(a.length).fill(0).map((o,i)=>a.charCodeAt(i)),n=new Uint8Array(r),s=new Blob([n],{type:t.type});return URL.createObjectURL(s)}function Pi({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async x=>{if(!x)return;const g=await Nn(x);await r(g)},i=x=>{if(!a)return;x.preventDefault(),s(!1);const g=x.dataTransfer.files?.[0];g&&o(g)},d=x=>{a&&(x.preventDefault(),s(!0))},u=()=>{a&&s(!1)},c=x=>{const g=x.target.files?.[0];g&&o(g)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:c}),a?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
|
|
2
2
|
${n?"border-blue-600 bg-blue-50":"border-gray-300"}
|
|
3
|
-
`,onDragOver:c,onDragLeave:u,onDrop:i,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(f.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(f.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const Si=[15,20,30,40,50,100];function hn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between ",children:[e.jsx("small",{className:"flex-1 px-2 text-gray-600 dark:text-gray-400",children:(a?.numberOfRows==null||a?.numberOfRows)&&a?.checkBoxColumn?e.jsxs(e.Fragment,{children:[t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."]}):e.jsxs(e.Fragment,{children:["Total ",t.getFilteredRowModel().rows.length," no(s) of rows."]})}),(a?.pagination==null||a.pagination)&&e.jsxs("div",{className:"flex items-start md:items-center gap-3 flex-col md:flex-row ",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("small",{className:"text-gray-600 dark:text-gray-400",children:"Rows per page"}),(a?.rowsPerPage==null||a.rowsPerPage)&&e.jsxs(nr,{value:`${t.getState().pagination.pageSize}`,onValueChange:r=>{t.setPageSize(Number(r))},children:[e.jsx(or,{className:"w-[70px] h-8",children:e.jsx(sr,{placeholder:t.getState().pagination.pageSize})}),e.jsx(ir,{side:"top",children:(a?.pageSizeArray||Si).map(r=>e.jsx(lr,{value:`${r}`,children:r},r))})]})]}),e.jsxs(e.Fragment,{children:[e.jsxs("small",{className:"flex w-[100px] items-center justify-center text-gray-600 dark:text-gray-400",children:["Page ",t.getState().pagination.pageIndex+1," of"," ",t.getPageCount()]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ie,{tooltipContent:"Go to first page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronsLeft,{})}),e.jsx(Ie,{tooltipContent:"Go to previous page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronLeft,{})}),e.jsx(Ie,{tooltipContent:"Go to next page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronRight,{})}),e.jsx(Ie,{tooltipContent:"Go to last page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronsRight,{})})]})]})]})]})}function bn({className:t,...a}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(f.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(K,{className:H.cx("pl-8 h-8",t),...a})]})}function vn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-3 overflow-hidden",children:[(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("search"))&&e.jsx(bn,{placeholder:"Search ...",onChange:r=>t.setGlobalFilter(r.target.value),className:"max-w-sm"}),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("filter"))&&e.jsx(gn,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[a?.extraTools?.map((r,n)=>e.jsx(m.Fragment,{children:r},n)),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("columnFilter"))&&e.jsx(xn,{table:t})]})]})}const ki=m.forwardRef(({columns:t,data:a,extraParams:r,onTableReady:n},s)=>{const[o,i]=m.useState([]),[c,u]=m.useState(""),[d,x]=m.useState([]),[p,w]=m.useState({pageIndex:r?.pageIndex||0,pageSize:r?.pageSize||15}),[N,v]=m.useState({}),[y,b]=m.useState([]),[C,g]=m.useState({}),[S,j]=m.useState({});t=t.map(D=>(D?.filterFn||(D.filterFn="arrIncludesSome"),D)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(h.getFilteredSelectedRowModel().rows)},[S]),r?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:D})=>e.jsx(Ze,{checked:D.getIsAllPageRowsSelected()||D.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:P=>D.toggleAllPageRowsSelected(!!P),"aria-label":"Select all"}),cell:({row:D})=>e.jsx(e.Fragment,{children:e.jsx(Ze,{checked:D.getIsSelected(),onCheckedChange:P=>D.toggleSelected(!!P),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(r?.actionMenu||r?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:D})=>D.getIsGrouped()?r?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Bt,{actionMenus:r.groupActionMenu.items,extraActionParams:{arguments:[D.original,...r.groupActionMenu.extraArguments||[]]}})}):null:r?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Bt,{actionMenus:r.actionMenu.items,extraActionParams:{arguments:[D.original,...r.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{r?.onPaginationChange?.(p)},[p]);const h=L.useReactTable({data:a,columns:t,state:{sorting:o,globalFilter:c,columnFilters:d,columnVisibility:N,rowSelection:S,grouping:y,expanded:C,pagination:p},onPaginationChange:w,onSortingChange:i,onExpandedChange:g,onColumnFiltersChange:x,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:u,onRowSelectionChange:j,getCoreRowModel:L.getCoreRowModel(),getPaginationRowModel:L.getPaginationRowModel(),getSortedRowModel:L.getSortedRowModel(),getFilteredRowModel:L.getFilteredRowModel(),getGroupedRowModel:L.getGroupedRowModel(),getExpandedRowModel:L.getExpandedRowModel(),getFacetedRowModel:L.getFacetedRowModel(),getFacetedUniqueValues:L.getFacetedUniqueValues(),getFacetedMinMaxValues:L.getFacetedMinMaxValues(),manualPagination:r?.pagination==null||r?.pagination==!0?void 0:!0});m.useImperativeHandle(s,()=>h);const[I,T]=m.useState([]),A=(D,P)=>{const E={id:P.id,title:ye(P.column)};D.dataTransfer.setData("headerObj",JSON.stringify(E)),D.dataTransfer.effectAllowed="move"},O=D=>{D.preventDefault();const P=JSON.parse(D.dataTransfer.getData("headerObj"));if(!I.find(E=>E.id==P.id)){T(_=>[..._,P]);const E=h.getColumn(P.id);E&&E.getToggleGroupingHandler()()}},V=D=>{D.preventDefault()},ce=D=>{const P=I.filter(_=>_.id!==D);T(()=>[...P]);const E=h.getColumn(D);E&&E.getToggleGroupingHandler()()},[ke,we]=m.useState(!1);return m.useEffect(()=>{ke||we(!0),r?.defaultGroups&&h.setGrouping(r?.defaultGroups)},[]),m.useEffect(()=>{n&&n(h)},[n,h]),ke&&e.jsxs("div",{className:"w-full h-full flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3 overflow-hidden",children:[(r?.defaultTools==null||r.defaultTools||r.extraTools)&&e.jsx(vn,{table:h,extraParams:r}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(r?.grouping==null||r.grouping)&&e.jsx("div",{className:"w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new",onDrop:O,onDragOver:V,children:I.length===0?"Drag a column header here to group its column":I.map((D,P)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[D.title,e.jsx("span",{onClick:()=>ce(D.id),children:e.jsx(f.X,{size:15})})]},D.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Ar,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Rr,{className:"sticky top-0 z-10 border-t bg-card-new",children:h.getHeaderGroups().map(D=>e.jsx(Ue,{className:H.cx(""),children:D.headers.map(P=>P.column.getIsGrouped()?P.column.getGroupedIndex()<I.length-1?null:e.jsx(Ft,{colSpan:I.length,className:H.cx("w-36 ","text-left")},P.id):e.jsx(Ft,{...r?.grouping==null||r.grouping?{onDragStart:E=>A(E,P),draggable:!0}:{},className:H.cx("text-left"),children:P.isPlaceholder?null:(r?.sorting==null||r.sorting)&&P.column.getCanSort()?e.jsxs("div",{onClick:P.column.getToggleSortingHandler(),className:H.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:L.flexRender(P.column.columnDef.header,P.getContext())}),P.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(f.ChevronUp,{className:H.cx("size-3.5 text-foreground",P.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(f.ChevronDown,{className:H.cx("size-3.5 text-foreground",P.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):L.flexRender(P.column.columnDef.header,P.getContext())},P.id))},D.id))}),e.jsx(zr,{children:h.getRowModel().rows.length?h.getRowModel().rows.map(D=>D.getIsGrouped()?e.jsx(Ue,{children:D.getVisibleCells().map(P=>P.column.getIndex()<D.depth?null:e.jsx(We,{colSpan:P.column.getIndex()==D.depth?D.depth+1:void 0,className:P.column.getIndex()==D.depth?"w-36":"",children:P.getIsGrouped()?e.jsxs(R,{variant:"link",onClick:D.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:D.depth+"rem"},children:[D.getIsExpanded()?e.jsx(f.ChevronDown,{}):e.jsx(f.ChevronRight,{})," ",L.flexRender(P.column.columnDef.cell,P.getContext())," ","(",D.subRows.length,")"]}):P.column.id=="DTActions"?L.flexRender(P.column.columnDef.cell,P.getContext()):P.getIsAggregated()?L.flexRender(P.column.columnDef.aggregatedCell??P.column.columnDef.cell,P.getContext()):P.getIsPlaceholder()?null:L.flexRender(P.column.columnDef.cell,P.getContext())},P.id))},D.id):e.jsx(Ue,{className:H.cx(D.getIsSelected()?"bg-accent/10":""),...r?.checkBoxColumn&&{onClick:()=>D.toggleSelected(!D.getIsSelected())},children:D.getVisibleCells().map((P,E)=>e.jsxs(We,{className:H.cx(D.getIsSelected()?"relative":"",!(r?.actionMenu||r?.groupActionMenu)&&"py-2"),children:[E===0&&D.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),P.getIsPlaceholder()?null:L.flexRender(P.column.columnDef.cell,P.getContext())]},P.id))},D.id)):e.jsx(Ue,{children:e.jsx(We,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),r?.footer&&e.jsx(_r,{className:"sticky bottom-0 bg-background text-foreground",children:h.getFooterGroups().map(D=>e.jsx(Ue,{children:D.headers.map(P=>e.jsx(We,{children:P.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:L.flexRender(P.column.columnDef.footer,P.getContext())})}))}))})]})})]})]}),(r?.paginationBar==null||r.paginationBar)&&e.jsx(hn,{table:h,extraParams:r})]})});function jn({isLoading:t,onReload:a,errorMessage:r}){return!t&&!r?null:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-md rounded-lg transition-all duration-300",children:e.jsx("div",{className:"flex flex-col items-center gap-4",children:t?e.jsx("div",{className:"bg-background/80 p-6 rounded-2xl shadow-xl border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx(f.Loader2,{size:48,className:"text-primary animate-spin"})}):e.jsx("div",{className:"bg-background/80 p-4 rounded-full shadow-lg border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx("button",{onClick:a,className:"p-3 rounded-full bg-primary/10 hover:bg-primary/20 transition-all text-primary hover:scale-110 active:scale-95",title:r||"Reload Data",children:e.jsx(f.RotateCcw,{className:"w-6 h-6"})})})})})}function Ii(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),[n,s]=m.useState(r.get("search")||""),[o]=ys.useDebounce(n,500);return m.useEffect(()=>{const i=new URLSearchParams(r.toString());o?i.set("search",o):i.delete("search"),i.get("search")!==r.get("search")&&(i.set("page","1"),t(`${a}?${i.toString()}`,{replace:!0}))},[o,a,t,r]),m.useEffect(()=>{const i=r.get("search")||"";i!==n&&s(i)},[r]),e.jsxs("div",{className:"relative w-full max-w-sm",children:[e.jsx(f.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search ...",value:n,onChange:i=>s(i.target.value),className:"flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"})]})}function Ti(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),n=r.get("size")||"10",s=o=>{const i=new URLSearchParams(r.toString());i.set("size",o.target.value),i.set("page","1"),t(`${a}?${i.toString()}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page:"}),e.jsxs("select",{className:"h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary",value:n,onChange:s,children:[e.jsx("option",{value:"10",children:"10"}),e.jsx("option",{value:"20",children:"20"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]})}function Di({totalPages:t,currentPage:a}){const r=ae.useNavigate(),{pathname:n}=ae.useLocation(),[s]=ae.useSearchParams(),o=i=>{const c=new URLSearchParams(s.toString());c.set("page",i.toString()),r(`${n}?${c.toString()}`)};return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>o(a-1),disabled:a<=1,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-2",children:["Page ",e.jsx("span",{className:"font-semibold",children:a})," of"," ",e.jsx("span",{className:"font-semibold",children:Math.max(t,1)})]}),e.jsx("button",{type:"button",onClick:()=>o(a+1),disabled:a>=t,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Next"})]})}function Pi({table:t}){const[a,r]=m.useState(!1),[n,s]=m.useState(""),o=m.useRef(null),i=t.getState().columnFilters,u=t.getAllLeafColumns().filter(d=>d.getCanFilter()).filter(d=>d.id.toLowerCase().includes(n.toLowerCase()));return m.useEffect(()=>{const d=x=>{o.current&&!o.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:e.jsxs("div",{className:"relative",ref:o,children:[e.jsxs("button",{onClick:()=>r(!a),className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background text-sm font-medium transition-all ${a?"border-primary ring-1 ring-primary":"border-border hover:bg-muted"}`,children:[e.jsx(f.ListFilter,{className:"w-4 h-4"}),"Filter"]}),a&&e.jsxs("div",{className:"absolute mt-2 w-64 bg-white border border-gray-200 rounded-md shadow-xl ",children:[e.jsx("div",{className:"p-3 border-b text-center font-bold text-gray-800 text-sm",children:"Columns For Filtering"}),e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(f.Search,{className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-gray-400"}),e.jsx("input",{placeholder:"Search columns...",className:"w-full pl-8 pr-2 py-1.5 border rounded text-sm outline-none focus:ring-1 focus:ring-blue-500",value:n,onChange:d=>s(d.target.value)})]}),e.jsx("div",{className:"max-h-48 overflow-y-auto space-y-1 pr-1",children:u.map(d=>{const x=i.some(p=>p.id===d.id);return e.jsxs("label",{className:"flex items-center gap-2 p-2 hover:bg-gray-50 rounded cursor-pointer text-sm group",children:[e.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:x,onChange:()=>{x?d.setFilterValue(void 0):d.setFilterValue([])}}),e.jsx("span",{className:"text-gray-700 group-hover:text-black",children:typeof d.columnDef.header=="string"?d.columnDef.header:d.id})]},d.id)})})]}),e.jsxs("div",{className:"p-3 border-t bg-gray-50 flex gap-2 rounded-b-md",children:[e.jsxs("button",{onClick:()=>r(!1),className:"flex-1 flex items-center justify-center gap-1 py-1.5 bg-blue-600 text-white rounded text-xs font-semibold hover:bg-blue-700",children:[e.jsx(f.Check,{size:14})," Apply"]}),e.jsxs("button",{onClick:()=>{t.resetColumnFilters(),r(!1)},className:"flex-1 flex items-center justify-center gap-1 py-1.5 border border-gray-300 bg-white text-gray-600 rounded text-xs font-semibold hover:bg-gray-50",children:[e.jsx(f.RotateCcw,{size:14})," Reset"]})]})]})]})})}function Ai({activeFilters:t,table:a}){return e.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(r=>e.jsx(Ri,{filter:r,table:a},r.id))})}function Ri({filter:t,table:a}){debugger;const[r,n]=m.useState(!1),[s,o]=m.useState(t.value||[]),i=m.useRef(null),c=a.getColumn(t.id);m.useEffect(()=>{o(t.value||[])},[t.value]);const u=m.useMemo(()=>{const p=new Set;return a.getPreFilteredRowModel().flatRows.forEach(w=>{const N=w.getValue(t.id);N!=null&&p.add(N)}),Array.from(p).sort()},[a.getPreFilteredRowModel().flatRows,t.id]);m.useEffect(()=>{const p=w=>{i.current&&!i.current.contains(w.target)&&n(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const d=()=>{c.setFilterValue(s.length>0?s:void 0),n(!1)},x=()=>{o([]),c.setFilterValue(void 0),n(!1)};return e.jsxs("div",{className:"relative",ref:i,children:[e.jsxs("div",{className:"flex items-center border border-gray-300 rounded-full bg-white px-3 py-1 text-xs shadow-sm",children:[e.jsxs("span",{className:"font-bold text-gray-500 uppercase mr-1 tracking-tight",children:[typeof c.columnDef.header=="string"?c.columnDef.header:t.id,":"]}),e.jsxs("button",{onClick:()=>n(!r),className:"flex items-center gap-1 font-semibold text-blue-600 hover:text-blue-800",children:[t.value?.length?`${t.value.length} Selected`:"All",e.jsx(f.ChevronDown,{size:12})]}),e.jsx("button",{onClick:()=>c.setFilterValue(void 0),className:"ml-2 text-gray-400 hover:text-red-500 transition-colors",children:e.jsx(f.X,{size:14})})]}),r&&e.jsxs("div",{className:"absolute top-full left-0 mt-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-[110]",children:[e.jsx("div",{className:"p-2 max-h-48 overflow-y-auto space-y-1",children:u.map(p=>e.jsxs("label",{className:"flex items-center gap-2 p-2 hover:bg-gray-50 rounded cursor-pointer text-xs",children:[e.jsx("input",{type:"checkbox",className:"rounded text-blue-600 border-gray-300",checked:s.includes(p),onChange:()=>{o(w=>w.includes(p)?w.filter(N=>N!==p):[...w,p])}}),e.jsx("span",{className:"truncate",children:String(p)})]},p))}),e.jsxs("div",{className:"p-2 border-t bg-gray-50 flex gap-2 rounded-b-md",children:[e.jsx("button",{onClick:d,className:"flex-1 py-1 px-2 bg-blue-600 text-white rounded text-[10px] font-bold hover:bg-blue-700",children:"Apply"}),e.jsx("button",{onClick:x,className:"flex-1 py-1 px-2 border border-gray-300 bg-white text-gray-600 rounded text-[10px] font-bold hover:bg-gray-50",children:"Reset"})]})]})]})}function zi({table:t}){const[a,r]=m.useState(!1),n=m.useRef(null);return m.useEffect(()=>{function s(o){n.current&&!n.current.contains(o.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),e.jsxs("div",{className:"relative",ref:n,children:[e.jsxs("button",{type:"button",className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background transition-colors text-sm font-medium ${a?"border-primary bg-muted":"border-border hover:bg-muted"}`,onClick:()=>r(!a),children:[e.jsx(f.Settings2,{className:"w-4 h-4"}),"Columns"]}),a&&e.jsxs("div",{className:"absolute right-0 mt-2 w-56 z-50 bg-background border border-border rounded-md shadow-lg p-2 animate-in fade-in zoom-in duration-100",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground border-b mb-1",children:"Toggle Columns"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.getAllLeafColumns().map(s=>s.getCanHide()?e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-muted rounded cursor-pointer text-sm capitalize",children:[e.jsx("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),e.jsx("span",{className:"truncate",children:typeof s.columnDef.header=="string"?s.columnDef.header:s.id})]},s.id):null)}),e.jsx("div",{className:"border-t mt-1 pt-1",children:e.jsx("button",{type:"button",onClick:()=>t.toggleAllColumnsVisible(!0),className:"w-full text-left px-2 py-1.5 text-xs hover:bg-muted hover:text-primary rounded",children:"Show All"})})]})]})}function _i({data:t,columns:a,totalPages:r,toggleViewMode:n,gridComponent:s,actionNode:o,filterComponent:i,showFooter:c,footerLabel:u,hiddenColumns:d}){const[x,p]=m.useState("list"),w=ae.useNavigate(),{pathname:N}=ae.useLocation(),[v]=ae.useSearchParams(),y=Number(v.get("page")||"1")-1,[b,C]=m.useState({pageIndex:0,pageSize:10}),[g,S]=m.useState(""),[j,h]=m.useState([]),[I,T]=m.useState([]),[A,O]=m.useState({}),[V,ce]=m.useState({}),[ke,we]=m.useState({}),[D,P]=m.useState([]),E=L.useReactTable({data:t,columns:a,pageCount:r,meta:{footerLabel:u},state:{pagination:b,globalFilter:g,sorting:j,grouping:I,expanded:A,rowSelection:V,columnVisibility:ke,columnFilters:D},onSortingChange:h,onGroupingChange:T,onExpandedChange:O,onRowSelectionChange:ce,onGlobalFilterChange:S,onPaginationChange:C,onColumnVisibilityChange:we,onColumnFiltersChange:P,manualPagination:!1,manualFiltering:!1,getCoreRowModel:L.getCoreRowModel(),getPaginationRowModel:L.getPaginationRowModel(),getSortedRowModel:L.getSortedRowModel(),getFilteredRowModel:L.getFilteredRowModel(),getGroupedRowModel:L.getGroupedRowModel(),getExpandedRowModel:L.getExpandedRowModel(),filterFns:{multiSelect:(F,M,ot)=>{debugger;return ot.length?ot.includes(String(F.getValue(M))):!0}}});m.useEffect(()=>{E.getAllLeafColumns().map(F=>{d?.includes(F.id)&&F.toggleVisibility(!1)})},[d,E]);const _=(F,M)=>{F.dataTransfer.setData("headerId",M)},U=F=>{debugger;F.preventDefault();const M=F.dataTransfer.getData("headerId");M&&!I.includes(M)&&E.getColumn(M)?.toggleGrouping()};return m.useEffect(()=>{debugger;E.setGlobalFilter(v.get("search")||"")},[v,w,N]),m.useEffect(()=>{E.setPageSize(Number(v.get("size")||"10")),E.setPageIndex(Number(v.get("page")||"1")-1)},[v,w,N]),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ii,{}),e.jsx(Ai,{activeFilters:E.getState().columnFilters,table:E}),i&&i]}),e.jsxs("div",{className:"flex items-center gap-2",children:[o&&o,e.jsx(zi,{table:E}),e.jsx(Pi,{table:E}),n&&e.jsxs("div",{className:"flex items-center border border-border rounded-md bg-background overflow-hidden h-9",children:[e.jsx("button",{onClick:()=>p("list"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${x==="list"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"List View",children:e.jsx(f.List,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>p("grid"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${x==="grid"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grid View",children:e.jsx(f.LayoutGrid,{className:"w-4 h-4"})})]})]})]}),x==="list"?e.jsxs(e.Fragment,{children:[e.jsx("div",{onDragOver:F=>F.preventDefault(),onDrop:U,className:"w-full border border-dashed rounded-md h-10 p-2 flex gap-2 items-center text-sm bg-muted/20 ",children:I.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Drag a column header here to group"}):I.map(F=>e.jsxs("div",{className:"flex items-center gap-1 bg-background border px-2 py-1 rounded shadow-sm",children:[F,e.jsx(f.X,{size:14,className:"cursor-pointer",onClick:()=>E.getColumn(F)?.toggleGrouping()})]},F))}),e.jsx("div",{className:"rounded-md border border-border bg-background overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 border-b border-border sticky top-0",children:E.getHeaderGroups().map(F=>e.jsx("tr",{children:F.headers.map(M=>e.jsx("th",{className:"px-4 py-3 text-left font-medium cursor-pointer select-none",draggable:!0,onDragStart:ot=>_(ot,M.id),children:e.jsxs("div",{className:"flex items-center gap-2",onClick:M.column.getToggleSortingHandler(),children:[L.flexRender(M.column.columnDef.header,M.getContext()),{asc:e.jsx(f.ChevronUp,{size:14}),desc:e.jsx(f.ChevronDown,{size:14})}[M.column.getIsSorted()]??null]})},M.id))},F.id))}),e.jsx("tbody",{className:"divide-y divide-border",children:E.getRowModel().rows.map(F=>e.jsx("tr",{className:`hover:bg-muted/30 transition-colors ${F.getIsSelected()?"bg-accent/20":""}`,children:F.getVisibleCells().map(M=>e.jsx("td",{className:"px-4 py-3",children:M.getIsGrouped()?e.jsxs("button",{onClick:F.getToggleExpandedHandler(),className:"flex items-center gap-2 font-semibold",children:[F.getIsExpanded()?e.jsx(f.ChevronDown,{size:16}):e.jsx(f.ChevronRight,{size:16}),L.flexRender(M.column.columnDef.cell,M.getContext())," (",F.subRows.length,")"]}):M.getIsAggregated()?L.flexRender(M.column.columnDef.aggregatedCell??M.column.columnDef.cell,M.getContext()):M.getIsPlaceholder()?null:L.flexRender(M.column.columnDef.cell,M.getContext())},M.id))},F.id))}),c&&e.jsx("tfoot",{className:"bg-muted/30 border-t-2 border-border font-bold",children:E.getFooterGroups().map(F=>e.jsx("tr",{children:F.headers.map(M=>e.jsx("td",{className:"px-4 py-3 text-left",children:M.isPlaceholder?null:L.flexRender(M.column.columnDef.footer,M.getContext())},M.id))},F.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx(Ti,{}),e.jsx(Di,{totalPages:r,currentPage:y+1})]})]}):s?s(t):e.jsx("div",{className:"p-12 text-center text-muted-foreground border border-border border-dashed rounded-md bg-muted/20",children:"Grid view not implemented for this component yet."})]})}function Fi({data:t,columns:a,totalPages:r,actionNode:n,toggleViewMode:s,gridComponent:o,isLoading:i=!1,onReload:c,filterComponent:u,hiddenColumns:d}){const[x,p]=m.useState("list");return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mb-2",children:e.jsx("div",{className:"flex items-center gap-2"})}),e.jsxs("div",{className:"relative min-h-[300px]",children:[e.jsx(jn,{isLoading:i,onReload:c||(()=>window.location.reload())}),e.jsx("div",{className:`transition-all duration-300 ${i?"opacity-50 pointer-events-none":""}`,children:e.jsx(_i,{data:t,columns:a,totalPages:r,actionNode:n,toggleViewMode:s,hiddenColumns:d,showFooter:!0,footerLabel:"Total Leads",filterComponent:u,gridComponent:o})})]})]})}function Mi(t){(t==null||typeof t!="object")&&(t={});const a={...t};return(a.toolbox===void 0||a.toolbox===null||typeof a.toolbox!="object")&&(a.toolbox={}),(a.toolbox.feature===void 0||a.toolbox.feature===null||typeof a.toolbox.feature!="object")&&(a.toolbox.feature={}),a}const Ei=m.forwardRef(({parentDivProps:t={},option:a={},style:r={},settings:n={},loading:s=!0,theme:o,isConfigurable:i=!1,resizeKey:c,onClick:u=()=>{},onConfigure:d=()=>{}},x)=>{const p=m.useRef(null),w=m.useRef(null),N=Mi(a);return i&&(N.toolbox.feature={...N.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>d?.()}}),m.useImperativeHandle(x,()=>({getChartObject:()=>p.current?Me.getInstanceByDom(p.current):null,setOption:(v,y)=>{if(!p.current)return;Me.getInstanceByDom(p.current)?.setOption(v,y)},resize:(v=0)=>{if(!p.current)return;const y=Me.getInstanceByDom(p.current);y?.resize(),v&&setTimeout(()=>y?.resize(),v)},loadingVisible:v=>{if(!p.current)return;const y=Me.getInstanceByDom(p.current);v?y?.showLoading():y?.hideLoading()},dispose:()=>{if(!p.current)return;Me.getInstanceByDom(p.current)?.dispose()},on:(v,y)=>{if(!p.current)return;Me.getInstanceByDom(p.current)?.on(v,y)}})),m.useEffect(()=>{p.current&&(w.current=Me.init(p.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(N,n),w.current&&w.current.on("click",u)},[a,n,o]),m.useEffect(()=>{w.current&&w.current.resize()},[c]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:p,...t,style:{width:"100%",height:"100%",...r}})});function wn({tooltipContent:t,fileNamePlaceholder:a,fileName:r,onFileNameChange:n,...s}){const o=m.useRef(null);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex",children:[e.jsx(K,{ref:o,type:"file",className:"hidden",...s}),e.jsx("div",{className:"mx-1"}),e.jsx(K,{className:"rounded-e-none",placeholder:a,onChange:(...i)=>n?.(...i),value:r}),e.jsx(Ie,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(f.Upload,{})})]})})}const Li=(({blur:t=0,inactiveZone:a=.7,proximity:r=0,spread:n=20,variant:s="default",glow:o=!1,className:i,movementDuration:c=2,borderWidth:u=1,disabled:d=!0})=>{const x=m.useRef(null),p=m.useRef({x:0,y:0}),w=m.useRef(0),N=m.useCallback(v=>{x.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const y=x.current;if(!y)return;const{left:b,top:C,width:g,height:S}=y.getBoundingClientRect(),j=v?.x??p.current.x,h=v?.y??p.current.y;v&&(p.current={x:j,y:h});const I=[b+g*.5,C+S*.5],T=Math.hypot(j-I[0],h-I[1]),A=.5*Math.min(g,S)*a;if(T<A){y.style.setProperty("--active","0");return}const O=j>b-r&&j<b+g+r&&h>C-r&&h<C+S+r;if(y.style.setProperty("--active",O?"1":"0"),!O)return;const V=parseFloat(y.style.getPropertyValue("--start"))||0,ke=(180*Math.atan2(h-I[1],j-I[0])/Math.PI+90-V+180)%360-180,we=V+ke;ct.animate(V,we,{duration:c,ease:[.16,1,.3,1],onUpdate:D=>{y.style.setProperty("--start",String(D))}})}))},[a,r,c]);return m.useEffect(()=>{if(d)return;const v=()=>N(),y=b=>N(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",y,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",y)}},[N,d]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",s==="white"&&"border-white",d&&"!block")}),e.jsx("div",{ref:x,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${u}px`,"--repeating-conic-gradient-times":"5","--gradient":s==="white"?"repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))":"linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)"},className:l("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",i,d&&"!hidden"),children:e.jsx("div",{className:l("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});function pt({name:t,...a}){const r=Rs[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Oi=({size:t=48,className:a,visible:r=!0,...n})=>r?e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"absolute inset-0 flex justify-center items-center z-50",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("animate-spin",a),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Bi({placeholder:t,items:a,onValueChange:r,defaultValue:n,defaultOptions:s=2}){const[o,i]=m.useState(n||[]),[c,u]=m.useState(""),d=m.useRef(null),[x,p]=m.useState(!1);m.useEffect(()=>{r(o)},[o,r]);const w=a.filter(g=>(g.label||g.value).toLowerCase().includes(c.toLowerCase())).sort((g,S)=>(g?.label??"").localeCompare(S?.label??"")),N=g=>{const S=g.currentTarget;S.scrollTop+=g.deltaY,g.preventDefault()},v=g=>{const S=o.includes(g)?o.filter(j=>j!==g):[...o,g];i(S)},[y,b]=m.useState(o.length),C=m.useCallback(()=>{const g=d.current;if(!g)return y;const S=Array.from(g.children),j=g.offsetWidth;let h=0,I=0;for(const T of S){const A=T.offsetWidth+4;if(h+A<=j)h+=A,I++;else break}return I},[y]);return m.useEffect(()=>{const g=d.current;if(!g)return;let S=null;const j=()=>{S&&cancelAnimationFrame(S),S=requestAnimationFrame(()=>{const I=C();b(T=>T!==I?I:T)})},h=new ResizeObserver(j);return h.observe(g),S=requestAnimationFrame(j),()=>{S&&cancelAnimationFrame(S),h.disconnect()}},[C]),e.jsxs(J,{open:x,onOpenChange:p,children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsxs(R,{variant:"outline",role:"combobox",className:l("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>p(g=>!g),children:[o.length>0?e.jsx(Te,{children:e.jsxs("div",{ref:d,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,s).map(g=>{const S=a.find(j=>j.value===g)?.label||g;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:S,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:S}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(g)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(g))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},g)}),o.length>s&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer",children:["+",o.length-s," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:N,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(s).map(g=>e.jsx("span",{className:"text-sm",children:a.find(S=>S.value===g)?.label||g},g))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ee,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Q,{onMouseDown:g=>g.preventDefault(),children:[e.jsx(ie,{placeholder:"Search...",value:c,onValueChange:u}),e.jsxs(le,{onWheel:N,className:"max-h-60 overflow-auto",children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:w.map(g=>{const S=o.includes(g.value),j=g.disabled===!0||typeof g.disabled=="function"&&g.disabled(g);return e.jsxs(X,{value:g.label||g.value,disabled:j,onPointerDown:h=>{h.preventDefault(),h.stopPropagation()},onSelect:()=>{j||v(g.value)},className:l("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Ze,{checked:S,onCheckedChange:()=>{j||v(g.value)},onClick:h=>h.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:g?.label||g.value})]},g.value)})})]})]})})]})}function na({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(f.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Ui({title:t,subtitle:a,tools:r,children:n}){return t=t??"",a=a??"",e.jsxs("div",{className:"flex flex-col gap-4 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[t&&e.jsx("h1",{className:"text-2xl font-semibold",children:t}),a&&e.jsx("p",{className:"text-muted-foreground/60",children:a})]}),e.jsx("div",{children:r})]}),n]})}const Vi=({value:t})=>{const a=Cs(t),r=a.score*100/4,n=()=>{switch(a.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(Ct,{value:r,className:n()})})},xa=({code:t})=>{const a=Es[t];return e.jsx(a,{})};function Gi({className:t,...a}){const[r,n]=m.useState(!1),[s,o]=m.useState(""),[i,c]=m.useState("");return e.jsxs(J,{open:r,onOpenChange:n,children:[e.jsx(Z,{asChild:!0,children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":r,className:"justify-between bg-secondary",children:[i?e.jsx(xa,{code:i}):"...",e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(ee,{className:"p-0",align:"start",children:e.jsxs(Q,{filter:(u,d,x=[])=>(u.toLowerCase()+" "+x.join(" ").toLowerCase()).includes(d.toLowerCase())?1:0,children:[e.jsx(ie,{placeholder:"Search ...",className:"h-9"}),e.jsxs(le,{children:[e.jsx(de,{children:"No country found."}),e.jsx(re,{children:Object.entries(Ss.countries).map(([u,d])=>d.phone.map(x=>e.jsxs(X,{value:`${x}`,keywords:[d.name,"+"+x.toString(),u],onSelect:p=>{o(p===s?"":p),c(u),n(!1)},children:[e.jsx(xa,{code:u})," ",d.name," +",x]},x)))})]})]})})]})}function Nn({buttonText:t,buttonIcon:a,buttonStyle:r,sheetContent:n,sheetDescription:s,sheetTitle:o,closeButton:i}){return e.jsxs(ea,{children:[e.jsx(ur,{asChild:!0,children:e.jsxs(R,{variant:"outline",className:r,size:"icon-sm",children:[t,a]})}),e.jsxs(ta,{className:"p-4",children:[e.jsx(aa,{children:o}),n]})]})}const $i=f.icons;function qi({title:t,iconName:a,iconSize:r,iconClass:n,primaryText:s,secondaryText:o,mainClassName:i="",loading:c,loadingMessage:u}){let d=null;return a&&(d=$i[a]),r=r===void 0?20:r,n=n??"",u=u??"Loading...",e.jsx(gt,{className:i,children:e.jsxs($a,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),c?e.jsx(f.LoaderCircle,{size:r,className:"animate-spin "+n}):d&&e.jsx(d,{size:r,className:n})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:c?"...":s}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:c?u:o})]})})}function yn({children:t,tabArray:a,pathName:r,tabListClass:n="",tabListInnerClass:s="",tabListButtonClass:o="",tabContentClass:i="",headerEndComponent:c,onTabChange:u,isSeperatePage:d=!1}){const[x,p]=m.useState(5),w=kt(),[N,v]=m.useState([]),[y,b]=m.useState([]),[C,g]=m.useState(a.find(h=>h.default)?.tabId||a[0]?.tabId||"");m.useEffect(()=>{p(w?2:5)},[w]),m.useEffect(()=>{if(r&&d){const h=r.split("/").pop()||"";g(h)}},[r,d]),m.useEffect(()=>{v(a.slice(0,x)),b(a.slice(x))},[a,x]);const S=h=>{g(h),u?.(h)},j=h=>{v(I=>{const T=[...I],A=T.pop();return A&&b(O=>[...O.filter(V=>V.tabId!==h.tabId),A]),[...T,h]}),S(h.tabId)};return e.jsxs(Fr,{value:C,onValueChange:S,className:"w-full h-full flex flex-col",children:[e.jsxs(Er,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[N.map(h=>e.jsx(Lr,{value:h.tabId,className:o,children:h.tabName},h.tabId)),y.length>0&&e.jsxs(ze,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(at,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(f.EllipsisVertical,{})})}),e.jsx(Fe,{children:y.map(h=>e.jsx(ue,{onClick:()=>j(h),children:h.tabName},h.tabId))})]})]}),c&&e.jsx("div",{children:c})]}),t?e.jsx(Mt,{value:C,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(gt,{className:"h-full w-full p-3",children:t})}):a.map(h=>e.jsx(Mt,{value:h.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(gt,{className:"h-full w-full p-3",children:h?.tabContent})},h.tabId))]})}function Cn(){const{setTheme:t,theme:a,resolvedTheme:r}=Pr(),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0)},[]);const o=a==="system"?r:a,i=N=>{const v=parseInt(N.slice(1),16),y=v>>16&255,b=v>>8&255,C=v>>0&255,[g,S,j]=[y,b,C].map(h=>(h=h/255,h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)));return .2126*g+.7152*S+.0722*j},c=N=>i(N)>.25?"#000000":"#ffffff",u=m.useCallback(()=>{const N=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",y=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",C=localStorage.getItem("secondaryChart")||"#fd9a00",g=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",N),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",y),document.documentElement.style.setProperty("--sidebar-primary",y),document.documentElement.style.setProperty("--sidebar-accent",y),document.documentElement.style.setProperty("--foreground",c(N)),document.documentElement.style.setProperty("--secondary-foreground",c(v)),document.documentElement.style.setProperty("--card-foreground",c(v)),document.documentElement.style.setProperty("--popover-foreground",c(v)),document.documentElement.style.setProperty("--muted-foreground",c(v)),document.documentElement.style.setProperty("--sidebar-foreground",c(v)),document.documentElement.style.setProperty("--accent-foreground",c(y)),document.documentElement.style.setProperty("--sidebar-primary-foreground",c(y)),document.documentElement.style.setProperty("--sidebar-accent-foreground",c(y)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",C),document.documentElement.style.setProperty("--chart-3",g),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",C)},[]),d=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{n&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[n,o,u]);const x=m.useCallback(N=>{t(N),(N==="light"||N==="dark")&&(document.documentElement.classList.remove("blue-dark"),d()),N==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[t,u,d]);if(!n)return null;const p=o==="blue-dark"?e.jsx(f.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(f.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(f.Sun,{className:"h-5 w-5"}):e.jsx(f.Laptop,{className:"h-5 w-5"}),w=N=>o===N;return e.jsxs(ze,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(R,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:p})}),e.jsxs(Fe,{align:"end",sideOffset:8,children:[e.jsxs(ue,{onClick:()=>x("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]})]})]})}function Wi({title:t,value:a,valueText:r,isPercent:n=!0,className:s,titleClassName:o,valueClassName:i,progressClassName:c}){let u=a.toFixed(2);const d=u.split(".");return d[1]==="00"&&(u=d[0]),e.jsxs("div",{className:"w-full "+(s??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(i??""),children:r??`${u}${n?"%":""}`})]}),e.jsx(Ct,{value:a,className:"w-full mt-2 "+(c??"")})]})}function Hi({processedData:t,value:a,onChange:r,placeholder:n="Select items...",searchPlaceholder:s="Search...",className:o}){const[i,c]=k.useState(!1),[u,d]=k.useState(""),{flatTree:x,itemMap:p}=t,w=k.useMemo(()=>{const b=new Map,C=new Set(a);return[...x].reverse().forEach(g=>{const S=p[g.id];if(!S||!g.treatAsParent||S.childrenIds.length===0)C.has(g.id)&&b.set(g.id,"checked");else{const j=S.childrenIds.map(T=>b.get(T)),h=j.filter(T=>T==="checked").length,I=j.filter(T=>T==="indeterminate").length;h===S.childrenIds.length?b.set(g.id,"checked"):(h>0||I>0)&&b.set(g.id,"indeterminate")}}),b},[a,x,p]),N=b=>{const C=new Set(a),g=w.get(b.id),S=!(g==="checked"||g==="indeterminate"),j=new Set,h=[...p[b.id]?.childrenIds||[]];for(;h.length>0;){const T=h.shift();j.add(T),(p[T]?.childrenIds||[]).forEach(O=>h.push(O))}S?(C.add(b.id),j.forEach(T=>C.add(T))):(C.delete(b.id),j.forEach(T=>C.delete(T)));let I=p[b.id]?.parentId;for(;I;){const T=p[I];T&&T.childrenIds.length>0&&(T.childrenIds.every(O=>C.has(O))?C.add(I):C.delete(I)),I=T?.parentId}r(Array.from(C))},v=k.useMemo(()=>{if(!u)return x.slice();const b=u.toLowerCase(),C=new Set;x.forEach(h=>{(h.title.toLowerCase().includes(b)||h.description.toLowerCase().includes(b)||h.index.toLowerCase().includes(b))&&C.add(h.id)});const g=new Set(C),S=h=>{let I=h;for(;I;){const T=p[I]?.parentId;if(T&&!g.has(T))g.add(T),I=T;else break}},j=h=>{const I=p[h]?.childrenIds||[];for(const T of I)g.has(T)||(g.add(T),j(T))};return C.forEach(h=>{S(h),j(h)}),x.filter(h=>g.has(h.id))},[u,x,p]),y=()=>{const b=a.filter(C=>{const g=p[C];return!g||g.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:n});if(b.length===1){const C=x.find(g=>g.id===b[0]);return C?C.index:n}return`${b.length} items selected`};return e.jsxs(J,{open:i,onOpenChange:c,children:[e.jsx(Z,{asChild:!0,children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":i,className:l("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:y()}),e.jsx(f.ChevronsUpDown,{className:l("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",i&&"rotate-180")})]})}),e.jsx(ee,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:s,value:u,onValueChange:d}),e.jsxs(le,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(de,{children:"No results found."}),v.map(b=>e.jsxs(X,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>N(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:C=>{C&&(C.indeterminate=w.get(b.id)==="indeterminate")},readOnly:!0}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:b.index}),e.jsx("span",{className:"font-medium",children:b.title})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b.description})]})]},b.id))]})]})})]})}function Ki({widgetData:t}){const a=t.slice(0,4),r=t.slice(4);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(Te,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(R,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(pt,{name:n.iconName})})]},n.id))}),r.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:r.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(Te,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(R,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(pt,{name:n.iconName})})]},n.id))})]})}function Yi({onNavigate:t,onView:a,label:r,extraTools:n,view:s}){const[o,i]=m.useState(s===W.Views.DAY?"DAY":s===W.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(Ee,{type:"single",variant:"outline",onValueChange:c=>{switch(c){case"PREV":t("PREV");break;case"NEXT":t("NEXT");break;case"TODAY":t("TODAY");break}},children:[e.jsx($,{className:"rounded-e-none",value:"PREV",children:e.jsx(f.ChevronLeft,{size:16})}),e.jsx($,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(f.ChevronRight,{size:16})}),e.jsx($,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:r}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(Ee,{type:"single",variant:"outline",value:o,onValueChange:c=>{switch(i(c),c){case"DAY":a(W.Views.DAY);break;case"WEEK":a(W.Views.WEEK);break;case"MONTH":a(W.Views.MONTH);break}},children:[e.jsx($,{className:"rounded-e-none",value:"MONTH",children:"Month"}),e.jsx($,{className:"rounded-none border-x-0",value:"WEEK",children:"Week"}),e.jsx($,{className:"rounded-s-none",value:"DAY",children:"Day"})]}),n?.map((c,u)=>e.jsx(m.Fragment,{children:c},u))]})]})})}function Xi({event:t,extraParamsEvent:a}){return e.jsxs("div",{className:"custom-event flex flex-row justify-between",children:[e.jsx("span",{className:"truncate w-auto",children:t.title}),e.jsxs("span",{className:"flex flex-row gap-1",children:[(a?.isEditableAll||t.isEditable)&&e.jsx(De,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onEditEventClick?.(t)},children:e.jsx(f.SquarePen,{size:16})})}),e.jsx(De,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onViewEventClick?.(t)},children:e.jsx(f.Eye,{size:16})})})]})]})}const Qi={"en-US":Is.enUS},Ji=W.dateFnsLocalizer({format:qe.format,parse:qe.parse,startOfWeek:qe.startOfWeek,getDay:qe.getDay,locales:Qi});function Zi({events:t,extraParamsEvent:a,extraTools:r}){const[n,s]=m.useState(a?.defaultView==="day"?W.Views.DAY:a?.defaultView==="week"?W.Views.WEEK:a?.defaultView==="month"?W.Views.MONTH:a?.defaultView==="work week"?W.Views.WORK_WEEK:a?.defaultView==="agenda"?W.Views.AGENDA:W.Views.MONTH),[o,i]=m.useState(new Date);return e.jsx(W.Calendar,{localizer:Ji,events:t||[],startAccessor:"start",endAccessor:"end",views:[W.Views.DAY,W.Views.WEEK,W.Views.MONTH],view:n,onView:c=>s(c),date:o,onNavigate:c=>i(c),components:{event:c=>e.jsx(Xi,{event:c.event,extraParamsEvent:a}),toolbar:c=>e.jsx(Yi,{...c,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const Sn=m.createContext(void 0);function kn({children:t}){const[a,r]=m.useState([]),n=c=>{r(u=>[...u.filter(x=>x.level<c.level),c])},s=(c,u)=>{r(u?c:d=>[...d,...c])},o=c=>{r(u=>[...u.filter(x=>x.level<=c.level)])},i=()=>{r([])};return e.jsx(Sn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:i},children:t})}function sa(){const t=m.useContext(Sn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function In(){const{breadcrumbItems:t,backBreadcrumb:a}=sa(),[r,n]=m.useState(!1),[s,o]=m.useState(2),i=kt(),c=be.useNavigate();m.useEffect(()=>{o(i?2:4)},[i]);const u=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:i?t.slice(2):t.slice(2,s),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<s?t.length:s)):[]}),[t,s,i]);return!u||i==null||s==null?null:e.jsx(Br,{children:e.jsxs(Ur,{children:[u.firstVisibleBreadcrumbList.map((d,x)=>x<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(Ve,{children:d.href?e.jsx(Lt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(d),d.href&&c(d.href)},children:d.title}):e.jsx(He,{className:"max-w-20 truncate md:max-w-none",children:d.title})}),e.jsx(mt,{},"firstsep"+x)]},"first"+x):e.jsx(Ve,{children:e.jsx(He,{className:"max-w-20 truncate md:max-w-none",children:d.title})},"first"+x)),t.length>s?e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:i?e.jsxs(qr,{open:r,onOpenChange:n,children:[e.jsx(Wr,{"aria-label":"Toggle Menu",children:e.jsx(Ot,{className:"h-4 w-4"})}),e.jsxs(Xr,{children:[e.jsxs(Qr,{className:"text-left",children:[e.jsx(Zr,{children:"Navigate to"}),e.jsx(en,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:u.hiddenBreadcrumbList.map((d,x)=>e.jsx("div",{children:d.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:d.title}):e.jsx(be.Link,{to:d.href?d.href:"#",className:"py-1 text-sm",children:d.title})},x))}),e.jsx(Jr,{className:"pt-4",children:e.jsx(Kr,{asChild:!0,children:e.jsx(R,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(ze,{open:r,onOpenChange:n,children:[e.jsx(_e,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(Ot,{className:"h-4 w-4"})}),e.jsx(Fe,{align:"start",children:u.hiddenBreadcrumbList.map((d,x)=>e.jsx(ue,{children:d.href?e.jsx(be.Link,{to:d.href?d.href:"#",children:d.title}):e.jsx("span",{children:d.title})},x))})]})}),!i&&e.jsx(mt,{})]}):null,!i&&u.lastVisibleBreadcrumbList.map((d,x)=>x==u.lastVisibleBreadcrumbList.length-1?e.jsx(Ve,{children:e.jsx(He,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:d.title})},"last"+x):e.jsxs(m.Fragment,{children:[e.jsx(Ve,{children:d.href?e.jsx(Lt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(d),d.href&&c(d.href)},children:d.title}):e.jsx(He,{className:"max-w-20 truncate md:max-w-none",children:d.title})}),e.jsx(mt,{},"lastsep"+x)]},"last"+x))]},"BreadcrumbList1")},"Breadcrumb1")}function el({breadcrumb:t}){const{addBreadcrumb:a}=sa();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}const Tn=m.createContext(void 0);function Dn({children:t}){const[a,r]=m.useState([]),[n,s]=m.useState(null),[o,i]=m.useState(null),c=N=>{r(v=>v.some(b=>b.title===N.title)?v.map(b=>b.title===N.title?{...b,...N}:b):[...v,N])},u=N=>{r(v=>v.filter(y=>y.title!==N))},d=(N,v)=>{r(y=>y.map(b=>b.title===N?{...b,...v}:b))},x=N=>{s(N)},p=N=>{i(N)},w=()=>{r([])};return e.jsx(Tn.Provider,{value:{navItems:a,header:n,footer:o,setNavItems:r,addNavItem:c,removeNavItem:u,updateNavItem:d,clearNavItems:w,setSidebarHeader:x,setSidebarFooter:p},children:t})}function nt(){const t=m.useContext(Tn);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function Pn(){const{navItems:t}=nt();return e.jsx(yr,{children:e.jsx(Cr,{children:t.map(a=>a.items&&a.items.length>0?e.jsx(Vr,{asChild:!0,defaultOpen:a.isActive,className:"group/collapsible",children:e.jsxs(zt,{children:[e.jsx(Gr,{asChild:!0,children:e.jsxs(_t,{tooltip:a.title,children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx($r,{children:e.jsx(Sr,{children:a.items.map(r=>e.jsx(kr,{children:e.jsx(Ir,{asChild:!0,children:e.jsx(be.Link,{to:r.url,children:e.jsx("span",{children:r.title})})})},r.title))})})]})},a.title):e.jsx(zt,{children:e.jsx(_t,{asChild:!0,tooltip:a.title,children:e.jsxs(be.Link,{to:a.url,className:"flex items-center gap-2 w-full",children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title})]})})},a.title))})})}function tl({items:t,sidebarHeader:a,sidebarFooter:r}){const{setNavItems:n,setSidebarHeader:s,setSidebarFooter:o}=nt();return m.useEffect(()=>{n(t),s(a),o(r)},[t,a,r,n,s,o]),null}function al({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o,disabled:i,onSelect:c}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(ve,{children:r})}),e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:l("justify-between",!u.value&&"text-muted-foreground"),disabled:i==!0||i&&i(...arguments),children:[u.value?o.find(d=>d.value===u.value)?.label||u.value:n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(ee,{className:"p-0",align:"start",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:o.map(d=>e.jsxs(X,{value:d.value,disabled:d.disabled==!0||d.disabled&&d.disabled(d),onSelect:x=>{u.onChange(x),c&&c(x)},children:[d?.label||d.value,e.jsx(f.Check,{className:l("ml-auto",d.value===u.value?"opacity-100":"opacity-0")})]},d.value))})]})]})})]}),s&&e.jsx(je,{children:s}),e.jsx(pe,{})]})})})}function rl(t){const{field:a}=$e.useController({name:t.name,control:t.formControl}),r=t.value!==void 0?t.value:a.value;return e.jsx(xe,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(fe,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(ve,{children:t.label}),e.jsx("br",{})]}),e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:l("justify-between",!r&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[r?t.items.find(s=>s.value===r)?.label||r:t.placeholder,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(ee,{className:"p-0",align:"start",children:e.jsxs(Q,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:t.items.map(s=>e.jsxs(X,{value:s.value,disabled:typeof s.disabled=="function"?s.disabled(s):s.disabled,onSelect:o=>{n.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[s?.label||s.value,e.jsx(f.Check,{className:l("ml-auto",s.value===r?"opacity-100":"opacity-0")})]},s.value))})]})]})})]}),t.formDescription&&e.jsx(je,{children:t.formDescription}),e.jsx(pe,{})]})})}function nl({formControl:t,name:a,label:r,placeholder:n,dateFormat:s,calendarDateDisabled:o,formDescription:i,disabled:c}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(ve,{children:r})}),e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(R,{variant:"outline",className:l(!u.value&&"text-foreground/50"),disabled:c,children:[u.value?qe.format(u.value,s||"PPP"):e.jsx("span",{children:n||"Pick a date"}),e.jsx(f.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(ee,{className:"w-auto p-0",align:"start",children:e.jsx(Va,{mode:"single",selected:u.value,onSelect:u.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),i&&e.jsx(je,{children:i}),e.jsx(pe,{})]})})})}function sl(){return e.jsx(e.Fragment,{})}function ol({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(ve,{children:a}),e.jsx(ge,{children:e.jsx(K,{...i,...o})}),n&&n(i.value),r&&e.jsx(je,{children:r}),e.jsx(pe,{})]})})})}function il({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o=[],disabled:i,onSelect:c,defaultValue:u=[],defaultOptions:d=2}){const[x,p]=m.useState(""),w=m.useRef(null),N=o.filter(v=>v.label?.toLowerCase().includes(x.toLowerCase())).sort((v,y)=>(v?.label??"").localeCompare(y?.label??""));return e.jsx(xe,{control:t,name:a,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&u.length>0&&v.onChange(u)},[u,v]);const y=v.value||[],[b,C]=m.useState(y.length),g=m.useCallback(()=>{const h=w.current;if(!h)return b;const I=Array.from(h.children);let T=h.offsetWidth,A=0,O=0;for(const V of I){const ce=V.offsetWidth+4;if(A+ce<=T)A+=ce,O++;else break}return O},[b]);m.useEffect(()=>{const h=w.current;if(!h)return;let I=null;const T=new ResizeObserver(()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const A=g();C(O=>O!==A?A:O)})});return T.observe(h),C(g()),()=>{I&&cancelAnimationFrame(I),T.disconnect()}},[g]);const S=h=>{let I;y.includes(h)?I=y.filter(T=>T!==h):I=[...y,h],v.onChange(I),c&&c(I)},j=h=>{const I=h.currentTarget;I.scrollTop+=h.deltaY,h.preventDefault()};return e.jsxs(fe,{children:[r&&e.jsx(ve,{children:r}),e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:l("justify-between",!y.length&&"text-foreground/50"),disabled:i===!0||i&&i(...arguments),children:[y.length>0?e.jsx(Te,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[y.slice(0,d).map(h=>{const I=o.find(T=>T.value===h)?.label||h;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:I,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:I}),e.jsx("span",{role:"button",tabIndex:0,onClick:T=>{T.stopPropagation();const A=y.filter(O=>O!==h);v.onChange(A),c&&c(A)},onKeyDown:T=>{if(T.key==="Enter"||T.key===" "){T.preventDefault(),T.stopPropagation();const A=y.filter(O=>O!==h);v.onChange(A),c&&c(A)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},h)}),y.length>d&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",y.length-d," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:y.slice(d).map(h=>e.jsx("span",{className:"text-sm",children:o.find(I=>I.value===h)?.label||h},h))})})]})]})}):n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(ee,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Q,{id:"commandPopover",children:[e.jsx(ie,{placeholder:"Search...",value:x,onValueChange:p,autoFocus:!0}),e.jsxs(le,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:N.map(h=>{const I=y.includes(h.value);return e.jsxs(X,{value:h.label??"",onSelect:()=>S(h.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Ze,{checked:I,onCheckedChange:()=>S(h.value),onClick:T=>T.stopPropagation()}),e.jsx("span",{children:h.label})]},h.value)})})]})]})})]}),s&&e.jsx(je,{children:s}),e.jsx(pe,{})]})}})}function ll({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(ve,{children:a}),e.jsx(ge,{children:e.jsx(nn,{maxLength:4,...i,children:e.jsxs(sn,{children:[e.jsx(Ke,{index:0}),e.jsx(Ke,{index:1}),e.jsx(Ke,{index:2}),e.jsx(Ke,{index:3})]})})}),n&&n(i.value),r&&e.jsx(je,{children:r}),e.jsx(pe,{})]})})})}function dl(){return e.jsx("div",{children:"FormPhoneInput"})}function cl({formControl:t,name:a,label:r,formItemClass:n,formDescription:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:i})=>e.jsxs(fe,{className:n,children:[r&&e.jsx(ve,{children:r}),e.jsx(ge,{children:e.jsx(Or,{...i,...o})}),s&&e.jsx(je,{children:s}),e.jsx(pe,{})]})})})}function ul({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[i,c]=k.useState(!1),u=()=>c(!i);return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:d})=>e.jsxs(fe,{children:[a&&e.jsx(ve,{children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(ge,{children:e.jsx(K,{type:i?"text":"password",...d,...o,className:`${o.className||""} pr-10`})}),e.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:u,children:i?e.jsx(f.EyeOff,{className:"h-4 w-4"}):e.jsx(f.Eye,{className:"h-4 w-4"})})]}),n&&n(d.value),r&&e.jsx(je,{children:r}),e.jsx(pe,{})]})})})}function ml({rowCount:t=6,showToolbar:a=!0}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(Le,{className:"h-8 w-64 rounded-md"}),e.jsx(Le,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((r,n)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(Le,{className:"h-8 w-full"})},n))})]})}function xl({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((a,r)=>e.jsx(Le,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+r))})}function An(){const t=$e.useForm({defaultValues:{text:"",fileNames:[]}}),[a,r]=m.useState(""),[n,s]=m.useState([]),[o,i]=m.useState([]),[c,u]=m.useState(""),[d,x]=m.useState(!0),p=o.some(b=>b.progress<100),w=async(b,C)=>{const g=new FormData;g.append("file",C.file);try{const S=await ja.post("UPLOAD_ENDPOINT_URL",g,{onUploadProgress:j=>{const h=Math.round(j.loaded*100/(j.total||1));i(I=>I.map((T,A)=>A===b?{...T,progress:h}:T))}});i(j=>j.map((h,I)=>I===b?{...h,url:S.data.url,progress:100}:h))}catch(S){console.error("Upload failed:",S)}};m.useEffect(()=>{const b=new Date,C=String(b.getDate()).padStart(2,"0"),g=String(b.getMonth()+1).padStart(2,"0"),S=b.getFullYear();u(`${C}-${g}-${S}`)},[]),m.useEffect(()=>{o.forEach((b,C)=>{b.progress===0&&w(C,b)})},[o]);const N=()=>{if(a.trim()||o.length>0){const b={text:a.trim(),fileNames:o.map(C=>C.name)};s([b,...n]),r(""),i([]),x(!1)}},v=b=>{if(b.target.files){const C=Array.from(b.target.files).map(g=>({name:g.name,url:"",progress:0,file:g}));i(g=>[...g,...C]),x(!1)}},y=b=>{const C=o.filter((g,S)=>S!==b);i(C),C.length===0&&n.length===0&&x(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[d&&e.jsx(na,{text:"No files uploaded"}),o.length>0&&e.jsxs("div",{className:"p-2 my-1 rounded-md border",children:[e.jsx("p",{className:"font-bold",children:"Selected Files:"}),o.map((b,C)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>y(C),className:"text-red-500 hover:text-red-800",children:e.jsx(f.X,{className:"w-4 h-4"})})]}),e.jsx(Ct,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},C))]}),n.map((b,C)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((g,S)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===g)?.url||"#",download:g,className:"text-sm text-blue-500 underline cursor-pointer",children:g})},S)),e.jsx("p",{children:b.text||"(No Text)"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("p",{children:"John Doe"}),e.jsx("p",{children:c})]})]},C))]}),e.jsx(tn,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>N()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(xe,{name:"text",render:({field:b})=>e.jsxs(fe,{children:[e.jsx(ge,{children:e.jsx(K,{id:"text-input",type:"text",value:a,onChange:C=>r(C.target.value),placeholder:"Type something..."})}),e.jsx(pe,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ne,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(R,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(f.UploadIcon,{className:"w-5 h-5"})})}),e.jsx(K,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(R,{variant:"outline",type:"submit",disabled:p,children:e.jsx(f.Send,{})})]})})})})]})})}function Rn({...t}){const{navItems:a,header:r,footer:n}=nt();return!a||a.length===0?null:e.jsxs(pr,{className:"ml-12",collapsible:"offcanvas",...t,children:[r&&e.jsx(jr,{children:r}),e.jsx(Nr,{children:e.jsx(Pn,{})}),n&&e.jsx(wr,{children:n}),e.jsx(br,{})]})}function zn(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(f.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const te={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},fl=t=>{te.IKON_BASE_API_URL=t.IKON_BASE_API_URL,te.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,te.IKON_AUTH_API_URL=`${te.IKON_PLATFORM_API_URL}/auth`,te.IKON_USER_API_URL=`${te.IKON_PLATFORM_API_URL}/user`,te.IKON_ACCOUNT_API_URL=`${te.IKON_PLATFORM_API_URL}/account`,te.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,te.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,te.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},he=()=>te;function _n(){const{navItems:t}=nt(),{IKON_PLATFORM_UI_URL:a}=he();return e.jsx("header",{className:"ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!t||t.length===0?e.jsx("div",{}):e.jsx(hr,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(St,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(In,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Ie,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(f.Bell,{})}),e.jsx(Cn,{}),e.jsx(be.Link,{to:`${a}/app-store`,children:e.jsxs(rt,{variant:"default",children:[e.jsx(f.Play,{}),"App Store"]})})]})]})})}const oa="ikoncloud_next_";function Ut(t,a,r){let n=r?.expires;!n&&r?.maxAge&&(n=r.maxAge/86400),qt.set(oa+t,a,{httpOnly:!1,sameSite:"lax",expires:n})}function ht(t){return qt.get(oa+t)}function Vt(t){qt.remove(oa+t)}async function gl(){}async function st(t){const a=ht("accessToken"),r=ht("refreshToken");if(a)return a;if(r){const n=await Fn(r,t?.isSetToken);if(n)return n}return null}async function Fn(t,a){try{const r=await fetch(`${he().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const s=await r.json(),{accessToken:o,refreshToken:i,expiresIn:c,refreshExpiresIn:u}=s;if(a==null||a)try{Ut("accessToken",o,{maxAge:c}),Ut("refreshToken",i,{maxAge:u})}catch(d){console.error(d)}return o}}catch(r){console.error("Failed to refresh access token:",r)}return null}function Gt(){Vt("accessToken"),Vt("refreshToken"),typeof window<"u"&&(window.location.href=he().LOGIN_PAGE_URL)}const Pe=ja.create();Pe.interceptors.request.use(async t=>{const a=await st();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Pe.interceptors.response.use(t=>t,async t=>{const a=t.config;if(t.response?.status===401&&a&&!a._retry){a._retry=!0;try{const r=await st({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Pe(a);Gt()}catch(r){return Gt(),Promise.reject(r instanceof Error?r:new Error(String(r)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function pl(t){return Oe.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Pe.get(`${he().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function hl(){const t=Oe.useQueryClient();return Oe.useMutation({mutationFn:async a=>{await Pe.post(`${he().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function bl(){return Oe.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Pe.get(`${he().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function vl(){return Oe.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Pe.get(`${he().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Mn=m.createContext(void 0);function jl({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const c=ht("accessToken");if(c)try{const u=Ts.jwtDecode(c);r(d=>({...d,userId:u.sub,primaryAccountId:u.primaryAccountId,activeAccountId:u.activeAccountId,roles:u.platformAccess?.roles??[]}))}catch{r(null)}},[]);const n=a?.userId??"",{data:s,isSuccess:o}=pl(n);m.useEffect(()=>{o&&s&&r(c=>({...c,...s}))},[o,s]);const i=c=>{r(u=>({...u,accountName:c}))};return e.jsx(Mn.Provider,{value:{user:a,setUser:r,setAccountName:i},children:t})}function En(){const t=m.useContext(Mn);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function wl(){const{user:t,setUser:a}=En();return e.jsxs(ze,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(f.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(Fe,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(f.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(yt,{className:"my-0"}),e.jsxs(ue,{onClick:async()=>{Gt()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(f.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function Nl(){const{data:t}=bl(),{user:a,setAccountName:r}=En(),n=i=>i?i.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const i=t?.find(c=>c.accountId===a?.activeAccountId);r(i?.accountName||"")},[t]);const{mutateAsync:s}=hl(),o=async i=>{await s(i.accountId),r(i.accountName)};return e.jsxs(ze,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(R,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!a?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:a?n(a.accountName):"..."})})}),e.jsxs(Fe,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(i=>e.jsxs(ue,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(i),window.location.reload()}catch(c){console.error("Switch account failed",c)}},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:n(i.accountName)})}),e.jsx("span",{className:"text-sm",children:i.accountName})]}),a?.activeAccountId===i.accountId&&e.jsx(f.Check,{className:"h-4 w-4 text-primary"})]},i.accountId))]})]})}function yl(){const{IKON_PLATFORM_UI_URL:t}=he(),{data:a}=vl();function r(n){return n.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/home`,children:[e.jsx(f.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:a?.map(n=>{if(!n.visible)return null;const s=!!(n.icon&&n.icon.trim()!=="");return e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:n.url??"#",children:[s?e.jsx(pt,{name:r(n.icon??""),className:"h-8 w-8"}):e.jsx(f.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:n.softwareName})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:n.softwareName})]},n.softwareName)})})]})}const Ln=()=>{const{IKON_PLATFORM_UI_URL:t}=he();return e.jsx(Te,{delayDuration:0,children:e.jsxs("aside",{className:"fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ",children:[e.jsx(Nl,{}),e.jsx(yl,{}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/settings`,children:[e.jsx(f.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(wl,{})]})})};function On({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx(Ln,{}),e.jsx(gr,{children:e.jsx(mn,{children:e.jsxs(Dn,{children:[e.jsx(Rn,{}),e.jsxs(vr,{className:"flex flex-col h-screen",children:[e.jsx(_n,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(zn,{})]})]})})})]})}const Bn=m.createContext(void 0);function Un({children:t}){const[a,r]=m.useState("Poppins"),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-font");i&&["Poppins","Oswald","Outfit"].includes(i)&&r(i)},[]),m.useEffect(()=>{if(!n)return;const i={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=i[a],document.documentElement.style.fontFamily=i[a],localStorage.setItem("app-font",a),console.log("Font changed to:",a,i[a])},[a,n]);const o=m.useMemo(()=>({font:a,setFont:r}),[a]);return e.jsx(Bn.Provider,{value:o,children:t})}const Cl=()=>{const t=m.useContext(Bn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},Vn=m.createContext(void 0);function Gn({children:t}){const[a,r]=m.useState(.5),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-radius");if(i){const c=parseFloat(i);[0,.25,.5,.75,1].includes(c)&&r(c)}},[]),m.useEffect(()=>{if(!n)return;const i=a===0?"0rem":`${a}rem`;document.documentElement.style.setProperty("--radius",i),localStorage.setItem("app-radius",a.toString()),console.log("Radius changed to:",a,i)},[a,n]);const o=m.useMemo(()=>({radius:a,setRadius:r}),[a]);return e.jsx(Vn.Provider,{value:o,children:t})}const Sl=()=>{const t=m.useContext(Vn);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},$n=m.createContext(void 0);function kl({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx($n.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function Il(){const t=m.useContext($n);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const Tl=new Oe.QueryClient;function Dl({children:t}){return e.jsx(Oe.QueryClientProvider,{client:Tl,children:t})}function Pl({children:t}){const a=he();if(!a.IKON_BASE_API_URL||!a.IKON_PLATFORM_UI_URL||!a.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(Dl,{children:e.jsx(jl,{children:e.jsx(Dr,{children:e.jsx(Un,{children:e.jsx(Gn,{children:e.jsx(kn,{children:e.jsx(kl,{children:e.jsx(be.BrowserRouter,{children:e.jsx(On,{children:t})})})})})})})})})}function Al({activityLogs:t=[]}){const a=[{tabName:"Activity",tabId:"tab-activity",default:!0,tabContent:e.jsx("div",{className:"overflow-auto flex flex-col gap-2 h-full",children:t.length>0?t.map(r=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:r.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(r.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:r.updatedBy})]})]},r.id)):e.jsx(na,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(An,{})}];return e.jsx(Nn,{buttonText:"",buttonIcon:e.jsx(f.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(yn,{tabArray:a,tabListClass:""}),closeButton:!0})}const Rl=({src:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o})=>{const i=m.useRef(null);function c(u){const d=i.current?.cropper;if(d){const p=d.getCroppedCanvas().toDataURL("image/webp");a(p)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const u=i.current?.cropper;u&&u.rotate(n)},[n]),m.useEffect(()=>{const u=i.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(s))},[s]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&u.getCropBoxData().width){const{x,y:p}=o;typeof x=="number"&&typeof p=="number"&&u.move(x,p)}},[o]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&(u.setAspectRatio(r),r===1)){const d=u.getCanvasData(),x=d.width,p=d.height,w=d.left,N=d.top,v=200,y=100,b=w+(x-v)/2,C=N+(p-y)/2;u.setCropBoxData({left:b,top:C,width:v,height:y})}},[r]),e.jsx(wa,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:c,ref:i,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},qn=m.memo(Rl),fa={landscape:4/3,portrait:3/4,icon:1/1};function zl({onNewFileUpload:t}){const{originalImage:a,setOriginalImage:r,aspectRatioWiseImages:n,setAspectRatioWiseImages:s}=ia(),[o,i]=m.useState(null),[c,u]=m.useState(),[d,x]=m.useState(0),[p,w]=m.useState(1),[N,v]=m.useState({x:0,y:0}),[y,b]=m.useState(null),C=j=>{j.preventDefault(),g(j.dataTransfer.files[0])},g=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const h=new FileReader;h.onloadend=()=>{b(h.result),u(void 0)},h.readAsDataURL(j),r({...a,image:j,name:j.name})}else ba.toast.error("Please select a valid image file.")};m.useEffect(()=>{a.image&&g(a.image)},[a.image]);const S=j=>{const h=o&&c===j?o:n[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx(Et,{ratio:fa[j],className:"bg-muted",children:h&&e.jsx("img",{src:h,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&s(c?{...n,[c]:o}:{landscape:o,portrait:o,icon:o})},[o]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-3 h-full overflow-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Ne,{htmlFor:"imageName",children:"Image Name"}),e.jsx(wn,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:a?.name||"",onChange:j=>{const h=j.target.files?.[0];h&&g(h)},onFileNameChange:j=>{r({...a,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Ne,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx(K,{id:"imageDescription",placeholder:"Enter image Description",value:a?.description||"",onChange:j=>r({...a,description:j.target.value})})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3",children:"Original Image"}),e.jsx(Et,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:C,onDragOver:j=>j.preventDefault(),children:y?e.jsx(qn,{src:y,onCroppedImage:i,aspectRatio:fa[c||"icon"],rotationAngle:d,zoomLevel:p,moveDirection:N}):e.jsxs("div",{className:"text-center",children:[e.jsx(Ne,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(at,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(Ee,{type:"single",variant:"outline",value:c,onValueChange:j=>u(j),children:[e.jsx($,{className:"rounded-e-none",value:"landscape",children:e.jsx(f.ImageIcon,{})}),e.jsx($,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(f.FileImage,{})}),e.jsx($,{className:"rounded-s-none",value:"icon",children:e.jsx(f.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(Ee,{type:"single",variant:"outline",value:"",onValueChange:j=>x(parseInt(j)),children:[e.jsx($,{className:"rounded-e-none",value:"90",children:e.jsx(f.RotateCw,{})}),e.jsx($,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs(Ee,{type:"single",variant:"outline",value:"",children:[e.jsx($,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(f.ArrowUp,{})}),e.jsx($,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(f.ArrowDown,{})}),e.jsx($,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(f.ArrowLeft,{})}),e.jsx($,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(f.ArrowRight,{})})]}),e.jsxs(Ee,{type:"single",variant:"outline",value:"",onValueChange:j=>w(h=>h+parseFloat(j)),children:[e.jsx($,{className:"rounded-e-none",value:"0.1",children:e.jsx(f.ZoomIn,{})}),e.jsx($,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(f.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:S("landscape")}),e.jsx("div",{className:"w-4/5",children:S("portrait")}),e.jsx("div",{className:"w-3/5",children:S("icon")})]})]})]})})}const Wn=m.memo(zl);function Hn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=ia();return e.jsx(jt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(wt,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(Qt,{children:e.jsx(Nt,{children:"Image to upload"})}),e.jsx(Wn,{}),e.jsx(Ka,{children:e.jsx(at,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function dt(t,a=""){if(!t||!t.resourceId)return null;try{return`${he().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function _l(t){if(!t)return null;const a=t.originalImageInfo?await dt(t.originalImageInfo):null,r=t.landscapeImageInfo?await dt(t.landscapeImageInfo):null,n=t.portraitImageInfo?await dt(t.portraitImageInfo):null,s=t.iconImageInfo?await dt(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const Kn=m.createContext(void 0);function Fl({children:t,uploadedImages:a,onCropperChange:r,modalOpen:n,onModalOpenChange:s}){const[o,i]=m.useState({landscape:null,portrait:null,icon:null}),[c,u]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function d(){if(a)try{const x=await _l(a);x&&(u(p=>JSON.stringify(p)===JSON.stringify(x.originalImage)?p:x.originalImage),i(p=>JSON.stringify(p)===JSON.stringify(x.aspectRatioWiseImages)?p:x.aspectRatioWiseImages))}catch(x){console.error("Error processing uploaded images:",x)}}d()},[a]),e.jsxs(Kn.Provider,{value:{originalImage:c,setOriginalImage:u,aspectRatioWiseImages:o,setAspectRatioWiseImages:i},children:[t,n&&s&&e.jsx(Hn,{open:n,onOpenChange:s,onCropperChange:r})]})}const ia=()=>{const t=m.useContext(Kn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},Yn=({imageSrc:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o,currentState:i})=>{const c=m.useRef(null),u=()=>{const d=c.current?.cropper;if(d){d.setDragMode("move");const p=d.getCroppedCanvas().toDataURL();a(p)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const d=c.current?.cropper;d&&d.rotate(n)},[n]),m.useEffect(()=>{const d=c.current?.cropper;d&&d.getCropBoxData().width&&(console.log("Inside cropper scale"),d.scale(s))},[s]),m.useEffect(()=>{const d=c.current?.cropper;if(d&&d.getCropBoxData().width){const{x:p,y:w}=o;typeof p=="number"&&typeof w=="number"&&d.move(p,w)}},[o]),m.useEffect(()=>{const d=c.current?.cropper;if(d&&(d.setAspectRatio(r),r===1)){const x=d.getCanvasData(),p=x.width,w=x.height,N=x.left,v=x.top,y=200,b=100,C=N+(p-y)/2,g=v+(w-b)/2;d.setCropBoxData({left:C,top:g,width:y,height:b})}},[r]),e.jsx(wa,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:u,ref:c,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Ml=({open:t,setOpen:a,onImageSubmit:r})=>{const[n,s]=m.useState(null),[o,i]=m.useState(null),[c,u]=m.useState({first:null,second:null,third:null}),[d,x]=m.useState(4/3),[p,w]=m.useState("first"),[N,v]=m.useState(0),[y,b]=m.useState(1),[C,g]=m.useState({x:0,y:0}),[S,j]=m.useState(""),h=()=>{console.log("Image Submit Button is pressed"),console.log(c),r(c.third),a(!1)},I=_=>{v(U=>U+_)},T=()=>{g({x:0,y:-5})},A=()=>{g({x:0,y:5})},O=()=>{g({x:-5,y:0})},V=()=>{g({x:5,y:0})},ce=()=>{b(_=>{const U=_+.2;return U<=2?U:_})},ke=()=>{b(_=>{const U=_-.2;return U>=.2?U:_})},we=(_,U)=>{x(_),w(U)},D=_=>{if(_.type.startsWith("image/")){const U=new FileReader;U.onloadend=()=>{s(U.result),j(F=>F||_.name)},U.readAsDataURL(_)}else alert("Please drop a valid image file.")},P=_=>{_.preventDefault(),D(_.dataTransfer.files[0])},E=_=>{const U=o&&p===_?o:c[_];return U?e.jsx("div",{className:`
|
|
4
|
-
${
|
|
5
|
-
${_==="first"?"relative w-3/5 h-[200px] bg-slate-400":_==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(c.first===null||c.second===null||c.third===null?u({first:o,second:o,third:o}):u(_=>({..._,[p]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Ne,{htmlFor:"imageName",children:"Image Name"}),e.jsx(K,{id:"imageName",placeholder:"Enter image name",value:S,onChange:_=>j(_.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(R,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(f.Upload,{})}),e.jsx(K,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:_=>{const U=_.target.files?.[0];if(U&&U.type.startsWith("image/")){const F=new FileReader;F.onloadend=()=>{s(F.result),j(M=>M||U.name)},F.readAsDataURL(U),u({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ne,{htmlFor:"imageDesc",children:"Image Description"}),e.jsx(K,{id:"imageDesc",placeholder:"Describe your image"})]})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{className:"w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100",style:{height:"70vh"},onDrop:P,onDragOver:_=>_.preventDefault(),children:n?e.jsx(Yn,{imageSrc:n,onCroppedImage:i,aspectRatio:d,rotationAngle:N,zoomLevel:y,moveDirection:C,currentState:p}):e.jsxs("div",{className:"text-center",children:[e.jsx(Ne,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(R,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx(K,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:_=>{const U=_.target.files?.[0];U&&D(U)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),E("first"),e.jsx("h3",{children:"Potrait"}),E("second"),e.jsx("h3",{children:"Icon"}),E("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(R,{variant:"outline",onClick:()=>we(4/3,"first"),children:e.jsx(f.ImageIcon,{})}),e.jsx(R,{variant:"outline",onClick:()=>we(3/4,"second"),children:e.jsx(f.FileImage,{})}),e.jsx(R,{variant:"outline",onClick:()=>we(1/1,"third"),children:e.jsx(f.Square,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:()=>I(90),variant:"outline",children:e.jsx(f.RotateCw,{})}),e.jsx(R,{onClick:()=>I(-90),variant:"outline",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:()=>ce(),variant:"outline",children:e.jsx(f.ZoomIn,{})}),e.jsx(R,{onClick:()=>ke(),variant:"outline",children:e.jsx(f.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:T,variant:"outline",children:e.jsx(f.ArrowUp,{})}),e.jsx(R,{onClick:A,variant:"outline",children:e.jsx(f.ArrowDown,{})}),e.jsx(R,{onClick:O,variant:"outline",children:e.jsx(f.ArrowLeft,{})}),e.jsx(R,{onClick:V,variant:"outline",children:e.jsx(f.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(R,{onClick:h,children:"Save"})})]})]})},El=m.memo(Ml);function Ll(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"bg-background text-forefround rounded-xl p-6 text-center max-w-md",children:[e.jsx("div",{className:"text-3xl font-bold mb-2 animate-pulse",children:"🚧 Work in Progress"}),e.jsx("p",{className:"text-muted-foreground",children:"We’re currently working on this section. Check back soon!"})]})})}function Ol({formControl:t,name:a,label:r,options:n,placeholder:s="Select an option",emptyMessage:o="No options found.",onValueChange:i,className:c,addNewPlaceholder:u="Add custom value...",formDescription:d,disabled:x}){const[p,w]=k.useState(!1),[N,v]=k.useState(""),[y,b]=k.useState(n),[C,g]=k.useState(!1),[S,j]=k.useState("");return k.useEffect(()=>{b(n)},[n]),e.jsx(xe,{control:t,name:a,render:({field:h})=>{const I=y.find(A=>A.value===h.value),T=()=>{const A=S.trim();if(!A)return;if(y.some(V=>V.value===A)){const V=y.find(ce=>ce.value===A);V&&(h.onChange(V.value),i?.(V.value),j(""),g(!1),w(!1),v(""));return}const O={value:A,label:A,disabled:!0};b(V=>[...V,O]),h.onChange(A),i?.(A),j(""),g(!1),w(!1),v("")};return e.jsxs(fe,{className:l(c),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(ve,{children:r}),e.jsx("br",{})]}),e.jsxs(J,{open:p,onOpenChange:A=>{w(A),A||(v(""),g(!1),j(""))},children:[e.jsx(Z,{asChild:!0,children:e.jsx(ge,{children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":p,className:l("w-full justify-between",!h.value&&"text-foreground/50",c),disabled:x||h.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:h.value?I?I.label:h.value:s}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(ee,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Q,{shouldFilter:!0,children:[e.jsx(ie,{placeholder:"Search...",value:N,onValueChange:v}),e.jsxs(le,{children:[e.jsx(de,{children:N&&y.length>0?"No results found.":o}),e.jsx(re,{children:y.filter(A=>A.label.toLowerCase().includes(N.toLowerCase())||A.value.toLowerCase().includes(N.toLowerCase())).map(A=>e.jsxs(X,{value:A.value,onSelect:O=>{h.onChange(O),i?.(O),w(!1),v("")},className:"cursor-pointer",disabled:A?.disabled,children:[e.jsx(f.Check,{className:l("mr-2 h-4 w-4",h.value===A.value?"opacity-100":"opacity-0")}),A.label]},A.value))})]}),e.jsx("div",{className:"border-t p-2",children:C?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{placeholder:u,value:S,onChange:A=>j(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),T()),A.key==="Escape"&&(g(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(R,{size:"sm",variant:"ghost",onClick:()=>{g(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(R,{size:"sm",variant:"default",onClick:T,className:"h-8",disabled:!S.trim()||y.some(A=>A.value===S.trim()),children:"Add"})]}):e.jsxs(R,{variant:"outline",className:"w-full justify-start",onClick:()=>g(!0),children:[e.jsx(f.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),d&&e.jsx(je,{children:d}),e.jsx(pe,{})]})}})}const me=m.forwardRef(({children:t,tooltip:a,side:r="bottom",className:n,...s},o)=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(R,{variant:"ghost",size:"icon",...s,className:l("aui-button-icon size-6 p-1",n),ref:o,children:[e.jsx($t.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),e.jsx(oe,{side:r,children:a})]}));me.displayName="TooltipIconButton";const Bl=()=>e.jsx(Dt.MarkdownTextPrimitive,{remarkPlugins:[Ps],className:"aui-md",components:$l}),Ul=m.memo(Bl),Vl=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Gl(),s=()=>{!a||r||n(a)};return e.jsxs("div",{className:"aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20",children:[e.jsx("span",{className:"aui-code-header-language lowercase [&>span]:text-xs",children:t}),e.jsxs(me,{tooltip:"Copy",onClick:s,children:[!r&&e.jsx(f.CopyIcon,{}),r&&e.jsx(f.CheckIcon,{})]})]})},Gl=({copiedDuration:t=3e3}={})=>{const[a,r]=m.useState(!1);return{isCopied:a,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),t)})}}},$l=Dt.unstable_memoizeMarkdownComponents({h1:({className:t,...a})=>e.jsx("h1",{className:l("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...a}),h2:({className:t,...a})=>e.jsx("h2",{className:l("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...a}),h3:({className:t,...a})=>e.jsx("h3",{className:l("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...a}),h4:({className:t,...a})=>e.jsx("h4",{className:l("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...a}),h5:({className:t,...a})=>e.jsx("h5",{className:l("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...a}),h6:({className:t,...a})=>e.jsx("h6",{className:l("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...a}),p:({className:t,...a})=>e.jsx("p",{className:l("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...a}),a:({className:t,...a})=>e.jsx("a",{className:l("aui-md-a font-medium text-primary underline underline-offset-4",t),...a}),blockquote:({className:t,...a})=>e.jsx("blockquote",{className:l("aui-md-blockquote border-l-2 pl-6 italic",t),...a}),ul:({className:t,...a})=>e.jsx("ul",{className:l("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...a}),ol:({className:t,...a})=>e.jsx("ol",{className:l("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...a}),hr:({className:t,...a})=>e.jsx("hr",{className:l("aui-md-hr my-5 border-b",t),...a}),table:({className:t,...a})=>e.jsx("table",{className:l("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...a}),th:({className:t,...a})=>e.jsx("th",{className:l("aui-md-th bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [[align=center]]:text-center [[align=right]]:text-right",t),...a}),td:({className:t,...a})=>e.jsx("td",{className:l("aui-md-td border-b border-l px-4 py-2 text-left last:border-r [[align=center]]:text-center [[align=right]]:text-right",t),...a}),tr:({className:t,...a})=>e.jsx("tr",{className:l("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t),...a}),sup:({className:t,...a})=>e.jsx("sup",{className:l("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...a}),pre:({className:t,...a})=>e.jsx("pre",{className:l("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...a}),code:function({className:a,...r}){const n=Dt.useIsMarkdownCodeBlock();return e.jsx("code",{className:l(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Vl}),ql=({toolName:t,argsText:a,result:r,status:n})=>{const[s,o]=m.useState(!0),i=n?.type==="incomplete"&&n.reason==="cancelled",c=i&&n.error?typeof n.error=="string"?n.error:JSON.stringify(n.error):null;return e.jsxs("div",{className:l("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",i&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[i?e.jsx(f.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(f.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:l("aui-tool-fallback-title grow",i&&"text-muted-foreground line-through"),children:[i?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(R,{onClick:()=>o(!s),children:s?e.jsx(f.ChevronUpIcon,{}):e.jsx(f.ChevronDownIcon,{})})]}),!s&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[c&&e.jsxs("div",{className:"aui-tool-fallback-cancelled-root px-4",children:[e.jsx("p",{className:"aui-tool-fallback-cancelled-header font-semibold text-muted-foreground",children:"Cancelled reason:"}),e.jsx("p",{className:"aui-tool-fallback-cancelled-reason text-muted-foreground",children:c})]}),e.jsx("div",{className:l("aui-tool-fallback-args-root px-4",i&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:a})}),!i&&r!==void 0&&e.jsxs("div",{className:"aui-tool-fallback-result-root border-t border-dashed px-4 pt-2",children:[e.jsx("p",{className:"aui-tool-fallback-result-header font-semibold",children:"Result:"}),e.jsx("pre",{className:"aui-tool-fallback-result-content whitespace-pre-wrap",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})]})},ga=t=>Symbol.iterator in t,pa=t=>"entries"in t,ha=(t,a)=>{const r=t instanceof Map?t:new Map(t.entries()),n=a instanceof Map?a:new Map(a.entries());if(r.size!==n.size)return!1;for(const[s,o]of r)if(!n.has(s)||!Object.is(o,n.get(s)))return!1;return!0},Wl=(t,a)=>{const r=t[Symbol.iterator](),n=a[Symbol.iterator]();let s=r.next(),o=n.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=r.next(),o=n.next()}return!!s.done&&!!o.done};function Hl(t,a){return Object.is(t,a)?!0:typeof t!="object"||t===null||typeof a!="object"||a===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(a)?!1:ga(t)&&ga(a)?pa(t)&&pa(a)?ha(t,a):Wl(t,a):ha({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function Kl(t){const a=m.useRef(void 0);return r=>{const n=t(r);return Hl(a.current,n)?a.current:a.current=n}}const Yl=t=>{const[a,r]=m.useState(void 0);return m.useEffect(()=>{if(!t){r(void 0);return}const n=URL.createObjectURL(t);return r(n),()=>{URL.revokeObjectURL(n)}},[t]),a},Xn=()=>{const{file:t,src:a}=z.useAssistantState(Kl(({attachment:r})=>{if(r.type!=="image")return{};if(r.file)return{file:r.file};const n=r.content?.filter(s=>s.type==="image")[0]?.image;return n?{src:n}:{}}));return Yl(t)??a},Xl=({src:t})=>{const[a,r]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:a?"aui-attachment-preview-image-loaded block h-auto max-h-[80vh] w-auto max-w-full object-contain":"aui-attachment-preview-image-loading hidden",onLoad:()=>r(!0),loading:"lazy"})},Ql=({children:t})=>{const a=Xn();return a?e.jsxs(jt,{children:[e.jsx(qa,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(wt,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(Nt,{className:"aui-sr-only sr-only",children:"Image Attachment Preview"}),e.jsx("div",{className:"aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background",children:e.jsx(Xl,{src:a})})]})]}):t},Jl=()=>{const t=z.useAssistantState(({attachment:r})=>r.type==="image"),a=Xn();return e.jsxs(La,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(Oa,{src:a,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Ba,{delayMs:t?200:0,children:e.jsx(f.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},Qn=()=>{const a=z.useAssistantApi().attachment.source==="composer",r=z.useAssistantState(({attachment:s})=>s.type==="image"),n=z.useAssistantState(({attachment:s})=>{const o=s.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const i=o;throw new Error(`Unknown attachment type: ${i}`)}}});return e.jsxs(ne,{children:[e.jsxs(z.AttachmentPrimitive.Root,{className:l("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Ql,{children:e.jsx(se,{asChild:!0,children:e.jsx("div",{className:l("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",a&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${n} attachment`,children:e.jsx(Jl,{})})})}),a&&e.jsx(Zl,{})]}),e.jsx(oe,{side:"top",children:e.jsx(z.AttachmentPrimitive.Name,{})})]})},Zl=()=>e.jsx(z.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(me,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(f.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),ed=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(z.MessagePrimitive.Attachments,{components:{Attachment:Qn}})}),td=()=>e.jsx("div",{className:"aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",children:e.jsx(z.ComposerPrimitive.Attachments,{components:{Attachment:Qn}})}),ad=()=>e.jsx(z.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(me,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(f.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),rd=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,i]=m.useState(!1),c=a||null;return e.jsxs(ze,{open:o,onOpenChange:i,children:[e.jsx(_e,{asChild:!0,children:e.jsxs(R,{variant:"outline",className:l("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",s),children:[e.jsx("span",{className:"truncate",children:c?.agentName||"Select Agent"}),e.jsx(f.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(Fe,{align:"end",className:l("min-w-[200px]",n),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Zt,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(yt,{}),e.jsx(Jt,{children:t.map(u=>e.jsxs(ue,{onClick:()=>{r(u),i(!1)},className:l("cursor-pointer flex flex-col gap-1",c?.agentID===u.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:u.agentName}),u.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.agentDescription})]},u.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},nd=({currentUserDetails:t,agents:a=[],initialAgentId:r="default-agent",initialAgentName:n="Default Agent",onAgentChange:s})=>{const[o,i]=m.useState(a.find(c=>c.agentID===r));return e.jsx(ct.LazyMotion,{features:ct.domAnimation,children:e.jsx(ct.MotionConfig,{reducedMotion:"user",children:e.jsx(z.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(z.ThreadPrimitive.Viewport,{turnAnchor:"top",className:"aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",children:[e.jsx(z.ThreadPrimitive.If,{empty:!0,children:e.jsx(od,{currentUserDetails:t})}),e.jsx(z.ThreadPrimitive.Messages,{components:{UserMessage:xd,EditComposer:gd,AssistantMessage:ud}}),e.jsxs(z.ThreadPrimitive.ViewportFooter,{className:"aui-thread-viewport-footer sticky bottom-0 mx-auto mt-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",children:[e.jsx(sd,{}),e.jsx(ld,{agents:a,selectedAgent:o,onSelectAgent:c=>{i(c),s?.(c)}})]})]})})})})},sd=()=>e.jsx(z.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(me,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(f.ArrowDownIcon,{})})}),od=({currentUserDetails:t})=>{const r=new Date().getHours();let n="";return r>=5&&r<12?n="Good Morning":r>=12&&r<17?n="Good Afternoon":r>=17&&r<21?n="Good Evening":n="Good Night",console.log(n),e.jsxs("div",{className:"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col",children:[e.jsx("div",{className:"aui-thread-welcome-center flex w-full flex-grow flex-col items-center justify-center",children:e.jsxs("div",{className:"aui-thread-welcome-message flex size-full flex-col justify-center px-8",children:[e.jsx(At.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"aui-thread-welcome-message-motion-1 text-2xl font-semibold",children:`${n} ${t.userName.split(" ")[0]}`}),e.jsx(At.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.1},className:"aui-thread-welcome-message-motion-2 text-2xl text-muted-foreground/65",children:"How can I help you today?"})]})}),e.jsx(id,{})]})},id=()=>e.jsx("div",{className:"aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2",children:[{title:"What's the weather",label:"in San Francisco?",action:"What's the weather in San Francisco?"},{title:"Explain React hooks",label:"like useState and useEffect",action:"Explain React hooks like useState and useEffect"},{title:"Write a SQL query",label:"to find top customers",action:"Write a SQL query to find top customers"},{title:"Create a meal plan",label:"for healthy weight loss",action:"Create a meal plan for healthy weight loss"}].map((t,a)=>e.jsx(At.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*a},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(z.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(R,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${a}`))}),ld=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(z.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(z.ComposerPrimitive.AttachmentDropzone,{className:"aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background",children:[e.jsx(td,{}),e.jsx(z.ComposerPrimitive.Input,{placeholder:"Send a message...",className:"aui-composer-input mb-1 max-h-32 min-h-16 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 text-base outline-none placeholder:text-muted-foreground focus-visible:ring-0",rows:1,autoFocus:!0,"aria-label":"Message input"}),e.jsx(dd,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),dd=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(ad,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(rd,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(z.ThreadPrimitive.If,{running:!1,children:e.jsx(z.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(me,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(f.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(z.ThreadPrimitive.If,{running:!0,children:e.jsx(z.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(R,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(f.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),cd=()=>e.jsx(z.MessagePrimitive.Error,{children:e.jsx(z.ErrorPrimitive.Root,{className:"aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200",children:e.jsx(z.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),ud=()=>e.jsxs(z.MessagePrimitive.Root,{className:"aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1","data-role":"assistant",children:[e.jsxs("div",{className:"aui-assistant-message-content mx-2 leading-7 break-words text-foreground",children:[e.jsx(z.MessagePrimitive.Parts,{components:{Text:Ul,tools:{Fallback:ql}}}),e.jsx(cd,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(Jn,{}),e.jsx(md,{})]})]}),md=()=>e.jsxs(z.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm",children:[e.jsx(z.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(me,{tooltip:"Copy",children:[e.jsx(z.MessagePrimitive.If,{copied:!0,children:e.jsx(f.CheckIcon,{})}),e.jsx(z.MessagePrimitive.If,{copied:!1,children:e.jsx(f.CopyIcon,{})})]})}),e.jsx(z.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(me,{tooltip:"Refresh",children:e.jsx(f.RefreshCwIcon,{})})})]}),xd=()=>e.jsxs(z.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(ed,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(z.MessagePrimitive.Parts,{})}),e.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:e.jsx(fd,{})})]}),e.jsx(Jn,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),fd=()=>e.jsx(z.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(z.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(me,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(f.PencilIcon,{})})})}),gd=()=>e.jsx(z.MessagePrimitive.Root,{className:"aui-edit-composer-wrapper mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 px-2",children:e.jsxs(z.ComposerPrimitive.Root,{className:"aui-edit-composer-root ml-auto flex w-full max-w-7/8 flex-col rounded-xl bg-muted",children:[e.jsx(z.ComposerPrimitive.Input,{className:"aui-edit-composer-input flex min-h-[60px] w-full resize-none bg-transparent p-4 text-foreground outline-none",autoFocus:!0}),e.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[e.jsx(z.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(R,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(z.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(R,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),Jn=({className:t,...a})=>e.jsxs(z.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:l("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...a,children:[e.jsx(z.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(me,{tooltip:"Previous",children:e.jsx(f.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(z.BranchPickerPrimitive.Number,{})," / ",e.jsx(z.BranchPickerPrimitive.Count,{})]}),e.jsx(z.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(me,{tooltip:"Next",children:e.jsx(f.ChevronRightIcon,{})})})]});class pd{agentConfig;baseUrl;chatIdMap=new Map;constructor(a){this.agentConfig=a,this.baseUrl=a.baseUrl||""}updateAgentConfig(a){this.agentConfig={...this.agentConfig,...a}}getChatId(a){return this.chatIdMap.has(a)?this.chatIdMap.get(a):la.v4()}async sendMessages(a){const{messages:r,chatId:n,abortSignal:s,headers:o,body:i}=a;console.log("sendMessages called with chatId:",n,"trigger:",a.trigger);const c=this.getChatId(n);console.log("Using server chatId:",c);const d={messages:r.map(w=>{const N=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?N+JSON.stringify(this.agentConfig.additionalReferenceInfo):N}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...i},p={"Content-Type":"application/json",Authorization:`Bearer ${await st()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${c}`,{method:"POST",headers:p,body:JSON.stringify(d),signal:s,cache:"no-store"});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);if(!w.body)throw new Error("Response body is null");return this.processResponseStream(w.body)}catch(w){throw console.error("Error in sendMessages:",w),w}}async reconnectToStream(a){return null}processResponseStream(a){const r=new TextDecoder;let n="",s=null,o=!1,i=[],c=!1,u="",d=!1,x="";return new ReadableStream({async start(p){s=a.getReader()},async pull(p){if(!(!s||o)){if(i.length>0){p.enqueue(i.shift());return}try{const{done:w,value:N}=await s.read();if(w){if(c&&u)for(d&&x&&i.push({type:"text-end",id:x}),i.push({type:"finish",finishReason:"stop"});i.length>0;)p.enqueue(i.shift());o||(o=!0,p.close());return}n+=r.decode(N,{stream:!0});const v=n.split(`
|
|
6
|
-
`);n=v.pop()||"";for(const y of v){const b=y.trim();if(b&&b.startsWith("data:")){const C=b.slice(5).trim();if(!C)continue;try{const g=JSON.parse(C);if(o)return;g.id&&!u&&(u=g.id,c=!0,i.push({type:"start"}));let S=null;if(g.type==="ai"){const j=g.messages?.[0];j?.content&&(x||(x=la.v4()),d||(d=!0,i.push({type:"text-start",id:x})),S={type:"text-delta",delta:j.content,id:x})}else if(g.type==="tool"){const j=g.toolCall;j&&(S={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}S&&i.push(S)}catch{}}}i.length>0&&p.enqueue(i.shift())}catch(w){o||(o=!0,p.error(w))}}},cancel(){o=!0,i=[],s&&(s.releaseLock(),s=null)}})}}const hd=({provider:t="openai",model:a="gpt-4o-mini",agentId:r="default-agent",agentName:n="Default Agent",temperature:s=.7,maxTokens:o=2048,className:i,baseUrl:c="http://localhost:3000",additionalReferenceInfo:u={},appId:d="",currentUserDetails:x})=>{const[p,w]=m.useState([]),[N,v]=m.useState(),y=m.useMemo(()=>new pd({provider:t,model:a,agentId:N?N.agentID:r,agentName:N?N.agentName:n,temperature:s,maxTokens:o,baseUrl:c,additionalReferenceInfo:u}),[t,a,N,r,n,s,o,c,u]),b=As.useChatRuntime({transport:y}),C=async()=>{try{const S=await st(),j=await fetch(`${c}/api/agent/${d}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${S}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const h=await j.json();console.log("Agent Data:",h),w(h)}catch(S){console.error("Error while fetching agents with the specific appId",S)}};m.useEffect(()=>{C()},[d,c]);const g=S=>{v(S),console.log("Agent changed to:",S.agentName)};return e.jsx(z.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:i,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${i}`,children:e.jsx(nd,{currentUserDetails:x,agents:p,initialAgentId:r,initialAgentName:n,onAgentChange:g})})})})};exports.Accordion=Ls;exports.AccordionContent=Us;exports.AccordionItem=Os;exports.AccordionTrigger=Bs;exports.ActionMenu=Bt;exports.ActivitySheet=Al;exports.Alert=uo;exports.AlertDescription=xo;exports.AlertDialog=Da;exports.AlertDialogAction=Rt;exports.AlertDialogCancel=Ea;exports.AlertDialogContent=Ra;exports.AlertDialogDescription=Ma;exports.AlertDialogFooter=_a;exports.AlertDialogHeader=za;exports.AlertDialogMedia=lo;exports.AlertDialogOverlay=Aa;exports.AlertDialogPortal=Pa;exports.AlertDialogTitle=Fa;exports.AlertDialogTrigger=io;exports.AlertTitle=mo;exports.AppBreadcrumb=In;exports.AppSidebar=Rn;exports.AspectRatio=Et;exports.AssistantComponent=hd;exports.Avatar=La;exports.AvatarBadge=fo;exports.AvatarFallback=Ba;exports.AvatarGroup=go;exports.AvatarGroupCount=po;exports.AvatarImage=Oa;exports.Badge=ut;exports.BigCalendar=Zi;exports.Breadcrumb=Br;exports.BreadcrumbEllipsis=Ot;exports.BreadcrumbItem=Ve;exports.BreadcrumbLink=Lt;exports.BreadcrumbList=Ur;exports.BreadcrumbPage=He;exports.BreadcrumbProvider=kn;exports.BreadcrumbSeparator=mt;exports.Button=R;exports.Calendar=Va;exports.CalendarDayButton=Ga;exports.Card=gt;exports.CardAction=jo;exports.CardContent=$a;exports.CardDescription=vo;exports.CardFooter=wo;exports.CardHeader=ho;exports.CardTitle=bo;exports.Checkbox=Ze;exports.Collapsible=Vr;exports.CollapsibleContent=$r;exports.CollapsibleTrigger=Gr;exports.ComboboxInput=Ni;exports.Command=Q;exports.CommandDialog=yo;exports.CommandEmpty=de;exports.CommandGroup=re;exports.CommandInput=ie;exports.CommandItem=X;exports.CommandList=le;exports.CommandSeparator=Xa;exports.CommandShortcut=Co;exports.CropperForm=Wn;exports.CropperFormWithModal=Hn;exports.CustomAlertDialog=cn;exports.CustomComboboxInput=Ol;exports.CustomTabs=yn;exports.DataTable=ki;exports.DataTableColumnFilter=xn;exports.DataTableFacetedFilter=fn;exports.DataTableFilterMenu=gn;exports.DataTableLayout=Fi;exports.DataTablePagination=hn;exports.DataTableToolbar=vn;exports.Dialog=jt;exports.DialogClose=No;exports.DialogContent=wt;exports.DialogDescription=Ya;exports.DialogFooter=Ka;exports.DialogHeader=Qt;exports.DialogOverlay=Ha;exports.DialogPortal=Wa;exports.DialogProvider=mn;exports.DialogTitle=Nt;exports.DialogTrigger=qa;exports.Drawer=qr;exports.DrawerClose=Kr;exports.DrawerContent=Xr;exports.DrawerDescription=en;exports.DrawerFooter=Jr;exports.DrawerHeader=Qr;exports.DrawerOverlay=Yr;exports.DrawerPortal=Hr;exports.DrawerTitle=Zr;exports.DrawerTrigger=Wr;exports.DropdownMenu=ze;exports.DropdownMenuCheckboxItem=So;exports.DropdownMenuContent=Fe;exports.DropdownMenuGroup=Jt;exports.DropdownMenuItem=ue;exports.DropdownMenuLabel=Zt;exports.DropdownMenuPortal=Qa;exports.DropdownMenuRadioGroup=ko;exports.DropdownMenuRadioItem=Io;exports.DropdownMenuSeparator=yt;exports.DropdownMenuShortcut=To;exports.DropdownMenuSub=Ja;exports.DropdownMenuSubContent=er;exports.DropdownMenuSubTrigger=Za;exports.DropdownMenuTrigger=_e;exports.EChart=Ei;exports.FileInput=wn;exports.FileUploader=Ci;exports.FontProvider=Un;exports.Footer=zn;exports.Form=tn;exports.FormComboboxInput=al;exports.FormComboboxInputWithValue=rl;exports.FormControl=ge;exports.FormDateInput=nl;exports.FormDescription=je;exports.FormField=xe;exports.FormFileInput=sl;exports.FormInput=ol;exports.FormItem=fe;exports.FormLabel=ve;exports.FormMessage=pe;exports.FormMultiComboboxInput=il;exports.FormOtpInput=ll;exports.FormPasswordInput=ul;exports.FormPhoneInput=dl;exports.FormTextarea=cl;exports.FrameworkItemDropdown=Hi;exports.GlowingEffect=Li;exports.GradeTableLoader=ml;exports.Header=_n;exports.HoverCard=Do;exports.HoverCardContent=Ao;exports.HoverCardTrigger=Po;exports.Icon=pt;exports.IconButton=dn;exports.IconButtonWithTooltip=Ie;exports.IconTextButton=rt;exports.IconTextButtonWithTooltip=ln;exports.ImageCropper=qn;exports.ImageCropperProvider=Fl;exports.Input=K;exports.InputOTP=nn;exports.InputOTPGroup=sn;exports.InputOTPSeparator=bi;exports.InputOTPSlot=Ke;exports.Label=Ne;exports.LoadingSpinner=Oi;exports.MainLayout=On;exports.MainSidebar=Ln;exports.MultiCombobox=Bi;exports.NavMain=Pn;exports.NavigationMenu=Ro;exports.NavigationMenuContent=Mo;exports.NavigationMenuIndicator=Lo;exports.NavigationMenuItem=_o;exports.NavigationMenuLink=Eo;exports.NavigationMenuList=zo;exports.NavigationMenuTrigger=Fo;exports.NavigationMenuViewport=ar;exports.NewCropperImg=Yn;exports.NewImageForm=El;exports.NoDataComponent=na;exports.PageWrapper=Ui;exports.PasswordStrengthMeter=Vi;exports.PhoneInput=Gi;exports.Popover=J;exports.PopoverAnchor=Oo;exports.PopoverContent=ee;exports.PopoverDescription=Vo;exports.PopoverHeader=Bo;exports.PopoverTitle=Uo;exports.PopoverTrigger=Z;exports.Progress=Ct;exports.ProviderWrapper=Pl;exports.RadioGroup=Go;exports.RadioGroupItem=$o;exports.RadiusProvider=Gn;exports.Reload=jn;exports.RenderAppBreadcrumb=el;exports.RenderSidebarNav=tl;exports.ScrollArea=qo;exports.ScrollBar=rr;exports.SearchInput=bn;exports.Select=nr;exports.SelectContent=ir;exports.SelectGroup=Wo;exports.SelectItem=lr;exports.SelectLabel=Ho;exports.SelectScrollDownButton=cr;exports.SelectScrollUpButton=dr;exports.SelectSeparator=Ko;exports.SelectTrigger=or;exports.SelectValue=sr;exports.Separator=St;exports.Sheet=ea;exports.SheetClose=Yo;exports.SheetComponent=Nn;exports.SheetContent=ta;exports.SheetDescription=xr;exports.SheetFooter=Jo;exports.SheetHeader=mr;exports.SheetTitle=aa;exports.SheetTrigger=ur;exports.Sidebar=pr;exports.SidebarContent=Nr;exports.SidebarFooter=wr;exports.SidebarGroup=yr;exports.SidebarGroupAction=li;exports.SidebarGroupContent=di;exports.SidebarGroupLabel=ii;exports.SidebarHeader=jr;exports.SidebarInput=si;exports.SidebarInset=vr;exports.SidebarMenu=Cr;exports.SidebarMenuAction=ui;exports.SidebarMenuBadge=mi;exports.SidebarMenuButton=_t;exports.SidebarMenuItem=zt;exports.SidebarMenuSkeleton=xi;exports.SidebarMenuSub=Sr;exports.SidebarMenuSubButton=Ir;exports.SidebarMenuSubItem=kr;exports.SidebarNavProvider=Dn;exports.SidebarProvider=gr;exports.SidebarRail=br;exports.SidebarSeparator=oi;exports.SidebarTrigger=hr;exports.SimpleWidget=qi;exports.Skeleton=Le;exports.SkeletonWidget=xl;exports.Slider=fi;exports.Switch=pi;exports.Table=Ar;exports.TableBody=zr;exports.TableCaption=hi;exports.TableCell=We;exports.TableFooter=_r;exports.TableHead=Ft;exports.TableHeader=Rr;exports.TableRow=Ue;exports.Tabs=Fr;exports.TabsContent=Mt;exports.TabsList=Er;exports.TabsTrigger=Lr;exports.TextButton=at;exports.TextButtonWithTooltip=ji;exports.Textarea=Or;exports.ThemeProvider=Dr;exports.ThemeToggleBtn=Cn;exports.TitleProgress=Wi;exports.Toaster=gi;exports.Toggle=vi;exports.ToggleGroup=Ee;exports.ToggleGroupItem=$;exports.Tooltip=ne;exports.TooltipComponent=De;exports.TooltipContent=oe;exports.TooltipProvider=Te;exports.TooltipTrigger=se;exports.UploadTab=An;exports.Widgets=Ki;exports.WorkInProgress=Ll;exports.axiosInstance=Pe;exports.badgeVariants=Ua;exports.buttonVariants=ft;exports.clearAllCookieSession=gl;exports.clearCookieSession=Vt;exports.cn=l;exports.convertFileToObject=pn;exports.getCookieSession=ht;exports.getDataTableColumnTitle=ye;exports.getImageFromObject=yi;exports.getValidAccessToken=st;exports.navigationMenuTriggerStyle=tr;exports.refreshAccessToken=Fn;exports.setCookieSession=Ut;exports.setIkonConfig=fl;exports.tabsListVariants=Mr;exports.toggleVariants=ra;exports.useBreadcrumb=sa;exports.useDialog=wi;exports.useFont=Cl;exports.useFormField=tt;exports.useImageCropper=ia;exports.useIsMobile=kt;exports.useRadius=Sl;exports.useRefresh=Il;exports.useSidebar=et;exports.useSidebarNav=nt;
|
|
3
|
+
`,onDragOver:d,onDragLeave:u,onDrop:i,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(f.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(f.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const Ti=[15,20,30,40,50,100];function yn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between ",children:[e.jsx("small",{className:"flex-1 px-2 text-gray-600 dark:text-gray-400",children:(a?.numberOfRows==null||a?.numberOfRows)&&a?.checkBoxColumn?e.jsxs(e.Fragment,{children:[t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."]}):e.jsxs(e.Fragment,{children:["Total ",t.getFilteredRowModel().rows.length," no(s) of rows."]})}),(a?.pagination==null||a.pagination)&&e.jsxs("div",{className:"flex items-start md:items-center gap-3 flex-col md:flex-row ",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("small",{className:"text-gray-600 dark:text-gray-400",children:"Rows per page"}),(a?.rowsPerPage==null||a.rowsPerPage)&&e.jsxs(cr,{value:`${t.getState().pagination.pageSize}`,onValueChange:r=>{t.setPageSize(Number(r))},children:[e.jsx(mr,{className:"w-[70px] h-8",children:e.jsx(ur,{placeholder:t.getState().pagination.pageSize})}),e.jsx(xr,{side:"top",children:(a?.pageSizeArray||Ti).map(r=>e.jsx(fr,{value:`${r}`,children:r},r))})]})]}),e.jsxs(e.Fragment,{children:[e.jsxs("small",{className:"flex w-[100px] items-center justify-center text-gray-600 dark:text-gray-400",children:["Page ",t.getState().pagination.pageIndex+1," of"," ",t.getPageCount()]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Re,{tooltipContent:"Go to first page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronsLeft,{})}),e.jsx(Re,{tooltipContent:"Go to previous page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronLeft,{})}),e.jsx(Re,{tooltipContent:"Go to next page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronRight,{})}),e.jsx(Re,{tooltipContent:"Go to last page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronsRight,{})})]})]})]})]})}function da({className:t,...a}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(f.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(H,{className:W.cx("pl-8 h-8",t),...a})]})}function Cn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-3 overflow-hidden",children:[(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("search"))&&e.jsx(da,{placeholder:"Search ...",onChange:r=>t.setGlobalFilter(r.target.value),className:"max-w-sm"}),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("filter"))&&e.jsx(wn,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[a?.extraTools?.map((r,n)=>e.jsx(m.Fragment,{children:r},n)),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("columnFilter"))&&e.jsx(vn,{table:t})]})]})}const Ri=m.forwardRef(({columns:t,data:a,extraParams:r,onTableReady:n},s)=>{const[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState([]),[g,w]=m.useState({pageIndex:r?.pageIndex||0,pageSize:r?.pageSize||15}),[N,v]=m.useState({}),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({});t=t.map(y=>(y?.filterFn||(y.filterFn="arrIncludesSome"),y)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(h.getFilteredSelectedRowModel().rows)},[I]),r?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:y})=>e.jsx(Ve,{checked:y.getIsAllPageRowsSelected()||y.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:k=>y.toggleAllPageRowsSelected(!!k),"aria-label":"Select all"}),cell:({row:y})=>e.jsx(e.Fragment,{children:e.jsx(Ve,{checked:y.getIsSelected(),onCheckedChange:k=>y.toggleSelected(!!k),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(r?.actionMenu||r?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:y})=>y.getIsGrouped()?r?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Wt,{actionMenus:r.groupActionMenu.items,extraActionParams:{arguments:[y.original,...r.groupActionMenu.extraArguments||[]]}})}):null:r?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Wt,{actionMenus:r.actionMenu.items,extraActionParams:{arguments:[y.original,...r.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{r?.onPaginationChange?.(g)},[g]);const h=E.useReactTable({data:a,columns:t,state:{sorting:o,globalFilter:d,columnFilters:c,columnVisibility:N,rowSelection:I,grouping:C,expanded:S,pagination:g},onPaginationChange:w,onSortingChange:i,onExpandedChange:p,onColumnFiltersChange:x,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:u,onRowSelectionChange:j,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),getFacetedRowModel:E.getFacetedRowModel(),getFacetedUniqueValues:E.getFacetedUniqueValues(),getFacetedMinMaxValues:E.getFacetedMinMaxValues(),manualPagination:r?.pagination==null||r?.pagination==!0?void 0:!0});m.useImperativeHandle(s,()=>h);const[A,P]=m.useState([]),R=(y,k)=>{const B={id:k.id,title:ke(k.column)};y.dataTransfer.setData("headerObj",JSON.stringify(B)),y.dataTransfer.effectAllowed="move"},M=y=>{y.preventDefault();const k=JSON.parse(y.dataTransfer.getData("headerObj"));if(!A.find(B=>B.id==k.id)){P(z=>[...z,k]);const B=h.getColumn(k.id);B&&B.getToggleGroupingHandler()()}},F=y=>{y.preventDefault()},ce=y=>{const k=A.filter(z=>z.id!==y);P(()=>[...k]);const B=h.getColumn(y);B&&B.getToggleGroupingHandler()()},[Ae,Ce]=m.useState(!1);return m.useEffect(()=>{Ae||Ce(!0),r?.defaultGroups&&h.setGrouping(r?.defaultGroups)},[]),m.useEffect(()=>{n&&n(h)},[n,h]),Ae&&e.jsxs("div",{className:"w-full h-full flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3 overflow-hidden",children:[(r?.defaultTools==null||r.defaultTools||r.extraTools)&&e.jsx(Cn,{table:h,extraParams:r}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(r?.grouping==null||r.grouping)&&e.jsx("div",{className:"w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new",onDrop:M,onDragOver:F,children:A.length===0?"Drag a column header here to group its column":A.map((y,k)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[y.title,e.jsx("span",{onClick:()=>ce(y.id),children:e.jsx(f.X,{size:15})})]},y.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Er,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Lr,{className:"sticky top-0 z-10 border-t bg-card-new",children:h.getHeaderGroups().map(y=>e.jsx(qe,{className:W.cx(""),children:y.headers.map(k=>k.column.getIsGrouped()?k.column.getGroupedIndex()<A.length-1?null:e.jsx(Ut,{colSpan:A.length,className:W.cx("w-36 ","text-left")},k.id):e.jsx(Ut,{...r?.grouping==null||r.grouping?{onDragStart:B=>R(B,k),draggable:!0}:{},className:W.cx("text-left"),children:k.isPlaceholder?null:(r?.sorting==null||r.sorting)&&k.column.getCanSort()?e.jsxs("div",{onClick:k.column.getToggleSortingHandler(),className:W.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:E.flexRender(k.column.columnDef.header,k.getContext())}),k.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(f.ChevronUp,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(f.ChevronDown,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):E.flexRender(k.column.columnDef.header,k.getContext())},k.id))},y.id))}),e.jsx(Or,{children:h.getRowModel().rows.length?h.getRowModel().rows.map(y=>y.getIsGrouped()?e.jsx(qe,{children:y.getVisibleCells().map(k=>k.column.getIndex()<y.depth?null:e.jsx(Ye,{colSpan:k.column.getIndex()==y.depth?y.depth+1:void 0,className:k.column.getIndex()==y.depth?"w-36":"",children:k.getIsGrouped()?e.jsxs(T,{variant:"link",onClick:y.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:y.depth+"rem"},children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{}):e.jsx(f.ChevronRight,{})," ",E.flexRender(k.column.columnDef.cell,k.getContext())," ","(",y.subRows.length,")"]}):k.column.id=="DTActions"?E.flexRender(k.column.columnDef.cell,k.getContext()):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id):e.jsx(qe,{className:W.cx(y.getIsSelected()?"bg-accent/10":""),...r?.checkBoxColumn&&{onClick:()=>y.toggleSelected(!y.getIsSelected())},children:y.getVisibleCells().map((k,B)=>e.jsxs(Ye,{className:W.cx(y.getIsSelected()?"relative":"",!(r?.actionMenu||r?.groupActionMenu)&&"py-2"),children:[B===0&&y.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())]},k.id))},y.id)):e.jsx(qe,{children:e.jsx(Ye,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),r?.footer&&e.jsx(Br,{className:"sticky bottom-0 bg-background text-foreground",children:h.getFooterGroups().map(y=>e.jsx(qe,{children:y.headers.map(k=>e.jsx(Ye,{children:k.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:E.flexRender(k.column.columnDef.footer,k.getContext())})}))}))})]})})]})]}),(r?.paginationBar==null||r.paginationBar)&&e.jsx(yn,{table:h,extraParams:r})]})});function Sn({isLoading:t,onReload:a,errorMessage:r}){return!t&&!r?null:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-md rounded-lg transition-all duration-300",children:e.jsx("div",{className:"flex flex-col items-center gap-4",children:t?e.jsx("div",{className:"bg-background/80 p-6 rounded-2xl shadow-xl border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx(f.Loader2,{size:48,className:"text-primary animate-spin"})}):e.jsx("div",{className:"bg-background/80 p-4 rounded-full shadow-lg border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx("button",{onClick:a,className:"p-3 rounded-full bg-primary/10 hover:bg-primary/20 transition-all text-primary hover:scale-110 active:scale-95",title:r||"Reload Data",children:e.jsx(f.RotateCcw,{className:"w-6 h-6"})})})})})}function _i(t){(t==null||typeof t!="object")&&(t={});const a={...t};return(a.toolbox===void 0||a.toolbox===null||typeof a.toolbox!="object")&&(a.toolbox={}),(a.toolbox.feature===void 0||a.toolbox.feature===null||typeof a.toolbox.feature!="object")&&(a.toolbox.feature={}),a}const zi=m.forwardRef(({parentDivProps:t={},option:a={},style:r={},settings:n={},loading:s=!0,theme:o,isConfigurable:i=!1,resizeKey:d,onClick:u=()=>{},onConfigure:c=()=>{}},x)=>{const g=m.useRef(null),w=m.useRef(null),N=_i(a);return i&&(N.toolbox.feature={...N.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>c?.()}}),m.useImperativeHandle(x,()=>({getChartObject:()=>g.current?Le.getInstanceByDom(g.current):null,setOption:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.setOption(v,C)},resize:(v=0)=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);C?.resize(),v&&setTimeout(()=>C?.resize(),v)},loadingVisible:v=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);v?C?.showLoading():C?.hideLoading()},dispose:()=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.dispose()},on:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.on(v,C)}})),m.useEffect(()=>{g.current&&(w.current=Le.init(g.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(N,n),w.current&&w.current.on("click",u)},[a,n,o]),m.useEffect(()=>{w.current&&w.current.resize()},[d]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:g,...t,style:{width:"100%",height:"100%",...r}})});function kn({tooltipContent:t,fileNamePlaceholder:a,fileName:r,onFileNameChange:n,...s}){const o=m.useRef(null);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex",children:[e.jsx(H,{ref:o,type:"file",className:"hidden",...s}),e.jsx("div",{className:"mx-1"}),e.jsx(H,{className:"rounded-e-none",placeholder:a,onChange:(...i)=>n?.(...i),value:r}),e.jsx(Re,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(f.Upload,{})})]})})}const Fi=(({blur:t=0,inactiveZone:a=.7,proximity:r=0,spread:n=20,variant:s="default",glow:o=!1,className:i,movementDuration:d=2,borderWidth:u=1,disabled:c=!0})=>{const x=m.useRef(null),g=m.useRef({x:0,y:0}),w=m.useRef(0),N=m.useCallback(v=>{x.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const C=x.current;if(!C)return;const{left:b,top:S,width:p,height:I}=C.getBoundingClientRect(),j=v?.x??g.current.x,h=v?.y??g.current.y;v&&(g.current={x:j,y:h});const A=[b+p*.5,S+I*.5],P=Math.hypot(j-A[0],h-A[1]),R=.5*Math.min(p,I)*a;if(P<R){C.style.setProperty("--active","0");return}const M=j>b-r&&j<b+p+r&&h>S-r&&h<S+I+r;if(C.style.setProperty("--active",M?"1":"0"),!M)return;const F=parseFloat(C.style.getPropertyValue("--start"))||0,Ae=(180*Math.atan2(h-A[1],j-A[0])/Math.PI+90-F+180)%360-180,Ce=F+Ae;pt.animate(F,Ce,{duration:d,ease:[.16,1,.3,1],onUpdate:y=>{C.style.setProperty("--start",String(y))}})}))},[a,r,d]);return m.useEffect(()=>{if(c)return;const v=()=>N(),C=b=>N(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",C,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",C)}},[N,c]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",s==="white"&&"border-white",c&&"!block")}),e.jsx("div",{ref:x,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${u}px`,"--repeating-conic-gradient-times":"5","--gradient":s==="white"?"repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))":"linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)"},className:l("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",i,c&&"!hidden"),children:e.jsx("div",{className:l("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});function Nt({name:t,...a}){const r=Ls[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Mi=({size:t=48,className:a,visible:r=!0,...n})=>r?e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"absolute inset-0 flex justify-center items-center z-50",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("animate-spin",a),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Ei({placeholder:t,items:a,onValueChange:r,defaultValue:n,defaultOptions:s=2}){const[o,i]=m.useState(n||[]),[d,u]=m.useState(""),c=m.useRef(null),[x,g]=m.useState(!1);m.useEffect(()=>{r(o)},[o,r]);const w=a.filter(p=>(p.label||p.value).toLowerCase().includes(d.toLowerCase())).sort((p,I)=>(p?.label??"").localeCompare(I?.label??"")),N=p=>{const I=p.currentTarget;I.scrollTop+=p.deltaY,p.preventDefault()},v=p=>{const I=o.includes(p)?o.filter(j=>j!==p):[...o,p];i(I)},[C,b]=m.useState(o.length),S=m.useCallback(()=>{const p=c.current;if(!p)return C;const I=Array.from(p.children),j=p.offsetWidth;let h=0,A=0;for(const P of I){const R=P.offsetWidth+4;if(h+R<=j)h+=R,A++;else break}return A},[C]);return m.useEffect(()=>{const p=c.current;if(!p)return;let I=null;const j=()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const A=S();b(P=>P!==A?A:P)})},h=new ResizeObserver(j);return h.observe(p),I=requestAnimationFrame(j),()=>{I&&cancelAnimationFrame(I),h.disconnect()}},[S]),e.jsxs(Q,{open:x,onOpenChange:g,children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>g(p=>!p),children:[o.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:c,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,s).map(p=>{const I=a.find(j=>j.value===p)?.label||p;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:I,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:I}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(p)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(p))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},p)}),o.length>s&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer",children:["+",o.length-s," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:N,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(s).map(p=>e.jsx("span",{className:"text-sm",children:a.find(I=>I.value===p)?.label||p},p))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Z,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{onMouseDown:p=>p.preventDefault(),children:[e.jsx(ie,{placeholder:"Search...",value:d,onValueChange:u}),e.jsxs(le,{onWheel:N,className:"max-h-60 overflow-auto",children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:w.map(p=>{const I=o.includes(p.value),j=p.disabled===!0||typeof p.disabled=="function"&&p.disabled(p);return e.jsxs(X,{value:p.label||p.value,disabled:j,onPointerDown:h=>{h.preventDefault(),h.stopPropagation()},onSelect:()=>{j||v(p.value)},className:l("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Ve,{checked:I,onCheckedChange:()=>{j||v(p.value)},onClick:h=>h.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:p?.label||p.value})]},p.value)})})]})]})})]})}function ca({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(f.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Li({title:t,subtitle:a,tools:r,children:n}){return t=t??"",a=a??"",e.jsxs("div",{className:"flex flex-col gap-4 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[t&&e.jsx("h1",{className:"text-2xl font-semibold",children:t}),a&&e.jsx("p",{className:"text-muted-foreground/60",children:a})]}),e.jsx("div",{children:r})]}),n]})}const Oi=({value:t})=>{const a=Ds(t),r=a.score*100/4,n=()=>{switch(a.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(Pt,{value:r,className:n()})})},va=({code:t})=>{const a=$s[t];return e.jsx(a,{})};function Bi({className:t,...a}){const[r,n]=m.useState(!1),[s,o]=m.useState(""),[i,d]=m.useState("");return e.jsxs(Q,{open:r,onOpenChange:n,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":r,className:"justify-between bg-secondary",children:[i?e.jsx(va,{code:i}):"...",e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{filter:(u,c,x=[])=>(u.toLowerCase()+" "+x.join(" ").toLowerCase()).includes(c.toLowerCase())?1:0,children:[e.jsx(ie,{placeholder:"Search ...",className:"h-9"}),e.jsxs(le,{children:[e.jsx(de,{children:"No country found."}),e.jsx(re,{children:Object.entries(As.countries).map(([u,c])=>c.phone.map(x=>e.jsxs(X,{value:`${x}`,keywords:[c.name,"+"+x.toString(),u],onSelect:g=>{o(g===s?"":g),d(u),n(!1)},children:[e.jsx(va,{code:u})," ",c.name," +",x]},x)))})]})]})})]})}function In({buttonText:t,buttonIcon:a,buttonStyle:r,sheetContent:n,sheetDescription:s,sheetTitle:o,closeButton:i}){return e.jsxs(sa,{children:[e.jsx(hr,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:r,size:"icon-sm",children:[t,a]})}),e.jsxs(oa,{className:"p-4",children:[e.jsx(ia,{children:o}),n]})]})}const Ui=f.icons;function Vi({title:t,iconName:a,iconSize:r,iconClass:n,primaryText:s,secondaryText:o,mainClassName:i="",loading:d,loadingMessage:u}){let c=null;return a&&(c=Ui[a]),r=r===void 0?20:r,n=n??"",u=u??"Loading...",e.jsx(wt,{className:i,children:e.jsxs(Ya,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),d?e.jsx(f.LoaderCircle,{size:r,className:"animate-spin "+n}):c&&e.jsx(c,{size:r,className:n})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:d?"...":s}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:d?u:o})]})})}function Dn({children:t,tabArray:a,pathName:r,tabListClass:n="",tabListInnerClass:s="",tabListButtonClass:o="",tabContentClass:i="",headerEndComponent:d,onTabChange:u,isSeperatePage:c=!1}){const[x,g]=m.useState(5),w=Rt(),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState(a.find(h=>h.default)?.tabId||a[0]?.tabId||"");m.useEffect(()=>{g(w?2:5)},[w]),m.useEffect(()=>{if(r&&c){const h=r.split("/").pop()||"";p(h)}},[r,c]),m.useEffect(()=>{v(a.slice(0,x)),b(a.slice(x))},[a,x]);const I=h=>{p(h),u?.(h)},j=h=>{v(A=>{const P=[...A],R=P.pop();return R&&b(M=>[...M.filter(F=>F.tabId!==h.tabId),R]),[...P,h]}),I(h.tabId)};return e.jsxs(Ur,{value:S,onValueChange:I,className:"w-full h-full flex flex-col",children:[e.jsxs($r,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[N.map(h=>e.jsx(Gr,{value:h.tabId,className:o,children:h.tabName},h.tabId)),C.length>0&&e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(ot,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(f.EllipsisVertical,{})})}),e.jsx(we,{children:C.map(h=>e.jsx(ue,{onClick:()=>j(h),children:h.tabName},h.tabId))})]})]}),d&&e.jsx("div",{children:d})]}),t?e.jsx(Vt,{value:S,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:t})}):a.map(h=>e.jsx(Vt,{value:h.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:h?.tabContent})},h.tabId))]})}function An(){const{setTheme:t,theme:a,resolvedTheme:r}=Mr(),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0)},[]);const o=a==="system"?r:a,i=N=>{const v=parseInt(N.slice(1),16),C=v>>16&255,b=v>>8&255,S=v>>0&255,[p,I,j]=[C,b,S].map(h=>(h=h/255,h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)));return .2126*p+.7152*I+.0722*j},d=N=>i(N)>.25?"#000000":"#ffffff",u=m.useCallback(()=>{const N=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",C=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",S=localStorage.getItem("secondaryChart")||"#fd9a00",p=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",N),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",C),document.documentElement.style.setProperty("--sidebar-primary",C),document.documentElement.style.setProperty("--sidebar-accent",C),document.documentElement.style.setProperty("--foreground",d(N)),document.documentElement.style.setProperty("--secondary-foreground",d(v)),document.documentElement.style.setProperty("--card-foreground",d(v)),document.documentElement.style.setProperty("--popover-foreground",d(v)),document.documentElement.style.setProperty("--muted-foreground",d(v)),document.documentElement.style.setProperty("--sidebar-foreground",d(v)),document.documentElement.style.setProperty("--accent-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-primary-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-accent-foreground",d(C)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",S),document.documentElement.style.setProperty("--chart-3",p),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",S)},[]),c=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{n&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[n,o,u]);const x=m.useCallback(N=>{t(N),(N==="light"||N==="dark")&&(document.documentElement.classList.remove("blue-dark"),c()),N==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[t,u,c]);if(!n)return null;const g=o==="blue-dark"?e.jsx(f.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(f.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(f.Sun,{className:"h-5 w-5"}):e.jsx(f.Laptop,{className:"h-5 w-5"}),w=N=>o===N;return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:g})}),e.jsxs(we,{align:"end",sideOffset:8,children:[e.jsxs(ue,{onClick:()=>x("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]})]})]})}function $i({title:t,value:a,valueText:r,isPercent:n=!0,className:s,titleClassName:o,valueClassName:i,progressClassName:d}){let u=a.toFixed(2);const c=u.split(".");return c[1]==="00"&&(u=c[0]),e.jsxs("div",{className:"w-full "+(s??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(i??""),children:r??`${u}${n?"%":""}`})]}),e.jsx(Pt,{value:a,className:"w-full mt-2 "+(d??"")})]})}function Gi({processedData:t,value:a,onChange:r,placeholder:n="Select items...",searchPlaceholder:s="Search...",className:o}){const[i,d]=D.useState(!1),[u,c]=D.useState(""),{flatTree:x,itemMap:g}=t,w=D.useMemo(()=>{const b=new Map,S=new Set(a);return[...x].reverse().forEach(p=>{const I=g[p.id];if(!I||!p.treatAsParent||I.childrenIds.length===0)S.has(p.id)&&b.set(p.id,"checked");else{const j=I.childrenIds.map(P=>b.get(P)),h=j.filter(P=>P==="checked").length,A=j.filter(P=>P==="indeterminate").length;h===I.childrenIds.length?b.set(p.id,"checked"):(h>0||A>0)&&b.set(p.id,"indeterminate")}}),b},[a,x,g]),N=b=>{const S=new Set(a),p=w.get(b.id),I=!(p==="checked"||p==="indeterminate"),j=new Set,h=[...g[b.id]?.childrenIds||[]];for(;h.length>0;){const P=h.shift();j.add(P),(g[P]?.childrenIds||[]).forEach(M=>h.push(M))}I?(S.add(b.id),j.forEach(P=>S.add(P))):(S.delete(b.id),j.forEach(P=>S.delete(P)));let A=g[b.id]?.parentId;for(;A;){const P=g[A];P&&P.childrenIds.length>0&&(P.childrenIds.every(M=>S.has(M))?S.add(A):S.delete(A)),A=P?.parentId}r(Array.from(S))},v=D.useMemo(()=>{if(!u)return x.slice();const b=u.toLowerCase(),S=new Set;x.forEach(h=>{(h.title.toLowerCase().includes(b)||h.description.toLowerCase().includes(b)||h.index.toLowerCase().includes(b))&&S.add(h.id)});const p=new Set(S),I=h=>{let A=h;for(;A;){const P=g[A]?.parentId;if(P&&!p.has(P))p.add(P),A=P;else break}},j=h=>{const A=g[h]?.childrenIds||[];for(const P of A)p.has(P)||(p.add(P),j(P))};return S.forEach(h=>{I(h),j(h)}),x.filter(h=>p.has(h.id))},[u,x,g]),C=()=>{const b=a.filter(S=>{const p=g[S];return!p||p.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:n});if(b.length===1){const S=x.find(p=>p.id===b[0]);return S?S.index:n}return`${b.length} items selected`};return e.jsxs(Q,{open:i,onOpenChange:d,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":i,className:l("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:C()}),e.jsx(f.ChevronsUpDown,{className:l("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",i&&"rotate-180")})]})}),e.jsx(Z,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:s,value:u,onValueChange:c}),e.jsxs(le,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(de,{children:"No results found."}),v.map(b=>e.jsxs(X,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>N(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:S=>{S&&(S.indeterminate=w.get(b.id)==="indeterminate")},readOnly:!0}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:b.index}),e.jsx("span",{className:"font-medium",children:b.title})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b.description})]})]},b.id))]})]})})]})}function qi({widgetData:t}){const a=t.slice(0,4),r=t.slice(4);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))}),r.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:r.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))})]})}function Wi({onNavigate:t,onView:a,label:r,extraTools:n,view:s}){const[o,i]=m.useState(s===q.Views.DAY?"DAY":s===q.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(Oe,{type:"single",variant:"outline",onValueChange:d=>{switch(d){case"PREV":t("PREV");break;case"NEXT":t("NEXT");break;case"TODAY":t("TODAY");break}},children:[e.jsx(V,{className:"rounded-e-none",value:"PREV",children:e.jsx(f.ChevronLeft,{size:16})}),e.jsx(V,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(f.ChevronRight,{size:16})}),e.jsx(V,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:r}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:o,onValueChange:d=>{switch(i(d),d){case"DAY":a(q.Views.DAY);break;case"WEEK":a(q.Views.WEEK);break;case"MONTH":a(q.Views.MONTH);break}},children:[e.jsx(V,{className:"rounded-e-none",value:"MONTH",children:"Month"}),e.jsx(V,{className:"rounded-none border-x-0",value:"WEEK",children:"Week"}),e.jsx(V,{className:"rounded-s-none",value:"DAY",children:"Day"})]}),n?.map((d,u)=>e.jsx(m.Fragment,{children:d},u))]})]})})}function Hi({event:t,extraParamsEvent:a}){return e.jsxs("div",{className:"custom-event flex flex-row justify-between",children:[e.jsx("span",{className:"truncate w-auto",children:t.title}),e.jsxs("span",{className:"flex flex-row gap-1",children:[(a?.isEditableAll||t.isEditable)&&e.jsx(ze,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onEditEventClick?.(t)},children:e.jsx(f.SquarePen,{size:16})})}),e.jsx(ze,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onViewEventClick?.(t)},children:e.jsx(f.Eye,{size:16})})})]})]})}const Ki={"en-US":Ts.enUS},Xi=q.dateFnsLocalizer({format:Xe.format,parse:Xe.parse,startOfWeek:Xe.startOfWeek,getDay:Xe.getDay,locales:Ki});function Yi({events:t,extraParamsEvent:a,extraTools:r}){const[n,s]=m.useState(a?.defaultView==="day"?q.Views.DAY:a?.defaultView==="week"?q.Views.WEEK:a?.defaultView==="month"?q.Views.MONTH:a?.defaultView==="work week"?q.Views.WORK_WEEK:a?.defaultView==="agenda"?q.Views.AGENDA:q.Views.MONTH),[o,i]=m.useState(new Date);return e.jsx(q.Calendar,{localizer:Xi,events:t||[],startAccessor:"start",endAccessor:"end",views:[q.Views.DAY,q.Views.WEEK,q.Views.MONTH],view:n,onView:d=>s(d),date:o,onNavigate:d=>i(d),components:{event:d=>e.jsx(Hi,{event:d.event,extraParamsEvent:a}),toolbar:d=>e.jsx(Wi,{...d,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const Pn=m.createContext(void 0);function Tn({children:t}){const[a,r]=m.useState([]),n=d=>{r(u=>[...u.filter(x=>x.level<d.level),d])},s=(d,u)=>{r(u?d:c=>[...c,...d])},o=d=>{r(u=>[...u.filter(x=>x.level<=d.level)])},i=()=>{r([])};return e.jsx(Pn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:i},children:t})}function ua(){const t=m.useContext(Pn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function Rn(){const{breadcrumbItems:t,backBreadcrumb:a}=ua(),[r,n]=m.useState(!1),[s,o]=m.useState(2),i=Rt(),d=be.useNavigate();m.useEffect(()=>{o(i?2:4)},[i]);const u=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:i?t.slice(2):t.slice(2,s),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<s?t.length:s)):[]}),[t,s,i]);return!u||i==null||s==null?null:e.jsx(Wr,{children:e.jsxs(Hr,{children:[u.firstVisibleBreadcrumbList.map((c,x)=>x<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"firstsep"+x)]},"first"+x):e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})},"first"+x)),t.length>s?e.jsxs(e.Fragment,{children:[e.jsx(We,{children:i?e.jsxs(Qr,{open:r,onOpenChange:n,children:[e.jsx(Jr,{"aria-label":"Toggle Menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsxs(an,{children:[e.jsxs(rn,{className:"text-left",children:[e.jsx(sn,{children:"Navigate to"}),e.jsx(on,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx("div",{children:c.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:c.title}):e.jsx(be.Link,{to:c.href?c.href:"#",className:"py-1 text-sm",children:c.title})},x))}),e.jsx(nn,{className:"pt-4",children:e.jsx(en,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(ve,{open:r,onOpenChange:n,children:[e.jsx(je,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsx(we,{align:"start",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx(ue,{children:c.href?e.jsx(be.Link,{to:c.href?c.href:"#",children:c.title}):e.jsx("span",{children:c.title})},x))})]})}),!i&&e.jsx(bt,{})]}):null,!i&&u.lastVisibleBreadcrumbList.map((c,x)=>x==u.lastVisibleBreadcrumbList.length-1?e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:c.title})},"last"+x):e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"lastsep"+x)]},"last"+x))]},"BreadcrumbList1")},"Breadcrumb1")}function Qi({breadcrumb:t}){const{addBreadcrumb:a}=ua();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}const _n=m.createContext(void 0);function zn({children:t}){const[a,r]=m.useState([]),[n,s]=m.useState(null),[o,i]=m.useState(null),d=N=>{r(v=>v.some(b=>b.title===N.title)?v.map(b=>b.title===N.title?{...b,...N}:b):[...v,N])},u=N=>{r(v=>v.filter(C=>C.title!==N))},c=(N,v)=>{r(C=>C.map(b=>b.title===N?{...b,...v}:b))},x=N=>{s(N)},g=N=>{i(N)},w=()=>{r([])};return e.jsx(_n.Provider,{value:{navItems:a,header:n,footer:o,setNavItems:r,addNavItem:d,removeNavItem:u,updateNavItem:c,clearNavItems:w,setSidebarHeader:x,setSidebarFooter:g},children:t})}function lt(){const t=m.useContext(_n);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function Fn(){const{navItems:t}=lt();return e.jsx(Ar,{children:e.jsx(Pr,{children:t.map(a=>a.items&&a.items.length>0?e.jsx(Kr,{asChild:!0,defaultOpen:a.isActive,className:"group/collapsible",children:e.jsxs(Ot,{children:[e.jsx(Xr,{asChild:!0,children:e.jsxs(Bt,{tooltip:a.title,children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Yr,{children:e.jsx(Tr,{children:a.items.map(r=>e.jsx(Rr,{children:e.jsx(_r,{asChild:!0,children:e.jsx(be.Link,{to:r.url,children:e.jsx("span",{children:r.title})})})},r.title))})})]})},a.title):e.jsx(Ot,{children:e.jsx(Bt,{asChild:!0,tooltip:a.title,children:e.jsxs(be.Link,{to:a.url,className:"flex items-center gap-2 w-full",children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title})]})})},a.title))})})}function Ji({items:t,sidebarHeader:a,sidebarFooter:r}){const{setNavItems:n,setSidebarHeader:s,setSidebarFooter:o}=lt();return m.useEffect(()=>{n(t),s(a),o(r)},[t,a,r,n,s,o]),null}function Zi({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o,disabled:i,onSelect:d}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!u.value&&"text-muted-foreground"),disabled:i==!0||i&&i(...arguments),children:[u.value?o.find(c=>c.value===u.value)?.label||u.value:n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:o.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled==!0||c.disabled&&c.disabled(c),onSelect:x=>{u.onChange(x),d&&d(x)},children:[c?.label||c.value,e.jsx(f.Check,{className:l("ml-auto",c.value===u.value?"opacity-100":"opacity-0")})]},c.value))})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})})})}function el(t){const{field:a}=Ke.useController({name:t.name,control:t.formControl}),r=t.value!==void 0?t.value:a.value;return e.jsx(xe,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(fe,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:t.label}),e.jsx("br",{})]}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!r&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[r?t.items.find(s=>s.value===r)?.label||r:t.placeholder,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:t.items.map(s=>e.jsxs(X,{value:s.value,disabled:typeof s.disabled=="function"?s.disabled(s):s.disabled,onSelect:o=>{n.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[s?.label||s.value,e.jsx(f.Check,{className:l("ml-auto",s.value===r?"opacity-100":"opacity-0")})]},s.value))})]})]})})]}),t.formDescription&&e.jsx(ye,{children:t.formDescription}),e.jsx(pe,{})]})})}function tl({formControl:t,name:a,label:r,placeholder:n,dateFormat:s,calendarDateDisabled:o,formDescription:i,disabled:d}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",className:l(!u.value&&"text-foreground/50"),disabled:d,children:[u.value?Xe.format(u.value,s||"PPP"):e.jsx("span",{children:n||"Pick a date"}),e.jsx(f.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Z,{className:"w-auto p-0",align:"start",children:e.jsx(Ka,{mode:"single",selected:u.value,onSelect:u.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),i&&e.jsx(ye,{children:i}),e.jsx(pe,{})]})})})}function al(){return e.jsx(e.Fragment,{})}function rl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(ge,{children:e.jsx(H,{...i,...o})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function nl({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o=[],disabled:i,onSelect:d,defaultValue:u=[],defaultOptions:c=2}){const[x,g]=m.useState(""),w=m.useRef(null),N=o.filter(v=>v.label?.toLowerCase().includes(x.toLowerCase())).sort((v,C)=>(v?.label??"").localeCompare(C?.label??""));return e.jsx(xe,{control:t,name:a,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&u.length>0&&v.onChange(u)},[u,v]);const C=v.value||[],[b,S]=m.useState(C.length),p=m.useCallback(()=>{const h=w.current;if(!h)return b;const A=Array.from(h.children);let P=h.offsetWidth,R=0,M=0;for(const F of A){const ce=F.offsetWidth+4;if(R+ce<=P)R+=ce,M++;else break}return M},[b]);m.useEffect(()=>{const h=w.current;if(!h)return;let A=null;const P=new ResizeObserver(()=>{A&&cancelAnimationFrame(A),A=requestAnimationFrame(()=>{const R=p();S(M=>M!==R?R:M)})});return P.observe(h),S(p()),()=>{A&&cancelAnimationFrame(A),P.disconnect()}},[p]);const I=h=>{let A;C.includes(h)?A=C.filter(P=>P!==h):A=[...C,h],v.onChange(A),d&&d(A)},j=h=>{const A=h.currentTarget;A.scrollTop+=h.deltaY,h.preventDefault()};return e.jsxs(fe,{children:[r&&e.jsx(Ne,{children:r}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!C.length&&"text-foreground/50"),disabled:i===!0||i&&i(...arguments),children:[C.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[C.slice(0,c).map(h=>{const A=o.find(P=>P.value===h)?.label||h;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:A,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:A}),e.jsx("span",{role:"button",tabIndex:0,onClick:P=>{P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)},onKeyDown:P=>{if(P.key==="Enter"||P.key===" "){P.preventDefault(),P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},h)}),C.length>c&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",C.length-c," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:C.slice(c).map(h=>e.jsx("span",{className:"text-sm",children:o.find(A=>A.value===h)?.label||h},h))})})]})]})}):n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{id:"commandPopover",children:[e.jsx(ie,{placeholder:"Search...",value:x,onValueChange:g,autoFocus:!0}),e.jsxs(le,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:N.map(h=>{const A=C.includes(h.value);return e.jsxs(X,{value:h.label??"",onSelect:()=>I(h.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Ve,{checked:A,onCheckedChange:()=>I(h.value),onClick:P=>P.stopPropagation()}),e.jsx("span",{children:h.label})]},h.value)})})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})}})}function sl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(ge,{children:e.jsx(un,{maxLength:4,...i,children:e.jsxs(mn,{children:[e.jsx(Je,{index:0}),e.jsx(Je,{index:1}),e.jsx(Je,{index:2}),e.jsx(Je,{index:3})]})})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function ol(){return e.jsx("div",{children:"FormPhoneInput"})}function il({formControl:t,name:a,label:r,formItemClass:n,formDescription:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:i})=>e.jsxs(fe,{className:n,children:[r&&e.jsx(Ne,{children:r}),e.jsx(ge,{children:e.jsx(qr,{...i,...o})}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})})})}function ll({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[i,d]=D.useState(!1),u=()=>d(!i);return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:c})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(ge,{children:e.jsx(H,{type:i?"text":"password",...c,...o,className:`${o.className||""} pr-10`})}),e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:u,children:i?e.jsx(f.EyeOff,{className:"h-4 w-4"}):e.jsx(f.Eye,{className:"h-4 w-4"})})]}),n&&n(c.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function dl({rowCount:t=6,showToolbar:a=!0}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(Be,{className:"h-8 w-64 rounded-md"}),e.jsx(Be,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((r,n)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(Be,{className:"h-8 w-full"})},n))})]})}function cl({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((a,r)=>e.jsx(Be,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+r))})}function Mn(){const t=Ke.useForm({defaultValues:{text:"",fileNames:[]}}),[a,r]=m.useState(""),[n,s]=m.useState([]),[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState(!0),g=o.some(b=>b.progress<100),w=async(b,S)=>{const p=new FormData;p.append("file",S.file);try{const I=await ka.post("UPLOAD_ENDPOINT_URL",p,{onUploadProgress:j=>{const h=Math.round(j.loaded*100/(j.total||1));i(A=>A.map((P,R)=>R===b?{...P,progress:h}:P))}});i(j=>j.map((h,A)=>A===b?{...h,url:I.data.url,progress:100}:h))}catch(I){console.error("Upload failed:",I)}};m.useEffect(()=>{const b=new Date,S=String(b.getDate()).padStart(2,"0"),p=String(b.getMonth()+1).padStart(2,"0"),I=b.getFullYear();u(`${S}-${p}-${I}`)},[]),m.useEffect(()=>{o.forEach((b,S)=>{b.progress===0&&w(S,b)})},[o]);const N=()=>{if(a.trim()||o.length>0){const b={text:a.trim(),fileNames:o.map(S=>S.name)};s([b,...n]),r(""),i([]),x(!1)}},v=b=>{if(b.target.files){const S=Array.from(b.target.files).map(p=>({name:p.name,url:"",progress:0,file:p}));i(p=>[...p,...S]),x(!1)}},C=b=>{const S=o.filter((p,I)=>I!==b);i(S),S.length===0&&n.length===0&&x(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[c&&e.jsx(ca,{text:"No files uploaded"}),o.length>0&&e.jsxs("div",{className:"p-2 my-1 rounded-md border",children:[e.jsx("p",{className:"font-bold",children:"Selected Files:"}),o.map((b,S)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>C(S),className:"text-red-500 hover:text-red-800",children:e.jsx(f.X,{className:"w-4 h-4"})})]}),e.jsx(Pt,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},S))]}),n.map((b,S)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((p,I)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===p)?.url||"#",download:p,className:"text-sm text-blue-500 underline cursor-pointer",children:p})},I)),e.jsx("p",{children:b.text||"(No Text)"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("p",{children:"John Doe"}),e.jsx("p",{children:d})]})]},S))]}),e.jsx(ln,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>N()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(xe,{name:"text",render:({field:b})=>e.jsxs(fe,{children:[e.jsx(ge,{children:e.jsx(H,{id:"text-input",type:"text",value:a,onChange:S=>r(S.target.value),placeholder:"Type something..."})}),e.jsx(pe,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(T,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(f.UploadIcon,{className:"w-5 h-5"})})}),e.jsx(H,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(T,{variant:"outline",type:"submit",disabled:g,children:e.jsx(f.Send,{})})]})})})})]})})}function En({...t}){const{navItems:a,header:r,footer:n}=lt();return!a||a.length===0?null:e.jsxs(Nr,{className:"ml-12",collapsible:"offcanvas",...t,children:[r&&e.jsx(kr,{children:r}),e.jsx(Dr,{children:e.jsx(Fn,{})}),n&&e.jsx(Ir,{children:n}),e.jsx(Cr,{})]})}function Ln(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(f.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const te={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},ul=t=>{te.IKON_BASE_API_URL=t.IKON_BASE_API_URL,te.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,te.IKON_AUTH_API_URL=`${te.IKON_PLATFORM_API_URL}/auth`,te.IKON_USER_API_URL=`${te.IKON_PLATFORM_API_URL}/user`,te.IKON_ACCOUNT_API_URL=`${te.IKON_PLATFORM_API_URL}/account`,te.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,te.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,te.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},he=()=>te;function On(){const{navItems:t}=lt(),{IKON_PLATFORM_UI_URL:a}=he();return e.jsx("header",{className:"ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!t||t.length===0?e.jsx("div",{}):e.jsx(yr,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(Tt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(Rn,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Re,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(f.Bell,{})}),e.jsx(An,{}),e.jsx(be.Link,{to:`${a}/app-store`,children:e.jsxs(it,{variant:"default",children:[e.jsx(f.Play,{}),"App Store"]})})]})]})})}const ma="ikoncloud_next_";function Ht(t,a,r){let n=r?.expires;!n&&r?.maxAge&&(n=r.maxAge/86400),Qt.set(ma+t,a,{httpOnly:!1,sameSite:"lax",expires:n})}function yt(t){return Qt.get(ma+t)}function Kt(t){Qt.remove(ma+t)}async function ml(){}async function dt(t){const a=yt("accessToken"),r=yt("refreshToken");if(a)return a;if(r){const n=await Bn(r,t?.isSetToken);if(n)return n}return null}async function Bn(t,a){try{const r=await fetch(`${he().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const s=await r.json(),{accessToken:o,refreshToken:i,expiresIn:d,refreshExpiresIn:u}=s;if(a==null||a)try{Ht("accessToken",o,{maxAge:d}),Ht("refreshToken",i,{maxAge:u})}catch(c){console.error(c)}return o}}catch(r){console.error("Failed to refresh access token:",r)}return null}function Xt(){Kt("accessToken"),Kt("refreshToken"),typeof window<"u"&&(window.location.href=he().LOGIN_PAGE_URL)}const Fe=ka.create();Fe.interceptors.request.use(async t=>{const a=await dt();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Fe.interceptors.response.use(t=>t,async t=>{const a=t.config;if(t.response?.status===401&&a&&!a._retry){a._retry=!0;try{const r=await dt({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Fe(a);Xt()}catch(r){return Xt(),Promise.reject(r instanceof Error?r:new Error(String(r)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function xl(t){return Ue.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Fe.get(`${he().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function fl(){const t=Ue.useQueryClient();return Ue.useMutation({mutationFn:async a=>{await Fe.post(`${he().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function gl(){return Ue.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Fe.get(`${he().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function pl(){return Ue.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Fe.get(`${he().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Un=m.createContext(void 0);function hl({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const d=yt("accessToken");if(d)try{const u=Rs.jwtDecode(d);r(c=>({...c,userId:u.sub,primaryAccountId:u.primaryAccountId,activeAccountId:u.activeAccountId,roles:u.platformAccess?.roles??[]}))}catch{r(null)}},[]);const n=a?.userId??"",{data:s,isSuccess:o}=xl(n);m.useEffect(()=>{o&&s&&r(d=>({...d,...s}))},[o,s]);const i=d=>{r(u=>({...u,accountName:d}))};return e.jsx(Un.Provider,{value:{user:a,setUser:r,setAccountName:i},children:t})}function Vn(){const t=m.useContext(Un);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function bl(){const{user:t,setUser:a}=Vn();return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(f.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(we,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(f.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(rt,{className:"my-0"}),e.jsxs(ue,{onClick:async()=>{Xt()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(f.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function vl(){const{data:t}=gl(),{user:a,setAccountName:r}=Vn(),n=i=>i?i.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const i=t?.find(d=>d.accountId===a?.activeAccountId);r(i?.accountName||"")},[t]);const{mutateAsync:s}=fl(),o=async i=>{await s(i.accountId),r(i.accountName)};return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!a?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:a?n(a.accountName):"..."})})}),e.jsxs(we,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(i=>e.jsxs(ue,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(i),window.location.reload()}catch(d){console.error("Switch account failed",d)}},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:n(i.accountName)})}),e.jsx("span",{className:"text-sm",children:i.accountName})]}),a?.activeAccountId===i.accountId&&e.jsx(f.Check,{className:"h-4 w-4 text-primary"})]},i.accountId))]})]})}function jl(){const{IKON_PLATFORM_UI_URL:t}=he(),{data:a}=pl();function r(n){return n.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/home`,children:[e.jsx(f.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:a?.map(n=>{if(!n.visible)return null;const s=!!(n.icon&&n.icon.trim()!=="");return e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:n.url??"#",children:[s?e.jsx(Nt,{name:r(n.icon??""),className:"h-8 w-8"}):e.jsx(f.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:n.softwareName})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:n.softwareName})]},n.softwareName)})})]})}const $n=()=>{const{IKON_PLATFORM_UI_URL:t}=he();return e.jsx(_e,{delayDuration:0,children:e.jsxs("aside",{className:"fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ",children:[e.jsx(vl,{}),e.jsx(jl,{}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/settings`,children:[e.jsx(f.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(bl,{})]})})};function Gn({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx($n,{}),e.jsx(wr,{children:e.jsx(bn,{children:e.jsxs(zn,{children:[e.jsx(En,{}),e.jsxs(Sr,{className:"flex flex-col h-screen",children:[e.jsx(On,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(Ln,{})]})]})})})]})}const qn=m.createContext(void 0);function Wn({children:t}){const[a,r]=m.useState("Poppins"),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-font");i&&["Poppins","Oswald","Outfit"].includes(i)&&r(i)},[]),m.useEffect(()=>{if(!n)return;const i={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=i[a],document.documentElement.style.fontFamily=i[a],localStorage.setItem("app-font",a),console.log("Font changed to:",a,i[a])},[a,n]);const o=m.useMemo(()=>({font:a,setFont:r}),[a]);return e.jsx(qn.Provider,{value:o,children:t})}const wl=()=>{const t=m.useContext(qn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},Hn=m.createContext(void 0);function Kn({children:t}){const[a,r]=m.useState(.5),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-radius");if(i){const d=parseFloat(i);[0,.25,.5,.75,1].includes(d)&&r(d)}},[]),m.useEffect(()=>{if(!n)return;const i=a===0?"0rem":`${a}rem`;document.documentElement.style.setProperty("--radius",i),localStorage.setItem("app-radius",a.toString()),console.log("Radius changed to:",a,i)},[a,n]);const o=m.useMemo(()=>({radius:a,setRadius:r}),[a]);return e.jsx(Hn.Provider,{value:o,children:t})}const Nl=()=>{const t=m.useContext(Hn);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Xn=m.createContext(void 0);function yl({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx(Xn.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function Cl(){const t=m.useContext(Xn);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const Sl=new Ue.QueryClient;function kl({children:t}){return e.jsx(Ue.QueryClientProvider,{client:Sl,children:t})}function Il({children:t}){const a=he();if(!a.IKON_BASE_API_URL||!a.IKON_PLATFORM_UI_URL||!a.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(kl,{children:e.jsx(hl,{children:e.jsx(Fr,{children:e.jsx(Wn,{children:e.jsx(Kn,{children:e.jsx(Tn,{children:e.jsx(yl,{children:e.jsx(be.BrowserRouter,{children:e.jsx(Gn,{children:t})})})})})})})})})}function Dl({activityLogs:t=[]}){const a=[{tabName:"Activity",tabId:"tab-activity",default:!0,tabContent:e.jsx("div",{className:"overflow-auto flex flex-col gap-2 h-full",children:t.length>0?t.map(r=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:r.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(r.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:r.updatedBy})]})]},r.id)):e.jsx(ca,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(Mn,{})}];return e.jsx(In,{buttonText:"",buttonIcon:e.jsx(f.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(Dn,{tabArray:a,tabListClass:""}),closeButton:!0})}const Al=({src:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o})=>{const i=m.useRef(null);function d(u){const c=i.current?.cropper;if(c){const g=c.getCroppedCanvas().toDataURL("image/webp");a(g)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const u=i.current?.cropper;u&&u.rotate(n)},[n]),m.useEffect(()=>{const u=i.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(s))},[s]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&u.getCropBoxData().width){const{x,y:g}=o;typeof x=="number"&&typeof g=="number"&&u.move(x,g)}},[o]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&(u.setAspectRatio(r),r===1)){const c=u.getCanvasData(),x=c.width,g=c.height,w=c.left,N=c.top,v=200,C=100,b=w+(x-v)/2,S=N+(g-C)/2;u.setCropBoxData({left:b,top:S,width:v,height:C})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:d,ref:i,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Yn=m.memo(Al),ja={landscape:4/3,portrait:3/4,icon:1/1};function Pl({onNewFileUpload:t}){const{originalImage:a,setOriginalImage:r,aspectRatioWiseImages:n,setAspectRatioWiseImages:s}=xa(),[o,i]=m.useState(null),[d,u]=m.useState(),[c,x]=m.useState(0),[g,w]=m.useState(1),[N,v]=m.useState({x:0,y:0}),[C,b]=m.useState(null),S=j=>{j.preventDefault(),p(j.dataTransfer.files[0])},p=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const h=new FileReader;h.onloadend=()=>{b(h.result),u(void 0)},h.readAsDataURL(j),r({...a,image:j,name:j.name})}else Ca.toast.error("Please select a valid image file.")};m.useEffect(()=>{a.image&&p(a.image)},[a.image]);const I=j=>{const h=o&&d===j?o:n[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx($t,{ratio:ja[j],className:"bg-muted",children:h&&e.jsx("img",{src:h,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&s(d?{...n,[d]:o}:{landscape:o,portrait:o,icon:o})},[o]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-3 h-full overflow-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(kn,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:a?.name||"",onChange:j=>{const h=j.target.files?.[0];h&&p(h)},onFileNameChange:j=>{r({...a,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx(H,{id:"imageDescription",placeholder:"Enter image Description",value:a?.description||"",onChange:j=>r({...a,description:j.target.value})})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3",children:"Original Image"}),e.jsx($t,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:S,onDragOver:j=>j.preventDefault(),children:C?e.jsx(Yn,{src:C,onCroppedImage:i,aspectRatio:ja[d||"icon"],rotationAngle:c,zoomLevel:g,moveDirection:N}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(ot,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(Oe,{type:"single",variant:"outline",value:d,onValueChange:j=>u(j),children:[e.jsx(V,{className:"rounded-e-none",value:"landscape",children:e.jsx(f.ImageIcon,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(f.FileImage,{})}),e.jsx(V,{className:"rounded-s-none",value:"icon",children:e.jsx(f.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>x(parseInt(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"90",children:e.jsx(f.RotateCw,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",children:[e.jsx(V,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(f.ArrowUp,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(f.ArrowDown,{})}),e.jsx(V,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(f.ArrowLeft,{})}),e.jsx(V,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(f.ArrowRight,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>w(h=>h+parseFloat(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"0.1",children:e.jsx(f.ZoomIn,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(f.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:I("landscape")}),e.jsx("div",{className:"w-4/5",children:I("portrait")}),e.jsx("div",{className:"w-3/5",children:I("icon")})]})]})]})})}const Qn=m.memo(Pl);function Jn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=xa();return e.jsx(kt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(It,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(ra,{children:e.jsx(Dt,{children:"Image to upload"})}),e.jsx(Qn,{}),e.jsx(er,{children:e.jsx(ot,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function gt(t,a=""){if(!t||!t.resourceId)return null;try{return`${he().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function Tl(t){if(!t)return null;const a=t.originalImageInfo?await gt(t.originalImageInfo):null,r=t.landscapeImageInfo?await gt(t.landscapeImageInfo):null,n=t.portraitImageInfo?await gt(t.portraitImageInfo):null,s=t.iconImageInfo?await gt(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const Zn=m.createContext(void 0);function Rl({children:t,uploadedImages:a,onCropperChange:r,modalOpen:n,onModalOpenChange:s}){const[o,i]=m.useState({landscape:null,portrait:null,icon:null}),[d,u]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function c(){if(a)try{const x=await Tl(a);x&&(u(g=>JSON.stringify(g)===JSON.stringify(x.originalImage)?g:x.originalImage),i(g=>JSON.stringify(g)===JSON.stringify(x.aspectRatioWiseImages)?g:x.aspectRatioWiseImages))}catch(x){console.error("Error processing uploaded images:",x)}}c()},[a]),e.jsxs(Zn.Provider,{value:{originalImage:d,setOriginalImage:u,aspectRatioWiseImages:o,setAspectRatioWiseImages:i},children:[t,n&&s&&e.jsx(Jn,{open:n,onOpenChange:s,onCropperChange:r})]})}const xa=()=>{const t=m.useContext(Zn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},es=({imageSrc:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o,currentState:i})=>{const d=m.useRef(null),u=()=>{const c=d.current?.cropper;if(c){c.setDragMode("move");const g=c.getCroppedCanvas().toDataURL();a(g)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const c=d.current?.cropper;c&&c.rotate(n)},[n]),m.useEffect(()=>{const c=d.current?.cropper;c&&c.getCropBoxData().width&&(console.log("Inside cropper scale"),c.scale(s))},[s]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&c.getCropBoxData().width){const{x:g,y:w}=o;typeof g=="number"&&typeof w=="number"&&c.move(g,w)}},[o]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&(c.setAspectRatio(r),r===1)){const x=c.getCanvasData(),g=x.width,w=x.height,N=x.left,v=x.top,C=200,b=100,S=N+(g-C)/2,p=v+(w-b)/2;c.setCropBoxData({left:S,top:p,width:C,height:b})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:u,ref:d,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},_l=({open:t,setOpen:a,onImageSubmit:r})=>{const[n,s]=m.useState(null),[o,i]=m.useState(null),[d,u]=m.useState({first:null,second:null,third:null}),[c,x]=m.useState(4/3),[g,w]=m.useState("first"),[N,v]=m.useState(0),[C,b]=m.useState(1),[S,p]=m.useState({x:0,y:0}),[I,j]=m.useState(""),h=()=>{console.log("Image Submit Button is pressed"),console.log(d),r(d.third),a(!1)},A=z=>{v(O=>O+z)},P=()=>{p({x:0,y:-5})},R=()=>{p({x:0,y:5})},M=()=>{p({x:-5,y:0})},F=()=>{p({x:5,y:0})},ce=()=>{b(z=>{const O=z+.2;return O<=2?O:z})},Ae=()=>{b(z=>{const O=z-.2;return O>=.2?O:z})},Ce=(z,O)=>{x(z),w(O)},y=z=>{if(z.type.startsWith("image/")){const O=new FileReader;O.onloadend=()=>{s(O.result),j(Pe=>Pe||z.name)},O.readAsDataURL(z)}else alert("Please drop a valid image file.")},k=z=>{z.preventDefault(),y(z.dataTransfer.files[0])},B=z=>{const O=o&&g===z?o:d[z];return O?e.jsx("div",{className:`
|
|
4
|
+
${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`,children:e.jsx("img",{src:O,alt:`Preview ${z}`,className:"absolute inset-0 w-full h-full object-contain"})}):e.jsx("div",{className:`
|
|
5
|
+
${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(d.first===null||d.second===null||d.third===null?u({first:o,second:o,third:o}):u(z=>({...z,[g]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(H,{id:"imageName",placeholder:"Enter image name",value:I,onChange:z=>j(z.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(f.Upload,{})}),e.jsx(H,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];if(O&&O.type.startsWith("image/")){const Pe=new FileReader;Pe.onloadend=()=>{s(Pe.result),j(ee=>ee||O.name)},Pe.readAsDataURL(O),u({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageDesc",children:"Image Description"}),e.jsx(H,{id:"imageDesc",placeholder:"Describe your image"})]})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{className:"w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100",style:{height:"70vh"},onDrop:k,onDragOver:z=>z.preventDefault(),children:n?e.jsx(es,{imageSrc:n,onCroppedImage:i,aspectRatio:c,rotationAngle:N,zoomLevel:C,moveDirection:S,currentState:g}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx(H,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];O&&y(O)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),B("first"),e.jsx("h3",{children:"Potrait"}),B("second"),e.jsx("h3",{children:"Icon"}),B("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{variant:"outline",onClick:()=>Ce(4/3,"first"),children:e.jsx(f.ImageIcon,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(3/4,"second"),children:e.jsx(f.FileImage,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(1/1,"third"),children:e.jsx(f.Square,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>A(90),variant:"outline",children:e.jsx(f.RotateCw,{})}),e.jsx(T,{onClick:()=>A(-90),variant:"outline",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>ce(),variant:"outline",children:e.jsx(f.ZoomIn,{})}),e.jsx(T,{onClick:()=>Ae(),variant:"outline",children:e.jsx(f.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:P,variant:"outline",children:e.jsx(f.ArrowUp,{})}),e.jsx(T,{onClick:R,variant:"outline",children:e.jsx(f.ArrowDown,{})}),e.jsx(T,{onClick:M,variant:"outline",children:e.jsx(f.ArrowLeft,{})}),e.jsx(T,{onClick:F,variant:"outline",children:e.jsx(f.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(T,{onClick:h,children:"Save"})})]})]})},zl=m.memo(_l);function Fl(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"bg-background text-forefround rounded-xl p-6 text-center max-w-md",children:[e.jsx("div",{className:"text-3xl font-bold mb-2 animate-pulse",children:"🚧 Work in Progress"}),e.jsx("p",{className:"text-muted-foreground",children:"We’re currently working on this section. Check back soon!"})]})})}function Ml({formControl:t,name:a,label:r,options:n,placeholder:s="Select an option",emptyMessage:o="No options found.",onValueChange:i,className:d,addNewPlaceholder:u="Add custom value...",formDescription:c,disabled:x}){const[g,w]=D.useState(!1),[N,v]=D.useState(""),[C,b]=D.useState(n),[S,p]=D.useState(!1),[I,j]=D.useState("");return D.useEffect(()=>{b(n)},[n]),e.jsx(xe,{control:t,name:a,render:({field:h})=>{const A=C.find(R=>R.value===h.value),P=()=>{const R=I.trim();if(!R)return;if(C.some(F=>F.value===R)){const F=C.find(ce=>ce.value===R);F&&(h.onChange(F.value),i?.(F.value),j(""),p(!1),w(!1),v(""));return}const M={value:R,label:R,disabled:!0};b(F=>[...F,M]),h.onChange(R),i?.(R),j(""),p(!1),w(!1),v("")};return e.jsxs(fe,{className:l(d),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:r}),e.jsx("br",{})]}),e.jsxs(Q,{open:g,onOpenChange:R=>{w(R),R||(v(""),p(!1),j(""))},children:[e.jsx(J,{asChild:!0,children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":g,className:l("w-full justify-between",!h.value&&"text-foreground/50",d),disabled:x||h.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:h.value?A?A.label:h.value:s}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(Z,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Y,{shouldFilter:!0,children:[e.jsx(ie,{placeholder:"Search...",value:N,onValueChange:v}),e.jsxs(le,{children:[e.jsx(de,{children:N&&C.length>0?"No results found.":o}),e.jsx(re,{children:C.filter(R=>R.label.toLowerCase().includes(N.toLowerCase())||R.value.toLowerCase().includes(N.toLowerCase())).map(R=>e.jsxs(X,{value:R.value,onSelect:M=>{h.onChange(M),i?.(M),w(!1),v("")},className:"cursor-pointer",disabled:R?.disabled,children:[e.jsx(f.Check,{className:l("mr-2 h-4 w-4",h.value===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))})]}),e.jsx("div",{className:"border-t p-2",children:S?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{placeholder:u,value:I,onChange:R=>j(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P()),R.key==="Escape"&&(p(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>{p(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(T,{size:"sm",variant:"default",onClick:P,className:"h-8",disabled:!I.trim()||C.some(R=>R.value===I.trim()),children:"Add"})]}):e.jsxs(T,{variant:"outline",className:"w-full justify-start",onClick:()=>p(!0),children:[e.jsx(f.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),c&&e.jsx(ye,{children:c}),e.jsx(pe,{})]})}})}const me=m.forwardRef(({children:t,tooltip:a,side:r="bottom",className:n,...s},o)=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(T,{variant:"ghost",size:"icon",...s,className:l("aui-button-icon size-6 p-1",n),ref:o,children:[e.jsx(Yt.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),e.jsx(oe,{side:r,children:a})]}));me.displayName="TooltipIconButton";const El=()=>e.jsx(Ft.MarkdownTextPrimitive,{remarkPlugins:[zs],className:"aui-md",components:Ul}),Ll=m.memo(El),Ol=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Bl(),s=()=>{!a||r||n(a)};return e.jsxs("div",{className:"aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20",children:[e.jsx("span",{className:"aui-code-header-language lowercase [&>span]:text-xs",children:t}),e.jsxs(me,{tooltip:"Copy",onClick:s,children:[!r&&e.jsx(f.CopyIcon,{}),r&&e.jsx(f.CheckIcon,{})]})]})},Bl=({copiedDuration:t=3e3}={})=>{const[a,r]=m.useState(!1);return{isCopied:a,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),t)})}}},Ul=Ft.unstable_memoizeMarkdownComponents({h1:({className:t,...a})=>e.jsx("h1",{className:l("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...a}),h2:({className:t,...a})=>e.jsx("h2",{className:l("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...a}),h3:({className:t,...a})=>e.jsx("h3",{className:l("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...a}),h4:({className:t,...a})=>e.jsx("h4",{className:l("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...a}),h5:({className:t,...a})=>e.jsx("h5",{className:l("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...a}),h6:({className:t,...a})=>e.jsx("h6",{className:l("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...a}),p:({className:t,...a})=>e.jsx("p",{className:l("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...a}),a:({className:t,...a})=>e.jsx("a",{className:l("aui-md-a font-medium text-primary underline underline-offset-4",t),...a}),blockquote:({className:t,...a})=>e.jsx("blockquote",{className:l("aui-md-blockquote border-l-2 pl-6 italic",t),...a}),ul:({className:t,...a})=>e.jsx("ul",{className:l("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...a}),ol:({className:t,...a})=>e.jsx("ol",{className:l("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...a}),hr:({className:t,...a})=>e.jsx("hr",{className:l("aui-md-hr my-5 border-b",t),...a}),table:({className:t,...a})=>e.jsx("table",{className:l("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...a}),th:({className:t,...a})=>e.jsx("th",{className:l("aui-md-th bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [[align=center]]:text-center [[align=right]]:text-right",t),...a}),td:({className:t,...a})=>e.jsx("td",{className:l("aui-md-td border-b border-l px-4 py-2 text-left last:border-r [[align=center]]:text-center [[align=right]]:text-right",t),...a}),tr:({className:t,...a})=>e.jsx("tr",{className:l("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t),...a}),sup:({className:t,...a})=>e.jsx("sup",{className:l("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...a}),pre:({className:t,...a})=>e.jsx("pre",{className:l("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...a}),code:function({className:a,...r}){const n=Ft.useIsMarkdownCodeBlock();return e.jsx("code",{className:l(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Ol}),Vl=({toolName:t,argsText:a,result:r,status:n})=>{const[s,o]=m.useState(!0),i=n?.type==="incomplete"&&n.reason==="cancelled",d=i&&n.error?typeof n.error=="string"?n.error:JSON.stringify(n.error):null;return e.jsxs("div",{className:l("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",i&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[i?e.jsx(f.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(f.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:l("aui-tool-fallback-title grow",i&&"text-muted-foreground line-through"),children:[i?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(T,{onClick:()=>o(!s),children:s?e.jsx(f.ChevronUpIcon,{}):e.jsx(f.ChevronDownIcon,{})})]}),!s&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[d&&e.jsxs("div",{className:"aui-tool-fallback-cancelled-root px-4",children:[e.jsx("p",{className:"aui-tool-fallback-cancelled-header font-semibold text-muted-foreground",children:"Cancelled reason:"}),e.jsx("p",{className:"aui-tool-fallback-cancelled-reason text-muted-foreground",children:d})]}),e.jsx("div",{className:l("aui-tool-fallback-args-root px-4",i&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:a})}),!i&&r!==void 0&&e.jsxs("div",{className:"aui-tool-fallback-result-root border-t border-dashed px-4 pt-2",children:[e.jsx("p",{className:"aui-tool-fallback-result-header font-semibold",children:"Result:"}),e.jsx("pre",{className:"aui-tool-fallback-result-content whitespace-pre-wrap",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})]})},wa=t=>Symbol.iterator in t,Na=t=>"entries"in t,ya=(t,a)=>{const r=t instanceof Map?t:new Map(t.entries()),n=a instanceof Map?a:new Map(a.entries());if(r.size!==n.size)return!1;for(const[s,o]of r)if(!n.has(s)||!Object.is(o,n.get(s)))return!1;return!0},$l=(t,a)=>{const r=t[Symbol.iterator](),n=a[Symbol.iterator]();let s=r.next(),o=n.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=r.next(),o=n.next()}return!!s.done&&!!o.done};function Gl(t,a){return Object.is(t,a)?!0:typeof t!="object"||t===null||typeof a!="object"||a===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(a)?!1:wa(t)&&wa(a)?Na(t)&&Na(a)?ya(t,a):$l(t,a):ya({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function ql(t){const a=m.useRef(void 0);return r=>{const n=t(r);return Gl(a.current,n)?a.current:a.current=n}}const Wl=t=>{const[a,r]=m.useState(void 0);return m.useEffect(()=>{if(!t){r(void 0);return}const n=URL.createObjectURL(t);return r(n),()=>{URL.revokeObjectURL(n)}},[t]),a},ts=()=>{const{file:t,src:a}=_.useAssistantState(ql(({attachment:r})=>{if(r.type!=="image")return{};if(r.file)return{file:r.file};const n=r.content?.filter(s=>s.type==="image")[0]?.image;return n?{src:n}:{}}));return Wl(t)??a},Hl=({src:t})=>{const[a,r]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:a?"aui-attachment-preview-image-loaded block h-auto max-h-[80vh] w-auto max-w-full object-contain":"aui-attachment-preview-image-loading hidden",onLoad:()=>r(!0),loading:"lazy"})},Kl=({children:t})=>{const a=ts();return a?e.jsxs(kt,{children:[e.jsx(Qa,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(It,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(Dt,{className:"aui-sr-only sr-only",children:"Image Attachment Preview"}),e.jsx("div",{className:"aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background",children:e.jsx(Hl,{src:a})})]})]}):t},Xl=()=>{const t=_.useAssistantState(({attachment:r})=>r.type==="image"),a=ts();return e.jsxs(Ga,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(qa,{src:a,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Wa,{delayMs:t?200:0,children:e.jsx(f.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},as=()=>{const a=_.useAssistantApi().attachment.source==="composer",r=_.useAssistantState(({attachment:s})=>s.type==="image"),n=_.useAssistantState(({attachment:s})=>{const o=s.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const i=o;throw new Error(`Unknown attachment type: ${i}`)}}});return e.jsxs(ne,{children:[e.jsxs(_.AttachmentPrimitive.Root,{className:l("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Kl,{children:e.jsx(se,{asChild:!0,children:e.jsx("div",{className:l("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",a&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${n} attachment`,children:e.jsx(Xl,{})})})}),a&&e.jsx(Yl,{})]}),e.jsx(oe,{side:"top",children:e.jsx(_.AttachmentPrimitive.Name,{})})]})},Yl=()=>e.jsx(_.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(me,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(f.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),Ql=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(_.MessagePrimitive.Attachments,{components:{Attachment:as}})}),Jl=()=>e.jsx("div",{className:"aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",children:e.jsx(_.ComposerPrimitive.Attachments,{components:{Attachment:as}})}),Zl=()=>e.jsx(_.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(me,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(f.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),ed=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,i]=m.useState(!1),d=a||null;return e.jsxs(ve,{open:o,onOpenChange:i,children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:l("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",s),children:[e.jsx("span",{className:"truncate",children:d?.agentName||"Select Agent"}),e.jsx(f.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(we,{align:"end",className:l("min-w-[200px]",n),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(rt,{}),e.jsx(na,{children:t.map(u=>e.jsxs(ue,{onClick:()=>{r(u),i(!1)},className:l("cursor-pointer flex flex-col gap-1",d?.agentID===u.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:u.agentName}),u.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.agentDescription})]},u.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},td=({currentUserDetails:t,agents:a=[],initialAgentId:r="default-agent",initialAgentName:n="Default Agent",onAgentChange:s})=>{const[o,i]=m.useState(a.find(d=>d.agentID===r));return e.jsx(pt.LazyMotion,{features:pt.domAnimation,children:e.jsx(pt.MotionConfig,{reducedMotion:"user",children:e.jsx(_.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(_.ThreadPrimitive.Viewport,{turnAnchor:"top",className:"aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",children:[e.jsx(_.ThreadPrimitive.If,{empty:!0,children:e.jsx(rd,{currentUserDetails:t})}),e.jsx(_.ThreadPrimitive.Messages,{components:{UserMessage:cd,EditComposer:md,AssistantMessage:ld}}),e.jsxs(_.ThreadPrimitive.ViewportFooter,{className:"aui-thread-viewport-footer sticky bottom-0 mx-auto mt-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",children:[e.jsx(ad,{}),e.jsx(sd,{agents:a,selectedAgent:o,onSelectAgent:d=>{i(d),s?.(d)}})]})]})})})})},ad=()=>e.jsx(_.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(me,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(f.ArrowDownIcon,{})})}),rd=({currentUserDetails:t})=>{const r=new Date().getHours();let n="";return r>=5&&r<12?n="Good Morning":r>=12&&r<17?n="Good Afternoon":r>=17&&r<21?n="Good Evening":n="Good Night",console.log(n),e.jsxs("div",{className:"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col",children:[e.jsx("div",{className:"aui-thread-welcome-center flex w-full flex-grow flex-col items-center justify-center",children:e.jsxs("div",{className:"aui-thread-welcome-message flex size-full flex-col justify-center px-8",children:[e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"aui-thread-welcome-message-motion-1 text-2xl font-semibold",children:`${n} ${t.userName.split(" ")[0]}`}),e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.1},className:"aui-thread-welcome-message-motion-2 text-2xl text-muted-foreground/65",children:"How can I help you today?"})]})}),e.jsx(nd,{})]})},nd=()=>e.jsx("div",{className:"aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2",children:[{title:"What's the weather",label:"in San Francisco?",action:"What's the weather in San Francisco?"},{title:"Explain React hooks",label:"like useState and useEffect",action:"Explain React hooks like useState and useEffect"},{title:"Write a SQL query",label:"to find top customers",action:"Write a SQL query to find top customers"},{title:"Create a meal plan",label:"for healthy weight loss",action:"Create a meal plan for healthy weight loss"}].map((t,a)=>e.jsx(Et.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*a},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(_.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(T,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${a}`))}),sd=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(_.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(_.ComposerPrimitive.AttachmentDropzone,{className:"aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background",children:[e.jsx(Jl,{}),e.jsx(_.ComposerPrimitive.Input,{placeholder:"Send a message...",className:"aui-composer-input mb-1 max-h-32 min-h-16 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 text-base outline-none placeholder:text-muted-foreground focus-visible:ring-0",rows:1,autoFocus:!0,"aria-label":"Message input"}),e.jsx(od,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),od=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(Zl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(ed,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(_.ThreadPrimitive.If,{running:!1,children:e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(me,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(f.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(_.ThreadPrimitive.If,{running:!0,children:e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(f.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),id=()=>e.jsx(_.MessagePrimitive.Error,{children:e.jsx(_.ErrorPrimitive.Root,{className:"aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200",children:e.jsx(_.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),ld=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1","data-role":"assistant",children:[e.jsxs("div",{className:"aui-assistant-message-content mx-2 leading-7 break-words text-foreground",children:[e.jsx(_.MessagePrimitive.Parts,{components:{Text:Ll,tools:{Fallback:Vl}}}),e.jsx(id,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(rs,{}),e.jsx(dd,{})]})]}),dd=()=>e.jsxs(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm",children:[e.jsx(_.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(me,{tooltip:"Copy",children:[e.jsx(_.MessagePrimitive.If,{copied:!0,children:e.jsx(f.CheckIcon,{})}),e.jsx(_.MessagePrimitive.If,{copied:!1,children:e.jsx(f.CopyIcon,{})})]})}),e.jsx(_.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(me,{tooltip:"Refresh",children:e.jsx(f.RefreshCwIcon,{})})})]}),cd=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(Ql,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(_.MessagePrimitive.Parts,{})}),e.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:e.jsx(ud,{})})]}),e.jsx(rs,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),ud=()=>e.jsx(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(_.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(me,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(f.PencilIcon,{})})})}),md=()=>e.jsx(_.MessagePrimitive.Root,{className:"aui-edit-composer-wrapper mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 px-2",children:e.jsxs(_.ComposerPrimitive.Root,{className:"aui-edit-composer-root ml-auto flex w-full max-w-7/8 flex-col rounded-xl bg-muted",children:[e.jsx(_.ComposerPrimitive.Input,{className:"aui-edit-composer-input flex min-h-[60px] w-full resize-none bg-transparent p-4 text-foreground outline-none",autoFocus:!0}),e.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(T,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),rs=({className:t,...a})=>e.jsxs(_.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:l("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...a,children:[e.jsx(_.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(me,{tooltip:"Previous",children:e.jsx(f.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(_.BranchPickerPrimitive.Number,{})," / ",e.jsx(_.BranchPickerPrimitive.Count,{})]}),e.jsx(_.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(me,{tooltip:"Next",children:e.jsx(f.ChevronRightIcon,{})})})]});class xd{agentConfig;baseUrl;chatIdMap=new Map;constructor(a){this.agentConfig=a,this.baseUrl=a.baseUrl||""}updateAgentConfig(a){this.agentConfig={...this.agentConfig,...a}}getChatId(a){return this.chatIdMap.has(a)?this.chatIdMap.get(a):fa.v4()}async sendMessages(a){const{messages:r,chatId:n,abortSignal:s,headers:o,body:i}=a;console.log("sendMessages called with chatId:",n,"trigger:",a.trigger);const d=this.getChatId(n);console.log("Using server chatId:",d);const c={messages:r.map(w=>{const N=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?N+JSON.stringify(this.agentConfig.additionalReferenceInfo):N}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...i},g={"Content-Type":"application/json",Authorization:`Bearer ${await dt()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${d}`,{method:"POST",headers:g,body:JSON.stringify(c),signal:s,cache:"no-store"});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);if(!w.body)throw new Error("Response body is null");return this.processResponseStream(w.body)}catch(w){throw console.error("Error in sendMessages:",w),w}}async reconnectToStream(a){return null}processResponseStream(a){const r=new TextDecoder;let n="",s=null,o=!1,i=[],d=!1,u="",c=!1,x="";return new ReadableStream({async start(g){s=a.getReader()},async pull(g){if(!(!s||o)){if(i.length>0){g.enqueue(i.shift());return}try{const{done:w,value:N}=await s.read();if(w){if(d&&u)for(c&&x&&i.push({type:"text-end",id:x}),i.push({type:"finish",finishReason:"stop"});i.length>0;)g.enqueue(i.shift());o||(o=!0,g.close());return}n+=r.decode(N,{stream:!0});const v=n.split(`
|
|
6
|
+
`);n=v.pop()||"";for(const C of v){const b=C.trim();if(b&&b.startsWith("data:")){const S=b.slice(5).trim();if(!S)continue;try{const p=JSON.parse(S);if(o)return;p.id&&!u&&(u=p.id,d=!0,i.push({type:"start"}));let I=null;if(p.type==="ai"){const j=p.messages?.[0];j?.content&&(x||(x=fa.v4()),c||(c=!0,i.push({type:"text-start",id:x})),I={type:"text-delta",delta:j.content,id:x})}else if(p.type==="tool"){const j=p.toolCall;j&&(I={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}I&&i.push(I)}catch{}}}i.length>0&&g.enqueue(i.shift())}catch(w){o||(o=!0,g.error(w))}}},cancel(){o=!0,i=[],s&&(s.releaseLock(),s=null)}})}}const fd=({provider:t="openai",model:a="gpt-4o-mini",agentId:r="default-agent",agentName:n="Default Agent",temperature:s=.7,maxTokens:o=2048,className:i,baseUrl:d="http://localhost:3000",additionalReferenceInfo:u={},appId:c="",currentUserDetails:x})=>{const[g,w]=m.useState([]),[N,v]=m.useState(),C=m.useMemo(()=>new xd({provider:t,model:a,agentId:N?N.agentID:r,agentName:N?N.agentName:n,temperature:s,maxTokens:o,baseUrl:d,additionalReferenceInfo:u}),[t,a,N,r,n,s,o,d,u]),b=Fs.useChatRuntime({transport:C}),S=async()=>{try{const I=await dt(),j=await fetch(`${d}/api/agent/${c}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const h=await j.json();console.log("Agent Data:",h),w(h)}catch(I){console.error("Error while fetching agents with the specific appId",I)}};m.useEffect(()=>{S()},[c,d]);const p=I=>{v(I),console.log("Agent changed to:",I.agentName)};return e.jsx(_.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:i,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${i}`,children:e.jsx(td,{currentUserDetails:x,agents:g,initialAgentId:r,initialAgentName:n,onAgentChange:p})})})})};function gd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),[n,s]=m.useState(r.get("search")||""),[o]=Es.useDebounce(n,500);return m.useEffect(()=>{const i=new URLSearchParams(r.toString());o?i.set("search",o):i.delete("search"),i.get("search")!==r.get("search")&&(i.set("page","1"),t(`${a}?${i.toString()}`,{replace:!0}))},[o,a,t,r]),m.useEffect(()=>{const i=r.get("search")||"";i!==n&&s(i)},[r]),e.jsxs("div",{className:"relative max-w-sm min-w-[10%]",children:[e.jsx(f.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search ...",value:n,onChange:i=>s(i.target.value),className:"flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"})]})}function pd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),n=r.get("size")||"10",s=o=>{const i=new URLSearchParams(r.toString());i.set("size",o.target.value),i.set("page","1"),t(`${a}?${i.toString()}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page:"}),e.jsxs("select",{className:"h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary",value:n,onChange:s,children:[e.jsx("option",{value:"10",children:"10"}),e.jsx("option",{value:"20",children:"20"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]})}function hd({totalPages:t,currentPage:a}){const r=ae.useNavigate(),{pathname:n}=ae.useLocation(),[s]=ae.useSearchParams(),o=i=>{const d=new URLSearchParams(s.toString());d.set("page",i.toString()),r(`${n}?${d.toString()}`)};return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>o(a-1),disabled:a<=1,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-2",children:["Page ",e.jsx("span",{className:"font-semibold",children:a})," of"," ",e.jsx("span",{className:"font-semibold",children:Math.max(t??1,1)})]}),e.jsx("button",{type:"button",onClick:()=>o(a+1),disabled:t===void 0?void 0:a>=t,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Next"})]})}function bd({table:t}){const[a,r]=m.useState(!1),[n,s]=m.useState(""),o=m.useRef(null),i=t.getState().columnFilters,u=t.getAllLeafColumns().filter(c=>c.getCanFilter()).filter(c=>c.id.toLowerCase().includes(n.toLowerCase()));return m.useEffect(()=>{const c=x=>{o.current&&!o.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),e.jsx("div",{className:"flex items-center gap-3 ",children:e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:" gap-2",children:[e.jsx(f.ListFilter,{className:"w-4 h-4"}),"Filter"]})}),e.jsxs(we,{align:"end",className:"w-64 p-2",children:[e.jsx(At,{className:"text-center",children:"Filter"}),e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"relative mb-2",children:[e.jsx(f.Search,{className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(da,{placeholder:"Search columns...",value:n,onChange:c=>s(c.target.value)})]}),e.jsx("div",{className:"max-h-50 overflow-auto space-y-1 scroll-m-1",children:u.map(c=>{const x=i.some(g=>g.id===c.id);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:c.id,checked:x,onCheckedChange:g=>{g?c.setFilterValue([]):c.setFilterValue(void 0)}}),e.jsx("label",{htmlFor:c.id,className:"text-sm font-medium leading-none cursor-pointer flex-1",children:typeof c.columnDef.header=="string"?c.columnDef.header:c.id})]},c.id)})})]}),e.jsx(rt,{}),e.jsx("div",{className:"flex gap-2 p-1",children:e.jsxs(T,{size:"sm",className:"flex-1 h-8",onClick:()=>t.resetColumnFilters(),children:[e.jsx(f.RotateCcw,{className:"mr-2 h-3 w-3"})," Reset"]})})]})]})})}function vd({activeFilters:t,table:a}){return e.jsx("div",{className:"flex flex-wrap gap-2 min-w-max max-w-[70%] overflow-y-auto",children:t.map(r=>e.jsx(jd,{filter:r,table:a},r.id))})}function jd({filter:t,table:a}){debugger;const[r,n]=m.useState(!1),[s,o]=m.useState(t.value||[]),i=m.useRef(null),d=a.getColumn(t.id);m.useEffect(()=>{o(t.value||[])},[t.value]);const u=m.useMemo(()=>{const g=new Set;return a.getPreFilteredRowModel().flatRows.forEach(w=>{const N=w.getValue(t.id);N!=null&&g.add(N)}),Array.from(g).sort()},[a.getPreFilteredRowModel().flatRows,t.id]);m.useEffect(()=>{const g=w=>{i.current&&!i.current.contains(w.target)&&n(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const c=()=>{d.setFilterValue(s.length>0?s:void 0),n(!1)},x=()=>{o([]),d.setFilterValue(void 0),n(!1)};return e.jsxs("div",{className:"flex items-center gap-1 ",ref:i,children:[e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 rounded-full px-3 text-xs border border-dashed",children:[e.jsxs("span",{className:"font-bold uppercase text-muted-foreground mr-1",children:[typeof d.columnDef.header=="string"?d.columnDef.header:t.id,":"]}),e.jsx("span",{className:"text-primary font-semibold",children:t.value?.length?`${t.value.length} Selected`:"All"}),e.jsx(f.ChevronDown,{className:"ml-1 h-3 w-3 opacity-50"})]})}),e.jsxs(we,{className:"w-56 p-0",align:"start",children:[e.jsx("div",{className:"p-2 max-h-48 overflow-y-auto",children:u.map(g=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:`${t.id}-${g}`,checked:s.includes(g),onCheckedChange:w=>{o(N=>w?[...N,g]:N.filter(v=>v!==g))}}),e.jsx("label",{htmlFor:`${t.id}-${g}`,className:"text-xs flex-1 truncate cursor-pointer",children:String(g).trim()===""?"N/A":String(g)})]},g))}),e.jsxs("div",{className:"p-2 border-t bg-muted/50 flex gap-2",children:[e.jsx(T,{size:"sm",className:"flex-1 h-7 text-[10px]",onClick:()=>c(),children:"Apply"}),e.jsx(T,{size:"sm",variant:"outline",className:"flex-1 h-7 text-[10px]",onClick:()=>{x()},children:"Clear"})]})]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full hover:text-destructive",onClick:()=>d.setFilterValue(void 0),children:e.jsx(f.X,{className:"h-3 w-3"})})]})}function wd({table:t}){const[a,r]=m.useState(!1),n=m.useRef(null);return m.useEffect(()=>{function s(o){n.current&&!n.current.contains(o.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),e.jsxs("div",{className:"relative",ref:n,children:[e.jsxs("button",{type:"button",className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background transition-colors text-sm font-medium ${a?"border-primary bg-muted":"border-border hover:bg-muted"}`,onClick:()=>r(!a),children:[e.jsx(f.Settings2,{className:"w-4 h-4"}),"Columns"]}),a&&e.jsxs("div",{className:"absolute right-0 mt-2 w-56 z-50 bg-background border border-border rounded-md shadow-lg p-2 animate-in fade-in zoom-in duration-100",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground border-b mb-1",children:"Toggle Columns"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.getAllLeafColumns().map(s=>s.getCanHide()?e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-muted rounded cursor-pointer text-sm capitalize",children:[e.jsx("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),e.jsx("span",{className:"truncate",children:typeof s.columnDef.header=="string"?s.columnDef.header:s.id})]},s.id):null)}),e.jsx("div",{className:"border-t mt-1 pt-1",children:e.jsx("button",{type:"button",onClick:()=>t.toggleAllColumnsVisible(!0),className:"w-full text-left px-2 py-1.5 text-xs hover:bg-muted hover:text-primary rounded",children:"Show All"})})]})]})}function Nd({data:t,columns:a,extraTools:r}){const[n,s]=m.useState("list"),o=ae.useNavigate(),{pathname:i}=ae.useLocation(),[d]=ae.useSearchParams(),u=Number(d.get("page")||"1")-1,[c,x]=m.useState({pageIndex:0,pageSize:10}),[g,w]=m.useState(""),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({}),[h,A]=m.useState({}),[P,R]=m.useState([]),M=r?.hiddenColumns||[];for(const y of a)y.filterFn===void 0&&(y.filterFns="multiSelect"),y.draggable===void 0&&(y.draggable=!0);const F=E.useReactTable({data:t,columns:a,pageCount:r?.totalPages,meta:{footerLabel:r?.footerLabel},state:{pagination:c,globalFilter:g,sorting:N,grouping:C,expanded:S,rowSelection:I,columnVisibility:h,columnFilters:P},onSortingChange:v,onGroupingChange:b,onExpandedChange:p,onRowSelectionChange:j,onGlobalFilterChange:w,onPaginationChange:x,onColumnVisibilityChange:A,onColumnFiltersChange:R,manualPagination:!1,manualFiltering:!1,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),filterFns:{multiSelect:(y,k,B)=>{debugger;return B.length?B.includes(String(y.getValue(k))):!0}}});m.useEffect(()=>{debugger;F.getAllLeafColumns().map(y=>{M?.includes(y.id)&&y.toggleVisibility(!1)})},[M,F]);const ce=(y,k)=>{y.dataTransfer.setData("headerId",k)},Ae=y=>{debugger;y.preventDefault();const k=y.dataTransfer.getData("headerId");k&&!C.includes(k)&&F.getColumn(k)?.getCanGroup()&&F.getColumn(k)?.toggleGrouping()};m.useEffect(()=>{debugger;F.setGlobalFilter(d.get("search")||"")},[d,o,i]),m.useEffect(()=>{F.setPageSize(Number(d.get("size")||"10")),F.setPageIndex(Number(d.get("page")||"1")-1)},[d,o,i]);const Ce=()=>{const y=F.getVisibleLeafColumns().filter(ee=>ee.id!=="select"&&ee.id!=="actions"),k=(ee,Te=0)=>ee.flatMap(G=>{if(G.getIsGrouped()){const Ge=String(G.id.replaceAll(`${y[0].id}:`,"")).trim()===""||G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${G.groupingColumnId}>`,"").replaceAll(`${y[0].id}:`,"").trim()===void 0?"N/A":G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${y[0].id}:`,"").trim();return[{[y[0].id]:`${" ".repeat(Te)} ${Ge} (${G.subRows.length})`},...k(G.subRows,Te+1)]}else{let Ge={};return y.forEach(ct=>{const ut=G.getValue(ct.id);Ge[ct.id]=ct.id===y[0].id||ut==="Actions"||ut==="actions"?" ":ut===void 0?"N/A":ut}),[Ge]}}),B=F.getState().grouping.length>0?k(F.getGroupedRowModel().rows):F.getFilteredRowModel().rows.map(ee=>{let Te={};return y.forEach(G=>Te[G.id]=ee.getValue(G.id)),Te}),z=xt.utils.json_to_sheet(B),O=y.map(ee=>{const Te=typeof ee.columnDef.header=="string"?ee.columnDef.header:ee.id;return{wch:Math.max(Te.length,...B.map(Ge=>String(Ge[Te]).length))+3}});z["!cols"]=O;const Pe=xt.utils.book_new();xt.utils.book_append_sheet(Pe,z,"Data"),xt.writeFile(Pe,`${r?.fileName}.xlsx`)};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(gd,{}),e.jsx(vd,{activeFilters:F.getState().columnFilters,table:F})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r?.actionNode&&r?.actionNode,e.jsx(wd,{table:F}),e.jsx(bd,{table:F}),e.jsx(T,{variant:"outline",size:"sm",className:" gap-2",onClick:()=>Ce(),children:e.jsx(f.Download,{className:"w-4 h-4"})}),r?.toggleViewMode&&e.jsxs("div",{className:"flex items-center border border-border rounded-md bg-background overflow-hidden h-9",children:[e.jsx("button",{onClick:()=>s("list"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="list"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"List View",children:e.jsx(f.List,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>s("grid"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="grid"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grid View",children:e.jsx(f.LayoutGrid,{className:"w-4 h-4"})})]})]})]}),n==="list"?e.jsxs(e.Fragment,{children:[e.jsx("div",{onDragOver:y=>y.preventDefault(),onDrop:Ae,className:"w-full border border-dashed rounded-md h-10 p-2 flex gap-2 items-center text-sm bg-muted/20 ",children:C.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Drag a column header here to group"}):C.map(y=>e.jsxs("div",{className:"flex items-center gap-1 bg-background border px-2 py-1 rounded shadow-sm",children:[y,e.jsx(f.X,{size:14,className:"cursor-pointer",onClick:()=>F.getColumn(y)?.toggleGrouping()})]},y))}),e.jsx("div",{className:"rounded-md border border-border bg-background overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 border-b border-border sticky top-0",children:F.getHeaderGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("th",{className:"px-4 py-3 text-left font-medium cursor-pointer select-none",draggable:!0,onDragStart:B=>ce(B,k.id),children:e.jsxs("div",{className:"flex items-center gap-2",onClick:k.column.getToggleSortingHandler(),children:[E.flexRender(k.column.columnDef.header,k.getContext()),{asc:e.jsx(f.ChevronUp,{size:14}),desc:e.jsx(f.ChevronDown,{size:14})}[k.column.getIsSorted()]??null]})},k.id))},y.id))}),e.jsx("tbody",{className:"divide-y divide-border",children:F.getRowModel().rows.map(y=>e.jsx("tr",{className:`hover:bg-muted/30 transition-colors ${y.getIsSelected()?"bg-accent/20":""}`,children:y.getVisibleCells().map(k=>e.jsx("td",{className:"px-4 py-3",children:k.getIsGrouped()?e.jsxs("button",{onClick:y.getToggleExpandedHandler(),className:"flex items-center gap-2 font-semibold",children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{size:16}):e.jsx(f.ChevronRight,{size:16}),E.flexRender(k.column.columnDef.cell,k.getContext())," (",y.subRows.length,")"]}):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id))}),r?.showFooter&&e.jsx("tfoot",{className:"bg-muted/30 border-t-2 border-border font-bold",children:F.getFooterGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("td",{className:"px-4 py-3 text-left",children:k.isPlaceholder?null:E.flexRender(k.column.columnDef.footer,k.getContext())},k.id))},y.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx(pd,{}),e.jsx(hd,{totalPages:r?.totalPages,currentPage:u+1})]})]}):r?.gridComponent?r.gridComponent(t):e.jsx("div",{className:"p-12 text-center text-muted-foreground border border-border border-dashed rounded-md bg-muted/20",children:"Grid view not implemented for this component yet."})]})}function yd({data:t,columns:a,extraTools:r}){return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"relative min-h-[300px]",children:[e.jsx(Sn,{isLoading:r?.isLoading,onReload:r?.onReload||(()=>window.location.reload())}),e.jsx("div",{className:`transition-all duration-300 ${r?.isLoading?"opacity-50 pointer-events-none":""}`,children:e.jsx(Nd,{data:t,columns:a,extraTools:r})})]})})}exports.Accordion=Gs;exports.AccordionContent=Hs;exports.AccordionItem=qs;exports.AccordionTrigger=Ws;exports.ActionMenu=Wt;exports.ActivitySheet=Dl;exports.Alert=ho;exports.AlertDescription=vo;exports.AlertDialog=Fa;exports.AlertDialogAction=Lt;exports.AlertDialogCancel=$a;exports.AlertDialogContent=La;exports.AlertDialogDescription=Va;exports.AlertDialogFooter=Ba;exports.AlertDialogHeader=Oa;exports.AlertDialogMedia=go;exports.AlertDialogOverlay=Ea;exports.AlertDialogPortal=Ma;exports.AlertDialogTitle=Ua;exports.AlertDialogTrigger=fo;exports.AlertTitle=bo;exports.AppBreadcrumb=Rn;exports.AppSidebar=En;exports.AspectRatio=$t;exports.AssistantComponent=fd;exports.Avatar=Ga;exports.AvatarBadge=jo;exports.AvatarFallback=Wa;exports.AvatarGroup=wo;exports.AvatarGroupCount=No;exports.AvatarImage=qa;exports.Badge=ht;exports.BigCalendar=Yi;exports.Breadcrumb=Wr;exports.BreadcrumbEllipsis=qt;exports.BreadcrumbItem=We;exports.BreadcrumbLink=Gt;exports.BreadcrumbList=Hr;exports.BreadcrumbPage=Qe;exports.BreadcrumbProvider=Tn;exports.BreadcrumbSeparator=bt;exports.Button=T;exports.Calendar=Ka;exports.CalendarDayButton=Xa;exports.Card=wt;exports.CardAction=ko;exports.CardContent=Ya;exports.CardDescription=So;exports.CardFooter=Io;exports.CardHeader=yo;exports.CardTitle=Co;exports.Checkbox=Ve;exports.Collapsible=Kr;exports.CollapsibleContent=Yr;exports.CollapsibleTrigger=Xr;exports.ComboboxInput=Di;exports.Command=Y;exports.CommandDialog=Ao;exports.CommandEmpty=de;exports.CommandGroup=re;exports.CommandInput=ie;exports.CommandItem=X;exports.CommandList=le;exports.CommandSeparator=ar;exports.CommandShortcut=Po;exports.CropperForm=Qn;exports.CropperFormWithModal=Jn;exports.CustomAlertDialog=pn;exports.CustomComboboxInput=Ml;exports.CustomTabs=Dn;exports.DataTable=Ri;exports.DataTableColumnFilter=vn;exports.DataTableFacetedFilter=jn;exports.DataTableFilterMenu=wn;exports.DataTableLayout=yd;exports.DataTablePagination=yn;exports.DataTableToolbar=Cn;exports.Dialog=kt;exports.DialogClose=Do;exports.DialogContent=It;exports.DialogDescription=tr;exports.DialogFooter=er;exports.DialogHeader=ra;exports.DialogOverlay=Za;exports.DialogPortal=Ja;exports.DialogProvider=bn;exports.DialogTitle=Dt;exports.DialogTrigger=Qa;exports.Drawer=Qr;exports.DrawerClose=en;exports.DrawerContent=an;exports.DrawerDescription=on;exports.DrawerFooter=nn;exports.DrawerHeader=rn;exports.DrawerOverlay=tn;exports.DrawerPortal=Zr;exports.DrawerTitle=sn;exports.DrawerTrigger=Jr;exports.DropdownMenu=ve;exports.DropdownMenuCheckboxItem=To;exports.DropdownMenuContent=we;exports.DropdownMenuGroup=na;exports.DropdownMenuItem=ue;exports.DropdownMenuLabel=At;exports.DropdownMenuPortal=rr;exports.DropdownMenuRadioGroup=Ro;exports.DropdownMenuRadioItem=_o;exports.DropdownMenuSeparator=rt;exports.DropdownMenuShortcut=zo;exports.DropdownMenuSub=nr;exports.DropdownMenuSubContent=or;exports.DropdownMenuSubTrigger=sr;exports.DropdownMenuTrigger=je;exports.EChart=zi;exports.FileInput=kn;exports.FileUploader=Pi;exports.FontProvider=Wn;exports.Footer=Ln;exports.Form=ln;exports.FormComboboxInput=Zi;exports.FormComboboxInputWithValue=el;exports.FormControl=ge;exports.FormDateInput=tl;exports.FormDescription=ye;exports.FormField=xe;exports.FormFileInput=al;exports.FormInput=rl;exports.FormItem=fe;exports.FormLabel=Ne;exports.FormMessage=pe;exports.FormMultiComboboxInput=nl;exports.FormOtpInput=sl;exports.FormPasswordInput=ll;exports.FormPhoneInput=ol;exports.FormTextarea=il;exports.FrameworkItemDropdown=Gi;exports.GlowingEffect=Fi;exports.GradeTableLoader=dl;exports.Header=On;exports.HoverCard=Fo;exports.HoverCardContent=Eo;exports.HoverCardTrigger=Mo;exports.Icon=Nt;exports.IconButton=gn;exports.IconButtonWithTooltip=Re;exports.IconTextButton=it;exports.IconTextButtonWithTooltip=fn;exports.ImageCropper=Yn;exports.ImageCropperProvider=Rl;exports.Input=H;exports.InputOTP=un;exports.InputOTPGroup=mn;exports.InputOTPSeparator=Ci;exports.InputOTPSlot=Je;exports.Label=Se;exports.LoadingSpinner=Mi;exports.MainLayout=Gn;exports.MainSidebar=$n;exports.MultiCombobox=Ei;exports.NavMain=Fn;exports.NavigationMenu=Lo;exports.NavigationMenuContent=Vo;exports.NavigationMenuIndicator=Go;exports.NavigationMenuItem=Bo;exports.NavigationMenuLink=$o;exports.NavigationMenuList=Oo;exports.NavigationMenuTrigger=Uo;exports.NavigationMenuViewport=lr;exports.NewCropperImg=es;exports.NewImageForm=zl;exports.NoDataComponent=ca;exports.PageWrapper=Li;exports.PasswordStrengthMeter=Oi;exports.PhoneInput=Bi;exports.Popover=Q;exports.PopoverAnchor=qo;exports.PopoverContent=Z;exports.PopoverDescription=Ko;exports.PopoverHeader=Wo;exports.PopoverTitle=Ho;exports.PopoverTrigger=J;exports.Progress=Pt;exports.ProviderWrapper=Il;exports.RadioGroup=Xo;exports.RadioGroupItem=Yo;exports.RadiusProvider=Kn;exports.Reload=Sn;exports.RenderAppBreadcrumb=Qi;exports.RenderSidebarNav=Ji;exports.ScrollArea=Qo;exports.ScrollBar=dr;exports.SearchInput=da;exports.Select=cr;exports.SelectContent=xr;exports.SelectGroup=Jo;exports.SelectItem=fr;exports.SelectLabel=Zo;exports.SelectScrollDownButton=pr;exports.SelectScrollUpButton=gr;exports.SelectSeparator=ei;exports.SelectTrigger=mr;exports.SelectValue=ur;exports.Separator=Tt;exports.Sheet=sa;exports.SheetClose=ti;exports.SheetComponent=In;exports.SheetContent=oa;exports.SheetDescription=vr;exports.SheetFooter=ni;exports.SheetHeader=br;exports.SheetTitle=ia;exports.SheetTrigger=hr;exports.Sidebar=Nr;exports.SidebarContent=Dr;exports.SidebarFooter=Ir;exports.SidebarGroup=Ar;exports.SidebarGroupAction=fi;exports.SidebarGroupContent=gi;exports.SidebarGroupLabel=xi;exports.SidebarHeader=kr;exports.SidebarInput=ui;exports.SidebarInset=Sr;exports.SidebarMenu=Pr;exports.SidebarMenuAction=hi;exports.SidebarMenuBadge=bi;exports.SidebarMenuButton=Bt;exports.SidebarMenuItem=Ot;exports.SidebarMenuSkeleton=vi;exports.SidebarMenuSub=Tr;exports.SidebarMenuSubButton=_r;exports.SidebarMenuSubItem=Rr;exports.SidebarNavProvider=zn;exports.SidebarProvider=wr;exports.SidebarRail=Cr;exports.SidebarSeparator=mi;exports.SidebarTrigger=yr;exports.SimpleWidget=Vi;exports.Skeleton=Be;exports.SkeletonWidget=cl;exports.Slider=ji;exports.Switch=Ni;exports.Table=Er;exports.TableBody=Or;exports.TableCaption=yi;exports.TableCell=Ye;exports.TableFooter=Br;exports.TableHead=Ut;exports.TableHeader=Lr;exports.TableRow=qe;exports.Tabs=Ur;exports.TabsContent=Vt;exports.TabsList=$r;exports.TabsTrigger=Gr;exports.TextButton=ot;exports.TextButtonWithTooltip=ki;exports.Textarea=qr;exports.ThemeProvider=Fr;exports.ThemeToggleBtn=An;exports.TitleProgress=$i;exports.Toaster=wi;exports.Toggle=Si;exports.ToggleGroup=Oe;exports.ToggleGroupItem=V;exports.Tooltip=ne;exports.TooltipComponent=ze;exports.TooltipContent=oe;exports.TooltipProvider=_e;exports.TooltipTrigger=se;exports.UploadTab=Mn;exports.Widgets=qi;exports.WorkInProgress=Fl;exports.axiosInstance=Fe;exports.badgeVariants=Ha;exports.buttonVariants=jt;exports.clearAllCookieSession=ml;exports.clearCookieSession=Kt;exports.cn=l;exports.convertFileToObject=Nn;exports.getCookieSession=yt;exports.getDataTableColumnTitle=ke;exports.getImageFromObject=Ai;exports.getValidAccessToken=dt;exports.navigationMenuTriggerStyle=ir;exports.refreshAccessToken=Bn;exports.setCookieSession=Ht;exports.setIkonConfig=ul;exports.tabsListVariants=Vr;exports.toggleVariants=la;exports.useBreadcrumb=ua;exports.useDialog=Ii;exports.useFont=wl;exports.useFormField=st;exports.useImageCropper=xa;exports.useIsMobile=Rt;exports.useRadius=Nl;exports.useRefresh=Cl;exports.useSidebar=nt;exports.useSidebarNav=lt;
|