@vertesia/ui 0.74.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/Center.js +1 -1
- package/lib/esm/core/components/Center.js.map +1 -1
- package/lib/esm/core/components/Overlay.js +57 -0
- package/lib/esm/core/components/Overlay.js.map +1 -0
- package/lib/esm/core/components/SidePanel.js +6 -6
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/index.js +1 -0
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/tabs.js +43 -5
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +9 -2
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/facets/DocumentsFacetsNav.js +4 -2
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VTypeFacet.js +2 -1
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -1
- package/lib/esm/features/magic-pdf/TextPageView.js +2 -4
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +2 -4
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +19 -21
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +2 -4
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +51 -46
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +50 -34
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +1 -3
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -1
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +4 -11
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +2 -2
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/session/UserSessionProvider.js +6 -3
- package/lib/esm/session/UserSessionProvider.js.map +1 -1
- package/lib/esm/session/auth/composable.js +3 -3
- package/lib/esm/session/auth/composable.js.map +1 -1
- package/lib/esm/session/auth/firebase.js +7 -0
- package/lib/esm/session/auth/firebase.js.map +1 -1
- package/lib/esm/session/auth/useAuthState.js +0 -3
- package/lib/esm/session/auth/useAuthState.js.map +1 -1
- package/lib/esm/shell/apps/StandaloneApp.js +1 -1
- package/lib/esm/shell/apps/StandaloneApp.js.map +1 -1
- package/lib/esm/shell/login/EnterpriseSigninButton.js +3 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -1
- package/lib/esm/shell/login/InviteAcceptModal.js +1 -1
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -1
- package/lib/esm/widgets/form/ManagedObject.js +1 -1
- package/lib/esm/widgets/index.js +1 -0
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/markdown/MarkdownRenderer.js +24 -0
- package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -0
- package/lib/esm/widgets/markdown/index.js +2 -0
- package/lib/esm/widgets/markdown/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/Overlay.d.ts +25 -0
- package/lib/types/core/components/Overlay.d.ts.map +1 -0
- package/lib/types/core/components/SidePanel.d.ts +3 -1
- package/lib/types/core/components/SidePanel.d.ts.map +1 -1
- package/lib/types/core/components/index.d.ts +1 -0
- package/lib/types/core/components/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/types/env/index.d.ts +2 -2
- package/lib/types/env/index.d.ts.map +1 -1
- package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/VTypeFacet.d.ts.map +1 -1
- package/lib/types/features/magic-pdf/TextPageView.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts +4 -3
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts.map +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +5 -2
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts +2 -4
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts.map +1 -1
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
- package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/types/session/auth/composable.d.ts +1 -1
- package/lib/types/session/auth/composable.d.ts.map +1 -1
- package/lib/types/session/auth/firebase.d.ts.map +1 -1
- package/lib/types/session/auth/useAuthState.d.ts.map +1 -1
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts.map +1 -1
- package/lib/types/widgets/index.d.ts +1 -0
- package/lib/types/widgets/index.d.ts.map +1 -1
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts +9 -0
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -0
- package/lib/types/widgets/markdown/index.d.ts +2 -0
- package/lib/types/widgets/markdown/index.d.ts.map +1 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +6 -4
- package/src/core/components/Center.tsx +1 -1
- package/src/core/components/Overlay.tsx +129 -0
- package/src/core/components/SidePanel.tsx +38 -33
- package/src/core/components/index.ts +1 -0
- package/src/core/components/shadcn/tabs.tsx +48 -5
- package/src/env/index.ts +1 -1
- package/src/features/agent/PayloadBuilder.tsx +8 -2
- package/src/features/facets/DocumentsFacetsNav.tsx +4 -2
- package/src/features/facets/VTypeFacet.tsx +2 -1
- package/src/features/magic-pdf/TextPageView.tsx +3 -4
- package/src/features/store/collections/CreateCollection.tsx +1 -1
- package/src/features/store/objects/DocumentPreviewPanel.tsx +2 -4
- package/src/features/store/objects/DocumentSearchResults.tsx +24 -26
- package/src/features/store/objects/components/ContentOverview.tsx +3 -6
- package/src/features/store/objects/components/VectorSearchWidget.tsx +88 -60
- package/src/features/store/objects/search/DocumentSearchContext.ts +57 -36
- package/src/features/store/objects/search/DocumentSearchProvider.tsx +2 -6
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +6 -12
- package/src/features/user/UserInfo.tsx +2 -2
- package/src/session/UserSessionProvider.tsx +5 -3
- package/src/session/auth/composable.ts +3 -3
- package/src/session/auth/firebase.ts +8 -0
- package/src/session/auth/useAuthState.ts +0 -4
- package/src/shell/apps/StandaloneApp.tsx +1 -1
- package/src/shell/login/EnterpriseSigninButton.tsx +3 -0
- package/src/shell/login/InviteAcceptModal.tsx +1 -1
- package/src/widgets/form/ManagedObject.ts +1 -1
- package/src/widgets/index.ts +1 -0
- package/src/widgets/markdown/MarkdownRenderer.tsx +45 -0
- package/src/widgets/markdown/index.ts +1 -0
package/lib/vertesia-ui-core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";import a,{clsx as i}from"clsx";import{twMerge as s}from"tailwind-merge";import{ChevronUpIcon as l,ChevronDownIcon as o,Loader2 as d,Check as c,CopyIcon as u,Computer as m,Sun as h,Moon as p,X as f,Search as g,ChevronsUpDown as x,SearchIcon as v,SquarePlus as b,ChevronRight as y,MoreHorizontal as w,ListFilter as N,TriangleAlert as k,Info as C,AlertTriangle as _,CircleX as z,CircleCheck as I,ChevronDown as T,Plus as L,ChevronsUpDownIcon as M}from"lucide-react";import*as R from"react";import O,{createContext as S,useContext as D,useRef as A,useState as E,useEffect as F,forwardRef as P,Fragment as $,useMemo as j,isValidElement as Y,useLayoutEffect as V}from"react";import{createPortal as B}from"react-dom";import{Slot as U}from"@radix-ui/react-slot";import{VTooltip as H,Button as G}from"@vertesia/ui/core";import*as W from"@radix-ui/react-dialog";import*as K from"@radix-ui/react-separator";import{isEqual as J}from"lodash-es";import*as Z from"@radix-ui/react-popover";import{Command as q}from"cmdk";import*as X from"@radix-ui/react-tabs";import*as Q from"@radix-ui/react-tooltip";import*as ee from"@radix-ui/react-label";import*as te from"@radix-ui/react-checkbox";import re from"dayjs";import ne from"react-calendar";import{Transition as ae,Menu as ie,MenuButton as se,MenuItems as le,MenuItem as oe,Listbox as de,ListboxButton as ce,ListboxOptions as ue,ListboxOption as me,Dialog as he,TransitionChild as pe,DialogPanel as fe,DialogTitle as ge,RadioGroup as xe,Switch as ve}from"@headlessui/react";function be(e){switch(e){case"xs":return"size-4";case"sm":return"size-6";case"md":return"size-8";case"lg":return"size-10";case"xl":return"size-12";case"2xl":return"size-14";default:throw new Error("Unexpected size: "+e)}}function ye({size:t,src:r,name:n,shape:a="circle",color:i="bg-gray-500",className:s}){const l="circle"===a?"rounded-full":"rounded-md",o=be(t||"md");if(r)return e("img",{className:`inline-block ${o} ${l} ${i} ${s}`,src:r,alt:n||r,title:n});if(n){const[r,a]=n.split(" ");let d=a?`${r[0]}${a[0]}`:`${r[0]}${r[1]}`;return e("span",{className:`inline-flex ${o} items-center justify-center ${l} ${i} ${s}`,title:n,children:e("span",{className:("xs"!=t?"text-xs":"text-[0.6rem]")+" font-medium leading-none text-white",children:d})})}return e("span",{className:`inline-block ${o} overflow-hidden ${l} ${i}`,children:e("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:e("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})})}function we({size:t,shape:r="circle",color:n="bg-gray-500",className:a,children:i}){const s="circle"===r?"rounded-full":"rounded-md",l=be(t||"md");return e("span",{className:`inline-block ${l} overflow-hidden ${s} ${n} ${a}`,children:i})}function Ne(...e){return s(i(e))}const ke=n("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium",{variants:{variant:{default:"text-foreground bg-muted",secondary:"bg-secondary text-primary",destructive:"bg-destructive text-destructive",attention:"bg-attention text-attention",success:"bg-success text-success",info:"bg-info text-info",done:"bg-done text-done"}},defaultVariants:{variant:"default"}});function Ce({className:t,variant:r,children:n,onClick:a,...i}){return e("span",{className:Ne(ke({variant:r}),t),onClick:a,...i,children:n})}const _e=n("inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border",{variants:{variant:{default:"",success:"",destructive:"",attention:"",done:"",info:""}},defaultVariants:{variant:"default"}}),ze=n("h-1.5 w-1.5",{variants:{variant:{default:"fill-foreground",success:"fill-success",destructive:"fill-destructive",attention:"fill-attention",done:"fill-done",info:"fill-info"}},defaultVariants:{variant:"default"}});function Ie({variant:r,className:n,dotClassName:a,children:i,...s}){return t("span",{className:Ne(_e({variant:r}),n),...s,children:[e("div",{className:"flex-shrink-0",children:e("svg",{className:Ne(ze({variant:r}),a),viewBox:"0 0 6 6","aria-hidden":"true",children:e("circle",{cx:3,cy:3,r:3})})}),e("span",{className:"truncate",children:i})]})}function Te({className:t,children:r}){return e("div",{className:a("flex items-ceter justify-center",t),children:r})}class Le{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,r){switch(e){case"top":this.top=t.top-r.height-this.gap,this.alignAxis="x";break;case"bottom":this.top=t.bottom+this.gap,this.alignAxis="x";break;case"left":this.left=t.left-r.width-this.gap,this.alignAxis="y";break;case"right":this.left=t.right+this.gap,this.alignAxis="y";break;case"ne":this.top=t.top-r.height-this.gap,this.left=t.right+this.gap;break;case"nw":this.top=t.top-r.height-this.gap,this.left=t.left-r.width-this.gap;break;case"se":this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case"sw":this.top=t.bottom+this.gap,this.left=t.left-r.width-this.gap}}align(e,t,r){if(this.alignAxis)switch(e){case"start":"x"===this.alignAxis?this.left=t.left:this.top=t.top;break;case"end":"x"===this.alignAxis?this.left=t.right-r.width:this.top=t.bottom-r.height;break;case"center":"x"===this.alignAxis?this.left=t.left+t.width/2-r.width/2:this.top=t.top+t.height/2-r.height/2;break;case"fill":"x"===this.alignAxis?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,r){if(this.position(e.position,r,t),e.align&&this.align(e.align,r,t),!this.left&&!this.top)throw new Error("Invalid position. Cannot compute x,y coordinates");const n=null!=this.width,a=null!=this.height,i=n?this.width:t.width,s=a?this.height:t.height;return{rect:new DOMRect(this.left,this.top,i,s),constrainWidth:n,constrainHeight:a,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){const t=function(e){switch(e){case"start":return"end";case"end":return"start";default:return e}}(e.align);if(t!==e.align)return{...e,align:t}}}else{const t=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";default:return e}}(e.position);if(t!==e.position)return{...e,position:t}}return null}}function Me(e,t,r){return"x"===r?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Re(e,t,r,n){const a=new Le(e.gap);let i=a.computePosition(e,t,r);const s=Me(i.rect,n,"x"),l=Me(i.rect,n,"y");if(s&&l)return i;let o=null;return s||(o=a.flipAxis(e,"x")),l||(o=a.flipAxis(o||e,"y")),o?(i=new Le(a.gap).computePosition(o,t,r),function(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}(i.rect,n)?i:null):null}function Oe(e,t){const r=Math.max(e.left,t.left),n=Math.max(e.top,t.top),a=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return a<=r||i<=n?null:new DOMRect(r,n,a-r,i-n)}function Se(e){const t=e.scrollHeight>e.clientHeight,r=e.scrollWidth>e.clientWidth;if(t||r){const n=getComputedStyle(e);if(t&&"visible"!==n.overflowY||r&&"visible"!==n.overflowX)return!0}return!1}class De{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=function(e,t=document.documentElement){const r=[];let n=e.parentElement;for(;n&&n!==t;)Se(n)&&r.push(n),n=n.parentElement;return r.push(t),r}(this.anchor,this.root),this.visibleClientRect=function(e){if(0===e.length)return null;let t=e[0].getBoundingClientRect();for(let r=1,n=e.length;r<n;r++)if(t=Oe(e[r].getBoundingClientRect(),t),!t)return null;return t}(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){const t=this.scrollableParents,r=()=>{this.update()};window.addEventListener("resize",r);for(const e of t)e.addEventListener("scroll",r);let n,a;this.options.closeOnClick&&(n=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout((function(){n&&document.addEventListener("click",n)}),0)),this.options.closeOnEsc&&(a=e=>{"Escape"===e.key&&this.tryClose()},window.setTimeout((function(){a&&document.addEventListener("keydown",a)}),0));const i=this.options.blockPageScroll;return i&&(document.body.style.overflow="hidden",document.body.style.height="100%"),()=>{window.removeEventListener("resize",r);for(const e of t)e.removeEventListener("scroll",r);n&&document.removeEventListener("click",n),a&&document.removeEventListener("keydown",a),i&&(document.body.style.overflow="",document.body.style.height="")}}open(e,t){if(this.context)throw new Error("The popup controller is already bound to an element");this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display="",e.style.visibility="hidden",this.update(),this.options.onOpen&&this.options.onOpen(this))}close(){if(!this.context)throw new Error("The popup controller is not bound to an element");this.tryClose()}tryClose(){this.context&&(this.options.onClose&&this.options.onClose(this),this.context.cleanup(),this.context.element.style.display="none",this.context=void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;const e=this.context.element,t=this.context.constraints,r=e.getBoundingClientRect(),n=this.anchor.getBoundingClientRect(),a=this.visibleClientRect;if(!a)return;const i=Re(t,r,n,a);this.context.position=i||void 0,i&&(i.constrainHeight&&(e.style.height=i.rect.height+"px"),i.constrainWidth&&(e.style.width=i.rect.width+"px"),e.style.left=i.rect.left+"px",e.style.top=i.rect.top+"px",e.style.visibility="visible")}createPopupElement(){const e=document.createElement("div");return e.style.margin="0",e.style.padding="0",e.style.border="none",e.style.background="transparent",e.className="composable-Popup",e}}const Ae=S(void 0);function Ee(){const e=D(Ae);if(!e)throw new Error("usePopupController must be used inside a Popup component");return e}function Fe({ctrlRef:t,id:r,constraints:n,isOpen:a,children:i,className:s,onClose:l,zIndex:o,position:d,...c}){const u=A(null),[m,h]=E();return F((()=>{if(!c.anchor)throw new Error("Anchor element is required");const e=new De({...c,onClose:l});return h(e),()=>{e.tryClose()}}),[]),F((()=>{t&&(t.current=m)}),[m]),F((()=>{m&&u.current?m.isOpen!==a&&(a?m.open(u.current,n):m.close()):m?.isOpen&&!a&&m.close()}),[a,m,u.current]),e(Ae.Provider,{value:m,children:a&&B(e("div",{id:r,style:{visibility:"hidden",position:d||"absolute",zIndex:o||100},ref:u,className:s,children:i}),document.body)})}function Pe({anchor:t,root:r,children:n,...a}){return!t.current||r&&!r.current?null:e(Fe,{anchor:t.current,root:r?.current||void 0,...a,children:n})}class $e{filter(e,t){const r=t.toLowerCase();return e.filter((e=>this.valueOf(e).toLowerCase().includes(r)))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find((e=>this.idOf(e)===t))}createItem(e){return null}}class je extends $e{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new je}class Ye extends je{createItem(e){return e}static instance=new Ye}function Ve(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:"w-72 bg-white mt-1 shadow-md border border-gray-200 overflow-auto p-0 z-10",inputClass:a(t?"block m-0 p-0 border-0 focus:outline-none focus:ring-0 bg-transparent":"block sm:text-sm sm:leading-6 rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 placeholder:text-gray-400 dark:placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-800 py-1.5",e?"w-full":"!w-auto"),optionClass:"py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300",Input:Ue,Menu:Ge,Toggle:He}}function Be({menuAlign:n="fill",menuGap:a,focusOnMount:i,onSelect:s,value:l,zIndex:o,unstyledInput:d,fullWidth:c,api:u,layout:m,adapter:h,items:p,placeholder:f}){const[g]=E(`combobox-popup-${Math.floor(1e6*Math.random())}`),x=A(void 0),v=A(null),b=m?Object.assign(Ve(c,d),m):Ve(c,d),y=O.useRef(null),w=We({adapter:h,items:p,value:l,popupId:g});F((()=>{v.current&&i&&v.current.focus()}),[v.current]),F((()=>{w.onSelect=s,w.popupCtrl=x.current}),[s,x.current]),F((()=>{if(u&&w&&v.current)return u.current={open:()=>w.openMenu(),close:()=>w.closeMenu(),toggle:()=>w.toggleMenu(),setInputValue:e=>w.inputText=e,inputValue:w.inputText||"",selectedItem:w.selectedItem,focus:()=>v.current?.focus()},()=>{u.current=null}}),[u,w,v.current]);const N=w.isMenuOpen&&w.filteredItems.length>0;return t(r,{children:[e(b.Input,{boxRef:y,inputRef:v,ctrl:w,layout:b,placeholder:f}),e(Pe,{id:g,ctrlRef:x,className:"combobox-popup",closeOnClick:!0,closeOnEsc:!0,onClose:()=>w.closeMenu(),isOpen:N,anchor:y,zIndex:o,constraints:{position:"bottom",align:n,gap:null!=a?a:4},children:e(b.Menu,{fillWidth:"fill"===n,items:w.filteredItems,ctrl:w,layout:b,adapter:h})})]})}function Ue({inputRef:r,placeholder:n,boxRef:a,ctrl:i,layout:s}){const l=s.buttonWidth,o=l>0?{paddingRight:`${l}px`}:void 0,d=s.Toggle;return t("div",{className:"relative",ref:a,children:[e("input",{ref:r,placeholder:n,...i.getInputProps(),style:o,className:s.inputClass}),d&&e("button",{style:{top:0,bottom:0,right:`${s.buttonRight}px`,width:`${l}px`,position:"absolute",border:"none",padding:0,margin:0,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},...i.getToggleButtonProps(),children:e(d,{ctrl:i,layout:s})})]})}function He({ctrl:t}){return t.isMenuOpen?e(l,{className:"w-4 h-4"}):e(o,{className:"w-4 h-4"})}function Ge({fillWidth:t,items:r,layout:n,ctrl:i,adapter:s}){const{highlightedIndex:l,selectedItem:o}=i;return e("ul",{style:{width:t?"100%":void 0,maxHeight:n.maxMenuHeight?`${n.maxMenuHeight}px`:"240px"},className:n.menuClass,...i.getMenuProps(),children:r.map(((t,r)=>e("li",{"data-index":r,className:a(n.optionClass,l===r&&"option-highlighted",o===t&&"option-selected"),...i.getItemProps(t,r),children:s.renderOption(t)},s.idOf(t))))})}function We(e){const[t,r]=E(new Ke(e));return F((()=>{t?.withState(r)}),[]),t}class Ke{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText="";_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:r,popupId:n}){this.adapter=e,this.items=t,this.popupId=n,"string"==typeof r?this._inputText=r:r&&(this._selectedItem=e.findById(t,e.idOf(r))||null,this._selectedItem&&(this._inputText=e.valueOf(r))),this._inputText?this._filteredItems=this.adapter.filter(this.items,this._inputText):this._filteredItems=this.items}withState(e){return this.setState=e,this}clone(){const e=new Ke({adapter:this.adapter,items:this.items,popupId:this.popupId});return e.setState=this.setState,e.onSelect=this.onSelect,e._inputText=this._inputText,e._highlightedIndex=this._highlightedIndex,e._selectedItem=this._selectedItem,e._isMenuOpen=this._isMenuOpen,e._filteredItems=this._filteredItems,e.popupCtrl=this.popupCtrl,e}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):"",this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){const e=this.popupCtrl,t=e.context?.position?.position;t&&"top"===t&&window.setTimeout((()=>{e.update()}),100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;const r=document.getElementById(this.popupId);r&&r.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){const e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{const t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{const r=t.key;if("Enter"===r){if(null!=this.highlightedIndex)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){const e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else"ArrowDown"===r?this.isMenuOpen?this.highlightIndex(null===this.highlightedIndex?0:(n=this.highlightedIndex,a=e.length,(n+1)%a),!1):this.openMenu():"ArrowUp"===r&&this.isMenuOpen&&this.highlightIndex(null===this.highlightedIndex?0:function(e,t){return(e-1+t)%t}(this.highlightedIndex,e.length),!0);var n,a}}}}const Je=n("hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{destructive:"bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50",outline:"border border-input bg-background shadow-xs hover:bg-muted ring-inset",secondary:"bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset",ghost:"hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset",link:"text-white underline-offset-4 hover:underline ring-inset",primary:"bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset",unstyled:""},size:{xs:"h-7 rounded px-2 py-1 text-xs gap-x-1",sm:"h-8 rounded px-3 text-xs",md:"h-9 rounded-md px-4 py-2",lg:"h-10 rounded-md px-3",xl:"rounded-md px-3.5 py-2.5 text-sm gap-x-2",icon:"p-0 m-0 rounded-full"}},defaultVariants:{variant:"primary",size:"md"}}),Ze=R.forwardRef((({className:r,variant:n,size:i,asChild:s=!1,alt:l,isDisabled:o,isLoading:c,title:u,onClick:m,type:h,...p},f)=>{const g=t(s?U:"button",{className:a(Ne(Je({variant:n,size:i})),r),disabled:o||c||p.disabled,ref:f,onClick:m,type:h,autoFocus:!1,...p,children:[c&&e(d,{className:"animate-spin"}),p.children]});return l||u?e(H,{description:l||u,asChild:!0,className:"cursor-pointer",size:"xs",placement:"top",children:g}):g}));Ze.displayName="Button";const qe=R.forwardRef((({size:t,content:r,toast:n,className:a,alt:i,...s},l)=>{const[o,d]=E(!1);return e(Ze,{ref:l,className:Ne(a),variant:"unstyled",size:t||"sm",onClick:()=>{navigator.clipboard.writeText(r).then((()=>{d(!0),setTimeout((()=>d(!1)),2e3),n&&n.toast&&n.toast({status:"success",title:n.message||"Copied to clipboard",duration:2e3})})).catch((e=>{console.error("Failed to copy text: ",e),n&&n.toast&&n.toast({status:"error",title:"Failed to copy",duration:2e3})}))},...s,alt:i??"Copy",children:o?e(c,{className:"text-success"}):e(u,{className:"size-4"})})}));qe.displayName="CopyButton";const Xe=S({theme:"system",setTheme:()=>null});function Qe({children:t,defaultTheme:r="system",storageKey:n="vite-ui-theme",...a}){const[i,s]=E((()=>localStorage.getItem(n)||r));F((()=>{const e=window.document.documentElement;if(e.classList.remove("light","dark"),"system"!==i)e.classList.add(i);else{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";e.classList.add(t)}}),[i]);const l={theme:i,setTheme:e=>{localStorage.setItem(n,e),s(e)}};return e(Xe.Provider,{...a,value:l,children:t})}const et=()=>{const e=D(Xe);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e};function tt({option:t,current:r,setTheme:n,icon:a}){return e(Ze,{variant:r===t?"secondary":"outline",size:"sm",onClick:()=>n(t),alt:t,children:a})}function rt(){const{setTheme:r}=et(),n=et().theme;return t("div",{className:"flex justify-between px-2 items-center",children:[e("p",{className:"text-sm font-semibold",children:"Theme"}),t("div",{className:"flex gap-2",children:[e(tt,{current:n,option:"system",setTheme:r,icon:e(m,{className:"text-muted"})}),e(tt,{current:n,option:"light",setTheme:r,icon:e(h,{className:"text-muted"})}),e(tt,{current:n,option:"dark",setTheme:r,icon:e(p,{className:"text-muted"})})]})]})}const nt=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("rounded-xl border bg-card text-card-foreground shadow",t),...r})));nt.displayName="Card";const at=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("flex flex-col p-6",t),...r})));at.displayName="CardHeader";const it=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("font-semibold leading-none tracking-tight",t),...r})));it.displayName="CardTitle";const st=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("text-sm text-muted-foreground",t),...r})));st.displayName="CardDescription";const lt=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("p-6 pt-0",t),...r})));lt.displayName="CardContent";const ot=R.forwardRef((({className:t,...r},n)=>e("div",{ref:n,className:Ne("flex items-center p-6 pt-0",t),...r})));function dt({children:t}){return e("span",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},children:t})}ot.displayName="CardFooter";const ct=S(!1);function ut(){return!!D(ct)}function mt({children:t}){return e(ct.Provider,{value:!0,children:t})}function ht({className:r,children:n,isOpen:a,onClose:i,description:s="Modal Description",noCloseButton:l=!1,allowOverflow:o=!1,disableCloseOnClickOutside:d=!1}){const c=e=>{e||i()};return t(xt,{open:a,onOpenChange:e=>{d&&!e||c(e)},children:[o&&e(wt,{className:"z-50 fixed inset-0 bg-black/80"}),e(dt,{children:e(kt,{children:s})}),t(Nt,{className:Ne("min-h-20 p-4","fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg",r),children:[!l&&e(yt,{onClick:()=>c(!1),asChild:!0,autoFocus:!1,children:e(Ze,{variant:"outline",alt:"Close",className:"top-4 right-4 absolute data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none",children:e(f,{className:"w-4 h-4"})})}),e(mt,{children:n})]})]})}const pt=({children:n,show:a=!0,className:i,description:s,...l})=>a?e(r,{children:t(Ct,{className:Ne("text-lg font-semibold leading-6 tracking-tight",{"py-2":!s},i),...l,children:[n,s&&e(kt,{className:"text-sm !font-normal text-muted-foreground pb-2",children:s})]})}):t(dt,{children:[e(Ct,{children:n}),s&&e(kt,{children:s})]}),ft=({children:t,className:r,...n})=>e("div",{className:Ne("text-sm max-h-[80vh] overflow-y-auto",r),...n,children:t}),gt=({align:t="right",children:r,className:n,...a})=>e("div",{className:Ne("w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end sm:space-x-2",{left:"justify-start",center:"justify-center",right:"justify-end"}[t],n),...a,children:r}),xt=W.Root,vt=W.Trigger,bt=W.Portal,yt=W.Close,wt=R.forwardRef((({className:t,...r},n)=>e(W.Overlay,{ref:n,className:Ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})));wt.displayName=W.Overlay.displayName;const Nt=R.forwardRef((({className:r,children:n,...a},i)=>t(bt,{children:[e(wt,{}),e(W.Content,{ref:i,autoFocus:!1,onOpenAutoFocus:e=>{e.preventDefault()},className:Ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:n})]})));Nt.displayName=W.Content.displayName;const kt=R.forwardRef((({className:t,...r},n)=>e(W.Description,{ref:n,className:Ne("text-sm text-muted",t),...r})));kt.displayName=W.Description.displayName;const Ct=R.forwardRef((({className:t,...r},n)=>e(W.Title,{ref:n,className:Ne("text-lg font-semibold leading-none tracking-tight",t),...r})));Ct.displayName=W.Title.displayName;const _t=n("",{variants:{size:{xs:"rounded py-1 text-xs rounded-xs",sm:"rounded text-xs rounded-sm",md:"rounded-md py-2 text-sm",lg:"rounded-md text-base",xl:"rounded-md py-2.5 text-lg"},variant:{default:"flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",unstyled:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",noPadding:"block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background",legacy:"py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background"}},defaultVariants:{size:"md",variant:"default"}}),zt=R.forwardRef((({className:r,type:n,size:a="md",variant:i="default",clearable:s=!0,onChange:l,value:o,...d},c)=>t("div",{className:"w-full",style:{position:"relative",display:"inline-block"},children:[e("input",{type:n,className:Ne(_t({size:a,variant:i}),r,s&&o?"pr-6":""),ref:c,value:null==o?"":o,onChange:e=>{l&&l(e.target.value)},...d}),s&&o&&!d.readOnly&&!d.disabled&&e("button",{onClick:()=>{l&&l("")},className:`absolute ${"number"!==n?"right-0":"right-7"} top-1/2 -translate-y-1/2 size-7 text-muted-foreground hover:text-destructive cursor-pointer flex items-center justify-center`,type:"button","aria-label":"Clear input",children:e(f,{size:16})})]})));zt.displayName="Input";const It=R.forwardRef((({className:t,orientation:r="horizontal",decorative:n=!0,...a},i)=>e(K.Root,{ref:i,decorative:n,orientation:r,className:Ne("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a})));It.displayName=K.Root.displayName;const Tt=R.createContext(null),Lt=({hover:t=!1,click:r=!1,children:n,_open:a,onOpenChange:i})=>{const[s,l]=R.useState(a||!1),o=ut();return e(Tt.Provider,{value:{open:s,setOpen:l,hover:t,click:r},children:e(Z.Root,{open:s,onOpenChange:e=>{l(e),i&&i(e)},modal:o,children:n})})};function Mt(e=!1,t=()=>{},r){e&&t("enter"===r)}const Rt=R.forwardRef((({children:t,...r},n)=>{const a=R.useContext(Tt);if(!a)throw new Error("PopoverTrigger must be used within a Popover");const{setOpen:i,hover:s,click:l}=a;return e(Z.Trigger,{ref:n,asChild:!0,onMouseEnter:()=>Mt(s,i,"enter"),onMouseLeave:()=>Mt(s,i,"leave"),onClick:()=>{l&&i((e=>!e))},...r,children:t})}));Rt.displayName=Z.Trigger.displayName;const Ot=Z.Anchor,St=R.forwardRef((({className:t,align:r="center",side:n="bottom",...a},i)=>{const s=R.useContext(Tt);if(!s)throw new Error("PopoverContent must be used within a Popover");const{setOpen:l,hover:o}=s;return e(Z.Portal,{children:e(Z.Content,{ref:i,align:r,side:n,onMouseEnter:()=>Mt(o,l,"enter"),onMouseLeave:()=>Mt(o,l,"leave"),className:Ne("z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in","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",t),...a})})}));St.displayName=Z.Content.displayName;const Dt=Z.Close;Dt.displayName=Z.Close.displayName;const At=R.forwardRef((({className:t,...r},n)=>e(q,{ref:n,className:Ne("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r})));At.displayName=q.displayName;const Et=({children:t,...r})=>e(xt,{...r,children:e(Nt,{className:"shadow-lg p-0 overflow-hidden",children:e(At,{className:"[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",children:t})})}),Ft=R.forwardRef((({className:r,...n},a)=>t("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[e(g,{className:"opacity-50 size-4 shrink-0"}),e(q.Input,{ref:a,className:Ne("focus:ring-0","border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...n})]})));Ft.displayName=q.Input.displayName;const Pt=R.forwardRef((({className:t,...r},n)=>e(q.List,{ref:n,className:Ne("overflow-y-auto overflow-x-hidden",t),...r})));Pt.displayName=q.List.displayName;const $t=R.forwardRef(((t,r)=>e(q.Empty,{ref:r,className:"py-2 text-sm text-center",...t})));$t.displayName=q.Empty.displayName;const jt=R.forwardRef((({className:t,...r},n)=>e(q.Group,{ref:n,className:Ne("overflow-y-auto overflow-x-hidden p-1 text-foreground","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r})));jt.displayName=q.Group.displayName;const Yt=R.forwardRef((({className:t,...r},n)=>e(q.Separator,{ref:n,className:Ne("-mx-1 h-px bg-border",t),...r})));Yt.displayName=q.Separator.displayName;const Vt=R.forwardRef((({className:t,...r},n)=>e(q.Item,{ref:n,className:Ne("hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...r})));Vt.displayName=q.Item.displayName;const Bt=({className:t,...r})=>e("span",{className:Ne("ml-auto text-xs tracking-widest text-muted-foreground",t),...r});function Ut({options:r,optionLabel:n,value:i,onChange:s,addNew:l,addNewLabel:o,disabled:d,filterBy:u,label:m,placeholder:h,className:p,popupClass:g,isClearable:y,border:w=!0,multiple:N=!1,by:k}){const C=A(null),[_,z]=E(!1),[I,T]=E(0),[L,M]=E("");F((()=>{const e=C.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;T(t)},r=new ResizeObserver((()=>{t()}));return t(),r.observe(e),()=>{r.disconnect()}}),[]);const R=(e,t)=>!(!t||0===t.length)&&t.some((t=>O(t,e))),O=(e,t)=>null==e||null==t?e===t:"string"==typeof k?e[k]===t[k]:"function"==typeof k?k(e,t):J(e,t);let S=r||[];const D=L.toLowerCase(),P=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(u);S=S.filter((e=>P(e).includes(D)));return t(Lt,{children:[e(Rt,{asChild:!0,children:t("div",{ref:C,onClick:e=>{d?e.preventDefault():z(!_)},className:a(p,w&&"border border-border","flex flex-row gap-2 items-center justify-between p-2 rounded-md group relative",d?"cursor-not-allowed text-muted":"cursor-pointer hover:bg-muted"),children:[t("div",{className:a("flex flex-col w-full rounded-md text-sm items-center justify-center truncate",!d&&"",y&&i&&(!Array.isArray(i)||i.length>0)&&"pr-6"),children:[m&&e("div",{className:"w-full text-left text-xs font-semibold",children:m}),e("div",{className:a("w-full text-left",!d&&""),children:N?(()=>{const r=Array.isArray(i)?i:i?[i]:[];return 0===r.length?e("span",{className:"text-muted",children:h}):1===r.length?n?n(r[0]):r[0]:t("div",{className:"flex flex-wrap gap-1",children:[r.slice(0,1).map(((t,r)=>e("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded",children:n?n(t):t},r))),r.length>1&&t("span",{className:"inline-flex items-center px-2 py-1 text-xs bg-muted rounded",children:["+",r.length-1," more"]})]})})():(()=>{if(!i||Array.isArray(i)&&0===i.length)return e("span",{className:"text-muted",children:h});const t=Array.isArray(i)?i[0]:i;return n?n(t):t})()})]}),t("div",{className:"flex items-center gap-1",children:[y&&i&&(!Array.isArray(i)||i.length>0)&&e("div",{onClick:e=>{e.stopPropagation(),s(N?[]:void 0)},className:"cursor-pointer hover:bg-muted/20 rounded p-1",children:e(f,{className:"size-4"})}),!d&&e(x,{className:"size-4 opacity-50"})]})]})}),t(St,{style:{width:`${I}px`,zIndex:1e6},className:a("min-w-[8rem] w-64 bg-popover p-1 border shadow","divide-y divide-border",g),children:[u&&t("div",{className:"flex justify-start items-center mb-1",children:[e("div",{className:"mx-2",children:e(v,{className:"size-4"})}),e(zt,{variant:"unstyled",value:L,onChange:M,className:"w-full p-1 rounded-md",placeholder:"Search..."})]}),e(At,{className:"overflow-hidden",children:t(Pt,{className:"max-h-[200px] overflow-y-auto",children:[e($t,{children:"No result found."}),e(jt,{className:"overflow-visible",children:S?.map(((r,a)=>{const l=N?R(r,Array.isArray(i)?i:[]):null!=i&&O(i,r);return e(Vt,{onSelect:()=>(e=>{if(N){const t=Array.isArray(i)?i:[];if(R(e,t)){const r=t.filter((t=>!O(t,e)));s(r)}else s([...t,e])}else z(!1),s(e)})(r),className:"w-full",children:N?t("div",{className:"w-full flex justify-between items-center cursor-pointer",children:[e("div",{className:"w-full truncate text-left",children:n?n(r):r}),l&&e(c,{className:"size-4"})]}):t(Dt,{className:"w-full flex justify-between items-center",children:[e("div",{className:"w-full truncate text-left",children:n?n(r):r}),l&&e(c,{className:"size-4"})]})},a)}))})]})}),l&&e("div",{className:"p-1",children:t("a",{onClick:l,className:a("gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent"),children:[e(b,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),o]})})]})]})}Bt.displayName="CommandShortcut";const Ht=R.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:"tabs"}),Gt=({tabs:t,defaultValue:r,current:n,className:a,fullWidth:i,children:s,onTabChange:l,responsive:o=!1,variant:d="tabs"})=>{const c="function"==typeof n?n():n||r,[u,m]=R.useState(c);R.useEffect((()=>{c&&m(c)}),[c]);const h=e=>{m(e),l&&l(e)},p=R.useCallback((e=>{h(e)}),[h]);return e(Ht.Provider,{value:{tabs:t,size:i?t.length:0,current:u,setTab:p,responsive:o,variant:d},children:e(X.Root,{defaultValue:t[0]?.name,value:u,onValueChange:h,className:a,children:s})})},Wt=({className:n})=>{const{tabs:a,size:i,current:s,setTab:l,responsive:o,variant:d}=R.useContext(Ht),c=0!==i,u=R.useCallback((e=>{if(!a||!l)return;const t=a.find((t=>t.name===e));t?.href&&window.history.pushState(null,"",t.href),l(e)}),[a,l]);return a&&l?t(r,{children:[o&&e("div",{className:"px-2 block lg:hidden",children:e(Ut,{label:"Tab",className:n,options:a,optionLabel:e=>"string"==typeof e.label?e.label:String(e.label),value:a.find((e=>e.name===s)),onChange:e=>{u(e.name)}})}),e(Jt,{size:i,variant:d,className:Ne(c?"w-full":"",n,o?"hidden lg:flex":""),children:a.map((t=>e(Zt,{value:t.name,disabled:t.disabled,href:t.href,variant:d,onClick:()=>u(t.name),children:t.label},t.name)))})]}):(console.warn("TabsBar: No tabs provided or setTab not available"),null)},Kt=()=>{const{tabs:t}=R.useContext(Ht);return t?e(r,{children:t.map((t=>e(qt,{value:t.name,children:t.content},t.name)))}):null},Jt=R.forwardRef((({className:t,size:r,variant:n="tabs",...a},i)=>e(Ht.Provider,{value:{size:r,variant:n},children:e(X.List,{ref:i,className:Ne("tabs"===n?"border-b -mb-px flex space-x-4":"flex space-x-2 p-1 rounded-md",t),...a})})));Jt.displayName=X.List.displayName;const Zt=R.forwardRef((({className:t,href:r,variant:n="tabs",...a},i)=>{const{size:s}=R.useContext(Ht),l=R.useCallback((e=>{r&&(e.preventDefault(),window.history.pushState(null,"",r)),a.onClick&&a.onClick(e)}),[r,a.onClick]);return e(X.Trigger,{ref:i,className:Ne("tabs"===n?Ne("border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer","border-transparent text-muted-foreground hover:border-border hover:text-foreground","data-[state=active]:border-primary data-[state=active]:text-primary","disabled:pointer-events-none disabled:opacity-50"):Ne("px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors","tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset","data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm","disabled:pointer-events-none disabled:opacity-50"),t,s?`w-1/${s}`:""),onClick:l,...a})}));Zt.displayName=X.Trigger.displayName;const qt=R.forwardRef((({className:t,...r},n)=>e(X.Content,{ref:n,className:Ne("focus-visible:outline-none",t),...r})));qt.displayName=X.Content.displayName;const Xt=Q.Provider,Qt=Q.Root,er=Q.Trigger,tr=R.forwardRef((({className:t,sideOffset:r=4,side:n="top",...a},i)=>e(Q.Portal,{children:e(Q.Content,{ref:i,sideOffset:r,side:n,style:{zIndex:100},className:Ne("max-w-[90vw]","z-50 overflow-hidden rounded-md bg-tooltips border px-3 py-1.5 text-xs 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",t),...a})})));function rr({description:r,children:n,size:a="sm",placement:i="top",className:s,asChild:l}){return e(Xt,{delayDuration:0,children:t(Qt,{children:[e(er,{className:"cursor-pointer",asChild:l,children:n}),e(tr,{side:i,className:`px-3 py-1.5 max-w-${a} text-${a} px-3 ${s}`,children:r})]})})}tr.displayName=Q.Content.displayName;const nr=n("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ar=R.forwardRef((({className:r,required:n,...a},i)=>t(ee.Root,{ref:i,className:Ne(nr(),r),...a,children:[a.children,n&&e("span",{className:"text-destructive-foreground ml-1",children:"*"})]})));function ir({children:r,maxItems:n=3,className:a,separator:i}){if(r.length<=n)return e(sr,{className:Ne("w-full",a),children:e(lr,{children:r.map(((n,a)=>t(R.Fragment,{children:[e(or,{children:n.href?e(dr,{href:n.href,children:n.label}):e(cr,{children:n.label})}),a<r.length-1&&e(ur,{children:i??e(y,{})})]},a)))})});const s=r[0],l=r.slice(-(n-2));return e(sr,{className:Ne("w-full",a),children:t(lr,{children:[e(or,{children:s.href?e(dr,{href:s.href,children:s.label}):e(cr,{children:s.label})}),e(ur,{children:i??e(y,{})}),e(or,{children:e(mr,{})}),e(ur,{children:i??e(y,{})}),l.map(((r,n)=>t(R.Fragment,{children:[e(or,{children:r.href?e(dr,{href:r.href,children:r.label}):e(cr,{children:r.label})}),n<l.length-1&&e(ur,{children:i??e(y,{})})]},n)))]})})}ar.displayName=ee.Root.displayName;const sr=R.forwardRef((({...t},r)=>e("nav",{ref:r,"aria-label":"breadcrumb",...t})));sr.displayName="Breadcrumb";const lr=R.forwardRef((({className:t,...r},n)=>e("ol",{ref:n,className:Ne("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...r})));lr.displayName="BreadcrumbList";const or=R.forwardRef((({className:t,...r},n)=>e("li",{ref:n,className:Ne("inline-flex items-center gap-1.5",t),...r})));or.displayName="BreadcrumbItem";const dr=R.forwardRef((({asChild:t,className:r,...n},a)=>e("a",{ref:a,className:Ne("transition-colors hover:text-foreground",r),...n})));dr.displayName="BreadcrumbLink";const cr=R.forwardRef((({className:t,...r},n)=>e("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Ne("font-normal text-foreground",t),...r})));cr.displayName="BreadcrumbPage";const ur=({children:t,className:r,...n})=>e("li",{role:"presentation","aria-hidden":"true",className:Ne("[&>svg]:w-3.5 [&>svg]:h-3.5",r),...n,children:t??e(y,{})});ur.displayName="BreadcrumbSeparator";const mr=({className:r,...n})=>t("span",{role:"presentation","aria-hidden":"true",className:Ne("flex h-9 w-9 items-center justify-center",r),...n,children:[e(w,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"More"})]});mr.displayName="BreadcrumbEllipsis";const hr=({children:t,className:r})=>{const n=A(null),[a,i]=E("auto");return F((()=>{if(n.current){const e=new ResizeObserver((e=>{const t=e[0].contentRect.height;i(t)}));return e.observe(n.current),()=>{e.disconnect()}}}),[]),e("div",{className:Ne(r,"overflow-hidden transition-all duration-100 ease-in"),style:{height:a},children:e("div",{ref:n,children:t})})},pr=R.forwardRef((({className:t,...r},n)=>e(te.Root,{ref:n,className:Ne("peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white",t),...r,children:e(te.Indicator,{className:Ne("flex items-center justify-center text-current"),children:e(c,{className:"size-4"})})})));function fr({value:t,labelRenderer:n,fallbackLabel:a}){const[i,s]=E(a||t),[l,o]=E(!1);return F((()=>{if(!n)return void s(a||t);(async()=>{o(!0);try{const e=n(t);if(e instanceof Promise){const t=await e;s(t)}else s(e)}catch(e){console.error("Error rendering label:",e),s(a||t)}finally{o(!1)}})()}),[t,n,a]),l?e("span",{className:"text-muted-foreground",children:"Loading..."}):e(r,{children:i})}pr.displayName=te.Root.displayName;const gr=({filterType:n,filterValues:a,setFilterValues:i,options:s,labelRenderer:l})=>{const[o,d]=E(!1),[c,u]=E(""),m=A(null),h=s?.filter((e=>!a.some((t=>t.value===e.value))));return t(Lt,{_open:o,onOpenChange:e=>{d(e),e||setTimeout((()=>{u("")}),200)},children:[e(Rt,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0",children:e("div",{className:"flex gap-1.5 items-center",children:1===a?.length?(()=>{const t=a[0];return e(fr,{value:t.value||"",labelRenderer:l,fallbackLabel:t.label})})():`${a?.length} selected`})}),e(St,{className:"w-[300px] p-0",children:e(hr,{children:t(At,{children:[e(Ft,{placeholder:n,className:"h-9",value:c,onInputCapture:e=>{u(e.currentTarget.value)},ref:m}),t(Pt,{children:[e($t,{children:"No results found."}),e(jt,{children:a.map((r=>t(Vt,{className:"group flex gap-2 items-center",onSelect:()=>{i(a.filter((e=>e.value!==r.value))),setTimeout((()=>{u("")}),200),d(!1)},children:[e("input",{type:"checkbox",checked:!0,onChange:()=>{}}),e(fr,{value:r.value||"",labelRenderer:l,fallbackLabel:r.label})]},r.value)))}),h?.length>0&&t(r,{children:[e(Yt,{}),e(jt,{children:h.filter((e=>String(e.label||e.value).toLowerCase().includes(c.toLowerCase()))).map((r=>t(Vt,{className:"group flex gap-2 items-center",value:String(r.label||r.value),onSelect:()=>{i([...a,{value:r.value,label:r.label}]),setTimeout((()=>{u("")}),200),d(!1)},children:[e(pr,{checked:!1,className:"opacity-0 group-data-[selected=true]:opacity-100"}),e("span",{className:"text-muted",children:e(fr,{value:r.value||"",labelRenderer:r.labelRenderer||l,fallbackLabel:r.label})})]},r.value)))})]})]})]})})})]})},xr="\n.calendar-wrapper .react-calendar__navigation {\n display: flex !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 8px !important;\n padding: 8px !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__label {\n flex: 1 !important;\n text-align: center !important;\n font-weight: 500 !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n min-width: 32px !important;\n height: 32px !important;\n border-radius: 4px !important;\n border: 1px solid hsl(var(--border)) !important;\n background: hsl(var(--background)) !important;\n color: hsl(var(--foreground)) !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow:hover {\n background: oklch(var(--muted)) !important;\n}\n\n.calendar-wrapper .react-calendar__tile {\n cursor: pointer !important;\n width: 0.5rem !important;\n font-size: 0.875rem !important;\n}\n\n.calendar-wrapper .react-calendar__tile:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile:not(.react-calendar__tile--active):hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled,\n.calendar-wrapper .react-calendar__tile:disabled,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled {\n cursor: not-allowed !important;\n color: #9ca3af !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled:hover,\n.calendar-wrapper .react-calendar__tile:disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled:hover {\n background: transparent !important;\n}\n\n\n.calendar-wrapper .react-calendar__month-view__weekdays {\n font-size: 0.75rem !important;\n}\n\n.calendar-wrapper .react-calendar__month-view__weekdays__weekday {\n width: 0.75rem !important;\n font-size: 0.75rem !important;\n text-align: center !important;\n}\n \n",vr=({filterValues:n,setFilterValues:a,isRange:i=!1})=>{const[s,l]=E(!1),[o,d]=E([null,null]),c=n[0]?new Date(n[0]):void 0,u=i?[o[0]||(n[0]?new Date(n[0]):null),o[1]||(n[1]?new Date(n[1]):null)]:[null,null];F((()=>{i&&d([n[0]?new Date(n[0]):null,n[1]?new Date(n[1]):null])}),[n,i]);const m=e=>{if(i)Array.isArray(e)&&(d([e[0],e[1]]),e[0]&&e[1]?a([re(e[0]).format("YYYY-MM-DD"),re(e[1]).format("YYYY-MM-DD")]):e[0]&&a([re(e[0]).format("YYYY-MM-DD")]));else if(e){const t=Array.isArray(e)?e[0]:e;t&&(a([re(t).format("YYYY-MM-DD")]),l(!1))}};return t(Lt,{_open:s,onOpenChange:l,children:[e(Rt,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center min-h-[20px]",children:i?u[0]&&u[1]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:re(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"-"}),e("span",{className:"font-medium",children:re(u[1]).format("MMMM DD, YYYY")})]}):u[0]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:re(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"- Select end"})]}):e("span",{className:"text-muted-foreground",children:"Select range"}):c?re(c).format("MMMM DD, YYYY"):"Pick a date"})}),e(St,{className:"w-auto p-0",align:"start",side:"bottom",alignOffset:-4,sideOffset:6,children:e("div",{className:"p-2",children:i?t(r,{children:[t("div",{className:"calendar-wrapper",children:[e("style",{children:xr}),e(ne,{value:u,onChange:m,selectRange:!0,returnValue:"range",maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),r=new Date;if(r.setHours(23,59,59,999),t>r.getTime())return"text-muted/20 cursor-not-allowed";if(u[0]){const e=u[0].getTime();if(u[1]){const r=u[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===r)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<r)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}})]}),u[0]&&u[1]&&e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>l(!1),children:"Apply"})]})})]}):t("div",{className:"calendar-wrapper",children:[e("style",{children:xr}),e(ne,{value:c,onChange:m,selectRange:!1,maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),r=new Date;if(r.setHours(23,59,59,999),t>r.getTime())return"text-muted/20 cursor-not-allowed";if(c&&t===c.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})]})},br=({filterType:r,filterValue:n,setFilterValue:a})=>{const[i,s]=E(!1),[l,o]=E(n);return t(Lt,{_open:i,onOpenChange:e=>{s(e),e||l===n||o(n)},children:[e(Rt,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:n||"Enter text..."})}),e(St,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:r})}),e(zt,{autoFocus:!0,type:"text",size:"sm",value:l,onChange:o,onKeyDown:e=>{"Enter"===e.key&&(a(l),s(!1))},placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:()=>{o(n),s(!1)},children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})})]})})]})},yr=({filterType:r,filterValues:n,setFilterValues:a})=>{const[i,s]=E(!1),[l,o]=E(n);return t(Lt,{_open:i,onOpenChange:e=>{s(e),e||JSON.stringify(l)===JSON.stringify(n)||o(n)},children:[e(Rt,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:n.length>0?1===n.length?n[0]:`${n.length} tags`:"Add tags..."})}),e(St,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-3",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:r})}),e(nn,{value:l,onChange:o,placeholder:`Add ${r.toLowerCase()}...`}),t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{size:"sm",variant:"ghost",onClick:()=>{o(n),s(!1)},children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})]})})]})};function wr(t,r,n){switch(t.type){case"date":return e(vr,{filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value.map((e=>e.value||"")):[],isRange:t.multiple,setFilterValues:e=>{r((r=>r.map((r=>r===t?{...r,value:e.length>0?e.map((e=>({value:e,label:re(e).format("LLL dd, y")}))):[]}:r))))}});case"text":return e(br,{filterType:t.placeholder||t.name,filterValue:Array.isArray(t.value)&&t.value[0]&&"object"==typeof t.value[0]&&t.value[0].value||"",setFilterValue:e=>{r((r=>r.map((r=>r===t?{...r,value:[{value:e,label:e}]}:r))))}});case"stringList":return e(yr,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"string"==typeof t.value[0]?t.value:[],setFilterValues:e=>{r((r=>r.map((r=>r===t?{...r,value:e}:r))))}});default:{const a=n.find((e=>e.name===t.name));return e(gr,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value:[],setFilterValues:e=>{r((r=>r.map((r=>r===t?{...r,value:e}:r))))},options:a?.options||[],labelRenderer:a?.labelRenderer})}}}function Nr({filters:r,setFilters:n,filterGroups:a}){return e("div",{className:"flex gap-2 flex-wrap justify-start",children:r.filter((e=>e.value?.length>0)).map((r=>t("div",{className:"flex gap-[1px] items-center text-sm",children:[e("div",{className:"flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center",children:r.placeholder||r.name}),wr(r,n,a),e(Ze,{variant:"ghost",size:"icon",onClick:()=>{n((e=>e.filter((e=>e!==r))))},className:"bg-muted rounded-l-none rounded-r-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0",children:e(f,{className:"size-6"})})]},r.name+"-"+("date"==r.type?"date":"stringList"===r.type&&"string"==typeof r.value[0]?r.value.join(","):Array.isArray(r.value)?r.value.map((e=>e.value)).join(","):""))))})}function kr({selectedView:r,textValue:n,setTextValue:a,setFilters:i,handleClose:s,filterGroups:l}){const o=()=>{i((e=>[...e,{name:r||"",placeholder:l.find((e=>e.name===r))?.placeholder,value:[{value:n,label:n}],type:"text"}])),s()};return t("div",{className:"p-2 flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:l.find((e=>e.name===r))?.placeholder})}),e(zt,{autoFocus:!0,type:"text",size:"sm",value:n,onChange:a,onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(Ze,{size:"sm",onClick:o,disabled:!n.trim(),children:"Apply"})]})})]})}function Cr({selectedView:n,selectedDate:a,setSelectedDate:i,setFilters:s,filters:l,handleClose:o,filterGroups:d}){const[c,u]=E([null,null]),[m,h]=E([null,null]),p=d.find((e=>e.name===n)),f=p?.multiple,g=new Date;g.setHours(23,59,59,999);const x=[m[0]||c[0],m[1]||c[1]],v=e=>{if(f)Array.isArray(e)?(h([e[0],e[1]]),u([e[0],e[1]])):(h([e,null]),u([e,null]));else{const t=Array.isArray(e)?e[0]:e;if(i(t||void 0),t){const e=new Date(t);e.setHours(0,0,0,0),s([...l,{name:n||"",placeholder:p?.placeholder,value:[{value:e.toISOString(),label:re(e).format("LLL dd, y")}],type:p?.type||"date",multiple:p?.multiple||!1}]),o()}}};return e("div",{className:"p-2",children:f?t(r,{children:[e("div",{children:f?x[0]&&x[1]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:re(x[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"To:"}),e("span",{className:"text-xs font-medium",children:re(x[1]).format("MMMM DD, YYYY")})]}):x[0]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:re(x[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"→ Select end date"})]}):e("span",{className:"text-muted text-xs",children:p?.placeholder||p?.name||n||"Select date range"}):a?re(a).format("MMMM DD, YYYY"):"Pick a date"}),t("div",{className:"calendar-wrapper",children:[e("style",{children:xr}),e(ne,{value:x,onChange:v,selectRange:!0,returnValue:"range",maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),r=new Date;if(r.setHours(23,59,59,999),t>r.getTime())return"text-muted/20 cursor-not-allowed";if(x[0]){const e=x[0].getTime();if(x[1]){const r=x[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===r)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<r)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}},`${x[0]?.getTime()}-${x[1]?.getTime()}`)]}),e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:o,children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>{if(c[0]){const e=new Date(c[0]),t=c[1]?new Date(c[1]):new Date(c[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);const r=[];r.push({value:e.toISOString(),label:re(e).format("LLL dd, y")}),c[1]&&c[0].getTime()!==c[1].getTime()&&r.push({value:t.toISOString(),label:re(t).format("LLL dd, y")}),s([...l,{name:n||"",placeholder:p?.placeholder,value:r,type:p?.type||"date",multiple:p?.multiple||!1}]),o()}},disabled:!x[0],children:"Apply"})]})})]}):e(r,{children:t("div",{className:"calendar-wrapper",children:[e("style",{children:xr}),e(ne,{value:a,onChange:v,selectRange:!1,maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),r=new Date;if(r.setHours(23,59,59,999),t>r.getTime())return"text-muted/20 cursor-not-allowed";if(a&&t===a.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})}function _r({selectedView:n,commandInput:a,setFilters:i,handleClose:s,filterGroups:l}){const[o,d]=E([]);if(!n)return null;const c=(e=>{const t=l.find((t=>t.name===e));if(!t)return[];let r=t.options||[];if(!a.trim())return r;if(t.filterBy){const e=a.toLowerCase();return r.filter((r=>void 0!==r.value&&t.filterBy(r.value,e)))}const n=a.toLowerCase();return r.filter((e=>String(e.value||"").toLowerCase().includes(n)))})(n),u=l.find((e=>e.name===n));if(0===c.length)return e($t,{children:"No matching options"});return t(r,{children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:u?.placeholder||u?.name})}),e("div",{className:"max-h-50 overflow-y-auto",children:c.map((r=>{const a=o.some((e=>e.value===r.value));return t(Vt,{className:"group flex gap-2 items-center w-full hover:bg-muted "+(u?.multiple&&a?"bg-muted":""),onSelect:()=>(e=>{const t={value:e.value,label:e.label};if(u?.multiple){const r=o.some((t=>t.value===e.value));d(r?t=>t.filter((t=>t.value!==e.value)):e=>[...e,t])}else i((e=>{const r=e.findIndex((e=>e.name===n));if(r>=0){const n=[...e];return n[r]={...n[r],value:[t]},n}return[...e,{name:n||"",placeholder:u?.placeholder||"",value:[t],type:u?.type||"select",multiple:u?.multiple||!1}]})),s()})(r),children:[e(fr,{value:r.value||"",labelRenderer:r.labelRenderer||u?.labelRenderer,fallbackLabel:r.label}),u?.multiple&&a&&e("span",{className:"ml-auto text-xs text-success",children:"✓"})]},r.value||`option-${Math.random()}`)}))}),u?.multiple&&e("div",{className:"p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>{o.length>0&&i((e=>[...e.filter((e=>e.name!==n)),{name:n||"",placeholder:u?.placeholder||"",value:o,type:u?.type||"select",multiple:u?.multiple||!1}])),s()},disabled:0===o.length,children:"Apply"})]})})]})}function zr({selectedView:r,setFilters:n,handleClose:a,filterGroups:i}){const[s,l]=E([]),o=i.find((e=>e.name===r));return t("div",{className:"p-2 space-y-3",children:[e("div",{className:"space-y-2",children:e(nn,{value:s,onChange:l,placeholder:o?.placeholder||`Add ${r}...`,autoFocus:!0})}),t("div",{className:"flex gap-2 justify-end",children:[e(Ze,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e(Ze,{size:"sm",onClick:()=>{s.length>0&&n((e=>[...e.filter((e=>e.name!==r)),{name:r,placeholder:o?.placeholder,value:s,type:"stringList"}])),a()},disabled:0===s.length,children:"Apply"})]})]})}const Ir=O.createContext({}),Tr=({filters:t,setFilters:r,filterGroups:n,children:a})=>{const i=new URL(window.location.href).searchParams;return F((()=>{try{const e=new URLSearchParams(i.toString());if(t.length>0){const r=t.map((e=>{let t;if("stringList"===e.type&&Array.isArray(e.value)&&"string"==typeof e.value[0])t=`[${e.value.map((e=>encodeURIComponent(e))).join(",")}]`;else if(Array.isArray(e.value))if(e.multiple||e.value.length>1)t=`[${e.value.map((e=>encodeURIComponent(e.value||""))).join(",")}]`;else{const r=e.value[0];t="string"==typeof r?encodeURIComponent(r):encodeURIComponent(r?.value||"")}else t=encodeURIComponent(e.value||"");return`${encodeURIComponent(e.name)}:${t}`})).join(";");e.set("filters",r)}else e.delete("filters");const r=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",r)}catch(e){console.error("Failed to update URL with filters:",e)}}),[t]),F((()=>{const e=i.get("filters");if(e)try{const t=e.split(";").map((e=>{const[t,r]=e.split(":"),a=decodeURIComponent(t);let i;if(r.startsWith("[")&&r.endsWith("]")){const e=r.slice(1,-1);i=e?e.split(",").map((e=>decodeURIComponent(e))):[]}else i=[decodeURIComponent(r)];const s=n.find((e=>e.name===a));let l;return l="stringList"===s?.type?i:"text"===s?.type?1===i.length?[{value:i[0],label:i[0]}]:i.map((e=>({value:e,label:e}))):i.map((e=>{const t=s?.options?.find((t=>t.value===e));let r=e;return t?.label?r=String(t.label):t?.labelRenderer?r=String(t.labelRenderer(e)):s?.labelRenderer&&(r=String(s.labelRenderer(e))),{value:e,label:r}})),{name:a,type:s?.type||"select",placeholder:s?.placeholder,value:l,multiple:s?.multiple||!1}}));r(t)}catch(e){console.error("Failed to parse filters from URL:",e)}}),[]),e(Ir.Provider,{value:{filters:t,setFilters:r,filterGroups:n},children:a})},Lr=({className:r})=>{const{filters:n,setFilters:a,filterGroups:i}=O.useContext(Ir),[s,l]=O.useState(!1),[o,d]=O.useState(null),[c,u]=O.useState(""),m=O.useRef(null),[h,p]=O.useState(),[f,g]=O.useState(""),x=()=>{l(!1),setTimeout((()=>{d(null),u(""),p(void 0)}),200)};return t(Lt,{_open:s,onOpenChange:e=>{l(e),e||setTimeout((()=>{d(null),u(""),g("")}),200)},children:[e(Rt,{asChild:!0,children:t(Ze,{variant:"outline",role:"combobox","aria-expanded":s,size:"md",className:Ne("transition group flex gap-1.5",r),children:[e(N,{className:"size-4 shrink-0 transition-all text-muted"}),"Filter"]})}),e(St,{className:"w-[300px] p-0",align:"start",children:t(At,{children:["select"===i.find((e=>e.name===o))?.type&&e(Ft,{placeholder:o?`Filter by ${o}`:"Filter...",className:"h-9 ring-0",value:c,onValueChange:e=>{u(e)},ref:m,autoFocus:!0}),e(Pt,{className:"max-h-[300px] overflow-y-auto",children:e(jt,{children:o?(()=>{if(!o)return null;const t=i.find((e=>e.name===o))?.type;switch(t){case"date":return e(Cr,{selectedView:o,selectedDate:h,setSelectedDate:p,setFilters:a,filters:n,handleClose:x,filterGroups:i});case"text":return e(kr,{selectedView:o,textValue:f,setTextValue:g,setFilters:a,handleClose:x,filterGroups:i});case"stringList":return e(zr,{selectedView:o,setFilters:a,handleClose:x,filterGroups:i});default:return e(_r,{selectedView:o,commandInput:c,setFilters:a,handleClose:x,filterGroups:i})}})():(()=>{let t=i.map((e=>({...e,options:(e.options??[]).filter((t=>!n.some((r=>"date"===r.type?r.name===e.name:r.name===e.name&&(Array.isArray(r.value)&&"string"==typeof r.value[0]?r.value.some((e=>e===t.value)):r.value.some((e=>e.value===t.value)))))))}))).filter((e=>(e.options??[]).length>0||"date"===e.type&&!n.some((t=>t.name===e.name))||"text"===e.type&&!n.some((t=>t.name===e.name))||"stringList"===e.type&&!n.some((t=>t.name===e.name))));return 0===t.length?e($t,{children:"No available filters"}):t.map(((t,r)=>e(Vt,{onSelect:()=>{return e=t.name,d(e),u(""),void m.current?.focus();var e},className:"group flex gap-2 items-center hover:bg-muted",children:e("span",{children:t.placeholder??t.name})},r)))})()})})]})})]})},Mr=({className:t})=>{const{filters:r,setFilters:n,filterGroups:a}=O.useContext(Ir);return e("div",{className:Ne(t),children:e(Nr,{filters:r,setFilters:n,filterGroups:a})})},Rr=({className:t})=>{const{filters:r,setFilters:n}=O.useContext(Ir);return r.filter((e=>e.value?.length>0)).length>0?e(Ze,{variant:"outline",size:"xs",className:Ne("transition group",t),onClick:()=>n([]),children:"Clear All"}):null};var Or;!function(e){e.IS="is",e.IS_NOT="is_not",e.CONTAINS="contains",e.BEFORE="before",e.AFTER="after",e.IS_ANY_OF="is_any_of"}(Or||(Or={}));const Sr=P((({className:t,level:r=3,...n},a)=>e(`h${r}`,{ref:a,className:Ne({h1:"text-2xl font-medium tracking-tight",h2:"text-xl font-medium tracking-tight",h3:"text-lg font-medium",h4:"text-base font-medium",h5:"text-sm font-medium",h6:"text-xs font-medium"}[`h${r}`],"mb-2",t),...n})));Sr.displayName="Heading";const Dr=n("text-foreground",{variants:{size:{xl:"text-base md:text-lg leading-relaxed",lg:"text-base leading-relaxed",default:"text-sm leading-normal",sm:"text-sm leading-normal",xs:"text-xs leading-normal"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold"}},defaultVariants:{size:"default",weight:"normal"}}),Ar=P((({className:t,size:r,weight:n,...a},i)=>e("p",{ref:i,className:Ne(Dr({size:r,weight:n,className:t})),...a})));function Er({title:r,content:n,onConfirm:a,onCancel:i,isOpen:s}){const l=A(null);return t(ht,{isOpen:s,onClose:i,description:"Confirm Modal",children:[t("div",{className:"sm:flex sm:items-start p-2",children:[e("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:e(k,{className:"size-6 text-red-600","aria-hidden":"true"})}),t("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[e(pt,{className:"leading-6",show:!0,children:r}),e("div",{className:"mt-2",children:e("div",{className:"prose text-sm text-gray-500",children:n})})]})]}),t(gt,{align:"right",children:[e(Ze,{variant:"destructive",onClick:a,children:"Confirm"}),e(Ze,{variant:"outline",onClick:i,ref:l,children:"Cancel"})]})]})}function Fr(){return D(Pr)}Ar.displayName="Text";const Pr=S((()=>{})),$r="--tailwind-portal";function jr({children:t}){const r=A(null),[n,a]=E(null);return F((()=>{if(r.current){const e=r.current.ownerDocument;let t=e.getElementById($r);t||(t=e.createElement("DIV"),t.id=$r,e.body.appendChild(t)),a(t)}}),[r.current]),n?B(t,n):e("span",{ref:r})}const Yr={success:I,error:z,warning:_,info:C},Vr={success:"text-success",error:"text-destructive",warning:"text-attention",info:"text-info"};function Br({data:r,onClose:n}){const[a,i]=E(!0),s=A(null),l=()=>{s.current&&globalThis.clearTimeout(s.current),r.duration&&(s.current=setTimeout((()=>i(!1)),r.duration))},o=()=>{s.current&&(globalThis.clearTimeout(s.current),s.current=null)};F((()=>(l(),o)),[r.duration]);const d=Yr[r.status]||C,c=Vr[r.status]||"text-info";return e("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100",children:e("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:e(ae,{appear:!0,show:a,as:$,afterLeave:n,enter:"transform ease-out duration-700 transition",enterFrom:"translate-y-0 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-2 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border",onMouseEnter:o,onMouseLeave:l,children:e("div",{className:"p-5",children:t("div",{className:"flex items-start",children:[e("div",{className:"shrink-0",children:e(d,{className:`size-6 ${c}`,"aria-hidden":"true"})}),t("div",{className:"ml-3 flex-1 pt-0.5 min-w-0",children:[e("p",{className:"text-sm font-semibold text-foreground break-words",children:r.title}),r.description&&e("p",{className:"mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed",children:r.description})]}),e("div",{className:"ml-4 flex shrink-0",children:t("button",{type:"button",className:"inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",onClick:()=>i(!1),children:[e("span",{className:"sr-only",children:"Close"}),e(f,{className:"size-5","aria-hidden":"true"})]})})]})})})})})})}function Ur({children:n}){const[a,i]=E(null),s=e=>{i(e)};return t(r,{children:[e(Pr.Provider,{value:s,children:n}),a&&e(jr,{children:e(Br,{data:a,onClose:()=>s(null)})})]})}function Hr({idToDelete:t,title:r,content:n,setIdToDelete:a,deleteApi:i}){const s=Fr();return e(Er,{title:r,content:n,isOpen:!!t,onConfirm:async()=>{if(t)return i(t).then((()=>{s({title:"Delete succeeded",status:"success"})})).catch((e=>{s({title:"Failed to delete",description:e.message??"An error occurred while deleting the object",status:"error"})})).finally((()=>{a(void 0)}))},onCancel:()=>{a(void 0)}})}function Gr({className:t}){return e("hr",{className:a("w-full h-0.5 border-t-0 bg-border",t)})}function Wr({trigger:r,children:n}){return t(ie,{as:"div",className:"relative",children:[e(se,{as:"span",className:"-m-1.5 flex items-center p-1.5",children:r}),e(ae,{as:$,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e(le,{className:"absolute right-0 z-10 mt-2.5 w-48 origin-top-right rounded-md bg-white dark:bg-slate-900 dark:border-slate-800 dark:border py-2 shadow-lg ring-1 ring-gray-900/5 dark:ring-slate-200/5 focus:outline-hidden",children:n})})]})}function Kr({children:t,href:r="#",onClick:n,closeOnClick:i=!0,isDisabled:s=!1}){return e(oe,{disabled:s,children:({active:l,close:o})=>e("a",{href:r,onClick:e=>{e.preventDefault(),e.stopPropagation(),n&&n(e),i&&o()},className:a(l?"bg-gray-50 dark:bg-slate-800":"",s?"opacity-50 cursor-not-allowed":"","block px-3 py-1 text-sm leading-6 text-gray-900 dark:text-gray-200"),children:t})})}function Jr({items:r,value:n,onChange:i}){return e(de,{value:n,onChange:i,children:({open:i})=>t("div",{className:"relative",children:[t("div",{className:"inline-flex divide-x divide-indigo-700 rounded-md shadow-2xs",children:[t("div",{className:"inline-flex items-center gap-x-1.5 rounded-l-md bg-indigo-600 px-3 py-2 text-white shadow-2xs",children:[n.name&&e(c,{className:"-ml-0.5 size-5","aria-hidden":"true"}),e("p",{className:"text-sm font-semibold",children:n.name||""})]}),t(ce,{className:"inline-flex items-center rounded-l-none rounded-r-md bg-indigo-600 p-2 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-gray-50",children:[e("span",{className:"sr-only",children:"Change selection"}),e(T,{className:"size-5 text-white","aria-hidden":"true"})]})]}),e(ae,{show:i,as:$,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e(ue,{className:"absolute right-0 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:r.map((r=>e(me,{className:({active:e})=>a(e?"bg-indigo-600 text-white":"text-gray-900","cursor-default select-none p-4 text-sm"),value:r,children:({selected:n,active:i})=>t("div",{className:"flex flex-col",children:[t("div",{className:"flex justify-between",children:[e("p",{className:n?"font-semibold":"font-normal",children:r.name}),n?e("span",{className:i?"text-white":"text-indigo-600",children:e(c,{className:"size-5","aria-hidden":"true"})}):null]}),e("p",{className:a(i?"text-indigo-200":"text-gray-500","mt-2"),children:r.description})]})},r.id)))})})]})})}function Zr({buttonLabel:r,title:n,children:a,onClick:i}){return e("div",{className:"flex items-center justify-center h-full text-center",children:t("div",{className:"py-12",children:[e("svg",{className:"mx-auto size-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),e("h3",{className:"mt-2 text-sm font-semibold",children:n}),e("p",{className:"mt-1 text-sm text-muted",children:a}),e("div",{className:"mt-6",children:t(G,{onClick:i,children:[e(L,{className:"-ml-0.5 mr-1.5 size-5","aria-hidden":"true"}),r]})})]})})}function qr({children:r,onUpload:n}){const a=A(null);return t("label",{style:{cursor:"pointer"},children:[r,e("input",{ref:a,type:"file",style:{display:"none"},onChange:()=>{a.current?.files&&n(function(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}(a.current.files))}})]})}function Xr({onUpload:r}){const n=Qr({onUpload:r});return e("div",{...n,className:"flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:t("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-full",children:[t("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),t("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[e("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),e("input",{id:"dropzone-file",type:"file",className:"hidden"})]})})}function Qr({onUpload:e,dragOverClass:t="is-drag-over-on",dropEffect:r="copy"}){const n=A(null);return{onDrop:r=>{r.preventDefault(),delete n.current.__dragOver_cnt__,n.current?.classList.remove(t);const a=r.dataTransfer.items;if(a){const t=[],r=(e,t="")=>new Promise((n=>{if(e.isFile)e.file((e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),n([e])}));else if(e.isDirectory){const a=e.createReader(),i=[],s=()=>{a.readEntries((a=>{if(a.length){for(const n of a)i.push(r(n,t+e.name+"/"));s()}else Promise.all(i).then((e=>n(e.flat())))}))};s()}}));for(let e=0;e<a.length;e++){const n=a[e].webkitGetAsEntry();n&&t.push(r(n))}Promise.all(t).then((t=>{const r=t.flat();r.length&&e(r)}))}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=r},onDragEnter:()=>{(function(e){let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t})(n.current)&&n.current?.classList.add(t)},onDragLeave:()=>{(function(e){let t=e.__dragOver_cnt__;return!!t&&(e.__dragOver_cnt__=t-1,1===t)})(n.current)&&n.current?.classList.remove(t)},ref:n}}function en({description:r,required:n,label:i,className:s,direction:l="column",children:o,disabled:d=!1}){return t("div",{className:a("flex w-full space-y-1",s,"row"===l?"flex-row justify-between items-center gap-2":"flex-col"),children:[t("div",{className:"flex items-center gap-1",children:[t("label",{className:"text-sm font-medium mb-1 "+(d?"text-muted":""),children:[i,n?e("span",{className:"text-destructive -mt-4 ml-1",children:"*"}):""]}),r&&e("div",{className:"mx-2 flex w-4 items-center",children:e(rr,{description:r,children:e(C,{className:"size-3 text-muted"})})})]}),o]})}const tn="rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",rn={INPUT_UNSTYLED:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",INPUT_NO_PADDING:tn,INPUT:tn+" py-1.5"};function nn({value:r=[],onChange:n,className:i,delimiters:s=", ",placeholder:l,autoFocus:o}){const[d,c]=E("");return t("div",{className:a(i,"w-full flex flex-wrap items-center gap-1 p-2",rn.INPUT),children:[r&&r.length>0&&r.map(((t,a)=>e(Ce,{variant:"secondary",onClick:()=>(e=>{r&&r.length>0&&(r.splice(e,1),n([...r]))})(a),className:"cursor-pointer",title:t,children:e("span",{className:"break-all",children:t})},a))),e(zt,{clearable:!1,className:"placeholder:text-muted-foreground px-1 min-w-0 flex-shrink-0 min-w-[120px]",variant:"unstyled",type:"text",value:d,onBlur:e=>{const t=e.target.value;t&&t.trim()&&(n([...r,t.trim()]),c(""))},onKeyDown:e=>{const t=e.target.value,a=!t.trim(),i=e.key;"Enter"===i||s.indexOf(i)>-1?(e.preventDefault(),r&&!a&&(n([...r,t.trim()]),c(""))):"Backspace"===i&&a&&r&&r.length>0&&(r.pop(),n([...r]))},onChange:c,placeholder:r&&0!==r.length?"":l,autoFocus:o})]})}function an({underline:t="always",className:r,children:n,...i}){let s;return"always"===t?s="underline":"hover"===t&&(s="hover:underline"),e("a",{className:a("text-indigo-800 dark:text-indigo-300",r,s),...i,children:n})}function sn({className:t,children:r}){return e("ul",{className:`${t} space-y-1 flex flex-col items-start dark:px-2`,children:r})}const ln=P((function(t,r){const{current:n,children:i,className:s,href:l="#",onClick:o,...d}=t;return e("li",{className:a(s,n?"bg-gray-50 text-indigo-600":"text-gray-700 dark:dark:text-slate-300 hover:text-indigo-600 hover:bg-gray-50 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:border dark:border-transparent dark:hover:border-slate-50","w-full rounded-md p-2 pl-3 text-sm leading-6 font-semibold"),children:e("a",{ref:r,href:l,onClick:e=>{o?(e.preventDefault(),o(e)):"#"===l&&e.preventDefault()},className:"w-full flex items-center gap-x-3",...d,children:i})})}));function on({icon:r,status:n,title:a,children:i,className:s}){let l,o,d,c;switch(n){case"error":l=e(z,{className:"size-5 text-destructive","aria-hidden":"true"}),o="",d="text-foreground",c="bg-destructive border border-destructive";break;case"warning":l=e(_,{className:"size-5 text-attention","aria-hidden":"true"}),o="",d="text-foreground",c="bg-attention border border-attention";break;case"success":l=e(I,{className:"size-5 text-success","aria-hidden":"true"}),o="",d="text-foreground",c="bg-success border border-success";break;case"info":l=e(C,{className:"size-5 text-info","aria-hidden":"true"}),o="",d="text-foreground",c="bg-info border border-info";break;case"default":l=e(C,{className:"size-5 text-muted","aria-hidden":"true"}),o="",d="text-foreground",c="bg-muted border border-muted";break;case"done":l=e(C,{className:"size-5 text-done","aria-hidden":"true"}),o="",d="text-foreground",c="bg-done border border-done"}return e("div",{className:`rounded-md p-4 ${c} ${s}`,children:t("div",{className:"flex",children:[e("div",{className:"shrink-0",children:r??l}),t("div",{className:"w-full ml-2 px-1",children:[a&&e("h3",{className:`text-sm font-medium mb-2 ${o}`,children:a}),e("div",{className:`text-sm ${d} break-words`,children:i})]})]})})}function dn({title:t,className:r,children:n}){return e(on,{status:"error",title:t,className:r,children:e("pre",{children:n})})}function cn({title:t,className:r,children:n}){return e(on,{status:"info",title:t,className:r,children:n})}function un({title:t,className:r,children:n}){return e(on,{status:"warning",title:t,className:r,children:n})}function mn({title:t,className:r,children:n}){return e(on,{status:"success",title:t,className:r,children:n})}function hn({title:t,className:r,children:n}){return e(on,{status:"default",title:t,className:r,children:n})}function pn({className:r,children:n,isOpen:i,onClose:s,noCloseButton:l=!1,allowOverflow:o=!1,disableCloseOnClickOutside:d=!1}){return e(ae,{show:i,as:$,children:t(he,{style:{zIndex:50},as:"div",className:"relative",onClose:d?()=>{}:e=>{e||s()},children:[e(pe,{as:$,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",unmount:!0,children:e("div",{className:"fixed inset-0 bg-gray-500 dark:bg-slate-800 dark:opacity-75 opacity-75 transition-opacity"})}),e("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:e("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:e(pe,{as:$,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t(fe,{className:a("p-0! relative transform rounded-lg bg-white dark:bg-slate-900 text-left dark:text-slate-100 shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-md sm:p-6",o?"overflow-visible":"overflow-hidden",r),children:[!l&&e(fn,{onClose:s}),n]})})})})]})})}function fn({onClose:r}){return e("div",{className:"absolute right-0 top-0 hidden pr-4 pt-4 sm:block",children:t("button",{tabIndex:-1,type:"button",className:"rounded-md bg-white text-gray-400 dark:text-slate-200 dark:bg-slate-800 hover:brightness-95 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 hover:cursor-pointer",onClick:r,children:[e("span",{className:"sr-only",children:"Close"}),e(f,{className:"size-6","aria-hidden":"true"})]})})}function gn({children:t,showDivider:r=!1}){return e("div",{className:r?"border-b-solid border-b border-b-1":"",children:e(ge,{as:"h3",className:"py-4 pl-4 pr-8 text-base font-semibold leading-6 text-gray-900 dark:text-slate-50",children:t})})}function xn({children:t,className:r="justify-end",fill:n=!1}){return e("div",{className:a("w-full flex space-x-2 p-4 border-t-solid border-t-gray-100 dark:border-t-gray-800 border-t",r||"justify-end",n?"bg-gray-100 dark:bg-slate-800":""),children:t})}function vn({children:t,className:r=""}){return e("div",{className:a("p-4",r),children:t})}function bn(e){return null==e||isNaN(e)?"":e.toString()}sn.Item=ln;const yn=O.forwardRef((({value:t,onChange:r,className:n,noScroll:i=!1,noSpinners:s=!1,...l},o)=>{const[d,c]=O.useState(bn(t));return F((()=>{if(null==t||!isNaN(t)){const e=bn(t);c(e)}}),[t]),e("input",{onWheel:i?e=>{e.target.blur()}:l.onWheel,type:"number",value:d,onChange:e=>{const t=e.target.value;if(c(t),""===t)r&&r(void 0,t);else{const e=parseFloat(t);r&&r(e,t)}},className:a(n,rn.INPUT,{"no-spinners":s},s&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),ref:o,...l})}));class wn{renderOption(e){return this.labelOf(e)}findById(e,t){return e.find((e=>this.idOf(e)===t))}}function Nn({checkColor:t,cols:r="grid-cols-1",gap:n="gap-2",value:i,onChange:s,options:l,checkIcon:o=Cn,adapter:d}){const[c,u]=E(i),m=e=>{u(e),s(e)},h=c?d.idOf(c):void 0;return e("div",{className:a("grid",r,n),children:l.map((r=>{const n=d.idOf(r);return e(kn,{checkColor:t,isSelected:n===h,option:r,adapter:d,onSelect:m,CheckIcon:o},n)}))})}function kn({checkColor:r,CheckIcon:n,adapter:a,isSelected:i,option:s,onSelect:l}){const[o,d]=E(!1);return t("div",{className:"flex gap-1 cursor-pointer items-center",onClick:()=>l(s),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[e("div",{className:"",children:e(n,{size:24,isChecked:i,isHighlighted:o,color:r})}),e("div",{children:a.renderOption(s)})]})}function Cn({size:t,isChecked:r,isHighlighted:n,color:a="currentColor"}){const i=n?1:.6;return e("svg",r?{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_checked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 Z M10,14.4393398 L16.4696699,7.96966991 C16.7625631,7.6767767 17.2374369,7.6767767 17.5303301,7.96966991 C17.7965966,8.23593648 17.8208027,8.65260016 17.6029482,8.94621165 L17.5303301,9.03033009 L10.5303301,16.0303301 C10.2640635,16.2965966 9.84739984,16.3208027 9.55378835,16.1029482 L9.46966991,16.0303301 L6.46966991,13.0303301 C6.1767767,12.7374369 6.1767767,12.2625631 6.46966991,11.9696699 C6.73593648,11.7034034 7.15260016,11.6791973 7.44621165,11.8970518 L7.53033009,11.9696699 L10,14.4393398 L16.4696699,7.96966991 L10,14.4393398 Z"})})})}:{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_unchecked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z"})})})})}function _n({size:n,className:i}){const s=function(e){switch(e){case"xs":return"size-2";case"sm":return"size-3";case"md":return"size-4";case"lg":return"size-5";case"xl":return"size-7";case"2xl":return"size-10";default:throw new Error("Unexpected size: "+e)}}(n||"md");return e(r,{children:t("svg",{className:a("animate-[spin_0.8s_linear_infinite] text-indigo-500",s,i),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}const zn={primary:"shadow-2xs bg-indigo-600 text-white hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",secondary:"shadow-2xs bg-white text-gray-900 hover:bg-gray-50 ring-1 ring-inset ring-gray-300",soft:"shadow-2xs bg-indigo-50 text-indigo-600 hover:bg-indigo-100",ghost:"text-indigo-600 hover:bg-indigo-100 dark:text-indigo-400 dark:hover:bg-indigo-900",unstyled:""},In={primary:"text-white",secondary:"text-indigo-500",soft:"text-indigo-600",ghost:"text-indigo-600",unstyled:"text-gray-600"};function Tn({title:r,className:n,type:i="button",children:s,size:l,onClick:o,variant:d="primary",isLoading:c=!1,isDisabled:u=!1}){const m=function(e){switch(e){case"xs":return"rounded-xs px-2 py-1 text-xs gap-x-1";case"sm":return"rounded-xs px-2 py-1 text-sm gap-x-1";case"md":return"rounded-md px-2.5 py-1.5 text-sm gap-x-1.5";case"lg":return"rounded-md px-3 py-2 text-sm gap-x-1.5";case"xl":return"rounded-md px-3.5 py-2.5 text-sm gap-x-2";default:throw new Error("Unexpected size: "+e)}}(l||"md");return t("button",{title:r,disabled:u||c,onClick:o,type:i,className:a("whitespace-nowrap inline-flex items-center justify-center font-semibold hover:cursor-pointer",zn[d],m,u&&"cursor-not-allowed text-gray-300!",n),children:[c&&e(_n,{className:In[d],size:l}),s]})}function Ln({clearTitle:r,ClearIcon:n=f,showFilter:a,filterBy:i,isClearable:s,disabled:l,by:o,options:d,value:c,onChange:u,className:m,addNew:h,addNewLabel:p,placeholder:g,optionLabel:x=e=>String(e),label:v}){const[b,y]=E(),w=A(null),[N,k]=E();F((()=>{if(w.current){const e=new ResizeObserver((e=>{k(e[0].contentRect.width)}));return e.observe(w.current),()=>e.disconnect()}}),[]);const C=e=>{e.preventDefault(),e.stopPropagation(),s&&u(void 0)},_=e=>{y(e.target.value)};let z=d||[];if(void 0===a&&(a=z?.length>=10),a&&b){const e=b.toLowerCase(),t=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(i);z=z.filter((r=>t(r).includes(e)))}const I=e=>{"Escape"!==e.key&&"Enter"!==e.key&&"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&e.stopPropagation()};return e(de,{value:c||null,onChange:u,by:o,disabled:l,children:()=>e("div",{className:"overflow-y-visible "+m,children:t("div",{className:"relative",children:[t(ce,{ref:w,className:"relative w-full cursor-default rounded-md bg-white py-1.5 text-left text-gray-900 shadow-2xs ring-1 ring-inset ring-gray-300 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 sm:text-sm sm:leading-6 hover:cursor-pointer",children:[v&&e("div",{className:"w-full text-gray-500 text-left px-2",children:v}),e("span",{className:"block truncate pl-3 pr-14",children:c?x(c):g}),s&&null!=c&&e("span",{className:"absolute inset-y-0 right-0 mr-5 flex items-center pr-2",onClick:C,children:e(n,{title:r,className:"size-5 text-gray-400 hover:text-red-500 cursor-pointer","aria-hidden":"true"})}),!l&&e("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:e(M,{className:"size-5 text-gray-400","aria-hidden":"true"})})]}),t(ue,{anchor:"bottom",style:{width:N,zIndex:1e8},className:"absolute z-10 mt-1 overflow-auto rounded-md bg-white dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 py-1 text-base shadow-lg ring-1 ring-gray-300 ring-opacity-5 focus:outline-hidden sm:text-sm",children:[a&&e("div",{className:"p-1",children:e("input",{type:"text",value:b||"",onKeyDown:I,onChange:_,className:"w-full p-1 border border-gray-300 rounded-md dark:bg-slate-700 dark:text-slate-50",placeholder:"Filter..."})}),e("div",{className:"overflow-y-auto max-h-60",children:z.map(((t,r)=>e(Mn,{option:t,optionLabel:x,className:"hover:cursor-pointer"},r)))}),h&&e(Te,{className:"font-semibold py-2 border-t",children:e(Tn,{variant:"secondary",onClick:h,children:p})})]})]})})})}function Mn({option:n,optionLabel:i,onClick:s,className:l}){return e(me,{className:({active:e})=>a(e?"bg-indigo-600 text-white dark:bg-indigo-800 dark:text-white":"text-gray-900 dark:text-slate-50","relative cursor-default select-none py-2 pl-3 pr-9",l),value:n,onClick:s,children:({selected:s,active:l})=>t(r,{children:[e("div",{className:a(s?"font-semibold":"font-inherit","block truncate"),children:i(n)}),s?e("div",{className:a(l?"text-white":"text-indigo-600","absolute inset-y-0 right-0 flex items-center pr-4"),children:e(c,{className:"size-5","aria-hidden":"true"})}):null]})})}function Rn(t,r){return{label:String(t),check:e(r?c:"div",{className:"size-4"}),reverse:!1,className:"flex-1 px-2 py-2 hover:bg-accent nowrap"}}function On({value:t,options:r,onChange:n,className:i,optionLayout:s,by:l,noCheck:o}){const[d,c]=E(t),u=e=>{c(e),n(e)},m=j((()=>"string"==typeof l?(e,t)=>e[l]===t[l]:l||((e,t)=>e===t)),[l]);return e("div",{className:a("",i),children:r.map(((t,r)=>{const n=!!d&&m(d,t);let a;return s?(a=s(t,n),a=Object.assign(Rn(t,n),a)):a=Rn(t,n),e(Sn,{option:t,onSelect:u,layout:a,noCheck:o},r)}))})}function Sn({option:r,onSelect:n,layout:i,noCheck:s}){return t("div",{className:a("group flex items-center cursor-pointer gap-x-2 hover:bg-muted",i.reverse&&"flex-row-reverse",i.className),onClick:()=>n(r),children:[s?null:e("div",{className:"",children:i.check}),e("div",{className:"flex-1",children:i.label})]})}function Dn({onSelect:n,selected:i,options:s}){return t(xe,{value:i,onChange:n,children:[e(xe.Label,{className:"sr-only",children:"Server size"}),e("div",{className:"space-y-4",children:s.map((n=>e(xe.Option,{value:n,className:({active:e})=>a(e?"border-border ring-2 ring-ring":"border-border","relative block cursor-pointer rounded-lg border bg-accent px-6 py-4 shadow-2xs focus:outline-hidden sm:flex sm:justify-between"),children:({active:i,checked:s})=>t(r,{children:[e("span",{className:"flex items-center",children:t("span",{className:"flex flex-col text-sm",children:[e(xe.Label,{as:"span",className:"font-medium text-text",children:n.label}),n.description&&e(xe.Description,{as:"span",className:"text-muted-foreground",children:n.description})]})}),e("span",{className:a(i?"border":"border-2",s?"border-accent-foreground":"border-transparent","pointer-events-none absolute -inset-px rounded-lg"),"aria-hidden":"true"})]})},n.id)))})]})}function An({isOpen:r,title:n,onClose:a,children:i}){const[s,l]=E(768);return e(ae,{show:r,as:$,children:t(he,{as:"div",className:"relative z-10",onClose:a,children:[e("div",{className:"fixed inset-y-0 right-0"}),e("div",{className:"fixed inset-y-0 right-0 overflow-hidden",children:e("div",{className:"absolute inset-0 overflow-hidden",children:e("div",{className:"pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16",children:e(pe,{as:$,enter:"transform transition ease-in-out duration-500 sm:duration-700",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transform transition ease-in-out duration-500 sm:duration-700",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",unmount:!0,children:e(fe,{className:"pointer-events-auto border-l",style:{width:`${s}px`},children:t("div",{className:"relative flex h-full",children:[e("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-ew-resize hover:bg-indigo-500 transition-colors",onMouseDown:e=>{e.preventDefault();let t=!0;const r=e.pageX,n=s,a=e=>{if(t){const t=r-e.pageX,a=Math.max(n+t,480);l(a)}},i=()=>{t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)}}),t("div",{className:"flex-1 flex flex-col overflow-y-scroll gap-4 bg-background py-6 shadow-xl",children:[e("div",{className:"px-4 sm:px-6",children:t("div",{className:"flex items-start justify-between",children:[e(ge,{className:"w-full text-base font-semibold leading-6",children:e("div",{className:"text-2xl",children:n??""})}),e("div",{className:"ml-3 flex h-7 items-center",children:e(En,{onClose:a})})]})}),e("div",{className:"px-4 sm:px-6",children:i})]})]})})})})})})]})})}function En({onClose:t}){return e(Ze,{alt:"Close panel",variant:"ghost",onClick:t,children:e(f,{className:"size-6","aria-hidden":"true"})})}const Fn={sm:["h-5 w-8","size-3","translate-x-4"],md:["h-6 w-11","size-4","translate-x-6"],lg:["h-8 w-16","size-6","translate-x-9"]};function Pn({value:r,onChange:n,size:a="md",children:i,className:s,disabled:l}){const o=Fn[a];return t(ve,{checked:r,onChange:()=>n(!r),className:`flex items-center ${s} ${l?"cursor-not-allowed opacity-50":"hover:cursor-pointer"}`,children:[e("div",{className:`${r?"bg-primary":"bg-muted/50"} relative inline-flex ${o[0]} items-center rounded-full border-1`,children:e("span",{className:`${r?o[2]:"translate-x-1"} inline-block ${o[1]} transform rounded-full bg-white transition`})}),i&&e("span",{className:"px-2",children:i})]})}function $n({className:t,children:r,...n}){return e("table",{className:a("\ndivide-y divide-border\n[&>tbody]:divide-y [&>tbody]:divide-border\n[&_th]:text-left [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted-foreground\n[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm\n",t),...n,children:r})}function jn({columns:t}){return e("tr",{className:"hover:bg-muted",children:Array(t).fill(0).map(((t,r)=>e("td",{children:e("div",{className:"animate-pulse rounded-xs h-5 bg-gray-200 dark:bg-gray-600"})},r)))})}function Yn({isLoading:t=!1,columns:r,rows:n=3,children:a}){return e("tbody",{children:t?Array(n).fill(0).map(((t,n)=>e(jn,{columns:r},n))):a})}function Vn({className:t,children:r,...n}){return e("tr",{className:a("hover:bg-muted hover:cursor-pointer",t),...n,children:r})}function Bn(){return D(Un)}const Un=S({});function Hn(e,t){const r="function"==typeof t?t():t;let n=null;const a=[];for(const t of e){const e={...t};e.current=!1,a.push(e),e.name===r&&(n=e)}return n||(n=a[0]),n.current=!0,a}function Gn({current:t,onSelect:r,tabs:n,children:a,navigate:i}){const[s,l]=E([]);F((()=>{l(Hn(n,t))}),[t,n]);const o={tabs:s,select:e=>{r&&!1===r(e)||(e.href?i?i(e.href):window.location.href=e.href:l([...Hn(s,e.name)]))}};return e(Un.Provider,{value:o,children:e("div",{className:"flex flex-col h-full",children:a})})}function Wn({actions:r,className:n}){const{tabs:i,select:s}=Bn();return t("div",{className:"border-b flex items-start justify-between",children:[e("nav",{className:"flex space-x-4 px-4","aria-label":"Tabs",children:i.map((t=>{const r=t.disabled?"cursor-not-allowed":"cursor-pointer";return e("a",{href:t.href||"#"+t.name,onClick:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),!t.disabled&&s(t)})(e,t),className:a(t.current?"border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-50":"border-transparent text-gray-500 dark:text-slate-300 hover:border-slate-400 hover:text-gray-700 dark:hover:border-slate-200 dark:hover:text-gray-200 ",n,"whitespace-nowrap border-b-2 py-2 px-1 text-sm font-medium",r),"aria-current":t.current?"page":void 0,children:t.label},t.name)}))}),e("div",{className:"flex gap-x-1",children:r})]})}function Kn({}){const{tabs:t}=Bn(),r=t.find((e=>e.current))?.content;if(!r)return null;if(Y(r))return e("div",{className:"h-full overflow-y-auto flex-1",children:r});return e("div",{className:"h-full overflow-y-auto flex-1",children:e(r,{})})}const Jn=O.forwardRef((({unstyled:t,value:r,onChange:n,className:i,...s},l)=>{const[o,d]=E(r||"");return e("textarea",{ref:l,...s,className:a("w-full",t?rn.INPUT_UNSTYLED:rn.INPUT,i),value:o,onChange:e=>{const t=e.target.value;d(t),n&&n(t)}})}));class Zn{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter((t=>t!==e))}}}function qn(e){const t=O.createContext(void 0);return e.Context=t,t.Provider}class Xn{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e&&e(this.current),this}}function Qn(e){const t=e.Context;if(!t)throw new Error("Context not defined for "+e.name);return D(t)}function ea(e){const[t,r]=E(e.value);return F((()=>e.watch((e=>{r("function"==typeof e?()=>e:e)}))),[e]),t}function ta(e,t){return F((()=>(e.value=t,()=>{e.value=void 0})),[e,t]),t}function ra(e,t){F((()=>e.watch(t)),[e,t])}function na(e){const[t,r]=E(e.current);return F((()=>(e.withConsumer(r),()=>{e.withConsumer(void 0)})),[e]),t}function aa(e,t){F((()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)})),[e,t])}function ia(e,t){F((()=>(e.current=t,()=>{e.current=void 0})),[e,t])}class sa{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter((t=>t!==e))}}}function la(e){const[t,r]=E(e.value);return F((()=>e.addWatcher((e=>{r("function"==typeof e?()=>e:e)}))),[e]),t}function oa(e,t){const r=A(null);return F((()=>{const n=n=>{r.current&&!r.current.contains(n.target)&&(t&&t(n)||e(n))};return window.setTimeout((()=>{document.addEventListener("click",n)}),0),()=>{document.removeEventListener("click",n)}}),[]),r}function da(){const[e,t]=E(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn("Copy failed",e),t(null),!1}}]}function ca(e){F((()=>{const t=window.matchMedia("(prefers-color-scheme: dark)"),r=t=>e(t.matches);return t.addEventListener("change",r),e(t.matches),()=>t.removeEventListener("change",r)}),[])}function ua(e,t){const[r,n]=E(e);return F((()=>{const r=setTimeout((()=>{n(e)}),t);return()=>{clearTimeout(r)}}),[e,t]),r}function ma(e,t,r){const n=[],a=new EventSource(e);return a.addEventListener("message",(e=>{const r=JSON.parse(e.data);r&&(n.push(r),t(n.join("")))})),a.addEventListener("close",(e=>{a.close();const t=JSON.parse(e.data);r(t)})),()=>{a.close()}}function ha(e,t,r){F((()=>{"function"==typeof e?e().then((e=>ma(e,t,r))):ma(e,t,r)}),[e])}function pa(e,t){Array.isArray(t)&&(t={deps:t});const r=t||{},[n,a]=E(null),[i,s]=E(!1),[l,o]=E(r.defaultValue),d=()=>(r.start&&r.start(),s(!0),e().then((e=>{o(e),r.onSuccess&&r.onSuccess(e)})).catch((e=>{a(e),r.onError&&r.onError(e)})).finally((()=>{s(!1),r.end&&r.end()})));return F((()=>{r.condition&&!r.condition()||d()}),r.deps),{data:l,isLoading:i,error:n,setData:o,refetch:d}}function fa(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),pa(e,t)}function ga(e=!1){const[t,r]=E(e);return{isOn:t,isOff:!t,set:e=>r(e),on:()=>r(!0),off:()=>r(!1),toggle:()=>r(!t)}}function xa(e,t,r={}){F((()=>{const n=new IntersectionObserver((e=>{const n=e[0].isIntersecting;r.leave?n||t(e[0]):n&&t(e[0])}),{threshold:r.threshold||1});return e.current&&n.observe(e.current),()=>{e.current&&n.unobserve(e.current)}}),r.deps?r.deps.concat(e):[e])}function va(){const e=A(!0);return F((t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0})),[]),e.current}const ba="undefined"!=typeof window?V:F;class ya{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}}function wa(e){const t=E(e);return new ya(t)}function Na(...e){return s(i(e))}export{hr as AnimateChangeInHeight,ye as Avatar,Ce as Badge,ir as Breadcrumbs,Ze as Button,nt as Card,lt as CardContent,st as CardDescription,ot as CardFooter,at as CardHeader,it as CardTitle,Te as Center,pr as Checkbox,Be as ComboBox,At as Command,Et as CommandDialog,$t as CommandEmpty,jt as CommandGroup,Ft as CommandInput,Vt as CommandItem,Pt as CommandList,Yt as CommandSeparator,Bt as CommandShortcut,Er as ConfirmModal,qe as CopyButton,Fe as DOMPopup,vr as DateCombobox,hn as DefaultBox,Hr as DeleteModal,xt as Dialog,yt as DialogClose,Nt as DialogContent,kt as DialogDescription,wt as DialogOverlay,bt as DialogPortal,Ct as DialogTitle,vt as DialogTrigger,Gr as Divider,Ie as DotBadge,Xr as DropZone,Wr as Dropdown,Jr as DropdownList,Zr as EmptyCollection,dn as ErrorBox,qr as FileUploadInput,Mr as FilterBar,Lr as FilterBtn,Rr as FilterClear,Or as FilterOperator,Tr as FilterProvider,en as FormItem,Sr as Heading,cn as InfoBox,zt as Input,nn as InputList,ar as Label,an as Link,Mn as ListOption,Kr as MenuItem,sn as MenuList,on as MessageBox,pn as Modal,vn as ModalBody,mt as ModalContextProvider,xn as ModalFooter,gn as ModalTitle,rt as ModeToggle,yn as NumberInput,$e as OptionAdapter,Lt as Popover,Ot as PopoverAnchor,Dt as PopoverClose,St as PopoverContent,Rt as PopoverTrigger,Pe as Popup,De as PopupController,jr as Portal,Zn as Property,Nn as RadioGroup,wn as RadioOptionAdapter,jn as RowSkeleton,Ln as SelectBox,On as SelectList,Dn as SelectStack,gr as SelectionCombobox,It as Separator,sa as SharedState,ya as SharedValue,An as SidePanel,Xn as Slot,_n as Spinner,yr as StringListCombobox,je as StringOptionAdapter,Ye as StringOptionAdapterWithCreate,rn as Styles,mn as SuccessBox,we as SvgAvatar,Pn as Switch,Yn as TBody,Vn as TR,$n as Table,Gn as Tabs,Wn as TabsBar,qt as TabsContent,Un as TabsContext,Jt as TabsList,Kn as TabsPanel,Zt as TabsTrigger,Ar as Text,br as TextCombobox,Jn as Textarea,Qe as ThemeProvider,Xe as ThemeProviderContext,Pr as ToastContext,Ur as ToastProvider,Qt as Tooltip,tr as TooltipContent,Xt as TooltipProvider,er as TooltipTrigger,ht as VModal,ft as VModalBody,gt as VModalFooter,pt as VModalTitle,Ut as VSelectBox,Gt as VTabs,Wt as VTabsBar,Kt as VTabsPanel,rr as VTooltip,un as WarningBox,Je as buttonVariants,Na as cn,Re as computePosition,qn as createCompositeStateProvider,Ve as getDefaultComboBoxLayout,oa as useClickOutside,We as useComboboxCtrl,Qn as useCompositeState,da as useCopyToClipboard,ca as useDarkMode,ua as useDebounce,ia as useDefineSlot,Qr as useDropZone,ha as useEventSource,pa as useFetch,fa as useFetchOnce,ga as useFlag,ea as useGetCompositeStateProperty,xa as useIntersectionObserver,va as useIsFirstRendering,ut as useIsInModal,Ee as usePopupController,ba as useSafeLayoutEffect,ta as useSetCompositeStateProperty,wa as useSharedValue,na as useSlot,Bn as useTabs,Fr as useToast,ra as useWatchCompositeStateProperty,la as useWatchSharedState,aa as useWatchSlot};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";import a,{clsx as i}from"clsx";import{twMerge as s}from"tailwind-merge";import{ChevronUpIcon as l,ChevronDownIcon as o,Loader2 as c,Check as d,CopyIcon as u,Computer as m,Sun as h,Moon as p,X as f,Search as g,ChevronsUpDown as x,SearchIcon as v,SquarePlus as b,ChevronRight as y,MoreHorizontal as w,ListFilter as N,TriangleAlert as C,Info as k,AlertTriangle as _,CircleX as z,CircleCheck as I,ChevronDown as T,Plus as L,ChevronsUpDownIcon as M}from"lucide-react";import*as R from"react";import O,{createContext as S,useContext as D,useRef as A,useState as $,useEffect as E,forwardRef as P,Fragment as F,useMemo as j,isValidElement as Y,useLayoutEffect as V}from"react";import{createPortal as B}from"react-dom";import{Slot as U}from"@radix-ui/react-slot";import{VTooltip as H,Button as G}from"@vertesia/ui/core";import*as W from"@radix-ui/react-dialog";import*as K from"@radix-ui/react-separator";import{isEqual as J}from"lodash-es";import*as Z from"@radix-ui/react-popover";import{Command as q}from"cmdk";import*as X from"@radix-ui/react-tabs";import*as Q from"@radix-ui/react-tooltip";import*as ee from"@radix-ui/react-label";import*as te from"@radix-ui/react-checkbox";import ne from"dayjs";import re from"react-calendar";import{Transition as ae,Menu as ie,MenuButton as se,MenuItems as le,MenuItem as oe,Listbox as ce,ListboxButton as de,ListboxOptions as ue,ListboxOption as me,Dialog as he,TransitionChild as pe,DialogPanel as fe,DialogTitle as ge,RadioGroup as xe,Switch as ve}from"@headlessui/react";import{motion as be,AnimatePresence as ye}from"framer-motion";function we(e){switch(e){case"xs":return"size-4";case"sm":return"size-6";case"md":return"size-8";case"lg":return"size-10";case"xl":return"size-12";case"2xl":return"size-14";default:throw new Error("Unexpected size: "+e)}}function Ne({size:t,src:n,name:r,shape:a="circle",color:i="bg-gray-500",className:s}){const l="circle"===a?"rounded-full":"rounded-md",o=we(t||"md");if(n)return e("img",{className:`inline-block ${o} ${l} ${i} ${s}`,src:n,alt:r||n,title:r});if(r){const[n,a]=r.split(" ");let c=a?`${n[0]}${a[0]}`:`${n[0]}${n[1]}`;return e("span",{className:`inline-flex ${o} items-center justify-center ${l} ${i} ${s}`,title:r,children:e("span",{className:("xs"!=t?"text-xs":"text-[0.6rem]")+" font-medium leading-none text-white",children:c})})}return e("span",{className:`inline-block ${o} overflow-hidden ${l} ${i}`,children:e("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:e("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})})}function Ce({size:t,shape:n="circle",color:r="bg-gray-500",className:a,children:i}){const s="circle"===n?"rounded-full":"rounded-md",l=we(t||"md");return e("span",{className:`inline-block ${l} overflow-hidden ${s} ${r} ${a}`,children:i})}function ke(...e){return s(i(e))}const _e=r("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium",{variants:{variant:{default:"text-foreground bg-muted",secondary:"bg-secondary text-primary",destructive:"bg-destructive text-destructive",attention:"bg-attention text-attention",success:"bg-success text-success",info:"bg-info text-info",done:"bg-done text-done"}},defaultVariants:{variant:"default"}});function ze({className:t,variant:n,children:r,onClick:a,...i}){return e("span",{className:ke(_e({variant:n}),t),onClick:a,...i,children:r})}const Ie=r("inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border",{variants:{variant:{default:"",success:"",destructive:"",attention:"",done:"",info:""}},defaultVariants:{variant:"default"}}),Te=r("h-1.5 w-1.5",{variants:{variant:{default:"fill-foreground",success:"fill-success",destructive:"fill-destructive",attention:"fill-attention",done:"fill-done",info:"fill-info"}},defaultVariants:{variant:"default"}});function Le({variant:n,className:r,dotClassName:a,children:i,...s}){return t("span",{className:ke(Ie({variant:n}),r),...s,children:[e("div",{className:"flex-shrink-0",children:e("svg",{className:ke(Te({variant:n}),a),viewBox:"0 0 6 6","aria-hidden":"true",children:e("circle",{cx:3,cy:3,r:3})})}),e("span",{className:"truncate",children:i})]})}function Me({className:t,children:n}){return e("div",{className:a("flex items-center justify-center",t),children:n})}class Re{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case"top":this.top=t.top-n.height-this.gap,this.alignAxis="x";break;case"bottom":this.top=t.bottom+this.gap,this.alignAxis="x";break;case"left":this.left=t.left-n.width-this.gap,this.alignAxis="y";break;case"right":this.left=t.right+this.gap,this.alignAxis="y";break;case"ne":this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case"nw":this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case"se":this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case"sw":this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case"start":"x"===this.alignAxis?this.left=t.left:this.top=t.top;break;case"end":"x"===this.alignAxis?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case"center":"x"===this.alignAxis?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case"fill":"x"===this.alignAxis?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw new Error("Invalid position. Cannot compute x,y coordinates");const r=null!=this.width,a=null!=this.height,i=r?this.width:t.width,s=a?this.height:t.height;return{rect:new DOMRect(this.left,this.top,i,s),constrainWidth:r,constrainHeight:a,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){const t=function(e){switch(e){case"start":return"end";case"end":return"start";default:return e}}(e.align);if(t!==e.align)return{...e,align:t}}}else{const t=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";default:return e}}(e.position);if(t!==e.position)return{...e,position:t}}return null}}function Oe(e,t,n){return"x"===n?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Se(e,t,n,r){const a=new Re(e.gap);let i=a.computePosition(e,t,n);const s=Oe(i.rect,r,"x"),l=Oe(i.rect,r,"y");if(s&&l)return i;let o=null;return s||(o=a.flipAxis(e,"x")),l||(o=a.flipAxis(o||e,"y")),o?(i=new Re(a.gap).computePosition(o,t,n),function(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}(i.rect,r)?i:null):null}function De(e,t){const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),a=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return a<=n||i<=r?null:new DOMRect(n,r,a-n,i-r)}function Ae(e){const t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){const r=getComputedStyle(e);if(t&&"visible"!==r.overflowY||n&&"visible"!==r.overflowX)return!0}return!1}class $e{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=function(e,t=document.documentElement){const n=[];let r=e.parentElement;for(;r&&r!==t;)Ae(r)&&n.push(r),r=r.parentElement;return n.push(t),n}(this.anchor,this.root),this.visibleClientRect=function(e){if(0===e.length)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=De(e[n].getBoundingClientRect(),t),!t)return null;return t}(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){const t=this.scrollableParents,n=()=>{this.update()};window.addEventListener("resize",n);for(const e of t)e.addEventListener("scroll",n);let r,a;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout((function(){r&&document.addEventListener("click",r)}),0)),this.options.closeOnEsc&&(a=e=>{"Escape"===e.key&&this.tryClose()},window.setTimeout((function(){a&&document.addEventListener("keydown",a)}),0));const i=this.options.blockPageScroll;return i&&(document.body.style.overflow="hidden",document.body.style.height="100%"),()=>{window.removeEventListener("resize",n);for(const e of t)e.removeEventListener("scroll",n);r&&document.removeEventListener("click",r),a&&document.removeEventListener("keydown",a),i&&(document.body.style.overflow="",document.body.style.height="")}}open(e,t){if(this.context)throw new Error("The popup controller is already bound to an element");this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display="",e.style.visibility="hidden",this.update(),this.options.onOpen&&this.options.onOpen(this))}close(){if(!this.context)throw new Error("The popup controller is not bound to an element");this.tryClose()}tryClose(){this.context&&(this.options.onClose&&this.options.onClose(this),this.context.cleanup(),this.context.element.style.display="none",this.context=void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;const e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),a=this.visibleClientRect;if(!a)return;const i=Se(t,n,r,a);this.context.position=i||void 0,i&&(i.constrainHeight&&(e.style.height=i.rect.height+"px"),i.constrainWidth&&(e.style.width=i.rect.width+"px"),e.style.left=i.rect.left+"px",e.style.top=i.rect.top+"px",e.style.visibility="visible")}createPopupElement(){const e=document.createElement("div");return e.style.margin="0",e.style.padding="0",e.style.border="none",e.style.background="transparent",e.className="composable-Popup",e}}const Ee=S(void 0);function Pe(){const e=D(Ee);if(!e)throw new Error("usePopupController must be used inside a Popup component");return e}function Fe({ctrlRef:t,id:n,constraints:r,isOpen:a,children:i,className:s,onClose:l,zIndex:o,position:c,...d}){const u=A(null),[m,h]=$();return E((()=>{if(!d.anchor)throw new Error("Anchor element is required");const e=new $e({...d,onClose:l});return h(e),()=>{e.tryClose()}}),[]),E((()=>{t&&(t.current=m)}),[m]),E((()=>{m&&u.current?m.isOpen!==a&&(a?m.open(u.current,r):m.close()):m?.isOpen&&!a&&m.close()}),[a,m,u.current]),e(Ee.Provider,{value:m,children:a&&B(e("div",{id:n,style:{visibility:"hidden",position:c||"absolute",zIndex:o||100},ref:u,className:s,children:i}),document.body)})}function je({anchor:t,root:n,children:r,...a}){return!t.current||n&&!n.current?null:e(Fe,{anchor:t.current,root:n?.current||void 0,...a,children:r})}class Ye{filter(e,t){const n=t.toLowerCase();return e.filter((e=>this.valueOf(e).toLowerCase().includes(n)))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find((e=>this.idOf(e)===t))}createItem(e){return null}}class Ve extends Ye{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new Ve}class Be extends Ve{createItem(e){return e}static instance=new Be}function Ue(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:"w-72 bg-white mt-1 shadow-md border border-gray-200 overflow-auto p-0 z-10",inputClass:a(t?"block m-0 p-0 border-0 focus:outline-none focus:ring-0 bg-transparent":"block sm:text-sm sm:leading-6 rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 placeholder:text-gray-400 dark:placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-800 py-1.5",e?"w-full":"!w-auto"),optionClass:"py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300",Input:Ge,Menu:Ke,Toggle:We}}function He({menuAlign:r="fill",menuGap:a,focusOnMount:i,onSelect:s,value:l,zIndex:o,unstyledInput:c,fullWidth:d,api:u,layout:m,adapter:h,items:p,placeholder:f}){const[g]=$(`combobox-popup-${Math.floor(1e6*Math.random())}`),x=A(void 0),v=A(null),b=m?Object.assign(Ue(d,c),m):Ue(d,c),y=O.useRef(null),w=Je({adapter:h,items:p,value:l,popupId:g});E((()=>{v.current&&i&&v.current.focus()}),[v.current]),E((()=>{w.onSelect=s,w.popupCtrl=x.current}),[s,x.current]),E((()=>{if(u&&w&&v.current)return u.current={open:()=>w.openMenu(),close:()=>w.closeMenu(),toggle:()=>w.toggleMenu(),setInputValue:e=>w.inputText=e,inputValue:w.inputText||"",selectedItem:w.selectedItem,focus:()=>v.current?.focus()},()=>{u.current=null}}),[u,w,v.current]);const N=w.isMenuOpen&&w.filteredItems.length>0;return t(n,{children:[e(b.Input,{boxRef:y,inputRef:v,ctrl:w,layout:b,placeholder:f}),e(je,{id:g,ctrlRef:x,className:"combobox-popup",closeOnClick:!0,closeOnEsc:!0,onClose:()=>w.closeMenu(),isOpen:N,anchor:y,zIndex:o,constraints:{position:"bottom",align:r,gap:null!=a?a:4},children:e(b.Menu,{fillWidth:"fill"===r,items:w.filteredItems,ctrl:w,layout:b,adapter:h})})]})}function Ge({inputRef:n,placeholder:r,boxRef:a,ctrl:i,layout:s}){const l=s.buttonWidth,o=l>0?{paddingRight:`${l}px`}:void 0,c=s.Toggle;return t("div",{className:"relative",ref:a,children:[e("input",{ref:n,placeholder:r,...i.getInputProps(),style:o,className:s.inputClass}),c&&e("button",{style:{top:0,bottom:0,right:`${s.buttonRight}px`,width:`${l}px`,position:"absolute",border:"none",padding:0,margin:0,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},...i.getToggleButtonProps(),children:e(c,{ctrl:i,layout:s})})]})}function We({ctrl:t}){return t.isMenuOpen?e(l,{className:"w-4 h-4"}):e(o,{className:"w-4 h-4"})}function Ke({fillWidth:t,items:n,layout:r,ctrl:i,adapter:s}){const{highlightedIndex:l,selectedItem:o}=i;return e("ul",{style:{width:t?"100%":void 0,maxHeight:r.maxMenuHeight?`${r.maxMenuHeight}px`:"240px"},className:r.menuClass,...i.getMenuProps(),children:n.map(((t,n)=>e("li",{"data-index":n,className:a(r.optionClass,l===n&&"option-highlighted",o===t&&"option-selected"),...i.getItemProps(t,n),children:s.renderOption(t)},s.idOf(t))))})}function Je(e){const[t,n]=$(new Ze(e));return E((()=>{t?.withState(n)}),[]),t}class Ze{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText="";_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,"string"==typeof n?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._inputText?this._filteredItems=this.adapter.filter(this.items,this._inputText):this._filteredItems=this.items}withState(e){return this.setState=e,this}clone(){const e=new Ze({adapter:this.adapter,items:this.items,popupId:this.popupId});return e.setState=this.setState,e.onSelect=this.onSelect,e._inputText=this._inputText,e._highlightedIndex=this._highlightedIndex,e._selectedItem=this._selectedItem,e._isMenuOpen=this._isMenuOpen,e._filteredItems=this._filteredItems,e.popupCtrl=this.popupCtrl,e}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):"",this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){const e=this.popupCtrl,t=e.context?.position?.position;t&&"top"===t&&window.setTimeout((()=>{e.update()}),100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;const n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){const e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{const t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{const n=t.key;if("Enter"===n){if(null!=this.highlightedIndex)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){const e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else"ArrowDown"===n?this.isMenuOpen?this.highlightIndex(null===this.highlightedIndex?0:(r=this.highlightedIndex,a=e.length,(r+1)%a),!1):this.openMenu():"ArrowUp"===n&&this.isMenuOpen&&this.highlightIndex(null===this.highlightedIndex?0:function(e,t){return(e-1+t)%t}(this.highlightedIndex,e.length),!0);var r,a}}}}const qe=r("hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{destructive:"bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50",outline:"border border-input bg-background shadow-xs hover:bg-muted ring-inset",secondary:"bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset",ghost:"hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset",link:"text-white underline-offset-4 hover:underline ring-inset",primary:"bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset",unstyled:""},size:{xs:"h-7 rounded px-2 py-1 text-xs gap-x-1",sm:"h-8 rounded px-3 text-xs",md:"h-9 rounded-md px-4 py-2",lg:"h-10 rounded-md px-3",xl:"rounded-md px-3.5 py-2.5 text-sm gap-x-2",icon:"p-0 m-0 rounded-full"}},defaultVariants:{variant:"primary",size:"md"}}),Xe=R.forwardRef((({className:n,variant:r,size:i,asChild:s=!1,alt:l,isDisabled:o,isLoading:d,title:u,onClick:m,type:h,...p},f)=>{const g=t(s?U:"button",{className:a(ke(qe({variant:r,size:i})),n),disabled:o||d||p.disabled,ref:f,onClick:m,type:h,autoFocus:!1,...p,children:[d&&e(c,{className:"animate-spin"}),p.children]});return l||u?e(H,{description:l||u,asChild:!0,className:"cursor-pointer",size:"xs",placement:"top",children:g}):g}));Xe.displayName="Button";const Qe=R.forwardRef((({size:t,content:n,toast:r,className:a,alt:i,...s},l)=>{const[o,c]=$(!1);return e(Xe,{ref:l,className:ke(a),variant:"unstyled",size:t||"sm",onClick:()=>{navigator.clipboard.writeText(n).then((()=>{c(!0),setTimeout((()=>c(!1)),2e3),r&&r.toast&&r.toast({status:"success",title:r.message||"Copied to clipboard",duration:2e3})})).catch((e=>{console.error("Failed to copy text: ",e),r&&r.toast&&r.toast({status:"error",title:"Failed to copy",duration:2e3})}))},...s,alt:i??"Copy",children:o?e(d,{className:"text-success"}):e(u,{className:"size-4"})})}));Qe.displayName="CopyButton";const et=S({theme:"system",setTheme:()=>null});function tt({children:t,defaultTheme:n="system",storageKey:r="vite-ui-theme",...a}){const[i,s]=$((()=>localStorage.getItem(r)||n));E((()=>{const e=window.document.documentElement;if(e.classList.remove("light","dark"),"system"!==i)e.classList.add(i);else{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";e.classList.add(t)}}),[i]);const l={theme:i,setTheme:e=>{localStorage.setItem(r,e),s(e)}};return e(et.Provider,{...a,value:l,children:t})}const nt=()=>{const e=D(et);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e};function rt({option:t,current:n,setTheme:r,icon:a}){return e(Xe,{variant:n===t?"secondary":"outline",size:"sm",onClick:()=>r(t),alt:t,children:a})}function at(){const{setTheme:n}=nt(),r=nt().theme;return t("div",{className:"flex justify-between px-2 items-center",children:[e("p",{className:"text-sm font-semibold",children:"Theme"}),t("div",{className:"flex gap-2",children:[e(rt,{current:r,option:"system",setTheme:n,icon:e(m,{className:"text-muted"})}),e(rt,{current:r,option:"light",setTheme:n,icon:e(h,{className:"text-muted"})}),e(rt,{current:r,option:"dark",setTheme:n,icon:e(p,{className:"text-muted"})})]})]})}const it=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("rounded-xl border bg-card text-card-foreground shadow",t),...n})));it.displayName="Card";const st=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("flex flex-col p-6",t),...n})));st.displayName="CardHeader";const lt=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("font-semibold leading-none tracking-tight",t),...n})));lt.displayName="CardTitle";const ot=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("text-sm text-muted-foreground",t),...n})));ot.displayName="CardDescription";const ct=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("p-6 pt-0",t),...n})));ct.displayName="CardContent";const dt=R.forwardRef((({className:t,...n},r)=>e("div",{ref:r,className:ke("flex items-center p-6 pt-0",t),...n})));function ut({children:t}){return e("span",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},children:t})}dt.displayName="CardFooter";const mt=S(!1);function ht(){return!!D(mt)}function pt({children:t}){return e(mt.Provider,{value:!0,children:t})}function ft({className:n,children:r,isOpen:a,onClose:i,description:s="Modal Description",noCloseButton:l=!1,allowOverflow:o=!1,disableCloseOnClickOutside:c=!1}){const d=e=>{e||i()};return t(bt,{open:a,onOpenChange:e=>{c&&!e||d(e)},children:[o&&e(Ct,{className:"z-50 fixed inset-0 bg-black/80"}),e(ut,{children:e(_t,{children:s})}),t(kt,{className:ke("min-h-20 p-4","fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg",n),children:[!l&&e(Nt,{onClick:()=>d(!1),asChild:!0,autoFocus:!1,children:e(Xe,{variant:"outline",alt:"Close",className:"top-4 right-4 absolute data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none",children:e(f,{className:"w-4 h-4"})})}),e(pt,{children:r})]})]})}const gt=({children:r,show:a=!0,className:i,description:s,...l})=>a?e(n,{children:t(zt,{className:ke("text-lg font-semibold leading-6 tracking-tight",{"py-2":!s},i),...l,children:[r,s&&e(_t,{className:"text-sm !font-normal text-muted-foreground pb-2",children:s})]})}):t(ut,{children:[e(zt,{children:r}),s&&e(_t,{children:s})]}),xt=({children:t,className:n,...r})=>e("div",{className:ke("text-sm max-h-[80vh] overflow-y-auto",n),...r,children:t}),vt=({align:t="right",children:n,className:r,...a})=>e("div",{className:ke("w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end sm:space-x-2",{left:"justify-start",center:"justify-center",right:"justify-end"}[t],r),...a,children:n}),bt=W.Root,yt=W.Trigger,wt=W.Portal,Nt=W.Close,Ct=R.forwardRef((({className:t,...n},r)=>e(W.Overlay,{ref:r,className:ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n})));Ct.displayName=W.Overlay.displayName;const kt=R.forwardRef((({className:n,children:r,...a},i)=>t(wt,{children:[e(Ct,{}),e(W.Content,{ref:i,autoFocus:!1,onOpenAutoFocus:e=>{e.preventDefault()},className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...a,children:r})]})));kt.displayName=W.Content.displayName;const _t=R.forwardRef((({className:t,...n},r)=>e(W.Description,{ref:r,className:ke("text-sm text-muted",t),...n})));_t.displayName=W.Description.displayName;const zt=R.forwardRef((({className:t,...n},r)=>e(W.Title,{ref:r,className:ke("text-lg font-semibold leading-none tracking-tight",t),...n})));zt.displayName=W.Title.displayName;const It=r("",{variants:{size:{xs:"rounded py-1 text-xs rounded-xs",sm:"rounded text-xs rounded-sm",md:"rounded-md py-2 text-sm",lg:"rounded-md text-base",xl:"rounded-md py-2.5 text-lg"},variant:{default:"flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",unstyled:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",noPadding:"block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background",legacy:"py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background"}},defaultVariants:{size:"md",variant:"default"}}),Tt=R.forwardRef((({className:n,type:r,size:a="md",variant:i="default",clearable:s=!0,onChange:l,value:o,...c},d)=>t("div",{className:"w-full",style:{position:"relative",display:"inline-block"},children:[e("input",{type:r,className:ke(It({size:a,variant:i}),n,s&&o?"pr-6":""),ref:d,value:null==o?"":o,onChange:e=>{l&&l(e.target.value)},...c}),s&&o&&!c.readOnly&&!c.disabled&&e("button",{onClick:()=>{l&&l("")},className:`absolute ${"number"!==r?"right-0":"right-7"} top-1/2 -translate-y-1/2 size-7 text-muted-foreground hover:text-destructive cursor-pointer flex items-center justify-center`,type:"button","aria-label":"Clear input",children:e(f,{size:16})})]})));Tt.displayName="Input";const Lt=R.forwardRef((({className:t,orientation:n="horizontal",decorative:r=!0,...a},i)=>e(K.Root,{ref:i,decorative:r,orientation:n,className:ke("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...a})));Lt.displayName=K.Root.displayName;const Mt=R.createContext(null),Rt=({hover:t=!1,click:n=!1,children:r,_open:a,onOpenChange:i})=>{const[s,l]=R.useState(a||!1),o=ht();return e(Mt.Provider,{value:{open:s,setOpen:l,hover:t,click:n},children:e(Z.Root,{open:s,onOpenChange:e=>{l(e),i&&i(e)},modal:o,children:r})})};function Ot(e=!1,t=()=>{},n){e&&t("enter"===n)}const St=R.forwardRef((({children:t,...n},r)=>{const a=R.useContext(Mt);if(!a)throw new Error("PopoverTrigger must be used within a Popover");const{setOpen:i,hover:s,click:l}=a;return e(Z.Trigger,{ref:r,asChild:!0,onMouseEnter:()=>Ot(s,i,"enter"),onMouseLeave:()=>Ot(s,i,"leave"),onClick:()=>{l&&i((e=>!e))},...n,children:t})}));St.displayName=Z.Trigger.displayName;const Dt=Z.Anchor,At=R.forwardRef((({className:t,align:n="center",side:r="bottom",...a},i)=>{const s=R.useContext(Mt);if(!s)throw new Error("PopoverContent must be used within a Popover");const{setOpen:l,hover:o}=s;return e(Z.Portal,{children:e(Z.Content,{ref:i,align:n,side:r,onMouseEnter:()=>Ot(o,l,"enter"),onMouseLeave:()=>Ot(o,l,"leave"),className:ke("z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in","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",t),...a})})}));At.displayName=Z.Content.displayName;const $t=Z.Close;$t.displayName=Z.Close.displayName;const Et=R.forwardRef((({className:t,...n},r)=>e(q,{ref:r,className:ke("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n})));Et.displayName=q.displayName;const Pt=({children:t,...n})=>e(bt,{...n,children:e(kt,{className:"shadow-lg p-0 overflow-hidden",children:e(Et,{className:"[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",children:t})})}),Ft=R.forwardRef((({className:n,...r},a)=>t("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[e(g,{className:"opacity-50 size-4 shrink-0"}),e(q.Input,{ref:a,className:ke("focus:ring-0","border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]})));Ft.displayName=q.Input.displayName;const jt=R.forwardRef((({className:t,...n},r)=>e(q.List,{ref:r,className:ke("overflow-y-auto overflow-x-hidden",t),...n})));jt.displayName=q.List.displayName;const Yt=R.forwardRef(((t,n)=>e(q.Empty,{ref:n,className:"py-2 text-sm text-center",...t})));Yt.displayName=q.Empty.displayName;const Vt=R.forwardRef((({className:t,...n},r)=>e(q.Group,{ref:r,className:ke("overflow-y-auto overflow-x-hidden p-1 text-foreground","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n})));Vt.displayName=q.Group.displayName;const Bt=R.forwardRef((({className:t,...n},r)=>e(q.Separator,{ref:r,className:ke("-mx-1 h-px bg-border",t),...n})));Bt.displayName=q.Separator.displayName;const Ut=R.forwardRef((({className:t,...n},r)=>e(q.Item,{ref:r,className:ke("hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...n})));Ut.displayName=q.Item.displayName;const Ht=({className:t,...n})=>e("span",{className:ke("ml-auto text-xs tracking-widest text-muted-foreground",t),...n});function Gt({options:n,optionLabel:r,value:i,onChange:s,addNew:l,addNewLabel:o,disabled:c,filterBy:u,label:m,placeholder:h,className:p,popupClass:g,isClearable:y,border:w=!0,multiple:N=!1,by:C}){const k=A(null),[_,z]=$(!1),[I,T]=$(0),[L,M]=$("");E((()=>{const e=k.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver((()=>{t()}));return t(),n.observe(e),()=>{n.disconnect()}}),[]);const R=(e,t)=>!(!t||0===t.length)&&t.some((t=>O(t,e))),O=(e,t)=>null==e||null==t?e===t:"string"==typeof C?e[C]===t[C]:"function"==typeof C?C(e,t):J(e,t);let S=n||[];const D=L.toLowerCase(),P=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(u);S=S.filter((e=>P(e).includes(D)));return t(Rt,{children:[e(St,{asChild:!0,children:t("div",{ref:k,onClick:e=>{c?e.preventDefault():z(!_)},className:a(p,w&&"border border-border","flex flex-row gap-2 items-center justify-between p-2 rounded-md group relative",c?"cursor-not-allowed text-muted":"cursor-pointer hover:bg-muted"),children:[t("div",{className:a("flex flex-col w-full rounded-md text-sm items-center justify-center truncate",!c&&"",y&&i&&(!Array.isArray(i)||i.length>0)&&"pr-6"),children:[m&&e("div",{className:"w-full text-left text-xs font-semibold",children:m}),e("div",{className:a("w-full text-left",!c&&""),children:N?(()=>{const n=Array.isArray(i)?i:i?[i]:[];return 0===n.length?e("span",{className:"text-muted",children:h}):1===n.length?r?r(n[0]):n[0]:t("div",{className:"flex flex-wrap gap-1",children:[n.slice(0,1).map(((t,n)=>e("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded",children:r?r(t):t},n))),n.length>1&&t("span",{className:"inline-flex items-center px-2 py-1 text-xs bg-muted rounded",children:["+",n.length-1," more"]})]})})():(()=>{if(!i||Array.isArray(i)&&0===i.length)return e("span",{className:"text-muted",children:h});const t=Array.isArray(i)?i[0]:i;return r?r(t):t})()})]}),t("div",{className:"flex items-center gap-1",children:[y&&i&&(!Array.isArray(i)||i.length>0)&&e("div",{onClick:e=>{e.stopPropagation(),s(N?[]:void 0)},className:"cursor-pointer hover:bg-muted/20 rounded p-1",children:e(f,{className:"size-4"})}),!c&&e(x,{className:"size-4 opacity-50"})]})]})}),t(At,{style:{width:`${I}px`,zIndex:1e6},className:a("min-w-[8rem] w-64 bg-popover p-1 border shadow","divide-y divide-border",g),children:[u&&t("div",{className:"flex justify-start items-center mb-1",children:[e("div",{className:"mx-2",children:e(v,{className:"size-4"})}),e(Tt,{variant:"unstyled",value:L,onChange:M,className:"w-full p-1 rounded-md",placeholder:"Search..."})]}),e(Et,{className:"overflow-hidden",children:t(jt,{className:"max-h-[200px] overflow-y-auto",children:[e(Yt,{children:"No result found."}),e(Vt,{className:"overflow-visible",children:S?.map(((n,a)=>{const l=N?R(n,Array.isArray(i)?i:[]):null!=i&&O(i,n);return e(Ut,{onSelect:()=>(e=>{if(N){const t=Array.isArray(i)?i:[];if(R(e,t)){const n=t.filter((t=>!O(t,e)));s(n)}else s([...t,e])}else z(!1),s(e)})(n),className:"w-full",children:N?t("div",{className:"w-full flex justify-between items-center cursor-pointer",children:[e("div",{className:"w-full truncate text-left",children:r?r(n):n}),l&&e(d,{className:"size-4"})]}):t($t,{className:"w-full flex justify-between items-center",children:[e("div",{className:"w-full truncate text-left",children:r?r(n):n}),l&&e(d,{className:"size-4"})]})},a)}))})]})}),l&&e("div",{className:"p-1",children:t("a",{onClick:l,className:a("gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent"),children:[e(b,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),o]})})]})]})}Ht.displayName="CommandShortcut";const Wt=R.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:"tabs"}),Kt=({tabs:t,defaultValue:n,current:r,className:a,fullWidth:i,children:s,onTabChange:l,responsive:o=!1,variant:c="tabs"})=>{const[d,u]=R.useState((()=>{const e="function"==typeof r?r():r;if(e)return e;const a=window.location.hash,i=a?a.substring(1):void 0;return i&&t.some((e=>e.name===i))?i:n||t[0]?.name}));R.useEffect((()=>{const e="function"==typeof r?r():r;e&&e!==d&&u(e)}),[r]),R.useEffect((()=>{if(r)return;const e=()=>{const e=window.location.hash,r=e?e.substring(1):void 0;r&&t.some((e=>e.name===r))?u(r):!e&&n&&u(n)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}),[r,t,n]);const m=e=>{u(e),l&&l(e)},h=R.useCallback((e=>{m(e)}),[m]);return e(Wt.Provider,{value:{tabs:t,size:i?t.length:0,current:d,setTab:h,responsive:o,variant:c},children:e(X.Root,{defaultValue:d||t[0]?.name,value:d,onValueChange:m,className:a,children:s})})},Jt=({className:r})=>{const{tabs:a,size:i,current:s,setTab:l,responsive:o,variant:c}=R.useContext(Wt),d=0!==i,u=R.useCallback((e=>{if(!a||!l)return;const t=a.find((t=>t.name===e));t?.href&&window.history.pushState(null,"",t.href),l(e)}),[a,l]);return a&&l?t(n,{children:[o&&e("div",{className:"px-2 block lg:hidden",children:e(Gt,{label:"Tab",className:r,options:a,optionLabel:e=>"string"==typeof e.label?e.label:String(e.label),value:a.find((e=>e.name===s)),onChange:e=>{u(e.name)}})}),e(qt,{size:i,variant:c,className:ke(d?"w-full":"",r,o?"hidden lg:flex":""),children:a.map((t=>e(Xt,{value:t.name,disabled:t.disabled,href:t.href,variant:c,onClick:()=>u(t.name),children:t.label},t.name)))})]}):(console.warn("TabsBar: No tabs provided or setTab not available"),null)},Zt=()=>{const{tabs:t}=R.useContext(Wt);return t?e(n,{children:t.map((t=>e(Qt,{value:t.name,children:t.content},t.name)))}):null},qt=R.forwardRef((({className:t,size:n,variant:r="tabs",...a},i)=>e(Wt.Provider,{value:{size:n,variant:r},children:e(X.List,{ref:i,className:ke("tabs"===r?"border-b -mb-px flex space-x-4":"flex space-x-2 p-1 rounded-md",t),...a})})));qt.displayName=X.List.displayName;const Xt=R.forwardRef((({className:t,href:n,variant:r="tabs",...a},i)=>{const{size:s}=R.useContext(Wt),l=R.useCallback((e=>{n&&(e.preventDefault(),window.history.pushState(null,"",n)),a.onClick&&a.onClick(e)}),[n,a.onClick]);return e(X.Trigger,{ref:i,className:ke("tabs"===r?ke("border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer","border-transparent text-muted-foreground hover:border-border hover:text-foreground","data-[state=active]:border-primary data-[state=active]:text-primary","disabled:pointer-events-none disabled:opacity-50"):ke("px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors","tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset","data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm","disabled:pointer-events-none disabled:opacity-50"),t,s?`w-1/${s}`:""),onClick:l,...a})}));Xt.displayName=X.Trigger.displayName;const Qt=R.forwardRef((({className:t,...n},r)=>e(X.Content,{ref:r,className:ke("focus-visible:outline-none",t),...n})));Qt.displayName=X.Content.displayName;const en=Q.Provider,tn=Q.Root,nn=Q.Trigger,rn=R.forwardRef((({className:t,sideOffset:n=4,side:r="top",...a},i)=>e(Q.Portal,{children:e(Q.Content,{ref:i,sideOffset:n,side:r,style:{zIndex:100},className:ke("max-w-[90vw]","z-50 overflow-hidden rounded-md bg-tooltips border px-3 py-1.5 text-xs 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",t),...a})})));function an({description:n,children:r,size:a="sm",placement:i="top",className:s,asChild:l}){return e(en,{delayDuration:0,children:t(tn,{children:[e(nn,{className:"cursor-pointer",asChild:l,children:r}),e(rn,{side:i,className:`px-3 py-1.5 max-w-${a} text-${a} px-3 ${s}`,children:n})]})})}rn.displayName=Q.Content.displayName;const sn=r("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ln=R.forwardRef((({className:n,required:r,...a},i)=>t(ee.Root,{ref:i,className:ke(sn(),n),...a,children:[a.children,r&&e("span",{className:"text-destructive-foreground ml-1",children:"*"})]})));function on({children:n,maxItems:r=3,className:a,separator:i}){if(n.length<=r)return e(cn,{className:ke("w-full",a),children:e(dn,{children:n.map(((r,a)=>t(R.Fragment,{children:[e(un,{children:r.href?e(mn,{href:r.href,children:r.label}):e(hn,{children:r.label})}),a<n.length-1&&e(pn,{children:i??e(y,{})})]},a)))})});const s=n[0],l=n.slice(-(r-2));return e(cn,{className:ke("w-full",a),children:t(dn,{children:[e(un,{children:s.href?e(mn,{href:s.href,children:s.label}):e(hn,{children:s.label})}),e(pn,{children:i??e(y,{})}),e(un,{children:e(fn,{})}),e(pn,{children:i??e(y,{})}),l.map(((n,r)=>t(R.Fragment,{children:[e(un,{children:n.href?e(mn,{href:n.href,children:n.label}):e(hn,{children:n.label})}),r<l.length-1&&e(pn,{children:i??e(y,{})})]},r)))]})})}ln.displayName=ee.Root.displayName;const cn=R.forwardRef((({...t},n)=>e("nav",{ref:n,"aria-label":"breadcrumb",...t})));cn.displayName="Breadcrumb";const dn=R.forwardRef((({className:t,...n},r)=>e("ol",{ref:r,className:ke("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...n})));dn.displayName="BreadcrumbList";const un=R.forwardRef((({className:t,...n},r)=>e("li",{ref:r,className:ke("inline-flex items-center gap-1.5",t),...n})));un.displayName="BreadcrumbItem";const mn=R.forwardRef((({asChild:t,className:n,...r},a)=>e("a",{ref:a,className:ke("transition-colors hover:text-foreground",n),...r})));mn.displayName="BreadcrumbLink";const hn=R.forwardRef((({className:t,...n},r)=>e("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:ke("font-normal text-foreground",t),...n})));hn.displayName="BreadcrumbPage";const pn=({children:t,className:n,...r})=>e("li",{role:"presentation","aria-hidden":"true",className:ke("[&>svg]:w-3.5 [&>svg]:h-3.5",n),...r,children:t??e(y,{})});pn.displayName="BreadcrumbSeparator";const fn=({className:n,...r})=>t("span",{role:"presentation","aria-hidden":"true",className:ke("flex h-9 w-9 items-center justify-center",n),...r,children:[e(w,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"More"})]});fn.displayName="BreadcrumbEllipsis";const gn=({children:t,className:n})=>{const r=A(null),[a,i]=$("auto");return E((()=>{if(r.current){const e=new ResizeObserver((e=>{const t=e[0].contentRect.height;i(t)}));return e.observe(r.current),()=>{e.disconnect()}}}),[]),e("div",{className:ke(n,"overflow-hidden transition-all duration-100 ease-in"),style:{height:a},children:e("div",{ref:r,children:t})})},xn=R.forwardRef((({className:t,...n},r)=>e(te.Root,{ref:r,className:ke("peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white",t),...n,children:e(te.Indicator,{className:ke("flex items-center justify-center text-current"),children:e(d,{className:"size-4"})})})));function vn({value:t,labelRenderer:r,fallbackLabel:a}){const[i,s]=$(a||t),[l,o]=$(!1);return E((()=>{if(!r)return void s(a||t);(async()=>{o(!0);try{const e=r(t);if(e instanceof Promise){const t=await e;s(t)}else s(e)}catch(e){console.error("Error rendering label:",e),s(a||t)}finally{o(!1)}})()}),[t,r,a]),l?e("span",{className:"text-muted-foreground",children:"Loading..."}):e(n,{children:i})}xn.displayName=te.Root.displayName;const bn=({filterType:r,filterValues:a,setFilterValues:i,options:s,labelRenderer:l})=>{const[o,c]=$(!1),[d,u]=$(""),m=A(null),h=s?.filter((e=>!a.some((t=>t.value===e.value))));return t(Rt,{_open:o,onOpenChange:e=>{c(e),e||setTimeout((()=>{u("")}),200)},children:[e(St,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0",children:e("div",{className:"flex gap-1.5 items-center",children:1===a?.length?(()=>{const t=a[0];return e(vn,{value:t.value||"",labelRenderer:l,fallbackLabel:t.label})})():`${a?.length} selected`})}),e(At,{className:"w-[300px] p-0",children:e(gn,{children:t(Et,{children:[e(Ft,{placeholder:r,className:"h-9",value:d,onInputCapture:e=>{u(e.currentTarget.value)},ref:m}),t(jt,{children:[e(Yt,{children:"No results found."}),e(Vt,{children:a.map((n=>t(Ut,{className:"group flex gap-2 items-center",onSelect:()=>{i(a.filter((e=>e.value!==n.value))),setTimeout((()=>{u("")}),200),c(!1)},children:[e("input",{type:"checkbox",checked:!0,onChange:()=>{}}),e(vn,{value:n.value||"",labelRenderer:l,fallbackLabel:n.label})]},n.value)))}),h?.length>0&&t(n,{children:[e(Bt,{}),e(Vt,{children:h.filter((e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase()))).map((n=>t(Ut,{className:"group flex gap-2 items-center",value:String(n.label||n.value),onSelect:()=>{i([...a,{value:n.value,label:n.label}]),setTimeout((()=>{u("")}),200),c(!1)},children:[e(xn,{checked:!1,className:"opacity-0 group-data-[selected=true]:opacity-100"}),e("span",{className:"text-muted",children:e(vn,{value:n.value||"",labelRenderer:n.labelRenderer||l,fallbackLabel:n.label})})]},n.value)))})]})]})]})})})]})},yn="\n.calendar-wrapper .react-calendar__navigation {\n display: flex !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 8px !important;\n padding: 8px !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__label {\n flex: 1 !important;\n text-align: center !important;\n font-weight: 500 !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n min-width: 32px !important;\n height: 32px !important;\n border-radius: 4px !important;\n border: 1px solid hsl(var(--border)) !important;\n background: hsl(var(--background)) !important;\n color: hsl(var(--foreground)) !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow:hover {\n background: oklch(var(--muted)) !important;\n}\n\n.calendar-wrapper .react-calendar__tile {\n cursor: pointer !important;\n width: 0.5rem !important;\n font-size: 0.875rem !important;\n}\n\n.calendar-wrapper .react-calendar__tile:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile:not(.react-calendar__tile--active):hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled,\n.calendar-wrapper .react-calendar__tile:disabled,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled {\n cursor: not-allowed !important;\n color: #9ca3af !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled:hover,\n.calendar-wrapper .react-calendar__tile:disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled:hover {\n background: transparent !important;\n}\n\n\n.calendar-wrapper .react-calendar__month-view__weekdays {\n font-size: 0.75rem !important;\n}\n\n.calendar-wrapper .react-calendar__month-view__weekdays__weekday {\n width: 0.75rem !important;\n font-size: 0.75rem !important;\n text-align: center !important;\n}\n \n",wn=({filterValues:r,setFilterValues:a,isRange:i=!1})=>{const[s,l]=$(!1),[o,c]=$([null,null]),d=r[0]?new Date(r[0]):void 0,u=i?[o[0]||(r[0]?new Date(r[0]):null),o[1]||(r[1]?new Date(r[1]):null)]:[null,null];E((()=>{i&&c([r[0]?new Date(r[0]):null,r[1]?new Date(r[1]):null])}),[r,i]);const m=e=>{if(i)Array.isArray(e)&&(c([e[0],e[1]]),e[0]&&e[1]?a([ne(e[0]).format("YYYY-MM-DD"),ne(e[1]).format("YYYY-MM-DD")]):e[0]&&a([ne(e[0]).format("YYYY-MM-DD")]));else if(e){const t=Array.isArray(e)?e[0]:e;t&&(a([ne(t).format("YYYY-MM-DD")]),l(!1))}};return t(Rt,{_open:s,onOpenChange:l,children:[e(St,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center min-h-[20px]",children:i?u[0]&&u[1]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:ne(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"-"}),e("span",{className:"font-medium",children:ne(u[1]).format("MMMM DD, YYYY")})]}):u[0]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:ne(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"- Select end"})]}):e("span",{className:"text-muted-foreground",children:"Select range"}):d?ne(d).format("MMMM DD, YYYY"):"Pick a date"})}),e(At,{className:"w-auto p-0",align:"start",side:"bottom",alignOffset:-4,sideOffset:6,children:e("div",{className:"p-2",children:i?t(n,{children:[t("div",{className:"calendar-wrapper",children:[e("style",{children:yn}),e(re,{value:u,onChange:m,selectRange:!0,returnValue:"range",maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(u[0]){const e=u[0].getTime();if(u[1]){const n=u[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}})]}),u[0]&&u[1]&&e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>l(!1),children:"Apply"})]})})]}):t("div",{className:"calendar-wrapper",children:[e("style",{children:yn}),e(re,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(d&&t===d.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})]})},Nn=({filterType:n,filterValue:r,setFilterValue:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(Rt,{_open:i,onOpenChange:e=>{s(e),e||l===r||o(r)},children:[e(St,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r||"Enter text..."})}),e(At,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(Tt,{autoFocus:!0,type:"text",size:"sm",value:l,onChange:o,onKeyDown:e=>{"Enter"===e.key&&(a(l),s(!1))},placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})})]})})]})},Cn=({filterType:n,filterValues:r,setFilterValues:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(Rt,{_open:i,onOpenChange:e=>{s(e),e||JSON.stringify(l)===JSON.stringify(r)||o(r)},children:[e(St,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r.length>0?1===r.length?r[0]:`${r.length} tags`:"Add tags..."})}),e(At,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-3",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(sr,{value:l,onChange:o,placeholder:`Add ${n.toLowerCase()}...`}),t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{size:"sm",variant:"ghost",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})]})})]})};function kn(t,n,r){switch(t.type){case"date":return e(wn,{filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value.map((e=>e.value||"")):[],isRange:t.multiple,setFilterValues:e=>{n((n=>n.map((n=>n===t?{...n,value:e.length>0?e.map((e=>({value:e,label:ne(e).format("LLL dd, y")}))):[]}:n))))}});case"text":return e(Nn,{filterType:t.placeholder||t.name,filterValue:Array.isArray(t.value)&&t.value[0]&&"object"==typeof t.value[0]&&t.value[0].value||"",setFilterValue:e=>{n((n=>n.map((n=>n===t?{...n,value:[{value:e,label:e}]}:n))))}});case"stringList":return e(Cn,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"string"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n((n=>n.map((n=>n===t?{...n,value:e}:n))))}});default:{const a=r.find((e=>e.name===t.name));return e(bn,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n((n=>n.map((n=>n===t?{...n,value:e}:n))))},options:a?.options||[],labelRenderer:a?.labelRenderer})}}}function _n({filters:n,setFilters:r,filterGroups:a}){return e("div",{className:"flex gap-2 flex-wrap justify-start",children:n.filter((e=>e.value?.length>0)).map((n=>t("div",{className:"flex gap-[1px] items-center text-sm",children:[e("div",{className:"flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center",children:n.placeholder||n.name}),kn(n,r,a),e(Xe,{variant:"ghost",size:"icon",onClick:()=>{r((e=>e.filter((e=>e!==n))))},className:"bg-muted rounded-l-none rounded-r-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0",children:e(f,{className:"size-6"})})]},n.name+"-"+("date"==n.type?"date":"stringList"===n.type&&"string"==typeof n.value[0]?n.value.join(","):Array.isArray(n.value)?n.value.map((e=>e.value)).join(","):""))))})}function zn({selectedView:n,textValue:r,setTextValue:a,setFilters:i,handleClose:s,filterGroups:l}){const o=()=>{i((e=>[...e,{name:n||"",placeholder:l.find((e=>e.name===n))?.placeholder,value:[{value:r,label:r}],type:"text"}])),s()};return t("div",{className:"p-2 flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:l.find((e=>e.name===n))?.placeholder})}),e(Tt,{autoFocus:!0,type:"text",size:"sm",value:r,onChange:a,onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(Xe,{size:"sm",onClick:o,disabled:!r.trim(),children:"Apply"})]})})]})}function In({selectedView:r,selectedDate:a,setSelectedDate:i,setFilters:s,filters:l,handleClose:o,filterGroups:c}){const[d,u]=$([null,null]),[m,h]=$([null,null]),p=c.find((e=>e.name===r)),f=p?.multiple,g=new Date;g.setHours(23,59,59,999);const x=[m[0]||d[0],m[1]||d[1]],v=e=>{if(f)Array.isArray(e)?(h([e[0],e[1]]),u([e[0],e[1]])):(h([e,null]),u([e,null]));else{const t=Array.isArray(e)?e[0]:e;if(i(t||void 0),t){const e=new Date(t);e.setHours(0,0,0,0),s([...l,{name:r||"",placeholder:p?.placeholder,value:[{value:e.toISOString(),label:ne(e).format("LLL dd, y")}],type:p?.type||"date",multiple:p?.multiple||!1}]),o()}}};return e("div",{className:"p-2",children:f?t(n,{children:[e("div",{children:f?x[0]&&x[1]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:ne(x[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"To:"}),e("span",{className:"text-xs font-medium",children:ne(x[1]).format("MMMM DD, YYYY")})]}):x[0]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:ne(x[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"→ Select end date"})]}):e("span",{className:"text-muted text-xs",children:p?.placeholder||p?.name||r||"Select date range"}):a?ne(a).format("MMMM DD, YYYY"):"Pick a date"}),t("div",{className:"calendar-wrapper",children:[e("style",{children:yn}),e(re,{value:x,onChange:v,selectRange:!0,returnValue:"range",maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(x[0]){const e=x[0].getTime();if(x[1]){const n=x[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}},`${x[0]?.getTime()}-${x[1]?.getTime()}`)]}),e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:o,children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>{if(d[0]){const e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);const n=[];n.push({value:e.toISOString(),label:ne(e).format("LLL dd, y")}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:ne(t).format("LLL dd, y")}),s([...l,{name:r||"",placeholder:p?.placeholder,value:n,type:p?.type||"date",multiple:p?.multiple||!1}]),o()}},disabled:!x[0],children:"Apply"})]})})]}):e(n,{children:t("div",{className:"calendar-wrapper",children:[e("style",{children:yn}),e(re,{value:a,onChange:v,selectRange:!1,maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(a&&t===a.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})}function Tn({selectedView:r,commandInput:a,setFilters:i,handleClose:s,filterGroups:l}){const[o,c]=$([]);if(!r)return null;const d=(e=>{const t=l.find((t=>t.name===e));if(!t)return[];let n=t.options||[];if(!a.trim())return n;if(t.filterBy){const e=a.toLowerCase();return n.filter((n=>void 0!==n.value&&t.filterBy(n.value,e)))}const r=a.toLowerCase();return n.filter((e=>String(e.value||"").toLowerCase().includes(r)))})(r),u=l.find((e=>e.name===r));if(0===d.length)return e(Yt,{children:"No matching options"});return t(n,{children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:u?.placeholder||u?.name})}),e("div",{className:"max-h-50 overflow-y-auto",children:d.map((n=>{const a=o.some((e=>e.value===n.value));return t(Ut,{className:"group flex gap-2 items-center w-full hover:bg-muted "+(u?.multiple&&a?"bg-muted":""),onSelect:()=>(e=>{const t={value:e.value,label:e.label};if(u?.multiple){const n=o.some((t=>t.value===e.value));c(n?t=>t.filter((t=>t.value!==e.value)):e=>[...e,t])}else i((e=>{const n=e.findIndex((e=>e.name===r));if(n>=0){const r=[...e];return r[n]={...r[n],value:[t]},r}return[...e,{name:r||"",placeholder:u?.placeholder||"",value:[t],type:u?.type||"select",multiple:u?.multiple||!1}]})),s()})(n),children:[e(vn,{value:n.value||"",labelRenderer:n.labelRenderer||u?.labelRenderer,fallbackLabel:n.label}),u?.multiple&&a&&e("span",{className:"ml-auto text-xs text-success",children:"✓"})]},n.value||`option-${Math.random()}`)}))}),u?.multiple&&e("div",{className:"p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>{o.length>0&&i((e=>[...e.filter((e=>e.name!==r)),{name:r||"",placeholder:u?.placeholder||"",value:o,type:u?.type||"select",multiple:u?.multiple||!1}])),s()},disabled:0===o.length,children:"Apply"})]})})]})}function Ln({selectedView:n,setFilters:r,handleClose:a,filterGroups:i}){const[s,l]=$([]),o=i.find((e=>e.name===n));return t("div",{className:"p-2 space-y-3",children:[e("div",{className:"space-y-2",children:e(sr,{value:s,onChange:l,placeholder:o?.placeholder||`Add ${n}...`,autoFocus:!0})}),t("div",{className:"flex gap-2 justify-end",children:[e(Xe,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e(Xe,{size:"sm",onClick:()=>{s.length>0&&r((e=>[...e.filter((e=>e.name!==n)),{name:n,placeholder:o?.placeholder,value:s,type:"stringList"}])),a()},disabled:0===s.length,children:"Apply"})]})]})}const Mn=O.createContext({}),Rn=({filters:t,setFilters:n,filterGroups:r,children:a})=>{const i=new URL(window.location.href).searchParams;return E((()=>{try{const e=new URLSearchParams(i.toString());if(t.length>0){const n=t.map((e=>{let t;if("stringList"===e.type&&Array.isArray(e.value)&&"string"==typeof e.value[0])t=`[${e.value.map((e=>encodeURIComponent(e))).join(",")}]`;else if(Array.isArray(e.value))if(e.multiple||e.value.length>1)t=`[${e.value.map((e=>encodeURIComponent(e.value||""))).join(",")}]`;else{const n=e.value[0];t="string"==typeof n?encodeURIComponent(n):encodeURIComponent(n?.value||"")}else t=encodeURIComponent(e.value||"");return`${encodeURIComponent(e.name)}:${t}`})).join(";");e.set("filters",n)}else e.delete("filters");const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}catch(e){console.error("Failed to update URL with filters:",e)}}),[t]),E((()=>{const e=i.get("filters");if(e)try{const t=e.split(";").map((e=>{const[t,n]=e.split(":"),a=decodeURIComponent(t);let i;if(n.startsWith("[")&&n.endsWith("]")){const e=n.slice(1,-1);i=e?e.split(",").map((e=>decodeURIComponent(e))):[]}else i=[decodeURIComponent(n)];const s=r.find((e=>e.name===a));let l;return l="stringList"===s?.type?i:"text"===s?.type?1===i.length?[{value:i[0],label:i[0]}]:i.map((e=>({value:e,label:e}))):i.map((e=>{const t=s?.options?.find((t=>t.value===e));let n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s?.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}})),{name:a,type:s?.type||"select",placeholder:s?.placeholder,value:l,multiple:s?.multiple||!1}}));n(t)}catch(e){console.error("Failed to parse filters from URL:",e)}}),[]),e(Mn.Provider,{value:{filters:t,setFilters:n,filterGroups:r},children:a})},On=({className:n})=>{const{filters:r,setFilters:a,filterGroups:i}=O.useContext(Mn),[s,l]=O.useState(!1),[o,c]=O.useState(null),[d,u]=O.useState(""),m=O.useRef(null),[h,p]=O.useState(),[f,g]=O.useState(""),x=()=>{l(!1),setTimeout((()=>{c(null),u(""),p(void 0)}),200)};return t(Rt,{_open:s,onOpenChange:e=>{l(e),e||setTimeout((()=>{c(null),u(""),g("")}),200)},children:[e(St,{asChild:!0,children:t(Xe,{variant:"outline",role:"combobox","aria-expanded":s,size:"md",className:ke("transition group flex gap-1.5",n),children:[e(N,{className:"size-4 shrink-0 transition-all text-muted"}),"Filter"]})}),e(At,{className:"w-[300px] p-0",align:"start",children:t(Et,{children:["select"===i.find((e=>e.name===o))?.type&&e(Ft,{placeholder:o?`Filter by ${o}`:"Filter...",className:"h-9 ring-0",value:d,onValueChange:e=>{u(e)},ref:m,autoFocus:!0}),e(jt,{className:"max-h-[300px] overflow-y-auto",children:e(Vt,{children:o?(()=>{if(!o)return null;const t=i.find((e=>e.name===o))?.type;switch(t){case"date":return e(In,{selectedView:o,selectedDate:h,setSelectedDate:p,setFilters:a,filters:r,handleClose:x,filterGroups:i});case"text":return e(zn,{selectedView:o,textValue:f,setTextValue:g,setFilters:a,handleClose:x,filterGroups:i});case"stringList":return e(Ln,{selectedView:o,setFilters:a,handleClose:x,filterGroups:i});default:return e(Tn,{selectedView:o,commandInput:d,setFilters:a,handleClose:x,filterGroups:i})}})():(()=>{let t=i.map((e=>({...e,options:(e.options??[]).filter((t=>!r.some((n=>"date"===n.type?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&"string"==typeof n.value[0]?n.value.some((e=>e===t.value)):n.value.some((e=>e.value===t.value)))))))}))).filter((e=>(e.options??[]).length>0||"date"===e.type&&!r.some((t=>t.name===e.name))||"text"===e.type&&!r.some((t=>t.name===e.name))||"stringList"===e.type&&!r.some((t=>t.name===e.name))));return 0===t.length?e(Yt,{children:"No available filters"}):t.map(((t,n)=>e(Ut,{onSelect:()=>{return e=t.name,c(e),u(""),void m.current?.focus();var e},className:"group flex gap-2 items-center hover:bg-muted",children:e("span",{children:t.placeholder??t.name})},n)))})()})})]})})]})},Sn=({className:t})=>{const{filters:n,setFilters:r,filterGroups:a}=O.useContext(Mn);return e("div",{className:ke(t),children:e(_n,{filters:n,setFilters:r,filterGroups:a})})},Dn=({className:t})=>{const{filters:n,setFilters:r}=O.useContext(Mn);return n.filter((e=>e.value?.length>0)).length>0?e(Xe,{variant:"outline",size:"xs",className:ke("transition group",t),onClick:()=>r([]),children:"Clear All"}):null};var An;!function(e){e.IS="is",e.IS_NOT="is_not",e.CONTAINS="contains",e.BEFORE="before",e.AFTER="after",e.IS_ANY_OF="is_any_of"}(An||(An={}));const $n=P((({className:t,level:n=3,...r},a)=>e(`h${n}`,{ref:a,className:ke({h1:"text-2xl font-medium tracking-tight",h2:"text-xl font-medium tracking-tight",h3:"text-lg font-medium",h4:"text-base font-medium",h5:"text-sm font-medium",h6:"text-xs font-medium"}[`h${n}`],"mb-2",t),...r})));$n.displayName="Heading";const En=r("text-foreground",{variants:{size:{xl:"text-base md:text-lg leading-relaxed",lg:"text-base leading-relaxed",default:"text-sm leading-normal",sm:"text-sm leading-normal",xs:"text-xs leading-normal"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold"}},defaultVariants:{size:"default",weight:"normal"}}),Pn=P((({className:t,size:n,weight:r,...a},i)=>e("p",{ref:i,className:ke(En({size:n,weight:r,className:t})),...a})));function Fn({title:n,content:r,onConfirm:a,onCancel:i,isOpen:s}){const l=A(null);return t(ft,{isOpen:s,onClose:i,description:"Confirm Modal",children:[t("div",{className:"sm:flex sm:items-start p-2",children:[e("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:e(C,{className:"size-6 text-red-600","aria-hidden":"true"})}),t("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[e(gt,{className:"leading-6",show:!0,children:n}),e("div",{className:"mt-2",children:e("div",{className:"prose text-sm text-gray-500",children:r})})]})]}),t(vt,{align:"right",children:[e(Xe,{variant:"destructive",onClick:a,children:"Confirm"}),e(Xe,{variant:"outline",onClick:i,ref:l,children:"Cancel"})]})]})}function jn(){return D(Yn)}Pn.displayName="Text";const Yn=S((()=>{})),Vn="--tailwind-portal";function Bn({children:t}){const n=A(null),[r,a]=$(null);return E((()=>{if(n.current){const e=n.current.ownerDocument;let t=e.getElementById(Vn);t||(t=e.createElement("DIV"),t.id=Vn,e.body.appendChild(t)),a(t)}}),[n.current]),r?B(t,r):e("span",{ref:n})}const Un={success:I,error:z,warning:_,info:k},Hn={success:"text-success",error:"text-destructive",warning:"text-attention",info:"text-info"};function Gn({data:n,onClose:r}){const[a,i]=$(!0),s=A(null),l=()=>{s.current&&globalThis.clearTimeout(s.current),n.duration&&(s.current=setTimeout((()=>i(!1)),n.duration))},o=()=>{s.current&&(globalThis.clearTimeout(s.current),s.current=null)};E((()=>(l(),o)),[n.duration]);const c=Un[n.status]||k,d=Hn[n.status]||"text-info";return e("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100",children:e("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:e(ae,{appear:!0,show:a,as:F,afterLeave:r,enter:"transform ease-out duration-700 transition",enterFrom:"translate-y-0 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-2 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border",onMouseEnter:o,onMouseLeave:l,children:e("div",{className:"p-5",children:t("div",{className:"flex items-start",children:[e("div",{className:"shrink-0",children:e(c,{className:`size-6 ${d}`,"aria-hidden":"true"})}),t("div",{className:"ml-3 flex-1 pt-0.5 min-w-0",children:[e("p",{className:"text-sm font-semibold text-foreground break-words",children:n.title}),n.description&&e("p",{className:"mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed",children:n.description})]}),e("div",{className:"ml-4 flex shrink-0",children:t("button",{type:"button",className:"inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",onClick:()=>i(!1),children:[e("span",{className:"sr-only",children:"Close"}),e(f,{className:"size-5","aria-hidden":"true"})]})})]})})})})})})}function Wn({children:r}){const[a,i]=$(null),s=e=>{i(e)};return t(n,{children:[e(Yn.Provider,{value:s,children:r}),a&&e(Bn,{children:e(Gn,{data:a,onClose:()=>s(null)})})]})}function Kn({idToDelete:t,title:n,content:r,setIdToDelete:a,deleteApi:i}){const s=jn();return e(Fn,{title:n,content:r,isOpen:!!t,onConfirm:async()=>{if(t)return i(t).then((()=>{s({title:"Delete succeeded",status:"success"})})).catch((e=>{s({title:"Failed to delete",description:e.message??"An error occurred while deleting the object",status:"error"})})).finally((()=>{a(void 0)}))},onCancel:()=>{a(void 0)}})}function Jn({className:t}){return e("hr",{className:a("w-full h-0.5 border-t-0 bg-border",t)})}function Zn({trigger:n,children:r}){return t(ie,{as:"div",className:"relative",children:[e(se,{as:"span",className:"-m-1.5 flex items-center p-1.5",children:n}),e(ae,{as:F,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e(le,{className:"absolute right-0 z-10 mt-2.5 w-48 origin-top-right rounded-md bg-white dark:bg-slate-900 dark:border-slate-800 dark:border py-2 shadow-lg ring-1 ring-gray-900/5 dark:ring-slate-200/5 focus:outline-hidden",children:r})})]})}function qn({children:t,href:n="#",onClick:r,closeOnClick:i=!0,isDisabled:s=!1}){return e(oe,{disabled:s,children:({active:l,close:o})=>e("a",{href:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),r&&r(e),i&&o()},className:a(l?"bg-gray-50 dark:bg-slate-800":"",s?"opacity-50 cursor-not-allowed":"","block px-3 py-1 text-sm leading-6 text-gray-900 dark:text-gray-200"),children:t})})}function Xn({items:n,value:r,onChange:i}){return e(ce,{value:r,onChange:i,children:({open:i})=>t("div",{className:"relative",children:[t("div",{className:"inline-flex divide-x divide-indigo-700 rounded-md shadow-2xs",children:[t("div",{className:"inline-flex items-center gap-x-1.5 rounded-l-md bg-indigo-600 px-3 py-2 text-white shadow-2xs",children:[r.name&&e(d,{className:"-ml-0.5 size-5","aria-hidden":"true"}),e("p",{className:"text-sm font-semibold",children:r.name||""})]}),t(de,{className:"inline-flex items-center rounded-l-none rounded-r-md bg-indigo-600 p-2 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-gray-50",children:[e("span",{className:"sr-only",children:"Change selection"}),e(T,{className:"size-5 text-white","aria-hidden":"true"})]})]}),e(ae,{show:i,as:F,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e(ue,{className:"absolute right-0 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:n.map((n=>e(me,{className:({active:e})=>a(e?"bg-indigo-600 text-white":"text-gray-900","cursor-default select-none p-4 text-sm"),value:n,children:({selected:r,active:i})=>t("div",{className:"flex flex-col",children:[t("div",{className:"flex justify-between",children:[e("p",{className:r?"font-semibold":"font-normal",children:n.name}),r?e("span",{className:i?"text-white":"text-indigo-600",children:e(d,{className:"size-5","aria-hidden":"true"})}):null]}),e("p",{className:a(i?"text-indigo-200":"text-gray-500","mt-2"),children:n.description})]})},n.id)))})})]})})}function Qn({buttonLabel:n,title:r,children:a,onClick:i}){return e("div",{className:"flex items-center justify-center h-full text-center",children:t("div",{className:"py-12",children:[e("svg",{className:"mx-auto size-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),e("h3",{className:"mt-2 text-sm font-semibold",children:r}),e("p",{className:"mt-1 text-sm text-muted",children:a}),e("div",{className:"mt-6",children:t(G,{onClick:i,children:[e(L,{className:"-ml-0.5 mr-1.5 size-5","aria-hidden":"true"}),n]})})]})})}function er({children:n,onUpload:r}){const a=A(null);return t("label",{style:{cursor:"pointer"},children:[n,e("input",{ref:a,type:"file",style:{display:"none"},onChange:()=>{a.current?.files&&r(function(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}(a.current.files))}})]})}function tr({onUpload:n}){const r=nr({onUpload:n});return e("div",{...r,className:"flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:t("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-full",children:[t("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),t("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[e("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),e("input",{id:"dropzone-file",type:"file",className:"hidden"})]})})}function nr({onUpload:e,dragOverClass:t="is-drag-over-on",dropEffect:n="copy"}){const r=A(null);return{onDrop:n=>{n.preventDefault(),delete r.current.__dragOver_cnt__,r.current?.classList.remove(t);const a=n.dataTransfer.items;if(a){const t=[],n=(e,t="")=>new Promise((r=>{if(e.isFile)e.file((e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])}));else if(e.isDirectory){const a=e.createReader(),i=[],s=()=>{a.readEntries((a=>{if(a.length){for(const r of a)i.push(n(r,t+e.name+"/"));s()}else Promise.all(i).then((e=>r(e.flat())))}))};s()}}));for(let e=0;e<a.length;e++){const r=a[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then((t=>{const n=t.flat();n.length&&e(n)}))}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{(function(e){let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t})(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{(function(e){let t=e.__dragOver_cnt__;return!!t&&(e.__dragOver_cnt__=t-1,1===t)})(r.current)&&r.current?.classList.remove(t)},ref:r}}function rr({description:n,required:r,label:i,className:s,direction:l="column",children:o,disabled:c=!1}){return t("div",{className:a("flex w-full space-y-1",s,"row"===l?"flex-row justify-between items-center gap-2":"flex-col"),children:[t("div",{className:"flex items-center gap-1",children:[t("label",{className:"text-sm font-medium mb-1 "+(c?"text-muted":""),children:[i,r?e("span",{className:"text-destructive -mt-4 ml-1",children:"*"}):""]}),n&&e("div",{className:"mx-2 flex w-4 items-center",children:e(an,{description:n,children:e(k,{className:"size-3 text-muted"})})})]}),o]})}const ar="rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",ir={INPUT_UNSTYLED:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",INPUT_NO_PADDING:ar,INPUT:ar+" py-1.5"};function sr({value:n=[],onChange:r,className:i,delimiters:s=", ",placeholder:l,autoFocus:o}){const[c,d]=$("");return t("div",{className:a(i,"w-full flex flex-wrap items-center gap-1 p-2",ir.INPUT),children:[n&&n.length>0&&n.map(((t,a)=>e(ze,{variant:"secondary",onClick:()=>(e=>{n&&n.length>0&&(n.splice(e,1),r([...n]))})(a),className:"cursor-pointer",title:t,children:e("span",{className:"break-all",children:t})},a))),e(Tt,{clearable:!1,className:"placeholder:text-muted-foreground px-1 min-w-0 flex-shrink-0 min-w-[120px]",variant:"unstyled",type:"text",value:c,onBlur:e=>{const t=e.target.value;t&&t.trim()&&(r([...n,t.trim()]),d(""))},onKeyDown:e=>{const t=e.target.value,a=!t.trim(),i=e.key;"Enter"===i||s.indexOf(i)>-1?(e.preventDefault(),n&&!a&&(r([...n,t.trim()]),d(""))):"Backspace"===i&&a&&n&&n.length>0&&(n.pop(),r([...n]))},onChange:d,placeholder:n&&0!==n.length?"":l,autoFocus:o})]})}function lr({underline:t="always",className:n,children:r,...i}){let s;return"always"===t?s="underline":"hover"===t&&(s="hover:underline"),e("a",{className:a("text-indigo-800 dark:text-indigo-300",n,s),...i,children:r})}function or({className:t,children:n}){return e("ul",{className:`${t} space-y-1 flex flex-col items-start dark:px-2`,children:n})}const cr=P((function(t,n){const{current:r,children:i,className:s,href:l="#",onClick:o,...c}=t;return e("li",{className:a(s,r?"bg-gray-50 text-indigo-600":"text-gray-700 dark:dark:text-slate-300 hover:text-indigo-600 hover:bg-gray-50 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:border dark:border-transparent dark:hover:border-slate-50","w-full rounded-md p-2 pl-3 text-sm leading-6 font-semibold"),children:e("a",{ref:n,href:l,onClick:e=>{o?(e.preventDefault(),o(e)):"#"===l&&e.preventDefault()},className:"w-full flex items-center gap-x-3",...c,children:i})})}));function dr({icon:n,status:r,title:a,children:i,className:s}){let l,o,c,d;switch(r){case"error":l=e(z,{className:"size-5 text-destructive","aria-hidden":"true"}),o="",c="text-foreground",d="bg-destructive border border-destructive";break;case"warning":l=e(_,{className:"size-5 text-attention","aria-hidden":"true"}),o="",c="text-foreground",d="bg-attention border border-attention";break;case"success":l=e(I,{className:"size-5 text-success","aria-hidden":"true"}),o="",c="text-foreground",d="bg-success border border-success";break;case"info":l=e(k,{className:"size-5 text-info","aria-hidden":"true"}),o="",c="text-foreground",d="bg-info border border-info";break;case"default":l=e(k,{className:"size-5 text-muted","aria-hidden":"true"}),o="",c="text-foreground",d="bg-muted border border-muted";break;case"done":l=e(k,{className:"size-5 text-done","aria-hidden":"true"}),o="",c="text-foreground",d="bg-done border border-done"}return e("div",{className:`rounded-md p-4 ${d} ${s}`,children:t("div",{className:"flex",children:[e("div",{className:"shrink-0",children:n??l}),t("div",{className:"w-full ml-2 px-1",children:[a&&e("h3",{className:`text-sm font-medium mb-2 ${o}`,children:a}),e("div",{className:`text-sm ${c} break-words`,children:i})]})]})})}function ur({title:t,className:n,children:r}){return e(dr,{status:"error",title:t,className:n,children:e("pre",{children:r})})}function mr({title:t,className:n,children:r}){return e(dr,{status:"info",title:t,className:n,children:r})}function hr({title:t,className:n,children:r}){return e(dr,{status:"warning",title:t,className:n,children:r})}function pr({title:t,className:n,children:r}){return e(dr,{status:"success",title:t,className:n,children:r})}function fr({title:t,className:n,children:r}){return e(dr,{status:"default",title:t,className:n,children:r})}function gr({className:n,children:r,isOpen:i,onClose:s,noCloseButton:l=!1,allowOverflow:o=!1,disableCloseOnClickOutside:c=!1}){return e(ae,{show:i,as:F,children:t(he,{style:{zIndex:50},as:"div",className:"relative",onClose:c?()=>{}:e=>{e||s()},children:[e(pe,{as:F,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",unmount:!0,children:e("div",{className:"fixed inset-0 bg-gray-500 dark:bg-slate-800 dark:opacity-75 opacity-75 transition-opacity"})}),e("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:e("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:e(pe,{as:F,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t(fe,{className:a("p-0! relative transform rounded-lg bg-white dark:bg-slate-900 text-left dark:text-slate-100 shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-md sm:p-6",o?"overflow-visible":"overflow-hidden",n),children:[!l&&e(xr,{onClose:s}),r]})})})})]})})}function xr({onClose:n}){return e("div",{className:"absolute right-0 top-0 hidden pr-4 pt-4 sm:block",children:t("button",{tabIndex:-1,type:"button",className:"rounded-md bg-white text-gray-400 dark:text-slate-200 dark:bg-slate-800 hover:brightness-95 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 hover:cursor-pointer",onClick:n,children:[e("span",{className:"sr-only",children:"Close"}),e(f,{className:"size-6","aria-hidden":"true"})]})})}function vr({children:t,showDivider:n=!1}){return e("div",{className:n?"border-b-solid border-b border-b-1":"",children:e(ge,{as:"h3",className:"py-4 pl-4 pr-8 text-base font-semibold leading-6 text-gray-900 dark:text-slate-50",children:t})})}function br({children:t,className:n="justify-end",fill:r=!1}){return e("div",{className:a("w-full flex space-x-2 p-4 border-t-solid border-t-gray-100 dark:border-t-gray-800 border-t",n||"justify-end",r?"bg-gray-100 dark:bg-slate-800":""),children:t})}function yr({children:t,className:n=""}){return e("div",{className:a("p-4",n),children:t})}function wr(e){return null==e||isNaN(e)?"":e.toString()}or.Item=cr;const Nr=O.forwardRef((({value:t,onChange:n,className:r,noScroll:i=!1,noSpinners:s=!1,...l},o)=>{const[c,d]=O.useState(wr(t));return E((()=>{if(null==t||!isNaN(t)){const e=wr(t);d(e)}}),[t]),e("input",{onWheel:i?e=>{e.target.blur()}:l.onWheel,type:"number",value:c,onChange:e=>{const t=e.target.value;if(d(t),""===t)n&&n(void 0,t);else{const e=parseFloat(t);n&&n(e,t)}},className:a(r,ir.INPUT,{"no-spinners":s},s&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),ref:o,...l})}));function Cr({size:r,className:i}){const s=function(e){switch(e){case"xs":return"size-2";case"sm":return"size-3";case"md":return"size-4";case"lg":return"size-5";case"xl":return"size-7";case"2xl":return"size-10";default:throw new Error("Unexpected size: "+e)}}(r||"md");return e(n,{children:t("svg",{className:a("animate-[spin_0.8s_linear_infinite] text-indigo-500",s,i),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}const kr={primary:"shadow-2xs bg-indigo-600 text-white hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",secondary:"shadow-2xs bg-white text-gray-900 hover:bg-gray-50 ring-1 ring-inset ring-gray-300",soft:"shadow-2xs bg-indigo-50 text-indigo-600 hover:bg-indigo-100",ghost:"text-indigo-600 hover:bg-indigo-100 dark:text-indigo-400 dark:hover:bg-indigo-900",unstyled:""},_r={primary:"text-white",secondary:"text-indigo-500",soft:"text-indigo-600",ghost:"text-indigo-600",unstyled:"text-gray-600"};function zr({title:n,className:r,type:i="button",children:s,size:l,onClick:o,variant:c="primary",isLoading:d=!1,isDisabled:u=!1}){const m=function(e){switch(e){case"xs":return"rounded-xs px-2 py-1 text-xs gap-x-1";case"sm":return"rounded-xs px-2 py-1 text-sm gap-x-1";case"md":return"rounded-md px-2.5 py-1.5 text-sm gap-x-1.5";case"lg":return"rounded-md px-3 py-2 text-sm gap-x-1.5";case"xl":return"rounded-md px-3.5 py-2.5 text-sm gap-x-2";default:throw new Error("Unexpected size: "+e)}}(l||"md");return t("button",{title:n,disabled:u||d,onClick:o,type:i,className:a("whitespace-nowrap inline-flex items-center justify-center font-semibold hover:cursor-pointer",kr[c],m,u&&"cursor-not-allowed text-gray-300!",r),children:[d&&e(Cr,{className:_r[c],size:l}),s]})}function Ir({children:n,overlayContent:r,className:a="",overlayClassName:i="",position:s="right",width:l,height:o,showCloseButton:c=!0,onOpen:d,onClose:u,triggerClassName:m="",backdropClassName:h="",animationConfig:p={type:"spring",stiffness:300,damping:30}}){const[g,x]=$(!1),v=function(e){switch(e){case"left":return{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"}};case"right":default:return{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"}};case"top":return{initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"}};case"bottom":return{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}};case"center":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}}}}(s),b=function(e,t,n){const r="fixed bg-white shadow-lg p-4 relative";switch(e){case"left":return`${r} left-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"right":default:return`${r} right-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"top":return`${r} top-[var(--header-height)] left-0 right-0 ${n||"h-80"}`;case"bottom":return`${r} bottom-0 left-0 right-0 ${n||"h-80"}`;case"center":return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||"w-96"} ${n||"max-h-96"}`}}(s,l,o);return t("div",{className:`flex items-center justify-center w-full ${a}`,children:[e("div",{onClick:()=>{x(!0),d?.()},className:`w-full align-left cursor-pointer ${m}`,children:n}),g&&e("div",{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${h}`,children:t(be.div,{...v,transition:p,className:`${b} ${i}`,children:[c&&e("div",{className:"absolute top-2 right-2 z-10",children:e(zr,{onClick:()=>{x(!1),u?.()},variant:"primary",children:e(f,{})})}),e("div",{className:c?"mt-8":"",children:r})]})})]})}class Tr{renderOption(e){return this.labelOf(e)}findById(e,t){return e.find((e=>this.idOf(e)===t))}}function Lr({checkColor:t,cols:n="grid-cols-1",gap:r="gap-2",value:i,onChange:s,options:l,checkIcon:o=Rr,adapter:c}){const[d,u]=$(i),m=e=>{u(e),s(e)},h=d?c.idOf(d):void 0;return e("div",{className:a("grid",n,r),children:l.map((n=>{const r=c.idOf(n);return e(Mr,{checkColor:t,isSelected:r===h,option:n,adapter:c,onSelect:m,CheckIcon:o},r)}))})}function Mr({checkColor:n,CheckIcon:r,adapter:a,isSelected:i,option:s,onSelect:l}){const[o,c]=$(!1);return t("div",{className:"flex gap-1 cursor-pointer items-center",onClick:()=>l(s),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e("div",{className:"",children:e(r,{size:24,isChecked:i,isHighlighted:o,color:n})}),e("div",{children:a.renderOption(s)})]})}function Rr({size:t,isChecked:n,isHighlighted:r,color:a="currentColor"}){const i=r?1:.6;return e("svg",n?{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_checked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 Z M10,14.4393398 L16.4696699,7.96966991 C16.7625631,7.6767767 17.2374369,7.6767767 17.5303301,7.96966991 C17.7965966,8.23593648 17.8208027,8.65260016 17.6029482,8.94621165 L17.5303301,9.03033009 L10.5303301,16.0303301 C10.2640635,16.2965966 9.84739984,16.3208027 9.55378835,16.1029482 L9.46966991,16.0303301 L6.46966991,13.0303301 C6.1767767,12.7374369 6.1767767,12.2625631 6.46966991,11.9696699 C6.73593648,11.7034034 7.15260016,11.6791973 7.44621165,11.8970518 L7.53033009,11.9696699 L10,14.4393398 L16.4696699,7.96966991 L10,14.4393398 Z"})})})}:{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_unchecked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z"})})})})}function Or({clearTitle:n,ClearIcon:r=f,showFilter:a,filterBy:i,isClearable:s,disabled:l,by:o,options:c,value:d,onChange:u,className:m,addNew:h,addNewLabel:p,placeholder:g,optionLabel:x=e=>String(e),label:v}){const[b,y]=$(),w=A(null),[N,C]=$();E((()=>{if(w.current){const e=new ResizeObserver((e=>{C(e[0].contentRect.width)}));return e.observe(w.current),()=>e.disconnect()}}),[]);const k=e=>{e.preventDefault(),e.stopPropagation(),s&&u(void 0)},_=e=>{y(e.target.value)};let z=c||[];if(void 0===a&&(a=z?.length>=10),a&&b){const e=b.toLowerCase(),t=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(i);z=z.filter((n=>t(n).includes(e)))}const I=e=>{"Escape"!==e.key&&"Enter"!==e.key&&"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&e.stopPropagation()};return e(ce,{value:d||null,onChange:u,by:o,disabled:l,children:()=>e("div",{className:"overflow-y-visible "+m,children:t("div",{className:"relative",children:[t(de,{ref:w,className:"relative w-full cursor-default rounded-md bg-white py-1.5 text-left text-gray-900 shadow-2xs ring-1 ring-inset ring-gray-300 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 sm:text-sm sm:leading-6 hover:cursor-pointer",children:[v&&e("div",{className:"w-full text-gray-500 text-left px-2",children:v}),e("span",{className:"block truncate pl-3 pr-14",children:d?x(d):g}),s&&null!=d&&e("span",{className:"absolute inset-y-0 right-0 mr-5 flex items-center pr-2",onClick:k,children:e(r,{title:n,className:"size-5 text-gray-400 hover:text-red-500 cursor-pointer","aria-hidden":"true"})}),!l&&e("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:e(M,{className:"size-5 text-gray-400","aria-hidden":"true"})})]}),t(ue,{anchor:"bottom",style:{width:N,zIndex:1e8},className:"absolute z-10 mt-1 overflow-auto rounded-md bg-white dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 py-1 text-base shadow-lg ring-1 ring-gray-300 ring-opacity-5 focus:outline-hidden sm:text-sm",children:[a&&e("div",{className:"p-1",children:e("input",{type:"text",value:b||"",onKeyDown:I,onChange:_,className:"w-full p-1 border border-gray-300 rounded-md dark:bg-slate-700 dark:text-slate-50",placeholder:"Filter..."})}),e("div",{className:"overflow-y-auto max-h-60",children:z.map(((t,n)=>e(Sr,{option:t,optionLabel:x,className:"hover:cursor-pointer"},n)))}),h&&e(Me,{className:"font-semibold py-2 border-t",children:e(zr,{variant:"secondary",onClick:h,children:p})})]})]})})})}function Sr({option:r,optionLabel:i,onClick:s,className:l}){return e(me,{className:({active:e})=>a(e?"bg-indigo-600 text-white dark:bg-indigo-800 dark:text-white":"text-gray-900 dark:text-slate-50","relative cursor-default select-none py-2 pl-3 pr-9",l),value:r,onClick:s,children:({selected:s,active:l})=>t(n,{children:[e("div",{className:a(s?"font-semibold":"font-inherit","block truncate"),children:i(r)}),s?e("div",{className:a(l?"text-white":"text-indigo-600","absolute inset-y-0 right-0 flex items-center pr-4"),children:e(d,{className:"size-5","aria-hidden":"true"})}):null]})})}function Dr(t,n){return{label:String(t),check:e(n?d:"div",{className:"size-4"}),reverse:!1,className:"flex-1 px-2 py-2 hover:bg-accent nowrap"}}function Ar({value:t,options:n,onChange:r,className:i,optionLayout:s,by:l,noCheck:o}){const[c,d]=$(t),u=e=>{d(e),r(e)},m=j((()=>"string"==typeof l?(e,t)=>e[l]===t[l]:l||((e,t)=>e===t)),[l]);return e("div",{className:a("",i),children:n.map(((t,n)=>{const r=!!c&&m(c,t);let a;return s?(a=s(t,r),a=Object.assign(Dr(t,r),a)):a=Dr(t,r),e($r,{option:t,onSelect:u,layout:a,noCheck:o},n)}))})}function $r({option:n,onSelect:r,layout:i,noCheck:s}){return t("div",{className:a("group flex items-center cursor-pointer gap-x-2 hover:bg-muted",i.reverse&&"flex-row-reverse",i.className),onClick:()=>r(n),children:[s?null:e("div",{className:"",children:i.check}),e("div",{className:"flex-1",children:i.label})]})}function Er({onSelect:r,selected:i,options:s}){return t(xe,{value:i,onChange:r,children:[e(xe.Label,{className:"sr-only",children:"Server size"}),e("div",{className:"space-y-4",children:s.map((r=>e(xe.Option,{value:r,className:({active:e})=>a(e?"border-border ring-2 ring-ring":"border-border","relative block cursor-pointer rounded-lg border bg-accent px-6 py-4 shadow-2xs focus:outline-hidden sm:flex sm:justify-between"),children:({active:i,checked:s})=>t(n,{children:[e("span",{className:"flex items-center",children:t("span",{className:"flex flex-col text-sm",children:[e(xe.Label,{as:"span",className:"font-medium text-text",children:r.label}),r.description&&e(xe.Description,{as:"span",className:"text-muted-foreground",children:r.description})]})}),e("span",{className:a(i?"border":"border-2",s?"border-accent-foreground":"border-transparent","pointer-events-none absolute -inset-px rounded-lg"),"aria-hidden":"true"})]})},r.id)))})]})}function Pr({isOpen:n,title:r,onClose:a,children:i,panelWidth:s=768,backdrop:l=!1}){const[o,c]=$(s);return e(ye,{children:n&&t("div",{className:"relative z-20",children:[l&&e(be.div,{className:"fixed inset-0 bg-black/70",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),e("div",{className:"fixed inset-y-0 right-0 overflow-hidden",children:e("div",{className:"absolute inset-0 overflow-hidden",children:e("div",{className:"pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16",children:e(be.div,{className:"pointer-events-auto border-l",style:{width:`${o}px`},initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",stiffness:300,damping:30},children:t("div",{className:"relative flex h-full",children:[e("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-ew-resize hover:bg-indigo-500 transition-colors",onMouseDown:e=>{e.preventDefault();let t=!0;const n=e.pageX,r=o,a=e=>{if(t){const t=n-e.pageX,a=Math.max(r+t,480);c(a)}},i=()=>{t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)}}),t("div",{className:"flex-1 flex flex-col overflow-y-scroll gap-4 bg-background py-6 shadow-xl",children:[e("div",{className:"px-2 sm:px-4",children:t("div",{className:"flex items-start justify-between",children:[e("h2",{className:"w-full text-base font-semibold leading-6",children:e("div",{className:"text-2xl",children:r??""})}),e("div",{className:"ml-3 flex h-7 items-center",children:e(Fr,{onClose:a})})]})}),e("div",{className:"px-2 sm:px-4",children:i})]})]})})})})})]})})}function Fr({onClose:t}){return e(Xe,{alt:"Close panel",variant:"ghost",onClick:t,children:e(f,{className:"size-6","aria-hidden":"true"})})}const jr={sm:["h-5 w-8","size-3","translate-x-4"],md:["h-6 w-11","size-4","translate-x-6"],lg:["h-8 w-16","size-6","translate-x-9"]};function Yr({value:n,onChange:r,size:a="md",children:i,className:s,disabled:l}){const o=jr[a];return t(ve,{checked:n,onChange:()=>r(!n),className:`flex items-center ${s} ${l?"cursor-not-allowed opacity-50":"hover:cursor-pointer"}`,children:[e("div",{className:`${n?"bg-primary":"bg-muted/50"} relative inline-flex ${o[0]} items-center rounded-full border-1`,children:e("span",{className:`${n?o[2]:"translate-x-1"} inline-block ${o[1]} transform rounded-full bg-white transition`})}),i&&e("span",{className:"px-2",children:i})]})}function Vr({className:t,children:n,...r}){return e("table",{className:a("\ndivide-y divide-border\n[&>tbody]:divide-y [&>tbody]:divide-border\n[&_th]:text-left [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted-foreground\n[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm\n",t),...r,children:n})}function Br({columns:t}){return e("tr",{className:"hover:bg-muted",children:Array(t).fill(0).map(((t,n)=>e("td",{children:e("div",{className:"animate-pulse rounded-xs h-5 bg-gray-200 dark:bg-gray-600"})},n)))})}function Ur({isLoading:t=!1,columns:n,rows:r=3,children:a}){return e("tbody",{children:t?Array(r).fill(0).map(((t,r)=>e(Br,{columns:n},r))):a})}function Hr({className:t,children:n,...r}){return e("tr",{className:a("hover:bg-muted hover:cursor-pointer",t),...r,children:n})}function Gr(){return D(Wr)}const Wr=S({});function Kr(e,t){const n="function"==typeof t?t():t;let r=null;const a=[];for(const t of e){const e={...t};e.current=!1,a.push(e),e.name===n&&(r=e)}return r||(r=a[0]),r.current=!0,a}function Jr({current:t,onSelect:n,tabs:r,children:a,navigate:i}){const[s,l]=$([]);E((()=>{l(Kr(r,t))}),[t,r]);const o={tabs:s,select:e=>{n&&!1===n(e)||(e.href?i?i(e.href):window.location.href=e.href:l([...Kr(s,e.name)]))}};return e(Wr.Provider,{value:o,children:e("div",{className:"flex flex-col h-full",children:a})})}function Zr({actions:n,className:r}){const{tabs:i,select:s}=Gr();return t("div",{className:"border-b flex items-start justify-between",children:[e("nav",{className:"flex space-x-4 px-4","aria-label":"Tabs",children:i.map((t=>{const n=t.disabled?"cursor-not-allowed":"cursor-pointer";return e("a",{href:t.href||"#"+t.name,onClick:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),!t.disabled&&s(t)})(e,t),className:a(t.current?"border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-50":"border-transparent text-gray-500 dark:text-slate-300 hover:border-slate-400 hover:text-gray-700 dark:hover:border-slate-200 dark:hover:text-gray-200 ",r,"whitespace-nowrap border-b-2 py-2 px-1 text-sm font-medium",n),"aria-current":t.current?"page":void 0,children:t.label},t.name)}))}),e("div",{className:"flex gap-x-1",children:n})]})}function qr({}){const{tabs:t}=Gr(),n=t.find((e=>e.current))?.content;if(!n)return null;if(Y(n))return e("div",{className:"h-full overflow-y-auto flex-1",children:n});return e("div",{className:"h-full overflow-y-auto flex-1",children:e(n,{})})}const Xr=O.forwardRef((({unstyled:t,value:n,onChange:r,className:i,...s},l)=>{const[o,c]=$(n||"");return e("textarea",{ref:l,...s,className:a("w-full",t?ir.INPUT_UNSTYLED:ir.INPUT,i),value:o,onChange:e=>{const t=e.target.value;c(t),r&&r(t)}})}));class Qr{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter((t=>t!==e))}}}function ea(e){const t=O.createContext(void 0);return e.Context=t,t.Provider}class ta{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e&&e(this.current),this}}function na(e){const t=e.Context;if(!t)throw new Error("Context not defined for "+e.name);return D(t)}function ra(e){const[t,n]=$(e.value);return E((()=>e.watch((e=>{n("function"==typeof e?()=>e:e)}))),[e]),t}function aa(e,t){return E((()=>(e.value=t,()=>{e.value=void 0})),[e,t]),t}function ia(e,t){E((()=>e.watch(t)),[e,t])}function sa(e){const[t,n]=$(e.current);return E((()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)})),[e]),t}function la(e,t){E((()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)})),[e,t])}function oa(e,t){E((()=>(e.current=t,()=>{e.current=void 0})),[e,t])}class ca{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter((t=>t!==e))}}}function da(e){const[t,n]=$(e.value);return E((()=>e.addWatcher((e=>{n("function"==typeof e?()=>e:e)}))),[e]),t}function ua(e,t){const n=A(null);return E((()=>{const r=r=>{n.current&&!n.current.contains(r.target)&&(t&&t(r)||e(r))};return window.setTimeout((()=>{document.addEventListener("click",r)}),0),()=>{document.removeEventListener("click",r)}}),[]),n}function ma(){const[e,t]=$(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn("Copy failed",e),t(null),!1}}]}function ha(e){E((()=>{const t=window.matchMedia("(prefers-color-scheme: dark)"),n=t=>e(t.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)}),[])}function pa(e,t){const[n,r]=$(e);return E((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n}function fa(e,t,n){const r=[],a=new EventSource(e);return a.addEventListener("message",(e=>{const n=JSON.parse(e.data);n&&(r.push(n),t(r.join("")))})),a.addEventListener("close",(e=>{a.close();const t=JSON.parse(e.data);n(t)})),()=>{a.close()}}function ga(e,t,n){E((()=>{"function"==typeof e?e().then((e=>fa(e,t,n))):fa(e,t,n)}),[e])}function xa(e,t){Array.isArray(t)&&(t={deps:t});const n=t||{},[r,a]=$(null),[i,s]=$(!1),[l,o]=$(n.defaultValue),c=()=>(n.start&&n.start(),s(!0),e().then((e=>{o(e),n.onSuccess&&n.onSuccess(e)})).catch((e=>{a(e),n.onError&&n.onError(e)})).finally((()=>{s(!1),n.end&&n.end()})));return E((()=>{n.condition&&!n.condition()||c()}),n.deps),{data:l,isLoading:i,error:r,setData:o,refetch:c}}function va(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),xa(e,t)}function ba(e=!1){const[t,n]=$(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function ya(e,t,n={}){E((()=>{const r=new IntersectionObserver((e=>{const r=e[0].isIntersecting;n.leave?r||t(e[0]):r&&t(e[0])}),{threshold:n.threshold||1});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}}),n.deps?n.deps.concat(e):[e])}function wa(){const e=A(!0);return E((t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0})),[]),e.current}const Na="undefined"!=typeof window?V:E;class Ca{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}}function ka(e){const t=$(e);return new Ca(t)}function _a(...e){return s(i(e))}export{gn as AnimateChangeInHeight,Ne as Avatar,ze as Badge,on as Breadcrumbs,Xe as Button,it as Card,ct as CardContent,ot as CardDescription,dt as CardFooter,st as CardHeader,lt as CardTitle,Me as Center,xn as Checkbox,He as ComboBox,Et as Command,Pt as CommandDialog,Yt as CommandEmpty,Vt as CommandGroup,Ft as CommandInput,Ut as CommandItem,jt as CommandList,Bt as CommandSeparator,Ht as CommandShortcut,Fn as ConfirmModal,Qe as CopyButton,Fe as DOMPopup,wn as DateCombobox,fr as DefaultBox,Kn as DeleteModal,bt as Dialog,Nt as DialogClose,kt as DialogContent,_t as DialogDescription,Ct as DialogOverlay,wt as DialogPortal,zt as DialogTitle,yt as DialogTrigger,Jn as Divider,Le as DotBadge,tr as DropZone,Zn as Dropdown,Xn as DropdownList,Qn as EmptyCollection,ur as ErrorBox,er as FileUploadInput,Sn as FilterBar,On as FilterBtn,Dn as FilterClear,An as FilterOperator,Rn as FilterProvider,rr as FormItem,$n as Heading,mr as InfoBox,Tt as Input,sr as InputList,ln as Label,lr as Link,Sr as ListOption,qn as MenuItem,or as MenuList,dr as MessageBox,gr as Modal,yr as ModalBody,pt as ModalContextProvider,br as ModalFooter,vr as ModalTitle,at as ModeToggle,Nr as NumberInput,Ye as OptionAdapter,Ir as Overlay,Rt as Popover,Dt as PopoverAnchor,$t as PopoverClose,At as PopoverContent,St as PopoverTrigger,je as Popup,$e as PopupController,Bn as Portal,Qr as Property,Lr as RadioGroup,Tr as RadioOptionAdapter,Br as RowSkeleton,Or as SelectBox,Ar as SelectList,Er as SelectStack,bn as SelectionCombobox,Lt as Separator,ca as SharedState,Ca as SharedValue,Pr as SidePanel,ta as Slot,Cr as Spinner,Cn as StringListCombobox,Ve as StringOptionAdapter,Be as StringOptionAdapterWithCreate,ir as Styles,pr as SuccessBox,Ce as SvgAvatar,Yr as Switch,Ur as TBody,Hr as TR,Vr as Table,Jr as Tabs,Zr as TabsBar,Qt as TabsContent,Wr as TabsContext,qt as TabsList,qr as TabsPanel,Xt as TabsTrigger,Pn as Text,Nn as TextCombobox,Xr as Textarea,tt as ThemeProvider,et as ThemeProviderContext,Yn as ToastContext,Wn as ToastProvider,tn as Tooltip,rn as TooltipContent,en as TooltipProvider,nn as TooltipTrigger,ft as VModal,xt as VModalBody,vt as VModalFooter,gt as VModalTitle,Gt as VSelectBox,Kt as VTabs,Jt as VTabsBar,Zt as VTabsPanel,an as VTooltip,hr as WarningBox,qe as buttonVariants,_a as cn,Se as computePosition,ea as createCompositeStateProvider,Ue as getDefaultComboBoxLayout,ua as useClickOutside,Je as useComboboxCtrl,na as useCompositeState,ma as useCopyToClipboard,ha as useDarkMode,pa as useDebounce,oa as useDefineSlot,nr as useDropZone,ga as useEventSource,xa as useFetch,va as useFetchOnce,ba as useFlag,ra as useGetCompositeStateProperty,ya as useIntersectionObserver,wa as useIsFirstRendering,ht as useIsInModal,Pe as usePopupController,Na as useSafeLayoutEffect,aa as useSetCompositeStateProperty,ka as useSharedValue,sa as useSlot,Gr as useTabs,jn as useToast,ia as useWatchCompositeStateProperty,da as useWatchSharedState,la as useWatchSlot};
|
|
2
2
|
//# sourceMappingURL=vertesia-ui-core.js.map
|