@accounter/client
Version:
Accounter client application
1 lines • 25.4 kB
JavaScript
import{s as e}from"./dist-BmACi7k_.js";import{i as t,o as n,t as r}from"./utils-BxkqV8PM.js";import{Ro as i,r as a,ro as o,t as s}from"./error-handling-sQ-z99nE.js";import{$ as c,H as l,J as u,Q as d,V as f,X as p,Y as m,Z as h,at as g,b as _,ct as v,et as y,g as b,gt as x,ht as S,it as C,nt as ee,q as te,rt as w,s as T,st as E,tt as ne,v as re,y as D}from"./select-BJv1AsCh.js";import{c as O,i as ie,s as k,t as A}from"./button-BZ6z_NAl.js";var ae=x(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),j=x(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),oe=x(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),M=e(n(),1),N=!1;function se(){let[e,t]=M.useState(N);return M.useEffect(()=>{N||(N=!0,t(!0))},[]),e}var P=M.useSyncExternalStore;function ce(){return()=>{}}function le(){return P(ce,()=>!0,()=>!1)}var ue=typeof P==`function`?le:se,F=t(),de=Object.defineProperty,I=(e,t)=>de(e,`name`,{value:t,configurable:!0}),L=`rovingFocusGroup.onEntryFocus`,fe={bubbles:!1,cancelable:!0},R=`RovingFocusGroup`,[pe,me,he]=C(R),[ge,z]=g(R,[he]),[_e,ve]=ge(R),ye=M.forwardRef(I(function(e,t){return(0,F.jsx)(pe.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(pe.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(be,{...e,ref:t})})})},`RovingFocusGroup`)),be=M.forwardRef(I(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,p=M.useRef(null),m=k(t,p),g=d(a),[_,v]=ne({prop:o,defaultProp:s??null,onChange:c,caller:R}),[y,b]=M.useState(!1),x=h(l),S=me(n),C=M.useRef(!1),[ee,te]=M.useState(0);return M.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(L,x),()=>e.removeEventListener(L,x)},[x]),(0,F.jsx)(_e,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:M.useCallback(e=>v(e),[v]),onItemShiftTab:M.useCallback(()=>b(!0),[]),onFocusableItemAdd:M.useCallback(()=>te(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>te(e=>e-1),[]),children:(0,F.jsx)(E.div,{tabIndex:y||ee===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:w(e.onMouseDown,()=>{C.current=!0}),onFocus:w(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(L,fe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);B([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:w(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),xe=`RovingFocusGroupItem`,Se=M.forwardRef(I(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,l=c(),u=a||l,d=ve(xe,n),f=d.currentTabStopId===u,p=me(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=ue();return ee(()=>{if(!(!_||!r))return m(),()=>h()},[_,r,m,h]),M.useEffect(()=>{if(!(_||!r))return m(),()=>h()},[_,r,m,h]),(0,F.jsx)(pe.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,F.jsx)(E.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:w(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:w(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:w(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Te(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Ee(n,r+1):n.slice(r+1)}setTimeout(()=>B(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),Ce={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function we(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}I(we,`getDirectionAwareKey`);function Te(e,t,n){let r=we(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ce[r]}I(Te,`getFocusIntent`);function B(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}I(B,`focusFirst`);function Ee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}I(Ee,`wrapArray`);var De=ye,Oe=Se,ke=Object.defineProperty,V=(e,t)=>ke(e,`name`,{value:t,configurable:!0}),H=[`Enter`,` `],Ae=[`ArrowDown`,`PageUp`,`Home`],je=[`ArrowUp`,`PageDown`,`End`],Me=[...Ae,...je];[...H],[...H];var U=`Menu`,[W,Ne,Pe]=C(U),[G,Fe]=g(U,[Pe,_,z]),K=_(),Ie=z(),[Le,q]=G(U),[Re,J]=G(U),ze=V(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=K(t),[c,l]=M.useState(null),u=M.useRef(!1),f=h(a),p=d(i);return M.useEffect(()=>{let e=V(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=V(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),M.useEffect(()=>{if(!n)return;let e=V(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,F.jsx)(D,{...s,children:(0,F.jsx)(Le,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:l,children:(0,F.jsx)(Re,{scope:t,onClose:M.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),Be=M.forwardRef(V(function(e,t){let{__scopeMenu:n,...r}=e,i=K(n);return(0,F.jsx)(b,{...i,...r,ref:t})},`MenuAnchor`)),Ve=`MenuPortal`,[He,Ue]=G(Ve,{forceMount:void 0}),We=V(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=q(Ve,t);return(0,F.jsx)(He,{scope:t,forceMount:n,children:(0,F.jsx)(y,{present:n||a.open,children:(0,F.jsx)(u,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Y=`MenuContent`,[Ge,Ke]=G(Y),qe=M.forwardRef(V(function(e,t){let n=Ue(Y,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q(Y,e.__scopeMenu),o=J(Y,e.__scopeMenu);return(0,F.jsx)(W.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(y,{present:r||a.open,children:(0,F.jsx)(W.Slot,{scope:e.__scopeMenu,children:o.modal?(0,F.jsx)(Je,{...i,ref:t}):(0,F.jsx)(Ye,{...i,ref:t})})})})},`MenuContent`)),Je=M.forwardRef(V(function(e,t){let n=q(Y,e.__scopeMenu),r=M.useRef(null),i=k(t,r);return M.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,F.jsx)(Ze,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Ye=M.forwardRef(V(function(e,t){let n=q(Y,e.__scopeMenu);return(0,F.jsx)(Ze,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Xe=ie(`MenuContent.ScrollLock`),Ze=M.forwardRef(V(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:_,...v}=e,y=q(Y,n),b=J(Y,n),x=K(n),S=Ie(n),C=Ne(n),[ee,T]=M.useState(null),E=M.useRef(null),ne=k(t,E,y.onContentChange),D=M.useRef(0),O=M.useRef(``),ie=M.useRef(0),A=M.useRef(null),ae=M.useRef(`right`),j=M.useRef(0),oe=_?l:M.Fragment,N=_?{as:Xe,allowPinchZoom:!0}:void 0,se=V(e=>{let t=O.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=_t(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;V((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);M.useEffect(()=>()=>window.clearTimeout(D.current),[]),te();let P=M.useCallback(e=>ae.current===A.current?.side&&yt(e,A.current?.area),[]);return(0,F.jsx)(Ge,{scope:n,searchRef:O,onItemEnter:M.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:M.useCallback(e=>{P(e)||(E.current?.focus(),T(null))},[P]),onTriggerLeave:M.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:M.useCallback(e=>{A.current=e},[]),children:(0,F.jsx)(oe,{...N,children:(0,F.jsx)(m,{asChild:!0,trapped:i,onMountAutoFocus:w(a,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,F.jsx)(p,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:g,children:(0,F.jsx)(De,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:ee,onCurrentTabStopIdChange:T,onEntryFocus:w(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(re,{role:`menu`,"aria-orientation":`vertical`,"data-state":pt(y.open),"data-radix-menu-content":``,dir:b.dir,...x,...v,ref:ne,style:{outline:`none`,...v.style},onKeyDown:w(v.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=E.current;if(e.target!==i||!Me.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);je.includes(e.key)&&a.reverse(),ht(a)}),onBlur:w(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:w(e.onPointerMove,Z(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;ae.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Qe=M.forwardRef(V(function(e,t){let{__scopeMenu:n,...r}=e;return(0,F.jsx)(E.div,{...r,ref:t})},`MenuLabel`)),$e=`MenuItem`,et=`menu.itemSelect`,tt=M.forwardRef(V(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=J($e,e.__scopeMenu),s=Ke($e,e.__scopeMenu),c=k(t,a),l=M.useRef(!1),u=V(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(et,{bubbles:!0,cancelable:!0});e.addEventListener(et,e=>r?.(e),{once:!0}),v(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,F.jsx)(nt,{...i,ref:c,disabled:n,onClick:w(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:w(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:w(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||H.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),nt=M.forwardRef(V(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ke($e,n),s=Ie(n),c=M.useRef(null),l=k(t,c),[u,d]=M.useState(!1),[f,p]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,F.jsx)(W.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,F.jsx)(Oe,{asChild:!0,...s,focusable:!r,children:(0,F.jsx)(E.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:w(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:w(e.onFocus,()=>d(!0)),onBlur:w(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),rt=M.forwardRef(V(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,F.jsx)(st,{scope:e.__scopeMenu,checked:n,children:(0,F.jsx)(tt,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":mt(n),onSelect:w(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[it,at]=G(`MenuRadioGroup`,{value:void 0,onValueChange:V(()=>{},`onValueChange`)}),ot=`MenuItemIndicator`,[st,ct]=G(ot,{checked:!1}),lt=M.forwardRef(V(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=ct(ot,n);return(0,F.jsx)(y,{present:r||X(a.checked)||a.checked===!0,children:(0,F.jsx)(E.span,{...i,ref:t,"data-state":mt(a.checked)})})},`MenuItemIndicator`)),ut=M.forwardRef(V(function(e,t){let{__scopeMenu:n,...r}=e;return(0,F.jsx)(E.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[dt,ft]=G(`MenuSub`);function pt(e){return e?`open`:`closed`}V(pt,`getOpenState`);function X(e){return e===`indeterminate`}V(X,`isIndeterminate`);function mt(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}V(mt,`getCheckedState`);function ht(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}V(ht,`focusFirst`);function gt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}V(gt,`wrapArray`);function _t(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=gt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}V(_t,`getNextMatch`);function vt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}V(vt,`isPointInPolygon`);function yt(e,t){return t?vt({x:e.clientX,y:e.clientY},t):!1}V(yt,`isPointerInGraceArea`);function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}V(Z,`whenMouse`);var bt=ze,xt=Be,St=We,Ct=qe,wt=Qe,Tt=tt,Et=rt,Dt=lt,Ot=ut,kt=Object.defineProperty,Q=(e,t)=>kt(e,`name`,{value:t,configurable:!0}),At=`DropdownMenu`,[jt,Mt]=g(At,[Fe]),$=Fe(),[Nt,Pt]=jt(At),Ft=Q(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=$(t),u=M.useRef(null),[d,f]=ne({prop:i,defaultProp:a??!1,onChange:o,caller:At});return(0,F.jsx)(Nt,{scope:t,triggerId:c(),triggerRef:u,contentId:c(),open:d,onOpenChange:f,onOpenToggle:M.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,F.jsx)(bt,{...l,open:d,onOpenChange:f,dir:r,modal:s,children:n})})},`DropdownMenu`),It=`DropdownMenuTrigger`,Lt=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Pt(It,n),o=$(n),s=k(t,a.triggerRef);return(0,F.jsx)(xt,{asChild:!0,...o,children:(0,F.jsx)(E.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:w(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:w(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Rt=Q(e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,F.jsx)(St,{...r,...n})},`DropdownMenuPortal`),zt=`DropdownMenuContent`,Bt=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Pt(zt,n),a=$(n),o=M.useRef(!1);return(0,F.jsx)(Ct,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:w(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Vt=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(wt,{...i,...r,ref:t})},`DropdownMenuLabel`)),Ht=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Tt,{...i,...r,ref:t})},`DropdownMenuItem`)),Ut=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Et,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Wt=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Dt,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Gt=M.forwardRef(Q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Ot,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Kt=Ft,qt=Lt,Jt=Rt,Yt=Bt,Xt=Vt,Zt=Ht,Qt=Ut,$t=Wt,en=Gt,tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0}),rn=`horizontal`,an=[`horizontal`,`vertical`],on=M.forwardRef(nn(function(e,t){let{decorative:n,orientation:r=rn,...i}=e,a=sn(r)?r:rn,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,F.jsx)(E.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function sn(e){return an.includes(e)}nn(sn,`isValidOrientation`);var cn=on;function ln({...e}){return(0,F.jsx)(Kt,{"data-slot":`dropdown-menu`,...e})}function un({...e}){return(0,F.jsx)(qt,{"data-slot":`dropdown-menu-trigger`,...e})}function dn({className:e,sideOffset:t=4,...n}){return(0,F.jsx)(Jt,{children:(0,F.jsx)(Yt,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:r(`bg-white text-gray-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-1001 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 p-1 shadow-md dark:bg-gray-950 dark:text-gray-50 dark:border-gray-800`,e),...n})})}function fn({className:e,inset:t,variant:n=`default`,...i}){return(0,F.jsx)(Zt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:r(`focus:bg-gray-100 focus:text-gray-900 data-[variant=destructive]:text-red-500 data-[variant=destructive]:focus:bg-red-500/10 dark:data-[variant=destructive]:focus:bg-red-500/20 data-[variant=destructive]:focus:text-red-500 data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-gray-500 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:focus:bg-gray-800 dark:focus:text-gray-50 dark:data-[variant=destructive]:text-red-900 dark:data-[variant=destructive]:focus:bg-red-900/10 dark:dark:data-[variant=destructive]:focus:bg-red-900/20 dark:data-[variant=destructive]:focus:text-red-900 dark:[&_svg:not([class*='text-'])]:text-gray-400`,e),...i})}function pn({className:e,children:t,checked:n,...i}){return(0,F.jsxs)(Qt,{"data-slot":`dropdown-menu-checkbox-item`,className:r(`focus:bg-gray-100 focus:text-gray-900 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:focus:bg-gray-800 dark:focus:text-gray-50`,e),checked:n,...i,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)($t,{children:(0,F.jsx)(S,{className:`size-4`})})}),t]})}function mn({className:e,inset:t,...n}){return(0,F.jsx)(Xt,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:r(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function hn({className:e,...t}){return(0,F.jsx)(en,{"data-slot":`dropdown-menu-separator`,className:r(`bg-gray-200 -mx-1 my-1 h-px dark:bg-gray-800`,e),...t})}var gn=(0,M.createContext)({filtersContext:null,setFiltersContext:()=>void 0}),_n=`updateTag`,vn=()=>{let[{fetching:e},t]=i(o);return{fetching:e,updateTag:(0,M.useCallback)(async e=>{let n=`Error updating tag ID [${e.tagId}]`,r=`${_n}-${e.tagId}`;a.loading(`Updating Tag...`,{id:r});try{let i=s(await t(e),n,r,`updateTag`);if(i)return a.success(`Success`,{id:r,description:`Tag updated`}),i.updateTag}catch(e){console.error(`${n}: ${e}`),a.error(`Error`,{id:r,description:n,duration:1e5,closeButton:!0})}return!1},[t])}};function yn({className:e,...t}){return(0,F.jsx)(`textarea`,{"data-slot":`textarea`,className:r(`border-gray-200 placeholder:text-gray-500 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:bg-gray-200/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-gray-800 dark:placeholder:text-gray-400 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900 dark:dark:bg-gray-800/30`,e),...t})}function bn({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:r(`group/input-group border-gray-200 dark:bg-gray-200/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow] dark:border-gray-800 dark:dark:bg-gray-800/30`,`h-9 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:ring-gray-950 has-[[data-slot=input-group-control]:focus-visible]:ring-1 dark:has-[[data-slot=input-group-control]:focus-visible]:ring-gray-300`,`has-[[data-slot][aria-invalid=true]]:ring-red-500/20 has-[[data-slot][aria-invalid=true]]:border-red-500 dark:has-[[data-slot][aria-invalid=true]]:ring-red-500/40 dark:has-[[data-slot][aria-invalid=true]]:ring-red-900/20 dark:has-[[data-slot][aria-invalid=true]]:border-red-900 dark:dark:has-[[data-slot][aria-invalid=true]]:ring-red-900/40`,e),...t})}var xn=O(`text-gray-500 flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 dark:text-gray-400`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5`,"block-end":`[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5`}},defaultVariants:{align:`inline-start`}});function Sn({className:e,align:t=`inline-start`,...n}){return(0,F.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:r(xn({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var Cn=O(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5`,sm:`h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function wn({className:e,type:t=`button`,variant:n=`ghost`,size:i=`xs`,...a}){return(0,F.jsx)(A,{type:t,"data-size":i,variant:n,className:r(Cn({size:i}),e),...a})}function Tn({className:e,...t}){return(0,F.jsx)(T,{"data-slot":`input-group-control`,className:r(`flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}function En({className:e,orientation:t=`horizontal`,decorative:n=!0,...i}){return(0,F.jsx)(cn,{"data-slot":`separator`,decorative:n,orientation:t,className:r(`bg-gray-200 shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px dark:bg-gray-800`,e),...i})}export{De as _,Tn as a,j as b,gn as c,dn as d,fn as f,Oe as g,un as h,wn as i,ln as l,hn as m,bn as n,yn as o,mn as p,Sn as r,vn as s,En as t,pn as u,z as v,ae as x,oe as y};