@mdspl/mds-shared-ui 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),a=require("@chakra-ui/react"),Ue=require("react-dom");function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}},Be={};var bn;function Jr(){if(bn)return Be;bn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var He={};var yn;function Zr(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===O?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case S:return"Fragment";case E:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case A:return"SuspenseList";case Y:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case x:return"Portal";case I:return m.displayName||"Context";case T:return(m._context.displayName||"Context")+".Consumer";case $:var R=m.render;return m=m.displayName,m||(m=R.displayName||R.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case L:return R=m.displayName||null,R!==null?R:e(m.type)||"Memo";case V:R=m._payload,m=m._init;try{return e(m(R))}catch{}}return null}function t(m){return""+m}function n(m){try{t(m);var R=!1}catch{R=!0}if(R){R=console;var N=R.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return N.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(m)}}function r(m){if(m===S)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===V)return"<...>";try{var R=e(m);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function o(){var m=H.A;return m===null?null:m.getOwner()}function s(){return Error("react-stack-top-frame")}function l(m){if(G.call(m,"key")){var R=Object.getOwnPropertyDescriptor(m,"key").get;if(R&&R.isReactWarning)return!1}return m.key!==void 0}function c(m,R){function N(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}N.isReactWarning=!0,Object.defineProperty(m,"key",{get:N,configurable:!0})}function u(){var m=e(this.type);return _[m]||(_[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function d(m,R,N,B,q,X){var W=N.ref;return m={$$typeof:p,type:m,key:R,props:N,_owner:B},(W!==void 0?W:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:u}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function f(m,R,N,B,q,X){var W=R.children;if(W!==void 0)if(B)if(k(W)){for(B=0;B<W.length;B++)g(W[B]);Object.freeze&&Object.freeze(W)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(W);if(G.call(R,"key")){W=e(m);var K=Object.keys(R).filter(function(F){return F!=="key"});B=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",z[W+B]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),a=require("@chakra-ui/react"),Ge=require("react-dom");function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}},He={};var yn;function Zr(){if(yn)return He;yn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return He.Fragment=t,He.jsx=n,He.jsxs=n,He}var Ve={};var Sn;function Qr(){return Sn||(Sn=1,process.env.NODE_ENV!=="production"&&(function(){function e(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===O?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case S:return"Fragment";case j:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof x=="object")switch(typeof x.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case m:return"Portal";case I:return x.displayName||"Context";case R:return(x._context.displayName||"Context")+".Consumer";case $:var T=x.render;return x=x.displayName,x||(x=T.displayName||T.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case L:return T=x.displayName||null,T!==null?T:e(x.type)||"Memo";case V:T=x._payload,x=x._init;try{return e(x(T))}catch{}}return null}function t(x){return""+x}function n(x){try{t(x);var T=!1}catch{T=!0}if(T){T=console;var N=T.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return N.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),t(x)}}function r(x){if(x===S)return"<>";if(typeof x=="object"&&x!==null&&x.$$typeof===V)return"<...>";try{var T=e(x);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var x=H.A;return x===null?null:x.getOwner()}function s(){return Error("react-stack-top-frame")}function c(x){if(G.call(x,"key")){var T=Object.getOwnPropertyDescriptor(x,"key").get;if(T&&T.isReactWarning)return!1}return x.key!==void 0}function l(x,T){function N(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",T))}N.isReactWarning=!0,Object.defineProperty(x,"key",{get:N,configurable:!0})}function u(){var x=e(this.type);return _[x]||(_[x]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),x=this.props.ref,x!==void 0?x:null}function d(x,T,N,Y,X,q){var W=N.ref;return x={$$typeof:p,type:x,key:T,props:N,_owner:Y},(W!==void 0?W:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:u}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function g(x,T,N,Y,X,q){var W=T.children;if(W!==void 0)if(Y)if(k(W)){for(Y=0;Y<W.length;Y++)f(W[Y]);Object.freeze&&Object.freeze(W)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(W);if(G.call(T,"key")){W=e(x);var K=Object.keys(T).filter(function(F){return F!=="key"});Y=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",z[W+Y]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,B,W,K,W),z[W+B]=!0)}if(W=null,N!==void 0&&(n(N),W=""+N),l(R)&&(n(R.key),W=""+R.key),"key"in R){N={};for(var J in R)J!=="key"&&(N[J]=R[J])}else N=R;return W&&c(N,typeof m=="function"?m.displayName||m.name||"Unknown":m),d(m,W,N,o(),q,X)}function g(m){y(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===V&&(m._payload.status==="fulfilled"?y(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function y(m){return typeof m=="object"&&m!==null&&m.$$typeof===p}var v=h,p=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),I=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),H=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,k=Array.isArray,j=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(m){return m()}};var C,_={},D=v.react_stack_bottom_frame.bind(v,s)(),P=j(r(s)),z={};He.Fragment=S,He.jsx=function(m,R,N){var B=1e4>H.recentlyCreatedOwnerStacks++;return f(m,R,N,!1,B?Error("react-stack-top-frame"):D,B?j(r(m)):P)},He.jsxs=function(m,R,N){var B=1e4>H.recentlyCreatedOwnerStacks++;return f(m,R,N,!0,B?Error("react-stack-top-frame"):D,B?j(r(m)):P)}})()),He}var Sn;function Qr(){return Sn||(Sn=1,process.env.NODE_ENV==="production"?it.exports=Jr():it.exports=Zr()),it.exports}var i=Qr();function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function en(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:en(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function tn(e){const{Document:t}=ae(e);return e instanceof t}function Qe(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function Kn(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:en(e)?tn(e)?e:Qe(e)||Kn(e)?e.ownerDocument:document:document:document}const xe=Dt?h.useLayoutEffect:h.useEffect;function nn(e){const t=h.useRef(e);return xe(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function to(){const e=h.useRef(null),t=h.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return xe(()=>{n.current!==e&&(n.current=e)},t),n}function et(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function xt(e){const t=nn(e),n=h.useRef(null),r=h.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Vt(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let $t={};function tt(e,t){return h.useMemo(()=>{if(t)return t;const n=$t[e]==null?0:$t[e]+1;return $t[e]=n,e+"-"+n},[e,t])}function Jn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,l)=>{const c=Object.entries(l);for(const[u,d]of c){const f=s[u];f!=null&&(s[u]=f+e*d)}return s},{...t})}}const $e=Jn(1),bt=Jn(-1);function no(e){return"clientX"in e&&"clientY"in e}function rn(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function ro(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(ro(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return no(e)?{x:e.clientX,y:e.clientY}:null}const Ie=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ie.Translate.toString(e),Ie.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),wn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function oo(e){return e.matches(wn)?e:e.querySelector(wn)}const so={display:"none"};function io(e){let{id:t,value:n}=e;return h.createElement("div",{id:t,style:so},n)}function ao(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function lo(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Zn=h.createContext(null);function co(e){const t=h.useContext(Zn);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uo(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.useCallback(r=>{let{type:o,event:s}=r;e.forEach(l=>{var c;return(c=l[o])==null?void 0:c.call(l,s)})},[e]),t]}const fo={draggable:`
6
+ <%s key={someKey} {...props} />`,Y,W,K,W),z[W+Y]=!0)}if(W=null,N!==void 0&&(n(N),W=""+N),c(T)&&(n(T.key),W=""+T.key),"key"in T){N={};for(var J in T)J!=="key"&&(N[J]=T[J])}else N=T;return W&&l(N,typeof x=="function"?x.displayName||x.name||"Unknown":x),d(x,W,N,o(),X,q)}function f(x){b(x)?x._store&&(x._store.validated=1):typeof x=="object"&&x!==null&&x.$$typeof===V&&(x._payload.status==="fulfilled"?b(x._payload.value)&&x._payload.value._store&&(x._payload.value._store.validated=1):x._store&&(x._store.validated=1))}function b(x){return typeof x=="object"&&x!==null&&x.$$typeof===p}var v=h,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),I=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),H=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,k=Array.isArray,E=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(x){return x()}};var C,_={},D=v.react_stack_bottom_frame.bind(v,s)(),P=E(r(s)),z={};Ve.Fragment=S,Ve.jsx=function(x,T,N){var Y=1e4>H.recentlyCreatedOwnerStacks++;return g(x,T,N,!1,Y?Error("react-stack-top-frame"):D,Y?E(r(x)):P)},Ve.jsxs=function(x,T,N){var Y=1e4>H.recentlyCreatedOwnerStacks++;return g(x,T,N,!0,Y?Error("react-stack-top-frame"):D,Y?E(r(x)):P)}})()),Ve}var wn;function eo(){return wn||(wn=1,process.env.NODE_ENV==="production"?it.exports=Zr():it.exports=Qr()),it.exports}var i=eo();function to(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function tn(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:tn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function nn(e){const{Document:t}=ae(e);return e instanceof t}function et(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function Jn(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:tn(e)?nn(e)?e:et(e)||Jn(e)?e.ownerDocument:document:document:document}const xe=Dt?h.useLayoutEffect:h.useEffect;function rn(e){const t=h.useRef(e);return xe(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function no(){const e=h.useRef(null),t=h.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Je(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return xe(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function xt(e){const t=rn(e),n=h.useRef(null),r=h.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Wt(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let It={};function nt(e,t){return h.useMemo(()=>{if(t)return t;const n=It[e]==null?0:It[e]+1;return It[e]=n,e+"-"+n},[e,t])}function Zn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,c)=>{const l=Object.entries(c);for(const[u,d]of l){const g=s[u];g!=null&&(s[u]=g+e*d)}return s},{...t})}}const $e=Zn(1),bt=Zn(-1);function ro(e){return"clientX"in e&&"clientY"in e}function on(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function oo(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Ut(e){if(oo(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return ro(e)?{x:e.clientX,y:e.clientY}:null}const Ie=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ie.Translate.toString(e),Ie.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Cn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function so(e){return e.matches(Cn)?e:e.querySelector(Cn)}const io={display:"none"};function ao(e){let{id:t,value:n}=e;return h.createElement("div",{id:t,style:io},n)}function co(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function lo(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Qn=h.createContext(null);function uo(e){const t=h.useContext(Qn);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function fo(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.useCallback(r=>{let{type:o,event:s}=r;e.forEach(c=>{var l;return(l=c[o])==null?void 0:l.call(c,s)})},[e]),t]}const ho={draggable:`
7
7
  To pick up a draggable item, press the space bar.
8
8
  While dragging, use the arrow keys to move the item.
9
9
  Press space again to drop the item in its new position, or press escape to cancel.
10
- `},ho={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function go(e){let{announcements:t=ho,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=fo}=e;const{announce:s,announcement:l}=lo(),c=tt("DndLiveRegion"),[u,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),co(h.useMemo(()=>({onDragStart(g){let{active:y}=g;s(t.onDragStart({active:y}))},onDragMove(g){let{active:y,over:v}=g;t.onDragMove&&s(t.onDragMove({active:y,over:v}))},onDragOver(g){let{active:y,over:v}=g;s(t.onDragOver({active:y,over:v}))},onDragEnd(g){let{active:y,over:v}=g;s(t.onDragEnd({active:y,over:v}))},onDragCancel(g){let{active:y,over:v}=g;s(t.onDragCancel({active:y,over:v}))}}),[s,t])),!u)return null;const f=h.createElement(h.Fragment,null,h.createElement(io,{id:r,value:o.draggable}),h.createElement(ao,{id:c,announcement:l}));return n?Ue.createPortal(f,n):f}var Q;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Q||(Q={}));function yt(){}function po(e,t){return h.useMemo(()=>({sensor:e,options:{}}),[e,t])}function vo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function mo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function bo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function yo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Cn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Cn(t,t.left,t.top),s=[];for(const l of r){const{id:c}=l,u=n.get(c);if(u){const d=mo(Cn(u),o);s.push({id:c,data:{droppableContainer:l,value:d}})}}return s.sort(xo)};function So(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),l=o-r,c=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,f=l*c,g=f/(u+d-f);return Number(g.toFixed(4))}return 0}const wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=So(c,t);u>0&&o.push({id:l,data:{droppableContainer:s,value:u}})}}return o.sort(bo)};function Co(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function Do(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const jo=Do(1);function Ro(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Eo(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:s,x:l,y:c}=r,u=e.left-l-(1-o)*parseFloat(n),d=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,g=s?e.height/s:e.height;return{width:f,height:g,top:d,right:u+f,bottom:d+g,left:u}}const To={ignoreTransform:!1};function Pe(e,t){t===void 0&&(t=To);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=ae(e).getComputedStyle(e);d&&(n=Eo(n,d,f))}const{top:r,left:o,width:s,height:l,bottom:c,right:u}=n;return{top:r,left:o,width:s,height:l,bottom:c,right:u}}function Dn(e){return Pe(e,{ignoreTransform:!0})}function Mo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function _o(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Oo(e,t){t===void 0&&(t=ae(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function on(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(tn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Qe(o)||Kn(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&Oo(o,s)&&n.push(o),_o(o,s)?n:r(o.parentNode)}return e?r(e):n}function tr(e){const[t]=on(e,1);return t??null}function It(e){return!Dt||!e?null:Ae(e)?e:en(e)?tn(e)||e===Le(e).scrollingElement?window:Qe(e)?e:null:null}function nr(e){return Ae(e)?e.scrollX:e.scrollLeft}function rr(e){return Ae(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:nr(e),y:rr(e)}}var ee;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ee||(ee={}));function or(e){return!Dt||!e?!1:e===document.scrollingElement}function sr(e){const t={x:0,y:0},n=or(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const ko={x:.2,y:.2};function $o(e,t,n,r,o){let{top:s,left:l,right:c,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=ko);const{isTop:d,isBottom:f,isLeft:g,isRight:y}=sr(e),v={x:0,y:0},p={x:0,y:0},x={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+x.height?(v.y=ee.Backward,p.y=r*Math.abs((t.top+x.height-s)/x.height)):!f&&u>=t.bottom-x.height&&(v.y=ee.Forward,p.y=r*Math.abs((t.bottom-x.height-u)/x.height)),!y&&c>=t.right-x.width?(v.x=ee.Forward,p.x=r*Math.abs((t.right-x.width-c)/x.width)):!g&&l<=t.left+x.width&&(v.x=ee.Backward,p.x=r*Math.abs((t.left+x.width-l)/x.width)),{direction:v,speed:p}}function Io(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:l}=window;return{top:0,left:0,right:s,bottom:l,width:s,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ir(e){return e.reduce((t,n)=>$e(t,Ut(n)),pe)}function Ao(e){return e.reduce((t,n)=>t+nr(n),0)}function Lo(e){return e.reduce((t,n)=>t+rr(n),0)}function Po(e,t){if(t===void 0&&(t=Pe),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);tr(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const No=[["x",["left","right"],Ao],["y",["top","bottom"],Lo]];class sn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=on(n),o=ir(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,l,c]of No)for(const u of l)Object.defineProperty(this,u,{get:()=>{const d=c(r),f=o[s]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ge{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function zo(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function At(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function jn(e){e.preventDefault()}function Fo(e){e.stopPropagation()}var U;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(U||(U={}));const ar={start:[U.Space,U.Enter],cancel:[U.Esc],end:[U.Space,U.Enter,U.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case U.Right:return{...n,x:n.x+25};case U.Left:return{...n,x:n.x-25};case U.Down:return{...n,y:n.y+25};case U.Up:return{...n,y:n.y-25}}};class lr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ge(Le(n)),this.windowListeners=new Ge(ae(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Po(r),n(pe)}handleKeyDown(t){if(rn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=ar,coordinateGetter:l=Yo,scrollBehavior:c="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=f);const g=l(t,{active:n,context:r.current,currentCoordinates:f});if(g){const y=bt(g,f),v={x:0,y:0},{scrollableAncestors:p}=r.current;for(const x of p){const S=t.code,{isTop:w,isRight:E,isLeft:T,isBottom:I,maxScroll:$,minScroll:M}=sr(x),A=Io(x),L={x:Math.min(S===U.Right?A.right-A.width/2:A.right,Math.max(S===U.Right?A.left:A.left+A.width/2,g.x)),y:Math.min(S===U.Down?A.bottom-A.height/2:A.bottom,Math.max(S===U.Down?A.top:A.top+A.height/2,g.y))},V=S===U.Right&&!E||S===U.Left&&!T,Y=S===U.Down&&!I||S===U.Up&&!w;if(V&&L.x!==g.x){const O=x.scrollLeft+y.x,H=S===U.Right&&O<=$.x||S===U.Left&&O>=M.x;if(H&&!y.y){x.scrollTo({left:O,behavior:c});return}H?v.x=x.scrollLeft-O:v.x=S===U.Right?x.scrollLeft-$.x:x.scrollLeft-M.x,v.x&&x.scrollBy({left:-v.x,behavior:c});break}else if(Y&&L.y!==g.y){const O=x.scrollTop+y.y,H=S===U.Down&&O<=$.y||S===U.Up&&O>=M.y;if(H&&!y.x){x.scrollTo({top:O,behavior:c});return}H?v.y=x.scrollTop-O:v.y=S===U.Down?x.scrollTop-$.y:x.scrollTop-M.y,v.y&&x.scrollBy({top:-v.y,behavior:c});break}}this.handleMove(t,$e(bt(g,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ar,onActivation:o}=t,{active:s}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=s.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Rn(e){return!!(e&&"distance"in e)}function En(e){return!!(e&&"delay"in e)}class an{constructor(t,n,r){var o;r===void 0&&(r=zo(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:l}=s;this.props=t,this.events=n,this.document=Le(l),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(l)),this.initialCoordinates=(o=Wt(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,jn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,jn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(En(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Rn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Fo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:l,options:{activationConstraint:c}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:pe,d=bt(o,u);if(!r&&c){if(Rn(c)){if(c.tolerance!=null&&At(d,c.tolerance))return this.handleCancel();if(At(d,c.distance))return this.handleStart()}if(En(c)&&At(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===U.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Bo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ln extends an{constructor(t){const{event:n}=t,r=Le(n.target);super(t,Bo,r)}}ln.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Ho={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Vo extends an{constructor(t){super(t,Ho,Le(t.event.target))}}Vo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Gt.RightClick?!1:(r?.({event:n}),!0)}}];const Lt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Wo extends an{constructor(t){super(t,Lt)}static setup(){return window.addEventListener(Lt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Lt.move.name,t)};function t(){}}}Wo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var qe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(qe||(qe={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function Uo(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:l=5,order:c=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:g,threshold:y}=e;const v=qo({delta:g,disabled:!s}),[p,x]=to(),S=h.useRef({x:0,y:0}),w=h.useRef({x:0,y:0}),E=h.useMemo(()=>{switch(n){case qe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case qe.DraggableRect:return o}},[n,o,u]),T=h.useRef(null),I=h.useCallback(()=>{const M=T.current;if(!M)return;const A=S.current.x*w.current.x,L=S.current.y*w.current.y;M.scrollBy(A,L)},[]),$=h.useMemo(()=>c===St.TreeOrder?[...d].reverse():d,[c,d]);h.useEffect(()=>{if(!s||!d.length||!E){x();return}for(const M of $){if(r?.(M)===!1)continue;const A=d.indexOf(M),L=f[A];if(!L)continue;const{direction:V,speed:Y}=$o(M,L,E,t,y);for(const O of["x","y"])v[O][V[O]]||(Y[O]=0,V[O]=0);if(Y.x>0||Y.y>0){x(),T.current=M,p(I,l),S.current=Y,w.current=V;return}}S.current={x:0,y:0},w.current={x:0,y:0},x()},[t,I,r,x,s,l,JSON.stringify(E),JSON.stringify(v),p,d,$,f,JSON.stringify(y)])}const Go={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Vt(t);return et(o=>{if(n||!r||!o)return Go;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ee.Backward]:o.x[ee.Backward]||s.x===-1,[ee.Forward]:o.x[ee.Forward]||s.x===1},y:{[ee.Backward]:o.y[ee.Backward]||s.y===-1,[ee.Forward]:o.y[ee.Forward]||s.y===1}}},[n,t,r])}function Xo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return et(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Ko(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...s]},[]),[e,t])}var Je;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Je||(Je={}));var qt;(function(e){e.Optimized="optimized"})(qt||(qt={}));const Tn=new Map;function Jo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,l]=h.useState(null),{frequency:c,measure:u,strategy:d}=o,f=h.useRef(e),g=S(),y=Ke(g),v=h.useCallback(function(w){w===void 0&&(w=[]),!y.current&&l(E=>E===null?w:E.concat(w.filter(T=>!E.includes(T))))},[y]),p=h.useRef(null),x=et(w=>{if(g&&!n)return Tn;if(!w||w===Tn||f.current!==e||s!=null){const E=new Map;for(let T of e){if(!T)continue;if(s&&s.length>0&&!s.includes(T.id)&&T.rect.current){E.set(T.id,T.rect.current);continue}const I=T.node.current,$=I?new sn(u(I),I):null;T.rect.current=$,$&&E.set(T.id,$)}return E}return w},[e,s,n,g,u]);return h.useEffect(()=>{f.current=e},[e]),h.useEffect(()=>{g||v()},[n,g]),h.useEffect(()=>{s&&s.length>0&&l(null)},[JSON.stringify(s)]),h.useEffect(()=>{g||typeof c!="number"||p.current!==null||(p.current=setTimeout(()=>{v(),p.current=null},c))},[c,g,v,...r]),{droppableRects:x,measureDroppableContainers:v,measuringScheduled:s!=null};function S(){switch(d){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function cr(e,t){return et(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zo(e,t){return cr(e,t)}function Qo(e){let{callback:t,disabled:n}=e;const r=nn(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function jt(e){let{callback:t,disabled:n}=e;const r=nn(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function es(e){return new sn(Pe(e),e)}function Mn(e,t,n){t===void 0&&(t=es);const[r,o]=h.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const f=t(e);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const l=Qo({callback(u){if(e)for(const d of u){const{type:f,target:g}=d;if(f==="childList"&&g instanceof HTMLElement&&g.contains(e)){s();break}}}}),c=jt({callback:s});return xe(()=>{s(),e?(c?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),l?.disconnect())},[e]),r}function ts(e){const t=cr(e);return er(e,t)}const _n=[];function ns(e){const t=h.useRef(e),n=et(r=>e?r&&r!==_n&&e&&t.current&&e.parentNode===t.current.parentNode?r:on(e):_n,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function rs(e){const[t,n]=h.useState(null),r=h.useRef(e),o=h.useCallback(s=>{const l=It(s.target);l&&n(c=>c?(c.set(l,Ut(l)),new Map(c)):null)},[]);return h.useEffect(()=>{const s=r.current;if(e!==s){l(s);const c=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(s)};function l(c){c.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,l)=>$e(s,l),pe):ir(e):pe,[e,t])}function On(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bt(e,n.current):pe}function os(e){h.useEffect(()=>{if(!Dt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function ss(e,t){return h.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=l=>{s(l,t)},n},{}),[e,t])}function ur(e){return h.useMemo(()=>e?Mo(e):null,[e])}const kn=[];function is(e,t){t===void 0&&(t=Pe);const[n]=e,r=ur(n?ae(n):null),[o,s]=h.useState(kn);function l(){s(()=>e.length?e.map(u=>or(u)?r:new sn(t(u),u)):kn)}const c=jt({callback:l});return xe(()=>{c?.disconnect(),l(),e.forEach(u=>c?.observe(u))},[e]),o}function as(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function ls(e){let{measure:t}=e;const[n,r]=h.useState(null),o=h.useCallback(d=>{for(const{target:f}of d)if(Qe(f)){r(g=>{const y=t(f);return g?{...g,width:y.width,height:y.height}:y});break}},[t]),s=jt({callback:o}),l=h.useCallback(d=>{const f=as(d);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[c,u]=xt(l);return h.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const cs=[{sensor:ln,options:{}},{sensor:lr,options:{}}],us={current:{}},ht={draggable:{measure:Dn},droppable:{measure:Dn,strategy:Je.WhileDragging,frequency:qt.Optimized},dragOverlay:{measure:Pe}};class Xe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ds={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:yt,windowRect:null,measuringScheduled:!1},fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=h.createContext(fs),dr=h.createContext(ds);function hs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function gs(e,t){switch(t.type){case Q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Q.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Q.DragEnd:case Q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Xe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new Xe(e.droppable.containers);return l.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case Q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Xe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ps(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=h.useContext(Rt),s=Vt(r),l=Vt(n?.id);return h.useEffect(()=>{if(!t&&!r&&s&&l!=null){if(!rn(s)||document.activeElement===s.target)return;const c=o.get(l);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const g=oo(f);if(g){g.focus();break}}})}},[r,t,o,l,s]),null}function vs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ms(e){return h.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function xs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=h.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;xe(()=>{if(!l&&!c||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),g=er(f,r);if(l||(g.x=0),c||(g.y=0),s.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const y=tr(d);y&&y.scrollBy({top:g.y,left:g.x})}},[t,l,c,r,n])}const fr=h.createContext({...pe,scaleX:1,scaleY:1});var Re;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Re||(Re={}));const hr=h.memo(function(t){var n,r,o,s;let{id:l,accessibility:c,autoScroll:u=!0,children:d,sensors:f=cs,collisionDetection:g=wo,measuring:y,modifiers:v,...p}=t;const x=h.useReducer(gs,void 0,hs),[S,w]=x,[E,T]=uo(),[I,$]=h.useState(Re.Uninitialized),M=I===Re.Initialized,{draggable:{active:A,nodes:L,translate:V},droppable:{containers:Y}}=S,O=A!=null?L.get(A):null,H=h.useRef({initial:null,translated:null}),G=h.useMemo(()=>{var re;return A!=null?{id:A,data:(re=O?.data)!=null?re:us,rect:H}:null},[A,O]),k=h.useRef(null),[j,C]=h.useState(null),[_,D]=h.useState(null),P=Ke(p,Object.values(p)),z=tt("DndDescribedBy",l),m=h.useMemo(()=>Y.getEnabled(),[Y]),R=ms(y),{droppableRects:N,measureDroppableContainers:B,measuringScheduled:q}=Jo(m,{dragging:M,dependencies:[V.x,V.y],config:R.droppable}),X=Xo(L,A),W=h.useMemo(()=>_?Wt(_):null,[_]),K=Kr(),J=Zo(X,R.draggable.measure);xs({activeNode:A!=null?L.get(A):null,config:K.layoutShiftCompensation,initialRect:J,measure:R.draggable.measure});const F=Mn(X,R.draggable.measure,J),se=Mn(X?X.parentElement:null),ne=h.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=Y.getNodeFor((n=ne.current.over)==null?void 0:n.id),be=ls({measure:R.dragOverlay.measure}),Te=(r=be.nodeRef.current)!=null?r:X,Me=M?(o=be.rect)!=null?o:F:null,dn=!!(be.nodeRef.current&&be.rect),fn=ts(dn?null:F),_t=ur(Te?ae(Te):null),Se=ns(M?he??X:null),ot=is(Se),st=vs(v,{transform:{x:V.x-fn.x,y:V.y-fn.y,scaleX:1,scaleY:1},activatorEvent:_,active:G,activeNodeRect:F,containerNodeRect:se,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:be.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:_t}),hn=W?$e(W,V):null,gn=rs(Se),Hr=On(gn),Vr=On(gn,[F]),_e=$e(st,Hr),Oe=Me?jo(Me,st):null,Ne=G&&Oe?g({active:G,collisionRect:Oe,droppableRects:N,droppableContainers:m,pointerCoordinates:hn}):null,pn=yo(Ne,"id"),[we,vn]=h.useState(null),Wr=dn?st:$e(st,Vr),Ur=Co(Wr,(s=we?.rect)!=null?s:null,F),Ot=h.useRef(null),mn=h.useCallback((re,le)=>{let{sensor:ce,options:Ce}=le;if(k.current==null)return;const de=L.get(k.current);if(!de)return;const ue=re.nativeEvent,ve=new ce({active:k.current,activeNode:de,event:ue,options:Ce,context:ne,onAbort(te){if(!L.get(te))return;const{onDragAbort:me}=P.current,ye={id:te};me?.(ye),E({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!L.get(te))return;const{onDragPending:Fe}=P.current,je={id:te,constraint:De,initialCoordinates:me,offset:ye};Fe?.(je),E({type:"onDragPending",event:je})},onStart(te){const De=k.current;if(De==null)return;const me=L.get(De);if(!me)return;const{onDragStart:ye}=P.current,ze={activatorEvent:ue,active:{id:De,data:me.data,rect:H}};Ue.unstable_batchedUpdates(()=>{ye?.(ze),$(Re.Initializing),w({type:Q.DragStart,initialCoordinates:te,active:De}),E({type:"onDragStart",event:ze}),C(Ot.current),D(ue)})},onMove(te){w({type:Q.DragMove,coordinates:te})},onEnd:ke(Q.DragEnd),onCancel:ke(Q.DragCancel)});Ot.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:ze,scrollAdjustedTranslate:Fe}=ne.current;let je=null;if(me&&Fe){const{cancelDrop:Ye}=P.current;je={activatorEvent:ue,active:me,collisions:ye,delta:Fe,over:ze},te===Q.DragEnd&&typeof Ye=="function"&&await Promise.resolve(Ye(je))&&(te=Q.DragCancel)}k.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),$(Re.Uninitialized),vn(null),C(null),D(null),Ot.current=null;const Ye=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(je){const kt=P.current[Ye];kt?.(je),E({type:Ye,event:je})}})}}},[L]),Gr=h.useCallback((re,le)=>(ce,Ce)=>{const de=ce.nativeEvent,ue=L.get(Ce);if(k.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(ce,le.options,ve)===!0&&(de.dndKit={capturedBy:le.sensor},k.current=Ce,mn(ce,le))},[L,mn]),xn=Ko(f,Gr);os(f),xe(()=>{F&&I===Re.Initializing&&$(Re.Initialized)},[F,I]),h.useEffect(()=>{const{onDragMove:re}=P.current,{active:le,activatorEvent:ce,collisions:Ce,over:de}=ne.current;if(!le||!ce)return;const ue={active:le,activatorEvent:ce,collisions:Ce,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(ue),E({type:"onDragMove",event:ue})})},[_e.x,_e.y]),h.useEffect(()=>{const{active:re,activatorEvent:le,collisions:ce,droppableContainers:Ce,scrollAdjustedTranslate:de}=ne.current;if(!re||k.current==null||!le||!de)return;const{onDragOver:ue}=P.current,ve=Ce.get(pn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:re,activatorEvent:le,collisions:ce,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{vn(ke),ue?.(te),E({type:"onDragOver",event:te})})},[pn]),xe(()=>{ne.current={activatorEvent:_,active:G,activeNode:X,collisionRect:Oe,collisions:Ne,droppableRects:N,draggableNodes:L,draggingNode:Te,draggingNodeRect:Me,droppableContainers:Y,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},H.current={initial:Me,translated:Oe}},[G,X,Ne,Oe,L,Te,Me,N,Y,we,Se,_e]),Uo({...K,delta:V,draggingRect:Oe,pointerCoordinates:hn,scrollableAncestors:Se,scrollableAncestorRects:ot});const qr=h.useMemo(()=>({active:G,activeNode:X,activeNodeRect:F,activatorEvent:_,collisions:Ne,containerNodeRect:se,dragOverlay:be,draggableNodes:L,droppableContainers:Y,droppableRects:N,over:we,measureDroppableContainers:B,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:R,measuringScheduled:q,windowRect:_t}),[G,X,F,_,Ne,se,be,L,Y,N,we,B,Se,ot,R,q,_t]),Xr=h.useMemo(()=>({activatorEvent:_,activators:xn,active:G,activeNodeRect:F,ariaDescribedById:{draggable:z},dispatch:w,draggableNodes:L,over:we,measureDroppableContainers:B}),[_,xn,G,F,w,z,L,we,B]);return h.createElement(Zn.Provider,{value:T},h.createElement(Rt.Provider,{value:Xr},h.createElement(dr.Provider,{value:qr},h.createElement(fr.Provider,{value:Ur},d)),h.createElement(ps,{disabled:c?.restoreFocus===!1})),h.createElement(go,{...c,hiddenTextDescribedById:z}));function Kr(){const re=j?.autoScrollEnabled===!1,le=typeof u=="object"?u.enabled===!1:u===!1,ce=M&&!re&&!le;return typeof u=="object"?{...u,enabled:ce}:{enabled:ce}}}),bs=h.createContext(null),$n="button",ys="Draggable";function Ss(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(ys),{activators:l,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:g,over:y}=h.useContext(Rt),{role:v=$n,roleDescription:p="draggable",tabIndex:x=0}=o??{},S=u?.id===t,w=h.useContext(S?fr:bs),[E,T]=xt(),[I,$]=xt(),M=ss(l,t),A=Ke(n);xe(()=>(g.set(t,{id:t,key:s,node:E,activatorNode:I,data:A}),()=>{const V=g.get(t);V&&V.key===s&&g.delete(t)}),[g,t]);const L=h.useMemo(()=>({role:v,tabIndex:x,"aria-disabled":r,"aria-pressed":S&&v===$n?!0:void 0,"aria-roledescription":p,"aria-describedby":f.draggable}),[r,v,x,S,p,f.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:L,isDragging:S,listeners:r?void 0:M,node:E,over:y,setNodeRef:T,setActivatorNodeRef:$,transform:w}}function ws(){return h.useContext(dr)}const Cs="Droppable",Ds={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(Cs),{active:l,dispatch:c,over:u,measureDroppableContainers:d}=h.useContext(Rt),f=h.useRef({disabled:n}),g=h.useRef(!1),y=h.useRef(null),v=h.useRef(null),{disabled:p,updateMeasurementsFor:x,timeout:S}={...Ds,...o},w=Ke(x??r),E=h.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),v.current=null},S)},[S]),T=jt({callback:E,disabled:p||!l}),I=h.useCallback((L,V)=>{T&&(V&&(T.unobserve(V),g.current=!1),L&&T.observe(L))},[T]),[$,M]=xt(I),A=Ke(t);return h.useEffect(()=>{!T||!$.current||(T.disconnect(),g.current=!1,T.observe($.current))},[$,T]),h.useEffect(()=>(c({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:y,data:A}}),()=>c({type:Q.UnregisterDroppable,key:s,id:r})),[r]),h.useEffect(()=>{n!==f.current.disabled&&(c({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:l,rect:y,isOver:u?.id===r,node:$,over:u,setNodeRef:M}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rs(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function at(e){return e!==null&&e>=0}function Es(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ts(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const lt={scaleX:1,scaleY:1},Ms=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:l}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const u=_s(n,l,o);if(l===o){const d=n[s];return d?{x:o<s?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...lt}:null}return l>o&&l<=s?{x:-c.width-u,y:0,...lt}:l<o&&l>=s?{x:c.width+u,y:0,...lt}:{x:0,y:0,...lt}};function _s(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const gr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Et(t,r,n),l=t[o],c=s[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},ct={scaleX:1,scaleY:1},Os=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:l}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const d=s[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...ct}:null}const u=ks(s,o,n);return o>n&&o<=l?{x:0,y:-c.height-u,...ct}:o<n&&o>=l?{x:0,y:c.height+u,...ct}:{x:0,y:0,...ct}};function ks(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const pr="Sortable",vr=h.createContext({activeIndex:-1,containerId:pr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:gr,disabled:{draggable:!1,droppable:!1}});function mr(e){let{children:t,id:n,items:r,strategy:o=gr,disabled:s=!1}=e;const{active:l,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:f}=ws(),g=tt(pr,n),y=c.rect!==null,v=h.useMemo(()=>r.map(M=>typeof M=="object"&&"id"in M?M.id:M),[r]),p=l!=null,x=l?v.indexOf(l.id):-1,S=d?v.indexOf(d.id):-1,w=h.useRef(v),E=!Es(v,w.current),T=S!==-1&&x===-1||E,I=Ts(s);xe(()=>{E&&p&&f(v)},[E,v,p,f]),h.useEffect(()=>{w.current=v},[v]);const $=h.useMemo(()=>({activeIndex:x,containerId:g,disabled:I,disableTransforms:T,items:v,overIndex:S,useDragOverlay:y,sortedRects:Rs(v,u),strategy:o}),[x,g,I.draggable,I.droppable,T,v,S,u,y,o]);return h.createElement(vr.Provider,{value:$},t)}const $s=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},Is=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:l,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==s&&o===l?!1:n?!0:l!==o&&t===u},As={duration:200,easing:"ease"},xr="transform",Ls=Ie.Transition.toString({property:xr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function Ns(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,l]=h.useState(null),c=h.useRef(n);return xe(()=>{if(!t&&n!==c.current&&r.current){const u=o.current;if(u){const d=Pe(r.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&l(f)}}n!==c.current&&(c.current=n)},[t,n,r,o]),h.useEffect(()=>{s&&l(null)},[s]),s}function br(e){let{animateLayoutChanges:t=Is,attributes:n,disabled:r,data:o,getNewIndex:s=$s,id:l,strategy:c,resizeObserverConfig:u,transition:d=As}=e;const{items:f,containerId:g,activeIndex:y,disabled:v,disableTransforms:p,sortedRects:x,overIndex:S,useDragOverlay:w,strategy:E}=h.useContext(vr),T=zs(r,v),I=f.indexOf(l),$=h.useMemo(()=>({sortable:{containerId:g,index:I,items:f},...o}),[g,o,I,f]),M=h.useMemo(()=>f.slice(f.indexOf(l)),[f,l]),{rect:A,node:L,isOver:V,setNodeRef:Y}=js({id:l,data:$,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...u}}),{active:O,activatorEvent:H,activeNodeRect:G,attributes:k,setNodeRef:j,listeners:C,isDragging:_,over:D,setActivatorNodeRef:P,transform:z}=Ss({id:l,data:$,attributes:{...Ps,...n},disabled:T.draggable}),m=eo(Y,j),R=!!O,N=R&&!p&&at(y)&&at(S),B=!w&&_,q=B&&N?z:null,W=N?q??(c??E)({rects:x,activeNodeRect:G,activeIndex:y,overIndex:S,index:I}):null,K=at(y)&&at(S)?s({id:l,items:f,activeIndex:y,overIndex:S}):I,J=O?.id,F=h.useRef({activeId:J,items:f,newIndex:K,containerId:g}),se=f!==F.current.items,ne=t({active:O,containerId:g,isDragging:_,isSorting:R,id:l,index:I,items:f,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=Ns({disabled:!ne,index:I,node:L,rect:A});return h.useEffect(()=>{R&&F.current.newIndex!==K&&(F.current.newIndex=K),g!==F.current.containerId&&(F.current.containerId=g),f!==F.current.items&&(F.current.items=f)},[R,K,g,f]),h.useEffect(()=>{if(J===F.current.activeId)return;if(J!=null&&F.current.activeId==null){F.current.activeId=J;return}const Te=setTimeout(()=>{F.current.activeId=J},50);return()=>clearTimeout(Te)},[J]),{active:O,activeIndex:y,attributes:k,data:$,rect:A,index:I,newIndex:K,items:f,isOver:V,isSorting:R,isDragging:_,listeners:C,node:L,overIndex:S,over:D,setNodeRef:m,setActivatorNodeRef:P,setDroppableNodeRef:Y,setDraggableNodeRef:j,transform:he??W,transition:be()};function be(){if(he||se&&F.current.newIndex===I)return Ls;if(!(B&&!rn(H)||!d)&&(R||ne))return Ie.Transition.toString({...d,property:xr})}}function zs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}U.Down,U.Right,U.Up,U.Left;var ut={exports:{}},Pt={},dt={exports:{}},Nt={};var In;function Fs(){if(In)return Nt;In=1;var e=h;function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,y){var v=y(),p=r({inst:{value:v,getSnapshot:y}}),x=p[0].inst,S=p[1];return s(function(){x.value=v,x.getSnapshot=y,u(x)&&S({inst:x})},[g,v,y]),o(function(){return u(x)&&S({inst:x}),g(function(){u(x)&&S({inst:x})})},[g]),l(v),v}function u(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function d(g,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Nt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Nt}var zt={};var An;function Ys(){return An||(An=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,p){return v===p&&(v!==0||1/v===1/p)||v!==v&&p!==p}function t(v,p){f||o.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=p();if(!g){var S=p();s(x,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}S=l({inst:{value:x,getSnapshot:p}});var w=S[0].inst,E=S[1];return u(function(){w.value=x,w.getSnapshot=p,n(w)&&E({inst:w})},[v,x,p]),c(function(){return n(w)&&E({inst:w}),v(function(){n(w)&&E({inst:w})})},[v]),d(x),x}function n(v){var p=v.getSnapshot;v=v.value;try{var x=p();return!s(v,x)}catch{return!0}}function r(v,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,s=typeof Object.is=="function"?Object.is:e,l=o.useState,c=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,f=!1,g=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;zt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),zt}var Ln;function yr(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?dt.exports=Fs():dt.exports=Ys()),dt.exports}var Pn;function Bs(){if(Pn)return Pt;Pn=1;var e=h,t=yr();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Pt.useSyncExternalStoreWithSelector=function(d,f,g,y,v){var p=s(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=c(function(){function w(M){if(!E){if(E=!0,T=M,M=y(M),v!==void 0&&x.hasValue){var A=x.value;if(v(A,M))return I=A}return I=M}if(A=I,r(T,M))return A;var L=y(M);return v!==void 0&&v(A,L)?(T=M,A):(T=M,I=L)}var E=!1,T,I,$=g===void 0?null:g;return[function(){return w(f())},$===null?void 0:function(){return w($())}]},[f,g,y,v]);var S=o(d,p[0],p[1]);return l(function(){x.hasValue=!0,x.value=S},[S]),u(S),S},Pt}var Ft={};var Nn;function Hs(){return Nn||(Nn=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,n=yr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,u=t.useDebugValue;Ft.useSyncExternalStoreWithSelector=function(d,f,g,y,v){var p=s(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=c(function(){function w(M){if(!E){if(E=!0,T=M,M=y(M),v!==void 0&&x.hasValue){var A=x.value;if(v(A,M))return I=A}return I=M}if(A=I,r(T,M))return A;var L=y(M);return v!==void 0&&v(A,L)?(T=M,A):(T=M,I=L)}var E=!1,T,I,$=g===void 0?null:g;return[function(){return w(f())},$===null?void 0:function(){return w($())}]},[f,g,y,v]);var S=o(d,p[0],p[1]);return l(function(){x.hasValue=!0,x.value=S},[S]),u(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ft}var zn;function Vs(){return zn||(zn=1,process.env.NODE_ENV==="production"?ut.exports=Bs():ut.exports=Hs()),ut.exports}var Ws=Vs();const Xt=new WeakMap,Us=new WeakMap,wt={current:[]};let Yt=!1;const ft=new Set,Fn=new Map;function Sr(e){for(const t of e){if(wt.current.includes(t))continue;wt.current.push(t),t.recompute();const n=Us.get(t);if(n)for(const r of n){const o=Xt.get(r);o?.length&&Sr(o)}}}function Gs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Xs(e){if(ft.add(e),!Yt)try{for(Yt=!0;ft.size>0;){const t=Array.from(ft);ft.clear();for(const n of t){const r=Fn.get(n)??n.prevState;n.prevState=r,Gs(n)}for(const n of t){const r=Xt.get(n);r&&(wt.current.push(n),Sr(r))}for(const n of t){const r=Xt.get(n);if(r)for(const o of r)qs(o)}}}finally{Yt=!1,wt.current=[],Fn.clear()}}function Ks(e){return typeof e=="function"}class wr{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const l=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Ks(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Xs(this)}}function nt(e,t=r=>r,n={}){const r=n.equal??Js;return Ws.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Js(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Yn(e);if(n.length!==Yn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Yn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ie=new wr({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}});function Cr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(f=>({id:f,label:f}))).filter(f=>Object.prototype.hasOwnProperty.call(n,f.id)),{tableId:s}=ie.state,l=JSON.parse(localStorage.getItem(Rr(s))||"[]"),c=[...l.map(f=>o.find(g=>g.id===f)).filter(Boolean),...o.filter(f=>!l.includes(f.id))],u=JSON.parse(localStorage.getItem(Er(s))||"{}"),d=c.reduce((f,g)=>(f[g.id]=u[g.id]??!0,f),{});ie.setState(f=>({...f,data:e,columnOrder:c,visibility:d,sortableColumns:c.map(g=>({id:g.id,label:g.label,sortable:!0,backgroundColor:g.backgroundColor}))}))}function Dr(e){ie.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const jr=e=>{ie.setState(t=>({...t,actionsConfig:e}))},Rr=e=>`table_column_order_v1:${e}`,Er=e=>`table_column_visibility_v1:${e}`,Zs=e=>{const{tableId:t}=ie.state;localStorage.setItem(Rr(t),JSON.stringify(e.map(n=>n.id))),ie.setState(n=>({...n,columnOrder:e})),ie.setState(n=>({...n,columnOrder:e}))};function Qs(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const ei=e=>{ie.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Er(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};const ti=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ni=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Bn=e=>{const t=ni(e);return t.charAt(0).toUpperCase()+t.slice(1)},Tr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ri=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var oi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const si=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},u)=>h.createElement("svg",{ref:u,...oi,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Tr("lucide",o),...!s&&!ri(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,f])=>h.createElement(d,f)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=h.forwardRef(({className:r,...o},s)=>h.createElement(si,{ref:s,iconNode:t,className:Tr(`lucide-${ti(Bn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Bn(e),n};const ii=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ai=oe("arrow-down",ii);const li=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ci=oe("arrow-up-down",li);const ui=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],di=oe("arrow-up",ui);const fi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],hi=oe("bookmark",fi);const gi=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Hn=oe("calendar",gi);const pi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vi=oe("chevron-left",pi);const mi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xi=oe("chevron-right",mi);const bi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],yi=oe("columns-2",bi);const Si=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],wi=oe("delete",Si);const Ci=[["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"}]],Di=oe("ellipsis",Ci);const ji=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ri=oe("funnel",ji);const Ei=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Mr=oe("grip-vertical",Ei);const Ti=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Mi=oe("pen",Ti);const _i=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Oi=oe("refresh-ccw",_i);const ki=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$i=oe("settings",ki);const Ii=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_r=oe("triangle-alert",Ii);function b(e){return h.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Ai=b(a.Menu.Trigger),Li=b(a.Menu.Positioner),Pi=b(a.Menu.Content),Ni=b(a.Menu.Item),zi=b(a.Checkbox.Label),Fi=b(a.Checkbox.HiddenInput),Yi=b(a.Checkbox.Control);function Bi({visibility:e,onToggle:t}){const{sortableColumns:n}=nt(ie);return i.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ai,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(yi,{size:18})})}),i.jsx(a.Portal,{children:i.jsx(Li,{children:i.jsx(Pi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(Ni,{value:r.id,closeOnSelect:!1,children:i.jsxs(a.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(Fi,{}),i.jsx(Yi,{}),i.jsx(zi,{children:r.label})]})},r.id)})})})})]})}function Hi({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:l}){const{setNodeRef:c,attributes:u,listeners:d,transform:f,transition:g}=br({id:e});return i.jsx(a.Table.ColumnHeader,{ref:c,onClick:n,backgroundColor:l,w:e==="id"||e==="row_number"?"80px":void 0,style:{transform:Ie.Transform.toString(f),transition:g,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(a.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Mr,{size:12})})]})})}function Vi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=nt(ie),l=e.map(c=>o.find(u=>u.id===c.id)).filter(c=>c!==void 0).filter(c=>t[c.id]);return i.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(a.Table.Row,{height:"28px",children:[s?.showSNo&&i.jsx(a.Table.ColumnHeader,{width:"60px",textAlign:"center",backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.indexChildren||"S.No"}),l.map(c=>{const u=n===c?.id;return i.jsx(Hi,{id:c?.id,onClick:()=>c?.sortable&&Qs(c?.id),cursor:c?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:c?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[c?.label,c?.sortable&&(u?r==="asc"?i.jsx(di,{size:14}):i.jsx(ai,{size:14}):i.jsx(ci,{size:14,opacity:.4}))]})},c?.id)}),s?.showActionColumn&&i.jsx(a.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children||"Actions"}),s?.showColumnVisibilityMenu&&i.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Bi,{visibility:t,onToggle:ei})})]})})}const Wi=[10,20,50,100],Ui=b(a.Select.Positioner),Gi=b(a.Select.Content),qi=b(a.Select.Item),Xi=b(a.Pagination.PrevTrigger),Ki=b(a.Pagination.NextTrigger),Ji=b(a.Select.HiddenSelect),Zi=b(a.Select.Control),Qi=b(a.Select.Trigger),ea=b(a.Select.ValueText),ta=b(a.Select.IndicatorGroup),na=b(a.Select.Indicator);function ra({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:l=Wi}){const c=a.createListCollection({items:l.map(u=>({label:String(u),value:String(u)}))});return i.jsx(a.Box,{width:"100%",children:i.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(a.HStack,{children:[i.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(a.Select.Root,{collection:c,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(Ji,{}),i.jsxs(Zi,{children:[i.jsx(Qi,{children:i.jsx(ea,{placeholder:""})}),i.jsx(ta,{children:i.jsx(na,{})})]}),i.jsx(a.Portal,{children:i.jsx(Ui,{children:i.jsx(Gi,{children:c.items.map(u=>i.jsxs(qi,{item:u.value,children:[u.label,i.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]}),i.jsxs(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),i.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Xi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Previous page",children:i.jsx(vi,{size:18})})}),i.jsx(a.Pagination.Items,{render:u=>i.jsx(a.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),i.jsx(Ki,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Next page",children:i.jsx(xi,{size:18})})})]})})]})})}const oa=b(a.Menu.Item),sa=b(a.Menu.Content),ia=b(a.Menu.Positioner),aa=b(a.Menu.Trigger);function la({data:e=[],actions:t=[],actionConfig:n,onRowSelect:r,onRowSelectEvent:o="left",startIndex:s=0}){const{columnOrder:l,visibility:c}=nt(ie);return i.jsx(a.Table.Body,{children:e.map((u,d)=>i.jsxs(a.Table.Row,{onClick:()=>o==="left"&&r?.(u.__raw),_hover:{bg:"blue.50"},onContextMenu:o==="right"?f=>{f.preventDefault(),r?.(u.__raw)}:void 0,children:[n?.showSNo&&i.jsx(a.Table.Cell,{textAlign:"center",fontWeight:"medium",children:s+d+1}),l.filter(f=>c[f.id]).map(f=>i.jsx(a.Table.Cell,{children:u[f.id]},f.id)),n?.showActionColumn&&i.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(a.Menu.Root,{children:[i.jsx(aa,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(Di,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(ia,{children:i.jsx(sa,{children:t.filter(f=>typeof f.visible=="function"?f.visible(u.__raw):f.visible!==!1).map(f=>i.jsxs(oa,{onClick:()=>f.onClick(u.__raw),colorScheme:f.colorScheme,value:f.label,children:[f.icon,f.label]},f.label))})})})]})}),n?.showColumnVisibilityMenu&&i.jsx(a.Table.Cell,{})]},u.__key||u.id))})}function ca({rows:e=6,columns:t}){return i.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(a.Table.Cell,{children:i.jsx(a.Skeleton,{height:"25px"})},s))},r))})}function ua({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:l="No data",actions:c,page:u=1,pageSize:d=10,onPageChange:f,onPageSizeChange:g,density:y="sm",totalCount:v=0,actionConfig:p,pageSizeOptions:x,onRowSelect:S,onRowSelectEvent:w="left"}){h.useEffect(()=>{Dr(e)},[e]),h.useEffect(()=>{Cr(t,n)},[t,n]),h.useEffect(()=>{p&&jr(p)},[p]);const{sortColumn:E,sortDirection:T,data:I,columnOrder:$}=nt(ie),M=h.useMemo(()=>{const H=[...I];return E&&H.sort((G,k)=>T==="asc"?String(G[E]).localeCompare(String(k[E])):String(k[E]).localeCompare(String(G[E]))),H},[I,E,T,u,d]),A=h.useMemo(()=>(Math.max(1,u||1)-1)*d,[u,d]);h.useEffect(()=>{u<1&&f&&f(1)},[u,f]);const L=H=>{const{active:G,over:k}=H;if(!k||G.id===k.id)return;const j=$.findIndex(D=>D.id===G.id),C=$.findIndex(D=>D.id===k.id),_=Et($,j,C);Zs(_)},V=r&&!s,Y=s&&!r,O=!r&&!s&&M.length===0;return i.jsx(hr,{collisionDetection:Qn,onDragEnd:L,children:i.jsx(mr,{items:$.map(H=>H.id),strategy:Ms,children:i.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[V&&i.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(a.Spinner,{})}),i.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:y,children:[i.jsx(Vi,{}),Y?i.jsx(ca,{rows:d,columns:n.length+(c?2:0)}):O?i.jsx(a.Table.Body,{children:i.jsx(a.Table.Row,{children:i.jsx(a.Table.Cell,{colSpan:n.length+(c?1:0),children:i.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:l})})})}):i.jsx(la,{data:M,actions:c,actionConfig:p,onRowSelect:S,startIndex:A,onRowSelectEvent:w})]})]}),i.jsx(a.Box,{mt:.5,children:i.jsx(ra,{totalCount:v,pageSize:d,currentPage:u,onPageChange:f,onPageSizeChange:H=>{g?.(H),u>1&&f?.(1)},pageSizeOptions:x})})]})})})}const da=b(a.Checkbox.Root),fa=b(a.Checkbox.HiddenInput),ha=b(a.Checkbox.Control),ga=b(a.Checkbox.Label),Or=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:l,errorText:c})=>i.jsxs(da,{value:e,onChange:t,size:n,children:[i.jsx(fa,{}),i.jsx(ha,{disabled:s,required:l,errorText:c,helperText:o}),r&&i.jsx(ga,{children:r})]}),pa=b(a.Combobox.Root),va=b(a.Combobox.Control),ma=b(a.Combobox.Input),xa=b(a.Combobox.IndicatorGroup),ba=b(a.Combobox.ClearTrigger),ya=b(a.Combobox.Trigger),Sa=b(a.Combobox.Positioner),wa=b(a.Combobox.Content);function kr({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:l,renderItem:c,value:u,loading:d,error:f,errorMessage:g,placeholder:y,helpText:v,onInputChange:p,onSelect:x,visible:S=!0,rootProps:w,inputProps:E,controlProps:T,contentProps:I,itemProps:$}){const[M,A]=h.useState(""),{collection:L,set:V}=a.useListCollection({initialItems:o,itemToString:s,itemToValue:l}),Y=h.useMemo(()=>{if(!M)return o;const O=M.toLowerCase();return o.filter(H=>s(H).toLowerCase().includes(O))},[o,M,s]);return h.useEffect(()=>{V(Y)},[Y,V]),h.useEffect(()=>{u&&A(s(u))},[u,s]),i.jsxs(pa,{width:n,size:t,variant:r,collection:L,placeholder:y,onInputValueChange:O=>{p?.(O.inputValue),A(O.inputValue)},value:u?[l(u)]:[],onValueChange:O=>{const H=O.value?.[0];if(!H)return;const G=L.items.find(k=>l(k)===H);G&&x?.(G)},positioning:{sameWidth:!1,placement:"bottom-start"},...w,children:[S&&e&&i.jsx(a.Text,{fontSize:"sm",children:e}),i.jsxs(va,{...T,children:[i.jsx(ma,{placeholder:y??"Type to search",...E}),i.jsxs(xa,{children:[i.jsx(ba,{}),i.jsx(ya,{})]})]}),i.jsx(Sa,{children:i.jsxs(wa,{minW:"sm",...I,children:[d?i.jsxs(a.HStack,{p:"2",children:[i.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(a.Span,{children:"Loading..."})]}):f?i.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:g||"Something went wrong"}):L.items.map(O=>i.jsxs(a.Combobox.Item,{item:O,...$,children:[c(O),i.jsx(a.Combobox.ItemIndicator,{})]},l(O))),v&&!f&&!d&&i.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:v})]})})]})}const Z=" to ",Vn=10,Ee={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},cn=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Wn=()=>{const{year:e,month:t,day:n}=cn();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},Ca=()=>{const{year:e,month:t,day:n}=cn();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},Da=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Ee.YEAR_MIN&&r<=Ee.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,l=o.substring(0,s);return parseInt(l+e)}return t},Ve=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=cn();let l,c,u;return n.length===1?(l=parseInt(n[0])||s,c=o,u=r):n.length===2?(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=r):(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=Da(n[2],r)),c=Math.max(1,Math.min(Ee.MONTH_MAX,c)),l=Math.max(1,Math.min(Ee.DAY_MAX,l)),`${u}-${String(c).padStart(2,"0")}-${String(l).padStart(2,"0")}`},ge=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},ja=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Ee.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Ee.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<Ee.YEAR_MIN||n>Ee.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Vn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Vn),ja(n,e)||t},Ra=b(a.Popover.Root),Ea=b(a.Popover.Trigger),Ta=b(a.Popover.Content),Ma=b(a.Popover.Positioner);function _a({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,l]=h.useState(()=>r&&o?`${ge(r)}${Z}${ge(o)}`:r?ge(r):""),[c,u]=h.useState(!1),d=h.useRef(null);h.useEffect(()=>{const p=x=>{x.ctrlKey&&x.key==="d"&&!x.shiftKey&&!x.metaKey&&(x.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[]);const f=p=>{let x=p;if(x.includes(Z)){const[S,w=""]=x.split(Z);x=`${We(S.trim())}${Z}${We(w.trim())}`}else if(x.toLowerCase().includes(" to ")){const[S,w=""]=x.split(/\s+to\s+/i);x=`${We(S.trim())} to ${We(w.trim())}`}else x=We(x);l(x)},g=()=>{const p=s.trim();if(!p){t(void 0);return}if(p.includes(Z)){const[x,S=""]=p.split(Z).map(T=>T.trim()),w=Ve(x),E=S?Ve(S):null;if(w&&E){const[T,I]=E<w?[E,w]:[w,E],$=`${ge(T)}${Z}${ge(I)}`;l($),t(`${T}|${I}`)}else if(w&&!S)l(`${ge(w)}${Z}`),t(void 0);else if(w&&S){const T=Ca(),[I,$]=T<w?[T,w]:[w,T],M=`${ge(I)}${Z}${ge($)}`;l(M),t(`${I}|${$}`)}else l(""),t(void 0)}else{const x=Ve(p);x?(l(`${ge(x)}${Z}`),t(void 0)):(l(""),t(void 0))}},y=p=>{if(p.key!=="Enter")return;p.preventDefault();const x=d.current?.selectionStart||0,S=s.indexOf(Z);if(!s.trim()){l(`${Wn()}${Z}`);return}if(S===-1){const E=Ve(s.trim());E&&l(`${ge(E)}${Z}`);return}if(x<=S+Z.length){const E=s.substring(0,S).trim(),T=s.substring(S+Z.length),I=Ve(E);I&&l(`${ge(I)}${Z}${T}`);return}if(s.substring(S+Z.length).trim())g(),d.current?.blur();else{const E=s.substring(0,S+Z.length)+Wn();l(E),setTimeout(()=>{g(),d.current?.blur()},0)}},v=()=>{l(""),t(void 0)};return i.jsx(a.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(a.InputElement,{position:"revert",children:[i.jsxs(Ra,{open:c,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(Ea,{asChild:!0,children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(p=>!p),children:i.jsx(Hn,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(Ma,{children:i.jsxs(Ta,{p:4,children:[i.jsx(a.PopoverArrow,{}),i.jsxs(a.VStack,{align:"start",gap:4,children:[i.jsxs(a.HStack,{children:[i.jsx(Hn,{size:16}),i.jsx(a.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(a.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(a.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(a.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(a.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(a.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(a.HStack,{children:[i.jsx(a.Kbd,{children:"Ctrl"}),i.jsx(a.Text,{children:"+"}),i.jsx(a.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(a.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:p=>f(p.target.value),onBlur:g,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(a.InputElement,{children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const Oa=b(a.Field.Root),ka=b(a.Field.Label),$a=b(a.Field.HelperText),Ia=b(a.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:l="100%",label:c,helperText:u,isDisabled:d=!1,required:f=!1,errorText:g,visible:y,type:v="text",min:p=0,max:x=100,step:S=1})=>i.jsxs(Oa,{width:l,children:[y&&i.jsx(ka,{children:c}),i.jsx(a.InputGroup,{startElement:e,children:i.jsx(a.Input,{value:t,onChange:w=>n?.(w.target.value),placeholder:r,size:o,type:v,variant:s,disabled:d,required:f,min:p,max:x,step:S})}),g&&i.jsx(Ia,{fontSize:"xs",children:g}),u&&i.jsx($a,{fontSize:"xs",children:u})]}),Aa=b(a.Field.Root),La=b(a.Field.HelperText),Pa=b(a.Field.ErrorText),Na=b(a.Select.Root),za=b(a.Select.Label),Fa=b(a.Select.Control),Ya=b(a.Select.Trigger),Ba=b(a.Select.ValueText),Ha=b(a.Select.IndicatorGroup),Va=b(a.Select.Indicator),Wa=b(a.Select.Content),Ua=b(a.Select.Item),Ga=b(a.Select.ItemIndicator),qa=b(a.Select.HiddenSelect),Xa=b(a.Select.Positioner),$r=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:l="100%",variant:c="outline",helperText:u,isDisabled:d,required:f,errorText:g,visible:y})=>{const v=a.createListCollection({items:e});return i.jsxs(Aa,{disabled:d,required:f,children:[i.jsxs(Na,{collection:v,variant:c,size:s,width:l,value:n?[n]:[],onValueChange:p=>r?.(p.value[0]),children:[i.jsx(qa,{}),y&&i.jsx(za,{children:t}),i.jsxs(Fa,{children:[i.jsx(Ya,{children:i.jsx(Ba,{placeholder:o})}),i.jsx(Ha,{children:i.jsx(Va,{})})]}),i.jsx(Xa,{children:i.jsx(Wa,{children:v.items.map(p=>i.jsxs(Ua,{item:p,children:[p.label,i.jsx(Ga,{})]},p.value))})})]}),u&&i.jsx(La,{children:u}),g&&i.jsx(Pa,{children:g})]})},Ir=(e="default")=>`FILTER_PRESETS_${e}`,Ka=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},Ja=e=>typeof window>"u"?[]:Ka(localStorage.getItem(Ir(e))),Ze=new wr({}),rt=e=>{const t=Ze.state;if(e in t)return t[e];const n=Ja(e);return Ze.setState(r=>({...r,[e]:n})),n},Tt=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(Ir(e),JSON.stringify(t))},Ar=(e,t)=>{const n=[t,...rt(e)];Tt(e,n)},Lr=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);Tt(e,n)},Za=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);Tt(e,r)},Qa=b(a.Checkbox.Root),el=b(a.Checkbox.HiddenInput),tl=b(a.Checkbox.Control),nl=b(a.Slider.Root),rl=b(a.Slider.Track),ol=b(a.Slider.Range),sl=b(a.Slider.Thumbs),il=b(a.Slider.Control),al=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:l,transition:c}=br({id:e.id}),u={transform:Ie.Transform.toString(l),transition:c};return i.jsxs(a.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Mr,{size:16}),i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(a.HStack,{justify:"space-between",children:[i.jsx(a.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(Qa,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(el,{}),i.jsx(tl,{})]})]}),i.jsxs(a.VStack,{align:"stretch",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",children:"Size"}),i.jsx(nl,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(il,{children:[i.jsx(rl,{children:i.jsx(ol,{})}),i.jsx(sl,{})]})})]})]})},ll=b(a.Drawer.Root),cl=b(a.Drawer.Trigger),ul=b(a.Drawer.Backdrop),dl=b(a.Drawer.Positioner),fl=b(a.Drawer.Content),hl=b(a.Drawer.Header),gl=b(a.Drawer.Title),pl=b(a.Drawer.Body),vl=b(a.Drawer.Footer),ml=b(a.Drawer.CloseTrigger),xl=b(a.Tabs.Root),bl=b(a.Tabs.List),Bt=b(a.Tabs.Trigger),Ht=b(a.Tabs.Content),Pr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return i.jsx(Kt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return i.jsx(Kt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return i.jsx(Or,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx($r,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return i.jsx(_a,{value:e.value,onChange:e.onChange});case"combobox":return i.jsx(kr,{visible:!0,label:e.label,items:e.options,itemToString:n=>n.label,itemToValue:n=>n.value,renderItem:n=>i.jsx("span",{children:n.label})});default:return null}},yl=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",onLoadPreset:l,activePresetName:c,onReorder:u,open:d,onOpenChange:f})=>{const y=nt(Ze)[s]??rt(s),v=()=>{const p=prompt("Preset name?");if(!p)return;const x=o.reduce((S,w)=>(S[w.id]=w.value,S),{});Ar(s,{id:crypto.randomUUID(),name:p,date:new Date().toISOString(),values:x})};return i.jsx(a.HStack,{wrap:"wrap",children:i.jsxs(ll,{size:e,open:d,onOpenChange:f,children:[i.jsx(cl,{asChild:!0,children:i.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(Ri,{size:16}),"Filters"]})}),i.jsxs(a.Portal,{children:[i.jsx(ul,{}),i.jsx(dl,{children:i.jsxs(fl,{children:[i.jsx(hl,{children:i.jsx(gl,{children:"Filters"})}),i.jsx(pl,{overflowY:"auto",pt:1,children:i.jsxs(xl,{defaultValue:"view",children:[i.jsxs(bl,{mb:4,children:[i.jsxs(Bt,{value:"view",children:[i.jsx(Mi,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx($i,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(hi,{size:16}),"Presets"]})]}),i.jsx(Ht,{value:"view",children:o.filter(p=>p.visible).map(p=>i.jsx(a.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:p.size??1,minW:`${(p.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Pr(p,d)},p.id))}),i.jsx(Ht,{value:"settings",children:i.jsx(hr,{sensors:vo(po(ln)),collisionDetection:Qn,onDragEnd:({active:p,over:x})=>{if(!x||p.id===x.id)return;const S=o.findIndex(T=>T.id===p.id),w=o.findIndex(T=>T.id===x.id),E=Et(o,S,w);u?.(E)},children:i.jsx(mr,{items:o.map(p=>p.id),strategy:Os,children:o.map(p=>i.jsx(al,{filter:p,onVisibilityChange:t,onSizeChange:n},p.id))})})}),i.jsx(Ht,{value:"presets",children:i.jsxs(a.VStack,{align:"stretch",mb:3,children:[y.length===0&&i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),y.map(p=>i.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:c===p.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(a.VStack,{align:"start",gap:0,children:[i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:p.name}),i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(p.date).toLocaleDateString()})]}),i.jsxs(a.HStack,{children:[i.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const x=o.map(S=>({...S,value:p.values[S.id]??S.value}));l?.(x,p.name)},children:"Load"}),i.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Lr(s,p.id),children:i.jsx(wi,{size:14})})]})]},p.id)),i.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(vl,{justify:"space-between",children:i.jsx(ml,{asChild:!0,children:i.jsx(a.CloseButton,{})})})]})})]})]})})},Sl=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,onLoadPreset:u,activePresetName:d,filterDrawerSize:f="sm"})=>{const[g,y]=h.useState(!1);return i.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(a.HStack,{gapX:1,children:[t.filter(v=>v.visible!==!1).map(v=>i.jsx(a.HStack,{flex:v.size??1,minW:`${(v.size??1)*100}px`,alignItems:"center",children:Pr(v)},v.id)),i.jsx(yl,{filterDrawerSize:f,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,filters:t,onLoadPreset:u,activePresetName:d,open:g,onOpenChange:v=>{y(v.open)}})]})]})},wl=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Cl=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Dl=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:l,colorScheme:c,loading:u,loadingText:d,rounded:f,type:g="button"})=>i.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:l,colorPalette:c,loading:u,loadingText:d,rounded:f,type:g,children:i.jsxs(a.HStack,{gap:1,children:[o,r,s]})}),jl=b(a.Dialog.Root),Rl=b(a.Dialog.Backdrop),El=b(a.Dialog.Positioner),Tl=b(a.Dialog.Content),Ml=b(a.Dialog.Header),_l=b(a.Dialog.Body),Ol=b(a.Dialog.Footer),kl=b(a.Dialog.Title),$l=b(a.Dialog.CloseTrigger);function Il({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:s="Confirm",cancelLabel:l="Cancel",icon:c,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return i.jsx(jl,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(Rl,{}),i.jsx(El,{children:i.jsxs(Tl,{maxW:"480px",children:[i.jsx(Ml,{borderBottom:"1px solid",borderColor:"gray.200",children:i.jsx(kl,{children:r})}),i.jsx(_l,{p:6,children:i.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[i.jsx(a.Box,{color:"orange.500",children:c??i.jsx(_r,{size:40})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),i.jsxs(Ol,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:l}),i.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:s})]}),i.jsx($l,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Al=b(a.Dialog.Root),Ll=b(a.Dialog.Backdrop),Pl=b(a.Dialog.Positioner),Nl=b(a.Dialog.Content),zl=b(a.Dialog.Header),Fl=b(a.Dialog.Body),Yl=b(a.Dialog.Footer),Bl=b(a.Dialog.Title),Hl=b(a.Dialog.CloseTrigger);function Vl({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:l="Delete",isLoading:c=!1}){const[u,d]=h.useState(""),f=u===s;return i.jsx(Al,{open:e,placement:"center",onOpenChange:g=>{!g.open&&t(),d("")},children:i.jsxs(a.Portal,{children:[i.jsx(Ll,{}),i.jsx(Pl,{children:i.jsxs(Nl,{maxW:"550px",children:[i.jsx(zl,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Bl,{color:"red.600",children:r})}),i.jsx(Fl,{p:2,style:{padding:"16px"},children:i.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(a.Box,{color:"red.600",mt:"2px",children:i.jsx(_r,{size:20})}),i.jsxs(a.Box,{children:[i.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(a.Box,{children:[i.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(a.Input,{placeholder:`Type ${s} here`,value:u,onChange:g=>d(g.target.value),size:"xs"})]})]})}),i.jsxs(Yl,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),i.jsx(a.Button,{size:"sm",disabled:!f,style:{backgroundColor:"#FF0000"},loading:c,onClick:n,children:l})]}),i.jsx(Hl,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Nr=({children:e})=>i.jsx(i.Fragment,{children:e}),zr=({children:e})=>i.jsx(i.Fragment,{children:e}),Wl=a.Button,Ul=b(a.Dialog.Root),Gl=b(a.Dialog.Backdrop),ql=b(a.Dialog.Positioner),Xl=b(a.Dialog.Content),Kl=b(a.Dialog.Header),Jl=b(a.Dialog.Body),Zl=b(a.Dialog.Footer),Ql=b(a.Dialog.Title),ec=b(a.Dialog.CloseTrigger);function tc(e){let t=null,n=null;return h.Children.forEach(e,r=>{h.isValidElement(r)&&(r.type===Nr&&(t=r.props.children),r.type===zr&&(n=r.props.children))}),{body:t,actions:n}}const nc=({open:e,onClose:t,title:n,children:r,width:o,position:s,refetch:l,loading:c=!1})=>{const{body:u,actions:d}=tc(r);return i.jsx(Ul,{open:e,onOpenChange:f=>!f.open&&t(),placement:s??"center",children:i.jsxs(a.Portal,{children:[i.jsx(Gl,{bg:"blackAlpha.400"}),i.jsx(ql,{children:i.jsxs(Xl,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[i.jsx(Kl,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:i.jsxs(a.Flex,{align:"center",justify:"space-between",children:[i.jsx(Ql,{fontSize:"16px",fontWeight:"600",children:n}),i.jsx(ec,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})}),l&&i.jsx(un,{label:"Refresh",refetch:l,isLoading:c})]})}),u&&i.jsx(Jl,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:i.jsx(a.Flex,{direction:"column",gap:"16px",children:u})}),d&&i.jsx(Zl,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:i.jsx(a.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},rc=b(a.Field.Root),oc=b(a.Field.Label),sc=b(a.Field.HelperText),ic=b(a.Field.ErrorText),ac=b(a.PinInput.Input),lc=b(a.PinInput.Control),cc=b(a.PinInput.HiddenInput),uc=b(a.PinInput.Root),dc=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:s,helperText:l,errorText:c,required:u=!1,visible:d=!0})=>{const f=Array.from({length:n}).map((g,y)=>e?.[y]??"");return i.jsxs(rc,{children:[d&&s&&i.jsxs(oc,{children:[s,u&&" *"]}),i.jsxs(uc,{value:f,onValueChange:g=>t?.(g.value.join("")),disabled:o,size:r,children:[i.jsx(cc,{}),i.jsx(lc,{children:i.jsx(a.HStack,{children:Array.from({length:n}).map((g,y)=>i.jsx(ac,{index:y},y))})})]}),c&&i.jsx(ic,{fontSize:"xs",children:c}),l&&!c&&i.jsx(sc,{fontSize:"xs",children:l})]})};function un({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=h.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Oi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var gt={exports:{}},fc=gt.exports,Un;function hc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(fc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",c="minute",u="hour",d="day",f="week",g="month",y="quarter",v="year",p="date",x="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var j=["th","st","nd","rd"],C=k%100;return"["+k+(j[(C-20)%10]||j[C]||j[0])+"]"}},T=function(k,j,C){var _=String(k);return!_||_.length>=j?k:""+Array(j+1-_.length).join(C)+k},I={s:T,z:function(k){var j=-k.utcOffset(),C=Math.abs(j),_=Math.floor(C/60),D=C%60;return(j<=0?"+":"-")+T(_,2,"0")+":"+T(D,2,"0")},m:function k(j,C){if(j.date()<C.date())return-k(C,j);var _=12*(C.year()-j.year())+(C.month()-j.month()),D=j.clone().add(_,g),P=C-D<0,z=j.clone().add(_+(P?-1:1),g);return+(-(_+(C-D)/(P?D-z:z-D))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:g,y:v,w:f,d,D:p,h:u,m:c,s:l,ms:s,Q:y}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},$="en",M={};M[$]=E;var A="$isDayjsObject",L=function(k){return k instanceof H||!(!k||!k[A])},V=function k(j,C,_){var D;if(!j)return $;if(typeof j=="string"){var P=j.toLowerCase();M[P]&&(D=P),C&&(M[P]=C,D=P);var z=j.split("-");if(!D&&z.length>1)return k(z[0])}else{var m=j.name;M[m]=j,D=m}return!_&&D&&($=D),D||!_&&$},Y=function(k,j){if(L(k))return k.clone();var C=typeof j=="object"?j:{};return C.date=k,C.args=arguments,new H(C)},O=I;O.l=V,O.i=L,O.w=function(k,j){return Y(k,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var H=(function(){function k(C){this.$L=V(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[A]=!0}var j=k.prototype;return j.parse=function(C){this.$d=(function(_){var D=_.date,P=_.utc;if(D===null)return new Date(NaN);if(O.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var z=D.match(S);if(z){var m=z[2]-1||0,R=(z[7]||"0").substring(0,3);return P?new Date(Date.UTC(z[1],m,z[3]||1,z[4]||0,z[5]||0,z[6]||0,R)):new Date(z[1],m,z[3]||1,z[4]||0,z[5]||0,z[6]||0,R)}}return new Date(D)})(C),this.init()},j.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==x},j.isSame=function(C,_){var D=Y(C);return this.startOf(_)<=D&&D<=this.endOf(_)},j.isAfter=function(C,_){return Y(C)<this.startOf(_)},j.isBefore=function(C,_){return this.endOf(_)<Y(C)},j.$g=function(C,_,D){return O.u(C)?this[_]:this.set(D,C)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(C,_){var D=this,P=!!O.u(_)||_,z=O.p(C),m=function(J,F){var se=O.w(D.$u?Date.UTC(D.$y,F,J):new Date(D.$y,F,J),D);return P?se:se.endOf(d)},R=function(J,F){return O.w(D.toDate()[J].apply(D.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(F)),D)},N=this.$W,B=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(z){case v:return P?m(1,0):m(31,11);case g:return P?m(1,B):m(0,B+1);case f:var W=this.$locale().weekStart||0,K=(N<W?N+7:N)-W;return m(P?q-K:q+(6-K),B);case d:case p:return R(X+"Hours",0);case u:return R(X+"Minutes",1);case c:return R(X+"Seconds",2);case l:return R(X+"Milliseconds",3);default:return this.clone()}},j.endOf=function(C){return this.startOf(C,!1)},j.$set=function(C,_){var D,P=O.p(C),z="set"+(this.$u?"UTC":""),m=(D={},D[d]=z+"Date",D[p]=z+"Date",D[g]=z+"Month",D[v]=z+"FullYear",D[u]=z+"Hours",D[c]=z+"Minutes",D[l]=z+"Seconds",D[s]=z+"Milliseconds",D)[P],R=P===d?this.$D+(_-this.$W):_;if(P===g||P===v){var N=this.clone().set(p,1);N.$d[m](R),N.init(),this.$d=N.set(p,Math.min(this.$D,N.daysInMonth())).$d}else m&&this.$d[m](R);return this.init(),this},j.set=function(C,_){return this.clone().$set(C,_)},j.get=function(C){return this[O.p(C)]()},j.add=function(C,_){var D,P=this;C=Number(C);var z=O.p(_),m=function(B){var q=Y(P);return O.w(q.date(q.date()+Math.round(B*C)),P)};if(z===g)return this.set(g,this.$M+C);if(z===v)return this.set(v,this.$y+C);if(z===d)return m(1);if(z===f)return m(7);var R=(D={},D[c]=r,D[u]=o,D[l]=n,D)[z]||1,N=this.$d.getTime()+C*R;return O.w(N,this)},j.subtract=function(C,_){return this.add(-1*C,_)},j.format=function(C){var _=this,D=this.$locale();if(!this.isValid())return D.invalidDate||x;var P=C||"YYYY-MM-DDTHH:mm:ssZ",z=O.z(this),m=this.$H,R=this.$m,N=this.$M,B=D.weekdays,q=D.months,X=D.meridiem,W=function(F,se,ne,he){return F&&(F[se]||F(_,P))||ne[se].slice(0,he)},K=function(F){return O.s(m%12||12,F,"0")},J=X||function(F,se,ne){var he=F<12?"AM":"PM";return ne?he.toLowerCase():he};return P.replace(w,(function(F,se){return se||(function(ne){switch(ne){case"YY":return String(_.$y).slice(-2);case"YYYY":return O.s(_.$y,4,"0");case"M":return N+1;case"MM":return O.s(N+1,2,"0");case"MMM":return W(D.monthsShort,N,q,3);case"MMMM":return W(q,N);case"D":return _.$D;case"DD":return O.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return W(D.weekdaysMin,_.$W,B,2);case"ddd":return W(D.weekdaysShort,_.$W,B,3);case"dddd":return B[_.$W];case"H":return String(m);case"HH":return O.s(m,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(m,R,!0);case"A":return J(m,R,!1);case"m":return String(R);case"mm":return O.s(R,2,"0");case"s":return String(_.$s);case"ss":return O.s(_.$s,2,"0");case"SSS":return O.s(_.$ms,3,"0");case"Z":return z}return null})(F)||z.replace(":","")}))},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(C,_,D){var P,z=this,m=O.p(_),R=Y(C),N=(R.utcOffset()-this.utcOffset())*r,B=this-R,q=function(){return O.m(z,R)};switch(m){case v:P=q()/12;break;case g:P=q();break;case y:P=q()/3;break;case f:P=(B-N)/6048e5;break;case d:P=(B-N)/864e5;break;case u:P=B/o;break;case c:P=B/r;break;case l:P=B/n;break;default:P=B}return D?P:O.a(P)},j.daysInMonth=function(){return this.endOf(g).$D},j.$locale=function(){return M[this.$L]},j.locale=function(C,_){if(!C)return this.$L;var D=this.clone(),P=V(C,_,!0);return P&&(D.$L=P),D},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},k})(),G=H.prototype;return Y.prototype=G,[["$ms",s],["$s",l],["$m",c],["$H",u],["$W",d],["$M",g],["$y",v],["$D",p]].forEach((function(k){G[k[1]]=function(j){return this.$g(j,k[0],k[1])}})),Y.extend=function(k,j){return k.$i||(k(j,H,Y),k.$i=!0),Y},Y.locale=V,Y.isDayjs=L,Y.unix=function(k){return Y(1e3*k)},Y.en=M[$],Y.Ls=M,Y.p={},Y}))})(gt)),gt.exports}var gc=hc();const Mt=Ct(gc);var pt={exports:{}},pc=pt.exports,Gn;function vc(){return Gn||(Gn=1,(function(e,t){(function(n,r){e.exports=r()})(pc,(function(){return function(n,r,o){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function c(d,f,g,y){return s.fromToBase(d,f,g,y)}o.en.relativeTime=l,s.fromToBase=function(d,f,g,y,v){for(var p,x,S,w=g.$locale().relativeTime||l,E=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],T=E.length,I=0;I<T;I+=1){var $=E[I];$.d&&(p=y?o(d).diff(g,$.d,!0):g.diff(d,$.d,!0));var M=(n.rounding||Math.round)(Math.abs(p));if(S=p>0,M<=$.r||!$.r){M<=1&&I>0&&($=E[I-1]);var A=w[$.l];v&&(M=v(""+M)),x=typeof A=="string"?A.replace("%d",M):A(M,f,$.l,S);break}}if(f)return x;var L=S?w.future:w.past;return typeof L=="function"?L(x):L.replace("%s",x)},s.to=function(d,f){return c(d,f,this,!0)},s.from=function(d,f){return c(d,f,this)};var u=function(d){return d.$u?o.utc():o()};s.toNow=function(d){return this.to(u(this),d)},s.fromNow=function(d){return this.from(u(this),d)}}}))})(pt)),pt.exports}var mc=vc();const xc=Ct(mc);var vt={exports:{}},bc=vt.exports,qn;function yc(){return qn||(qn=1,(function(e,t){(function(n,r){e.exports=r()})(bc,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var l=o.prototype,c=l.format;s.en.formats=n,l.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,f=(function(g,y){return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,p,x){var S=x&&x.toUpperCase();return p||y[x]||n[x]||y[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,E,T){return E||T.slice(1)}))}))})(u,d===void 0?{}:d);return c.call(this,f)}}}))})(vt)),vt.exports}var Sc=yc();const wc=Ct(Sc);var mt={exports:{}},Cc=mt.exports,Xn;function Dc(){return Xn||(Xn=1,(function(e,t){(function(n,r){e.exports=r()})(Cc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(l){var c=this,u=this.$locale();if(!this.isValid())return s.bind(this)(l);var d=this.$utils(),f=(l||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(g){switch(g){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return d.s(c.week(),g==="w"?1:2,"0");case"W":case"WW":return d.s(c.isoWeek(),g==="W"?1:2,"0");case"k":case"kk":return d.s(String(c.$H===0?24:c.$H),g==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return g}}));return s.bind(this)(f)}}}))})(mt)),mt.exports}var jc=Dc();const Rc=Ct(jc);Mt.extend(xc);Mt.extend(wc);Mt.extend(Rc);const Ec={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function Jt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=Mt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Ec[t]):r}function Tc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:l="gray.700",dateFontSize:c="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:f="12px",timeFontWeight:g="400"}){return i.jsxs(a.Stack,{gap:.5,align:s,children:[i.jsx(a.Text,{fontSize:c,fontWeight:u,color:l,children:Jt({value:e,variant:t,format:r})}),i.jsx(a.Text,{fontSize:f,fontWeight:g,color:d,children:Jt({value:e,variant:n,format:o})})]})}class Fr{state=new Map;listeners=new Map;get(t){return this.state.get(t)}set(t){this.state.set(t.key,t),this.notify(t.key)}setMany(t){t.forEach(n=>this.set(n))}subscribe(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),n(this.state.get(t)),()=>{this.listeners.get(t)?.delete(n)}}notify(t){this.listeners.get(t)?.forEach(n=>n(this.state.get(t)))}clear(){this.state.clear()}}class Zt{constructor(t){this.baseUrl=t}async fetchLatest(t){const n=new URLSearchParams;return n.set("keys",t.join(",")),(await(await fetch(`${this.baseUrl}/options?${n}`)).json()).data}}class Qt{constructor(t){this.api=t}store=new Fr;inflight=new Map;getRaw(t){return this.store.get(t)}async getKey(t){const n=this.store.get(t);return n?n.value:(await this.fetchMissing([t]),this.store.get(t)?.value)}async getMultiKey(t){const n={},r=[];for(const o of t){const s=this.store.get(o);s?n[o]=s.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const s=this.store.get(o);s&&(n[o]=s.value)})),n}subscribe(t,n){return this.store.subscribe(t,n)}hydrate(t){this.store.setMany(t)}clear(){this.store.clear()}async fetchMissing(t){const n=t.filter(o=>!this.inflight.has(o));if(!n.length)return;const r=this.api.fetchLatest(n).then(o=>{this.store.setMany(o),n.forEach(s=>this.inflight.delete(s))});n.forEach(o=>this.inflight.set(o,r)),await r}}const Yr=h.createContext(null);function Br(){const e=h.useContext(Yr);if(!e)throw new Error("OptionsProvider is missing. Wrap your app with <OptionsProvider />");return e}function Mc({client:{apiUrl:e},children:t}){const n=h.useRef(new Qt(new Zt(e)));return n.current||(n.current=new Qt(new Zt(e))),i.jsx(Yr.Provider,{value:n.current,children:t})}function _c(e){const t=Br(),[n,r]=h.useState(t.getRaw(e)?.value);return h.useEffect(()=>{let o=!0;t.getKey(e).then(l=>{o&&r(l)});const s=t.subscribe(e,l=>{r(l?.value)});return()=>{o=!1,s()}},[e,t]),n}function Oc(e){const t=Br(),[n,r]=h.useState({});return h.useEffect(()=>{let o=!0;t.getMultiKey(e).then(l=>{o&&r(l)});const s=e.map(l=>t.subscribe(l,c=>{r(u=>({...u,[l]:c?.value}))}));return()=>{o=!1,s.forEach(l=>l())}},[e.join("|"),t]),n}async function kc(e,t){return e.getKey(t)}async function $c(e,t){await e.getMultiKey(t)}function Ic(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=h.useState(t),[s,l]=h.useState(n),c=h.useCallback(y=>{o(Math.max(1,y))},[]),u=h.useCallback(y=>{l(Math.max(1,y)),o(1)},[]),d=h.useCallback(()=>{o(y=>y+1)},[]),f=h.useCallback(()=>{o(y=>Math.max(1,y-1))},[]),g=h.useCallback(()=>{o(t),l(n)},[t,n]);return{page:r,limit:s,setPage:c,setLimit:u,nextPage:d,prevPage:f,reset:g}}function Ac(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=h.useState(t),s=Lc(r,n),l=h.useCallback(u=>{o(u)},[]),c=h.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:s,onSearchChange:l,reset:c}}function Lc(e,t=300){const[n,r]=h.useState(e);return h.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}exports.DataTable=ua;exports.Filters=Sl;exports.HttpOptionsApi=Zt;exports.MDSButton=Dl;exports.MDSCheckbox=Or;exports.MDSCombobox=kr;exports.MDSConfirmActionDialog=Il;exports.MDSConfirmDeleteDialog=Vl;exports.MDSDialogAction=Wl;exports.MDSDialogActions=zr;exports.MDSDialogBody=Nr;exports.MDSDialogWrapper=nc;exports.MDSInput=Kt;exports.MDSPinInput=dc;exports.MDSRefreshButton=un;exports.MDSSelectBox=$r;exports.OptionsClientImpl=Qt;exports.OptionsProvider=Mc;exports.OptionsStore=Fr;exports.RefreshButton=un;exports.StackedDateTime=Tc;exports.addPreset=Ar;exports.deletePreset=Lr;exports.formatDateTime=Jt;exports.getOption=kc;exports.getPresets=rt;exports.loadOrder=Cl;exports.prefetchOptions=$c;exports.presetStore=Ze;exports.saveOrder=wl;exports.savePresets=Tt;exports.setActionsConfig=jr;exports.setData=Cr;exports.setTableId=Dr;exports.tableStore=ie;exports.updatePreset=Za;exports.useDebouncedSearch=Ac;exports.useOption=_c;exports.useOptions=Oc;exports.usePagination=Ic;exports.withChildren=b;
10
+ `},go={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function po(e){let{announcements:t=go,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ho}=e;const{announce:s,announcement:c}=lo(),l=nt("DndLiveRegion"),[u,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),uo(h.useMemo(()=>({onDragStart(f){let{active:b}=f;s(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:v}=f;t.onDragMove&&s(t.onDragMove({active:b,over:v}))},onDragOver(f){let{active:b,over:v}=f;s(t.onDragOver({active:b,over:v}))},onDragEnd(f){let{active:b,over:v}=f;s(t.onDragEnd({active:b,over:v}))},onDragCancel(f){let{active:b,over:v}=f;s(t.onDragCancel({active:b,over:v}))}}),[s,t])),!u)return null;const g=h.createElement(h.Fragment,null,h.createElement(ao,{id:r,value:o.draggable}),h.createElement(co,{id:l,announcement:c}));return n?Ge.createPortal(g,n):g}var Q;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Q||(Q={}));function yt(){}function vo(e,t){return h.useMemo(()=>({sensor:e,options:{}}),[e,t])}function mo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function xo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function yo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function So(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Dn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const er=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Dn(t,t.left,t.top),s=[];for(const c of r){const{id:l}=c,u=n.get(l);if(u){const d=xo(Dn(u),o);s.push({id:l,data:{droppableContainer:c,value:d}})}}return s.sort(bo)};function wo(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),c=o-r,l=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,g=c*l,f=g/(u+d-g);return Number(f.toFixed(4))}return 0}const Co=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:c}=s,l=n.get(c);if(l){const u=wo(l,t);u>0&&o.push({id:c,data:{droppableContainer:s,value:u}})}}return o.sort(yo)};function Do(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function tr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function jo(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((c,l)=>({...c,top:c.top+e*l.y,bottom:c.bottom+e*l.y,left:c.left+e*l.x,right:c.right+e*l.x}),{...n})}}const Ro=jo(1);function Eo(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function To(e,t,n){const r=Eo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:c,y:l}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:g,height:f,top:d,right:u+g,bottom:d+f,left:u}}const Mo={ignoreTransform:!1};function Pe(e,t){t===void 0&&(t=Mo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=ae(e).getComputedStyle(e);d&&(n=To(n,d,g))}const{top:r,left:o,width:s,height:c,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:c,bottom:l,right:u}}function jn(e){return Pe(e,{ignoreTransform:!0})}function _o(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Oo(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function ko(e,t){t===void 0&&(t=ae(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function sn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(nn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||Jn(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&ko(o,s)&&n.push(o),Oo(o,s)?n:r(o.parentNode)}return e?r(e):n}function nr(e){const[t]=sn(e,1);return t??null}function At(e){return!Dt||!e?null:Ae(e)?e:tn(e)?nn(e)||e===Le(e).scrollingElement?window:et(e)?e:null:null}function rr(e){return Ae(e)?e.scrollX:e.scrollLeft}function or(e){return Ae(e)?e.scrollY:e.scrollTop}function Gt(e){return{x:rr(e),y:or(e)}}var ee;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ee||(ee={}));function sr(e){return!Dt||!e?!1:e===document.scrollingElement}function ir(e){const t={x:0,y:0},n=sr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:c,isRight:l,maxScroll:r,minScroll:t}}const $o={x:.2,y:.2};function Io(e,t,n,r,o){let{top:s,left:c,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=$o);const{isTop:d,isBottom:g,isLeft:f,isRight:b}=ir(e),v={x:0,y:0},p={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+m.height?(v.y=ee.Backward,p.y=r*Math.abs((t.top+m.height-s)/m.height)):!g&&u>=t.bottom-m.height&&(v.y=ee.Forward,p.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!b&&l>=t.right-m.width?(v.x=ee.Forward,p.x=r*Math.abs((t.right-m.width-l)/m.width)):!f&&c<=t.left+m.width&&(v.x=ee.Backward,p.x=r*Math.abs((t.left+m.width-c)/m.width)),{direction:v,speed:p}}function Ao(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,height:c}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ar(e){return e.reduce((t,n)=>$e(t,Gt(n)),pe)}function Lo(e){return e.reduce((t,n)=>t+rr(n),0)}function Po(e){return e.reduce((t,n)=>t+or(n),0)}function No(e,t){if(t===void 0&&(t=Pe),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);nr(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zo=[["x",["left","right"],Lo],["y",["top","bottom"],Po]];class an{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=sn(n),o=ar(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,l]of zo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),g=o[s]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Fo(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function Lt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function Rn(e){e.preventDefault()}function Bo(e){e.stopPropagation()}var U;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(U||(U={}));const cr={start:[U.Space,U.Enter],cancel:[U.Esc],end:[U.Space,U.Enter,U.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case U.Right:return{...n,x:n.x+25};case U.Left:return{...n,x:n.x-25};case U.Down:return{...n,y:n.y+25};case U.Up:return{...n,y:n.y-25}}};class lr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Xe(Le(n)),this.windowListeners=new Xe(ae(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&No(r),n(pe)}handleKeyDown(t){if(on(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=cr,coordinateGetter:c=Yo,scrollBehavior:l="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=g);const f=c(t,{active:n,context:r.current,currentCoordinates:g});if(f){const b=bt(f,g),v={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const S=t.code,{isTop:w,isRight:j,isLeft:R,isBottom:I,maxScroll:$,minScroll:M}=ir(m),A=Ao(m),L={x:Math.min(S===U.Right?A.right-A.width/2:A.right,Math.max(S===U.Right?A.left:A.left+A.width/2,f.x)),y:Math.min(S===U.Down?A.bottom-A.height/2:A.bottom,Math.max(S===U.Down?A.top:A.top+A.height/2,f.y))},V=S===U.Right&&!j||S===U.Left&&!R,B=S===U.Down&&!I||S===U.Up&&!w;if(V&&L.x!==f.x){const O=m.scrollLeft+b.x,H=S===U.Right&&O<=$.x||S===U.Left&&O>=M.x;if(H&&!b.y){m.scrollTo({left:O,behavior:l});return}H?v.x=m.scrollLeft-O:v.x=S===U.Right?m.scrollLeft-$.x:m.scrollLeft-M.x,v.x&&m.scrollBy({left:-v.x,behavior:l});break}else if(B&&L.y!==f.y){const O=m.scrollTop+b.y,H=S===U.Down&&O<=$.y||S===U.Up&&O>=M.y;if(H&&!b.x){m.scrollTo({top:O,behavior:l});return}H?v.y=m.scrollTop-O:v.y=S===U.Down?m.scrollTop-$.y:m.scrollTop-M.y,v.y&&m.scrollBy({top:-v.y,behavior:l});break}}this.handleMove(t,$e(bt(f,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=cr,onActivation:o}=t,{active:s}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function En(e){return!!(e&&"distance"in e)}function Tn(e){return!!(e&&"delay"in e)}class cn{constructor(t,n,r){var o;r===void 0&&(r=Fo(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:c}=s;this.props=t,this.events=n,this.document=Le(c),this.documentListeners=new Xe(this.document),this.listeners=new Xe(r),this.windowListeners=new Xe(ae(c)),this.initialCoordinates=(o=Ut(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,Rn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,Rn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Tn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(En(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Bo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:c,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=Ut(t))!=null?n:pe,d=bt(o,u);if(!r&&l){if(En(l)){if(l.tolerance!=null&&Lt(d,l.tolerance))return this.handleCancel();if(Lt(d,l.distance))return this.handleStart()}if(Tn(l)&&Lt(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),c(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===U.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ho={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ln extends cn{constructor(t){const{event:n}=t,r=Le(n.target);super(t,Ho,r)}}ln.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Vo={move:{name:"mousemove"},end:{name:"mouseup"}};var Xt;(function(e){e[e.RightClick=2]="RightClick"})(Xt||(Xt={}));class Wo extends cn{constructor(t){super(t,Vo,Le(t.event.target))}}Wo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Xt.RightClick?!1:(r?.({event:n}),!0)}}];const Pt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Uo extends cn{constructor(t){super(t,Pt)}static setup(){return window.addEventListener(Pt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Pt.move.name,t)};function t(){}}}Uo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var qe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(qe||(qe={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function Go(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:l=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:b}=e;const v=qo({delta:f,disabled:!s}),[p,m]=no(),S=h.useRef({x:0,y:0}),w=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case qe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case qe.DraggableRect:return o}},[n,o,u]),R=h.useRef(null),I=h.useCallback(()=>{const M=R.current;if(!M)return;const A=S.current.x*w.current.x,L=S.current.y*w.current.y;M.scrollBy(A,L)},[]),$=h.useMemo(()=>l===St.TreeOrder?[...d].reverse():d,[l,d]);h.useEffect(()=>{if(!s||!d.length||!j){m();return}for(const M of $){if(r?.(M)===!1)continue;const A=d.indexOf(M),L=g[A];if(!L)continue;const{direction:V,speed:B}=Io(M,L,j,t,b);for(const O of["x","y"])v[O][V[O]]||(B[O]=0,V[O]=0);if(B.x>0||B.y>0){m(),R.current=M,p(I,c),S.current=B,w.current=V;return}}S.current={x:0,y:0},w.current={x:0,y:0},m()},[t,I,r,m,s,c,JSON.stringify(j),JSON.stringify(v),p,d,$,g,JSON.stringify(b)])}const Xo={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Wt(t);return tt(o=>{if(n||!r||!o)return Xo;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ee.Backward]:o.x[ee.Backward]||s.x===-1,[ee.Forward]:o.x[ee.Forward]||s.x===1},y:{[ee.Backward]:o.y[ee.Backward]||s.y===-1,[ee.Forward]:o.y[ee.Forward]||s.y===1}}},[n,t,r])}function Ko(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return tt(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Jo(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...s]},[]),[e,t])}var Ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ze||(Ze={}));var qt;(function(e){e.Optimized="optimized"})(qt||(qt={}));const Mn=new Map;function Zo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,c]=h.useState(null),{frequency:l,measure:u,strategy:d}=o,g=h.useRef(e),f=S(),b=Je(f),v=h.useCallback(function(w){w===void 0&&(w=[]),!b.current&&c(j=>j===null?w:j.concat(w.filter(R=>!j.includes(R))))},[b]),p=h.useRef(null),m=tt(w=>{if(f&&!n)return Mn;if(!w||w===Mn||g.current!==e||s!=null){const j=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){j.set(R.id,R.rect.current);continue}const I=R.node.current,$=I?new an(u(I),I):null;R.rect.current=$,$&&j.set(R.id,$)}return j}return w},[e,s,n,f,u]);return h.useEffect(()=>{g.current=e},[e]),h.useEffect(()=>{f||v()},[n,f]),h.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),h.useEffect(()=>{f||typeof l!="number"||p.current!==null||(p.current=setTimeout(()=>{v(),p.current=null},l))},[l,f,v,...r]),{droppableRects:m,measureDroppableContainers:v,measuringScheduled:s!=null};function S(){switch(d){case Ze.Always:return!1;case Ze.BeforeDragging:return n;default:return!n}}}function ur(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Qo(e,t){return ur(e,t)}function es(e){let{callback:t,disabled:n}=e;const r=rn(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function jt(e){let{callback:t,disabled:n}=e;const r=rn(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function ts(e){return new an(Pe(e),e)}function _n(e,t,n){t===void 0&&(t=ts);const[r,o]=h.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const g=t(e);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const c=es({callback(u){if(e)for(const d of u){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),l=jt({callback:s});return xe(()=>{s(),e?(l?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),c?.disconnect())},[e]),r}function ns(e){const t=ur(e);return tr(e,t)}const On=[];function rs(e){const t=h.useRef(e),n=tt(r=>e?r&&r!==On&&e&&t.current&&e.parentNode===t.current.parentNode?r:sn(e):On,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function os(e){const[t,n]=h.useState(null),r=h.useRef(e),o=h.useCallback(s=>{const c=At(s.target);c&&n(l=>l?(l.set(c,Gt(c)),new Map(l)):null)},[]);return h.useEffect(()=>{const s=r.current;if(e!==s){c(s);const l=e.map(u=>{const d=At(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Gt(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{c(e),c(s)};function c(l){l.forEach(u=>{const d=At(u);d?.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>$e(s,c),pe):ar(e):pe,[e,t])}function kn(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bt(e,n.current):pe}function ss(e){h.useEffect(()=>{if(!Dt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function is(e,t){return h.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=c=>{s(c,t)},n},{}),[e,t])}function dr(e){return h.useMemo(()=>e?_o(e):null,[e])}const $n=[];function as(e,t){t===void 0&&(t=Pe);const[n]=e,r=dr(n?ae(n):null),[o,s]=h.useState($n);function c(){s(()=>e.length?e.map(u=>sr(u)?r:new an(t(u),u)):$n)}const l=jt({callback:c});return xe(()=>{l?.disconnect(),c(),e.forEach(u=>l?.observe(u))},[e]),o}function cs(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function ls(e){let{measure:t}=e;const[n,r]=h.useState(null),o=h.useCallback(d=>{for(const{target:g}of d)if(et(g)){r(f=>{const b=t(g);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),s=jt({callback:o}),c=h.useCallback(d=>{const g=cs(d);s?.disconnect(),g&&s?.observe(g),r(g?t(g):null)},[t,s]),[l,u]=xt(c);return h.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const us=[{sensor:ln,options:{}},{sensor:lr,options:{}}],ds={current:{}},ht={draggable:{measure:jn},droppable:{measure:jn,strategy:Ze.WhileDragging,frequency:qt.Optimized},dragOverlay:{measure:Pe}};class Ke extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const fs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ke,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:yt,windowRect:null,measuringScheduled:!1},hs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=h.createContext(hs),fr=h.createContext(fs);function gs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ke}}}function ps(e,t){switch(t.type){case Q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Q.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Q.DragEnd:case Q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ke(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const c=new Ke(e.droppable.containers);return c.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Ke(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function vs(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=h.useContext(Rt),s=Wt(r),c=Wt(n?.id);return h.useEffect(()=>{if(!t&&!r&&s&&c!=null){if(!on(s)||document.activeElement===s.target)return;const l=o.get(c);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[u.current,d.current]){if(!g)continue;const f=so(g);if(f){f.focus();break}}})}},[r,t,o,c,s]),null}function ms(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function xs(e){return h.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function bs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=h.useRef(!1),{x:c,y:l}=typeof o=="boolean"?{x:o,y:o}:o;xe(()=>{if(!c&&!l||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=tr(g,r);if(c||(f.x=0),l||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=nr(d);b&&b.scrollBy({top:f.y,left:f.x})}},[t,c,l,r,n])}const hr=h.createContext({...pe,scaleX:1,scaleY:1});var Re;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Re||(Re={}));const gr=h.memo(function(t){var n,r,o,s;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:g=us,collisionDetection:f=Co,measuring:b,modifiers:v,...p}=t;const m=h.useReducer(ps,void 0,gs),[S,w]=m,[j,R]=fo(),[I,$]=h.useState(Re.Uninitialized),M=I===Re.Initialized,{draggable:{active:A,nodes:L,translate:V},droppable:{containers:B}}=S,O=A!=null?L.get(A):null,H=h.useRef({initial:null,translated:null}),G=h.useMemo(()=>{var oe;return A!=null?{id:A,data:(oe=O?.data)!=null?oe:ds,rect:H}:null},[A,O]),k=h.useRef(null),[E,C]=h.useState(null),[_,D]=h.useState(null),P=Je(p,Object.values(p)),z=nt("DndDescribedBy",c),x=h.useMemo(()=>B.getEnabled(),[B]),T=xs(b),{droppableRects:N,measureDroppableContainers:Y,measuringScheduled:X}=Zo(x,{dragging:M,dependencies:[V.x,V.y],config:T.droppable}),q=Ko(L,A),W=h.useMemo(()=>_?Ut(_):null,[_]),K=Jr(),J=Qo(q,T.draggable.measure);bs({activeNode:A!=null?L.get(A):null,config:K.layoutShiftCompensation,initialRect:J,measure:T.draggable.measure});const F=_n(q,T.draggable.measure,J),ie=_n(q?q.parentElement:null),re=h.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=re.current.over)==null?void 0:n.id),be=ls({measure:T.dragOverlay.measure}),Te=(r=be.nodeRef.current)!=null?r:q,Me=M?(o=be.rect)!=null?o:F:null,fn=!!(be.nodeRef.current&&be.rect),hn=ns(fn?null:F),Ot=dr(Te?ae(Te):null),Se=rs(M?he??q:null),ot=as(Se),st=ms(v,{transform:{x:V.x-hn.x,y:V.y-hn.y,scaleX:1,scaleY:1},activatorEvent:_,active:G,activeNodeRect:F,containerNodeRect:ie,draggingNodeRect:Me,over:re.current.over,overlayNodeRect:be.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:Ot}),gn=W?$e(W,V):null,pn=os(Se),Vr=kn(pn),Wr=kn(pn,[F]),_e=$e(st,Vr),Oe=Me?Ro(Me,st):null,ze=G&&Oe?f({active:G,collisionRect:Oe,droppableRects:N,droppableContainers:x,pointerCoordinates:gn}):null,vn=So(ze,"id"),[we,mn]=h.useState(null),Ur=fn?st:$e(st,Wr),Gr=Do(Ur,(s=we?.rect)!=null?s:null,F),kt=h.useRef(null),xn=h.useCallback((oe,ce)=>{let{sensor:le,options:Ce}=ce;if(k.current==null)return;const de=L.get(k.current);if(!de)return;const ue=oe.nativeEvent,ve=new le({active:k.current,activeNode:de,event:ue,options:Ce,context:re,onAbort(te){if(!L.get(te))return;const{onDragAbort:me}=P.current,ye={id:te};me?.(ye),j({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!L.get(te))return;const{onDragPending:Be}=P.current,je={id:te,constraint:De,initialCoordinates:me,offset:ye};Be?.(je),j({type:"onDragPending",event:je})},onStart(te){const De=k.current;if(De==null)return;const me=L.get(De);if(!me)return;const{onDragStart:ye}=P.current,Fe={activatorEvent:ue,active:{id:De,data:me.data,rect:H}};Ge.unstable_batchedUpdates(()=>{ye?.(Fe),$(Re.Initializing),w({type:Q.DragStart,initialCoordinates:te,active:De}),j({type:"onDragStart",event:Fe}),C(kt.current),D(ue)})},onMove(te){w({type:Q.DragMove,coordinates:te})},onEnd:ke(Q.DragEnd),onCancel:ke(Q.DragCancel)});kt.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:Fe,scrollAdjustedTranslate:Be}=re.current;let je=null;if(me&&Be){const{cancelDrop:Ye}=P.current;je={activatorEvent:ue,active:me,collisions:ye,delta:Be,over:Fe},te===Q.DragEnd&&typeof Ye=="function"&&await Promise.resolve(Ye(je))&&(te=Q.DragCancel)}k.current=null,Ge.unstable_batchedUpdates(()=>{w({type:te}),$(Re.Uninitialized),mn(null),C(null),D(null),kt.current=null;const Ye=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(je){const $t=P.current[Ye];$t?.(je),j({type:Ye,event:je})}})}}},[L]),Xr=h.useCallback((oe,ce)=>(le,Ce)=>{const de=le.nativeEvent,ue=L.get(Ce);if(k.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};oe(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},k.current=Ce,xn(le,ce))},[L,xn]),bn=Jo(g,Xr);ss(g),xe(()=>{F&&I===Re.Initializing&&$(Re.Initialized)},[F,I]),h.useEffect(()=>{const{onDragMove:oe}=P.current,{active:ce,activatorEvent:le,collisions:Ce,over:de}=re.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:Ce,delta:{x:_e.x,y:_e.y},over:de};Ge.unstable_batchedUpdates(()=>{oe?.(ue),j({type:"onDragMove",event:ue})})},[_e.x,_e.y]),h.useEffect(()=>{const{active:oe,activatorEvent:ce,collisions:le,droppableContainers:Ce,scrollAdjustedTranslate:de}=re.current;if(!oe||k.current==null||!ce||!de)return;const{onDragOver:ue}=P.current,ve=Ce.get(vn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:oe,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:ke};Ge.unstable_batchedUpdates(()=>{mn(ke),ue?.(te),j({type:"onDragOver",event:te})})},[vn]),xe(()=>{re.current={activatorEvent:_,active:G,activeNode:q,collisionRect:Oe,collisions:ze,droppableRects:N,draggableNodes:L,draggingNode:Te,draggingNodeRect:Me,droppableContainers:B,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},H.current={initial:Me,translated:Oe}},[G,q,ze,Oe,L,Te,Me,N,B,we,Se,_e]),Go({...K,delta:V,draggingRect:Oe,pointerCoordinates:gn,scrollableAncestors:Se,scrollableAncestorRects:ot});const qr=h.useMemo(()=>({active:G,activeNode:q,activeNodeRect:F,activatorEvent:_,collisions:ze,containerNodeRect:ie,dragOverlay:be,draggableNodes:L,droppableContainers:B,droppableRects:N,over:we,measureDroppableContainers:Y,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:T,measuringScheduled:X,windowRect:Ot}),[G,q,F,_,ze,ie,be,L,B,N,we,Y,Se,ot,T,X,Ot]),Kr=h.useMemo(()=>({activatorEvent:_,activators:bn,active:G,activeNodeRect:F,ariaDescribedById:{draggable:z},dispatch:w,draggableNodes:L,over:we,measureDroppableContainers:Y}),[_,bn,G,F,w,z,L,we,Y]);return h.createElement(Qn.Provider,{value:R},h.createElement(Rt.Provider,{value:Kr},h.createElement(fr.Provider,{value:qr},h.createElement(hr.Provider,{value:Gr},d)),h.createElement(vs,{disabled:l?.restoreFocus===!1})),h.createElement(po,{...l,hiddenTextDescribedById:z}));function Jr(){const oe=E?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=M&&!oe&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),ys=h.createContext(null),In="button",Ss="Draggable";function ws(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=nt(Ss),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:b}=h.useContext(Rt),{role:v=In,roleDescription:p="draggable",tabIndex:m=0}=o??{},S=u?.id===t,w=h.useContext(S?hr:ys),[j,R]=xt(),[I,$]=xt(),M=is(c,t),A=Je(n);xe(()=>(f.set(t,{id:t,key:s,node:j,activatorNode:I,data:A}),()=>{const V=f.get(t);V&&V.key===s&&f.delete(t)}),[f,t]);const L=h.useMemo(()=>({role:v,tabIndex:m,"aria-disabled":r,"aria-pressed":S&&v===In?!0:void 0,"aria-roledescription":p,"aria-describedby":g.draggable}),[r,v,m,S,p,g.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:L,isDragging:S,listeners:r?void 0:M,node:j,over:b,setNodeRef:R,setActivatorNodeRef:$,transform:w}}function Cs(){return h.useContext(fr)}const Ds="Droppable",js={timeout:25};function Rs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=nt(Ds),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=h.useContext(Rt),g=h.useRef({disabled:n}),f=h.useRef(!1),b=h.useRef(null),v=h.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:S}={...js,...o},w=Je(m??r),j=h.useCallback(()=>{if(!f.current){f.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),v.current=null},S)},[S]),R=jt({callback:j,disabled:p||!c}),I=h.useCallback((L,V)=>{R&&(V&&(R.unobserve(V),f.current=!1),L&&R.observe(L))},[R]),[$,M]=xt(I),A=Je(t);return h.useEffect(()=>{!R||!$.current||(R.disconnect(),f.current=!1,R.observe($.current))},[$,R]),h.useEffect(()=>(l({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:b,data:A}}),()=>l({type:Q.UnregisterDroppable,key:s,id:r})),[r]),h.useEffect(()=>{n!==g.current.disabled&&(l({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,l]),{active:c,rect:b,isOver:u?.id===r,node:$,over:u,setNodeRef:M}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Es(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function at(e){return e!==null&&e>=0}function Ts(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ms(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},_s=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:c}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=Os(n,c,o);if(c===o){const d=n[s];return d?{x:o<s?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...ct}:null}return c>o&&c<=s?{x:-l.width-u,y:0,...ct}:c<o&&c>=s?{x:l.width+u,y:0,...ct}:{x:0,y:0,...ct}};function Os(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const pr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Et(t,r,n),c=t[o],l=s[o];return!l||!c?null:{x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height}},lt={scaleX:1,scaleY:1},ks=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:c}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(o===n){const d=s[c];return d?{x:0,y:n<c?d.top+d.height-(l.top+l.height):d.top-l.top,...lt}:null}const u=$s(s,o,n);return o>n&&o<=c?{x:0,y:-l.height-u,...lt}:o<n&&o>=c?{x:0,y:l.height+u,...lt}:{x:0,y:0,...lt}};function $s(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const vr="Sortable",mr=h.createContext({activeIndex:-1,containerId:vr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pr,disabled:{draggable:!1,droppable:!1}});function xr(e){let{children:t,id:n,items:r,strategy:o=pr,disabled:s=!1}=e;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:g}=Cs(),f=nt(vr,n),b=l.rect!==null,v=h.useMemo(()=>r.map(M=>typeof M=="object"&&"id"in M?M.id:M),[r]),p=c!=null,m=c?v.indexOf(c.id):-1,S=d?v.indexOf(d.id):-1,w=h.useRef(v),j=!Ts(v,w.current),R=S!==-1&&m===-1||j,I=Ms(s);xe(()=>{j&&p&&g(v)},[j,v,p,g]),h.useEffect(()=>{w.current=v},[v]);const $=h.useMemo(()=>({activeIndex:m,containerId:f,disabled:I,disableTransforms:R,items:v,overIndex:S,useDragOverlay:b,sortedRects:Es(v,u),strategy:o}),[m,f,I.draggable,I.droppable,R,v,S,u,b,o]);return h.createElement(mr.Provider,{value:$},t)}const Is=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},As=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=e;return!d||!r||l!==s&&o===c?!1:n?!0:c!==o&&t===u},Ls={duration:200,easing:"ease"},br="transform",Ps=Ie.Transition.toString({property:br,duration:0,easing:"linear"}),Ns={roleDescription:"sortable"};function zs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,c]=h.useState(null),l=h.useRef(n);return xe(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const d=Pe(r.current,{ignoreTransform:!0}),g={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(g.x||g.y)&&c(g)}}n!==l.current&&(l.current=n)},[t,n,r,o]),h.useEffect(()=>{s&&c(null)},[s]),s}function yr(e){let{animateLayoutChanges:t=As,attributes:n,disabled:r,data:o,getNewIndex:s=Is,id:c,strategy:l,resizeObserverConfig:u,transition:d=Ls}=e;const{items:g,containerId:f,activeIndex:b,disabled:v,disableTransforms:p,sortedRects:m,overIndex:S,useDragOverlay:w,strategy:j}=h.useContext(mr),R=Fs(r,v),I=g.indexOf(c),$=h.useMemo(()=>({sortable:{containerId:f,index:I,items:g},...o}),[f,o,I,g]),M=h.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:A,node:L,isOver:V,setNodeRef:B}=Rs({id:c,data:$,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...u}}),{active:O,activatorEvent:H,activeNodeRect:G,attributes:k,setNodeRef:E,listeners:C,isDragging:_,over:D,setActivatorNodeRef:P,transform:z}=ws({id:c,data:$,attributes:{...Ns,...n},disabled:R.draggable}),x=to(B,E),T=!!O,N=T&&!p&&at(b)&&at(S),Y=!w&&_,X=Y&&N?z:null,W=N?X??(l??j)({rects:m,activeNodeRect:G,activeIndex:b,overIndex:S,index:I}):null,K=at(b)&&at(S)?s({id:c,items:g,activeIndex:b,overIndex:S}):I,J=O?.id,F=h.useRef({activeId:J,items:g,newIndex:K,containerId:f}),ie=g!==F.current.items,re=t({active:O,containerId:f,isDragging:_,isSorting:T,id:c,index:I,items:g,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=zs({disabled:!re,index:I,node:L,rect:A});return h.useEffect(()=>{T&&F.current.newIndex!==K&&(F.current.newIndex=K),f!==F.current.containerId&&(F.current.containerId=f),g!==F.current.items&&(F.current.items=g)},[T,K,f,g]),h.useEffect(()=>{if(J===F.current.activeId)return;if(J!=null&&F.current.activeId==null){F.current.activeId=J;return}const Te=setTimeout(()=>{F.current.activeId=J},50);return()=>clearTimeout(Te)},[J]),{active:O,activeIndex:b,attributes:k,data:$,rect:A,index:I,newIndex:K,items:g,isOver:V,isSorting:T,isDragging:_,listeners:C,node:L,overIndex:S,over:D,setNodeRef:x,setActivatorNodeRef:P,setDroppableNodeRef:B,setDraggableNodeRef:E,transform:he??W,transition:be()};function be(){if(he||ie&&F.current.newIndex===I)return Ps;if(!(Y&&!on(H)||!d)&&(T||re))return Ie.Transition.toString({...d,property:br})}}function Fs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}U.Down,U.Right,U.Up,U.Left;var ut={exports:{}},Nt={},dt={exports:{}},zt={};var An;function Bs(){if(An)return zt;An=1;var e=h;function t(f,b){return f===b&&(f!==0||1/f===1/b)||f!==f&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function l(f,b){var v=b(),p=r({inst:{value:v,getSnapshot:b}}),m=p[0].inst,S=p[1];return s(function(){m.value=v,m.getSnapshot=b,u(m)&&S({inst:m})},[f,v,b]),o(function(){return u(m)&&S({inst:m}),f(function(){u(m)&&S({inst:m})})},[f]),c(v),v}function u(f){var b=f.getSnapshot;f=f.value;try{var v=b();return!n(f,v)}catch{return!0}}function d(f,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return zt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,zt}var Ft={};var Ln;function Ys(){return Ln||(Ln=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,p){return v===p&&(v!==0||1/v===1/p)||v!==v&&p!==p}function t(v,p){g||o.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=p();if(!f){var S=p();s(m,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=c({inst:{value:m,getSnapshot:p}});var w=S[0].inst,j=S[1];return u(function(){w.value=m,w.getSnapshot=p,n(w)&&j({inst:w})},[v,m,p]),l(function(){return n(w)&&j({inst:w}),v(function(){n(w)&&j({inst:w})})},[v]),d(m),m}function n(v){var p=v.getSnapshot;v=v.value;try{var m=p();return!s(v,m)}catch{return!0}}function r(v,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,s=typeof Object.is=="function"?Object.is:e,c=o.useState,l=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,g=!1,f=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Ft.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ft}var Pn;function Sr(){return Pn||(Pn=1,process.env.NODE_ENV==="production"?dt.exports=Bs():dt.exports=Ys()),dt.exports}var Nn;function Hs(){if(Nn)return Nt;Nn=1;var e=h,t=Sr();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Nt.useSyncExternalStoreWithSelector=function(d,g,f,b,v){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=l(function(){function w(M){if(!j){if(j=!0,R=M,M=b(M),v!==void 0&&m.hasValue){var A=m.value;if(v(A,M))return I=A}return I=M}if(A=I,r(R,M))return A;var L=b(M);return v!==void 0&&v(A,L)?(R=M,A):(R=M,I=L)}var j=!1,R,I,$=f===void 0?null:f;return[function(){return w(g())},$===null?void 0:function(){return w($())}]},[g,f,b,v]);var S=o(d,p[0],p[1]);return c(function(){m.hasValue=!0,m.value=S},[S]),u(S),S},Nt}var Bt={};var zn;function Vs(){return zn||(zn=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,n=Sr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;Bt.useSyncExternalStoreWithSelector=function(d,g,f,b,v){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=l(function(){function w(M){if(!j){if(j=!0,R=M,M=b(M),v!==void 0&&m.hasValue){var A=m.value;if(v(A,M))return I=A}return I=M}if(A=I,r(R,M))return A;var L=b(M);return v!==void 0&&v(A,L)?(R=M,A):(R=M,I=L)}var j=!1,R,I,$=f===void 0?null:f;return[function(){return w(g())},$===null?void 0:function(){return w($())}]},[g,f,b,v]);var S=o(d,p[0],p[1]);return c(function(){m.hasValue=!0,m.value=S},[S]),u(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Bt}var Fn;function Ws(){return Fn||(Fn=1,process.env.NODE_ENV==="production"?ut.exports=Hs():ut.exports=Vs()),ut.exports}var Us=Ws();const Kt=new WeakMap,Gs=new WeakMap,wt={current:[]};let Yt=!1;const ft=new Set,Bn=new Map;function wr(e){for(const t of e){if(wt.current.includes(t))continue;wt.current.push(t),t.recompute();const n=Gs.get(t);if(n)for(const r of n){const o=Kt.get(r);o?.length&&wr(o)}}}function Xs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ks(e){if(ft.add(e),!Yt)try{for(Yt=!0;ft.size>0;){const t=Array.from(ft);ft.clear();for(const n of t){const r=Bn.get(n)??n.prevState;n.prevState=r,Xs(n)}for(const n of t){const r=Kt.get(n);r&&(wt.current.push(n),wr(r))}for(const n of t){const r=Kt.get(n);if(r)for(const o of r)qs(o)}}}finally{Yt=!1,wt.current=[],Bn.clear()}}function Js(e){return typeof e=="function"}class Cr{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const c=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),c?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Js(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Ks(this)}}function Ne(e,t=r=>r,n={}){const r=n.equal??Zs;return Us.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Yn(e);if(n.length!==Yn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Yn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ne=new Cr({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],columnWidths:{},data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}}),Tt=e=>`datatable:${e}:column-widths`;function Dr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(f=>({id:f,label:f}))).filter(f=>Object.prototype.hasOwnProperty.call(n,f.id)),{tableId:s}=ne.state,c=JSON.parse(localStorage.getItem(Er(s))||"[]"),l=[...c.map(f=>o.find(b=>b.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],u=JSON.parse(localStorage.getItem(Tr(s))||"{}"),d=l.reduce((f,b)=>(f[b.id]=u[b.id]??!0,f),{}),g=JSON.parse(localStorage.getItem(Tt(s))||"{}");ne.setState(f=>({...f,data:e,columnOrder:l,visibility:d,columnWidths:g,sortableColumns:l.map(b=>({id:b.id,label:b.label,sortable:!0,backgroundColor:b.backgroundColor}))}))}function jr(e){ne.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const Rr=e=>{ne.setState(t=>({...t,actionsConfig:e}))};function Qs(e,t){ne.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Tt(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const Er=e=>`table_column_order_v1:${e}`,Tr=e=>`table_column_visibility_v1:${e}`,ei=e=>{const{tableId:t}=ne.state;localStorage.setItem(Er(t),JSON.stringify(e.map(n=>n.id))),ne.setState(n=>({...n,columnOrder:e})),ne.setState(n=>({...n,columnOrder:e}))};function ti(e){ne.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const ni=e=>{ne.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Tr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};function ri(e,t){ne.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Tt(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),si=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Hn=e=>{const t=si(e);return t.charAt(0).toUpperCase()+t.slice(1)},Mr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ii=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ai={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ci=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...l},u)=>h.createElement("svg",{ref:u,...ai,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Mr("lucide",o),...!s&&!ii(l)&&{"aria-hidden":"true"},...l},[...c.map(([d,g])=>h.createElement(d,g)),...Array.isArray(s)?s:[s]]));const se=(e,t)=>{const n=h.forwardRef(({className:r,...o},s)=>h.createElement(ci,{ref:s,iconNode:t,className:Mr(`lucide-${oi(Hn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Hn(e),n};const li=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ui=se("arrow-down",li);const di=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],fi=se("arrow-up-down",di);const hi=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],gi=se("arrow-up",hi);const pi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],vi=se("bookmark",pi);const mi=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Vn=se("calendar",mi);const xi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],bi=se("chevron-left",xi);const yi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Si=se("chevron-right",yi);const wi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Ci=se("columns-2",wi);const Di=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],ji=se("delete",Di);const Ri=[["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"}]],Ei=se("ellipsis",Ri);const Ti=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Mi=se("funnel",Ti);const _i=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_r=se("grip-vertical",_i);const Oi=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],ki=se("pen",Oi);const $i=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Ii=se("refresh-ccw",$i);const Ai=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Li=se("settings",Ai);const Pi=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Or=se("triangle-alert",Pi);function y(e){return h.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Ni=y(a.Menu.Trigger),zi=y(a.Menu.Positioner),Fi=y(a.Menu.Content),Bi=y(a.Menu.Item),Yi=y(a.Checkbox.Label),Hi=y(a.Checkbox.HiddenInput),Vi=y(a.Checkbox.Control);function Wi({visibility:e,onToggle:t}){const{sortableColumns:n}=Ne(ne);return i.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ni,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(Ci,{size:18})})}),i.jsx(a.Portal,{children:i.jsx(zi,{children:i.jsx(Fi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(Bi,{value:r.id,closeOnSelect:!1,children:i.jsxs(a.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(Hi,{}),i.jsx(Vi,{}),i.jsx(Yi,{children:r.label})]})},r.id)})})})})]})}function Ui({id:e,children:t,onClick:n,cursor:r,borderRight:o,backgroundColor:s}){const{columnWidths:c}=Ne(ne),l=c[e],u=h.useRef(0),d=h.useRef(0),{setNodeRef:g,attributes:f,listeners:b,transform:v,transition:p}=yr({id:e}),m=S=>{S.stopPropagation(),u.current=S.clientX,d.current=l??150;const w=R=>{ri(e,d.current+(R.clientX-u.current))},j=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",j)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",j)};return i.jsx(a.Table.ColumnHeader,{ref:g,onClick:n,backgroundColor:s,w:l?`${l}px`:void 0,minW:"60px",style:{transform:Ie.Transform.toString(v),transition:p,cursor:r,borderRight:o},...f,children:i.jsxs(a.HStack,{position:"relative",children:[i.jsx("span",{...b,children:i.jsx(_r,{size:12})}),t,i.jsx(a.Box,{position:"absolute",right:0,top:0,h:"100%",w:"5px",cursor:"col-resize",background:"gray.200",onMouseDown:m,_hover:{bg:"gray.600"}})]})})}function Gi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=Ne(ne),c=e.map(l=>o.find(u=>u.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]);return i.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(a.Table.Row,{height:"28px",children:[s?.showSNo&&i.jsx(a.Table.ColumnHeader,{width:"60px",textAlign:"center",backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.indexChildren||"S.No"}),c.map(l=>{const u=n===l?.id;return i.jsx(Ui,{id:l?.id,onClick:()=>l?.sortable&&ti(l?.id),cursor:l?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:l?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l?.label,l?.sortable&&(u?r==="asc"?i.jsx(gi,{size:14}):i.jsx(ui,{size:14}):i.jsx(fi,{size:14,opacity:.4}))]})},l?.id)}),s?.showActionColumn&&i.jsx(a.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children||"Actions"}),s?.showColumnVisibilityMenu&&i.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Wi,{visibility:t,onToggle:ni})})]})})}const Xi=[10,20,50,100],qi=y(a.Select.Positioner),Ki=y(a.Select.Content),Ji=y(a.Select.Item),Zi=y(a.Pagination.PrevTrigger),Qi=y(a.Pagination.NextTrigger),ea=y(a.Select.HiddenSelect),ta=y(a.Select.Control),na=y(a.Select.Trigger),ra=y(a.Select.ValueText),oa=y(a.Select.IndicatorGroup),sa=y(a.Select.Indicator);function ia({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:c=Xi}){const l=a.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return i.jsx(a.Box,{width:"100%",children:i.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(a.HStack,{children:[i.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(a.Select.Root,{collection:l,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(ea,{}),i.jsxs(ta,{children:[i.jsx(na,{children:i.jsx(ra,{placeholder:""})}),i.jsx(oa,{children:i.jsx(sa,{})})]}),i.jsx(a.Portal,{children:i.jsx(qi,{children:i.jsx(Ki,{children:l.items.map(u=>i.jsxs(Ji,{item:u.value,children:[u.label,i.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]}),i.jsxs(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),i.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Zi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Previous page",children:i.jsx(bi,{size:18})})}),i.jsx(a.Pagination.Items,{render:u=>i.jsx(a.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),i.jsx(Qi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Next page",children:i.jsx(Si,{size:18})})})]})})]})})}const aa=y(a.Menu.Item),ca=y(a.Menu.Content),la=y(a.Menu.Positioner),ua=y(a.Menu.Trigger);function da({data:e=[],actions:t=[],actionConfig:n,onRowSelect:r,onRowSelectEvent:o="left",startIndex:s=0}){const{columnOrder:c,visibility:l,columnWidths:u}=Ne(ne);return i.jsx(a.Table.Body,{children:e.map((d,g)=>i.jsxs(a.Table.Row,{onClick:()=>o==="left"&&r?.(d.__raw),_hover:{bg:"blue.50"},onContextMenu:o==="right"?f=>{f.preventDefault(),r?.(d.__raw)}:void 0,children:[n?.showSNo&&i.jsx(a.Table.Cell,{textAlign:"center",fontWeight:"medium",children:s+g+1}),c.filter(f=>l[f.id]).map(f=>i.jsx(a.Table.Cell,{w:u[f.id]?u[f.id]+"px":void 0,children:d[f.id]},f.id)),n?.showActionColumn&&i.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(a.Menu.Root,{children:[i.jsx(ua,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(Ei,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(la,{children:i.jsx(ca,{children:t.filter(f=>typeof f.visible=="function"?f.visible(d.__raw):f.visible!==!1).map(f=>i.jsxs(aa,{onClick:()=>f.onClick(d.__raw),colorScheme:f.colorScheme,value:f.label,children:[f.icon,f.label]},f.label))})})})]})}),n?.showColumnVisibilityMenu&&i.jsx(a.Table.Cell,{})]},d.__key||d.id))})}function fa({rows:e=6,columns:t}){return i.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(a.Table.Cell,{children:i.jsx(a.Skeleton,{height:"25px"})},s))},r))})}function ha({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:c="No data",actions:l,page:u=1,pageSize:d=10,onPageChange:g,onPageSizeChange:f,density:b="sm",totalCount:v=0,actionConfig:p,pageSizeOptions:m,onRowSelect:S,onRowSelectEvent:w="left"}){h.useEffect(()=>{jr(e)},[e]),h.useEffect(()=>{Dr(t,n)},[t,n]),h.useEffect(()=>{p&&Rr(p)},[p]);const{sortColumn:j,sortDirection:R,data:I,columnOrder:$}=Ne(ne),M=h.useMemo(()=>{const H=[...I];return j&&H.sort((G,k)=>R==="asc"?String(G[j]).localeCompare(String(k[j])):String(k[j]).localeCompare(String(G[j]))),H},[I,j,R,u,d]),A=h.useMemo(()=>(Math.max(1,u||1)-1)*d,[u,d]);h.useEffect(()=>{u<1&&g&&g(1)},[u,g]);const L=H=>{const{active:G,over:k}=H;if(!k||G.id===k.id)return;const E=$.findIndex(D=>D.id===G.id),C=$.findIndex(D=>D.id===k.id),_=Et($,E,C);ei(_)},V=r&&!s,B=s&&!r,O=!r&&!s&&M.length===0;return i.jsx(gr,{collisionDetection:er,onDragEnd:L,children:i.jsx(xr,{items:$.map(H=>H.id),strategy:_s,children:i.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[V&&i.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(a.Spinner,{})}),i.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:b,children:[i.jsx(Gi,{}),B?i.jsx(fa,{rows:d,columns:n.length+(l?2:0)}):O?i.jsx(a.Table.Body,{children:i.jsx(a.Table.Row,{children:i.jsx(a.Table.Cell,{colSpan:n.length+(l?1:0),children:i.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):i.jsx(da,{data:M,actions:l,actionConfig:p,onRowSelect:S,startIndex:A,onRowSelectEvent:w})]})]}),i.jsx(a.Box,{mt:.5,children:i.jsx(ia,{totalCount:v,pageSize:d,currentPage:u,onPageChange:g,onPageSizeChange:H=>{f?.(H),u>1&&g?.(1)},pageSizeOptions:m})})]})})})}const ga=y(a.Checkbox.Root),pa=y(a.Checkbox.HiddenInput),va=y(a.Checkbox.Control),ma=y(a.Checkbox.Label),kr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:c,errorText:l})=>i.jsxs(ga,{value:e,onChange:t,size:n,children:[i.jsx(pa,{}),i.jsx(va,{disabled:s,required:c,errorText:l,helperText:o}),r&&i.jsx(ma,{children:r})]}),xa=y(a.Combobox.Root),ba=y(a.Combobox.Control),ya=y(a.Combobox.Input),Sa=y(a.Combobox.IndicatorGroup),wa=y(a.Combobox.ClearTrigger),Ca=y(a.Combobox.Trigger),Da=y(a.Combobox.Positioner),ja=y(a.Combobox.Content);function $r({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:c,renderItem:l,value:u,loading:d,error:g,errorMessage:f,placeholder:b,helpText:v,onInputChange:p,onSelect:m,visible:S=!0,rootProps:w,inputProps:j,controlProps:R,contentProps:I,itemProps:$}){const[M,A]=h.useState(""),{collection:L,set:V}=a.useListCollection({initialItems:o,itemToString:s,itemToValue:c}),B=h.useMemo(()=>{if(!M)return o;const O=M.toLowerCase();return o.filter(H=>s(H).toLowerCase().includes(O))},[o,M,s]);return h.useEffect(()=>{V(B)},[B,V]),h.useEffect(()=>{u&&A(s(u))},[u,s]),i.jsxs(xa,{width:n,size:t,variant:r,collection:L,placeholder:b,onInputValueChange:O=>{p?.(O.inputValue),A(O.inputValue)},value:u?[c(u)]:[],onValueChange:O=>{const H=O.value?.[0];if(!H)return;const G=L.items.find(k=>c(k)===H);G&&m?.(G)},positioning:{sameWidth:!1,placement:"bottom-start"},...w,children:[S&&e&&i.jsx(a.Text,{fontSize:"sm",children:e}),i.jsxs(ba,{...R,children:[i.jsx(ya,{placeholder:b??"Type to search",...j}),i.jsxs(Sa,{children:[i.jsx(wa,{}),i.jsx(Ca,{})]})]}),i.jsx(Da,{children:i.jsxs(ja,{minW:"sm",...I,children:[d?i.jsxs(a.HStack,{p:"2",children:[i.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(a.Span,{children:"Loading..."})]}):g?i.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):L.items.map(O=>i.jsxs(a.Combobox.Item,{item:O,...$,children:[l(O),i.jsx(a.Combobox.ItemIndicator,{})]},c(O))),v&&!g&&!d&&i.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:v})]})})]})}const Z=" to ",Wn=10,Ee={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},un=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Un=()=>{const{year:e,month:t,day:n}=un();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},Ra=()=>{const{year:e,month:t,day:n}=un();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},Ea=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Ee.YEAR_MIN&&r<=Ee.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,c=o.substring(0,s);return parseInt(c+e)}return t},We=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=un();let c,l,u;return n.length===1?(c=parseInt(n[0])||s,l=o,u=r):n.length===2?(c=parseInt(n[0])||s,l=parseInt(n[1])||o,u=r):(c=parseInt(n[0])||s,l=parseInt(n[1])||o,u=Ea(n[2],r)),l=Math.max(1,Math.min(Ee.MONTH_MAX,l)),c=Math.max(1,Math.min(Ee.DAY_MAX,c)),`${u}-${String(l).padStart(2,"0")}-${String(c).padStart(2,"0")}`},ge=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},Ta=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Ee.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Ee.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<Ee.YEAR_MIN||n>Ee.YEAR_MAX))return t}return null},Ue=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Wn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Wn),Ta(n,e)||t},Ma=y(a.Popover.Root),_a=y(a.Popover.Trigger),Oa=y(a.Popover.Content),ka=y(a.Popover.Positioner);function $a({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,c]=h.useState(()=>r&&o?`${ge(r)}${Z}${ge(o)}`:r?ge(r):""),[l,u]=h.useState(!1),d=h.useRef(null);h.useEffect(()=>{const p=m=>{m.ctrlKey&&m.key==="d"&&!m.shiftKey&&!m.metaKey&&(m.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[]);const g=p=>{let m=p;if(m.includes(Z)){const[S,w=""]=m.split(Z);m=`${Ue(S.trim())}${Z}${Ue(w.trim())}`}else if(m.toLowerCase().includes(" to ")){const[S,w=""]=m.split(/\s+to\s+/i);m=`${Ue(S.trim())} to ${Ue(w.trim())}`}else m=Ue(m);c(m)},f=()=>{const p=s.trim();if(!p){t(void 0);return}if(p.includes(Z)){const[m,S=""]=p.split(Z).map(R=>R.trim()),w=We(m),j=S?We(S):null;if(w&&j){const[R,I]=j<w?[j,w]:[w,j],$=`${ge(R)}${Z}${ge(I)}`;c($),t(`${R}|${I}`)}else if(w&&!S)c(`${ge(w)}${Z}`),t(void 0);else if(w&&S){const R=Ra(),[I,$]=R<w?[R,w]:[w,R],M=`${ge(I)}${Z}${ge($)}`;c(M),t(`${I}|${$}`)}else c(""),t(void 0)}else{const m=We(p);m?(c(`${ge(m)}${Z}`),t(void 0)):(c(""),t(void 0))}},b=p=>{if(p.key!=="Enter")return;p.preventDefault();const m=d.current?.selectionStart||0,S=s.indexOf(Z);if(!s.trim()){c(`${Un()}${Z}`);return}if(S===-1){const j=We(s.trim());j&&c(`${ge(j)}${Z}`);return}if(m<=S+Z.length){const j=s.substring(0,S).trim(),R=s.substring(S+Z.length),I=We(j);I&&c(`${ge(I)}${Z}${R}`);return}if(s.substring(S+Z.length).trim())f(),d.current?.blur();else{const j=s.substring(0,S+Z.length)+Un();c(j),setTimeout(()=>{f(),d.current?.blur()},0)}},v=()=>{c(""),t(void 0)};return i.jsx(a.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(a.InputElement,{position:"revert",children:[i.jsxs(Ma,{open:l,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(_a,{asChild:!0,children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(p=>!p),children:i.jsx(Vn,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(ka,{children:i.jsxs(Oa,{p:4,children:[i.jsx(a.PopoverArrow,{}),i.jsxs(a.VStack,{align:"start",gap:4,children:[i.jsxs(a.HStack,{children:[i.jsx(Vn,{size:16}),i.jsx(a.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(a.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(a.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(a.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(a.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(a.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(a.HStack,{children:[i.jsx(a.Kbd,{children:"Ctrl"}),i.jsx(a.Text,{children:"+"}),i.jsx(a.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(a.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:p=>g(p.target.value),onBlur:f,onKeyDown:b,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(a.InputElement,{children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const Ia=y(a.Field.Root),Aa=y(a.Field.Label),La=y(a.Field.HelperText),Pa=y(a.Field.ErrorText),Jt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:c="100%",label:l,helperText:u,isDisabled:d=!1,required:g=!1,errorText:f,visible:b,type:v="text",min:p=0,max:m=100,step:S=1})=>i.jsxs(Ia,{width:c,children:[b&&i.jsx(Aa,{children:l}),i.jsx(a.InputGroup,{startElement:e,children:i.jsx(a.Input,{value:t,onChange:w=>n?.(w.target.value),placeholder:r,size:o,type:v,variant:s,disabled:d,required:g,min:p,max:m,step:S})}),f&&i.jsx(Pa,{fontSize:"xs",children:f}),u&&i.jsx(La,{fontSize:"xs",children:u})]}),Na=y(a.Field.Root),za=y(a.Field.HelperText),Fa=y(a.Field.ErrorText),Ba=y(a.Select.Root),Ya=y(a.Select.Label),Ha=y(a.Select.Control),Va=y(a.Select.Trigger),Wa=y(a.Select.ValueText),Ua=y(a.Select.IndicatorGroup),Ga=y(a.Select.Indicator),Xa=y(a.Select.Content),qa=y(a.Select.Item),Ka=y(a.Select.ItemIndicator),Ja=y(a.Select.HiddenSelect),Za=y(a.Select.Positioner),Ir=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:c="100%",variant:l="outline",helperText:u,isDisabled:d,required:g,errorText:f,visible:b})=>{const v=a.createListCollection({items:e});return i.jsxs(Na,{disabled:d,required:g,children:[i.jsxs(Ba,{collection:v,variant:l,size:s,width:c,value:n?[n]:[],onValueChange:p=>r?.(p.value[0]),children:[i.jsx(Ja,{}),b&&i.jsx(Ya,{children:t}),i.jsxs(Ha,{children:[i.jsx(Va,{children:i.jsx(Wa,{placeholder:o})}),i.jsx(Ua,{children:i.jsx(Ga,{})})]}),i.jsx(Za,{children:i.jsx(Xa,{children:v.items.map(p=>i.jsxs(qa,{item:p,children:[p.label,i.jsx(Ka,{})]},p.value))})})]}),u&&i.jsx(za,{children:u}),f&&i.jsx(Fa,{children:f})]})},Ar=(e="default")=>`FILTER_PRESETS_${e}`,Qa=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},ec=e=>typeof window>"u"?[]:Qa(localStorage.getItem(Ar(e))),Qe=new Cr({}),rt=e=>{const t=Qe.state;if(e in t)return t[e];const n=ec(e);return Qe.setState(r=>({...r,[e]:n})),n},Mt=(e,t)=>{Qe.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(Ar(e),JSON.stringify(t))},Lr=(e,t)=>{const n=[t,...rt(e)];Mt(e,n)},Pr=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);Mt(e,n)},tc=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);Mt(e,r)},nc=y(a.Checkbox.Root),rc=y(a.Checkbox.HiddenInput),oc=y(a.Checkbox.Control),sc=y(a.Slider.Root),ic=y(a.Slider.Track),ac=y(a.Slider.Range),cc=y(a.Slider.Thumbs),lc=y(a.Slider.Control),uc=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:c,transition:l}=yr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:l};return i.jsxs(a.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(_r,{size:16}),i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(a.HStack,{justify:"space-between",children:[i.jsx(a.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(nc,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(rc,{}),i.jsx(oc,{})]})]}),i.jsxs(a.VStack,{align:"stretch",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",children:"Size"}),i.jsx(sc,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(lc,{children:[i.jsx(ic,{children:i.jsx(ac,{})}),i.jsx(cc,{})]})})]})]})},dc=y(a.Drawer.Root),fc=y(a.Drawer.Trigger),hc=y(a.Drawer.Backdrop),gc=y(a.Drawer.Positioner),pc=y(a.Drawer.Content),vc=y(a.Drawer.Header),mc=y(a.Drawer.Title),xc=y(a.Drawer.Body),bc=y(a.Drawer.Footer),yc=y(a.Drawer.CloseTrigger),Sc=y(a.Tabs.Root),wc=y(a.Tabs.List),Ht=y(a.Tabs.Trigger),Vt=y(a.Tabs.Content),Nr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return i.jsx(Jt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return i.jsx(Jt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return i.jsx(kr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Ir,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return i.jsx($a,{value:e.value,onChange:e.onChange});case"combobox":return i.jsx($r,{visible:!0,label:e.label,items:e.options,itemToString:n=>n.label,itemToValue:n=>n.value,renderItem:n=>i.jsx("span",{children:n.label})});default:return null}},Cc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",onLoadPreset:c,activePresetName:l,onReorder:u,open:d,onOpenChange:g})=>{const b=Ne(Qe)[s]??rt(s),v=()=>{const p=prompt("Preset name?");if(!p)return;const m=o.reduce((S,w)=>(S[w.id]=w.value,S),{});Lr(s,{id:crypto.randomUUID(),name:p,date:new Date().toISOString(),values:m})};return i.jsx(a.HStack,{wrap:"wrap",children:i.jsxs(dc,{size:e,open:d,onOpenChange:g,children:[i.jsx(fc,{asChild:!0,children:i.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(Mi,{size:16}),"Filters"]})}),i.jsxs(a.Portal,{children:[i.jsx(hc,{}),i.jsx(gc,{children:i.jsxs(pc,{children:[i.jsx(vc,{children:i.jsx(mc,{children:"Filters"})}),i.jsx(xc,{overflowY:"auto",pt:1,children:i.jsxs(Sc,{defaultValue:"view",children:[i.jsxs(wc,{mb:4,children:[i.jsxs(Ht,{value:"view",children:[i.jsx(ki,{size:16}),"Edit"]}),i.jsxs(Ht,{value:"settings",children:[i.jsx(Li,{size:16}),"Settings"]}),i.jsxs(Ht,{value:"presets",children:[i.jsx(vi,{size:16}),"Presets"]})]}),i.jsx(Vt,{value:"view",children:o.filter(p=>p.visible).map(p=>i.jsx(a.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:p.size??1,minW:`${(p.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Nr(p,d)},p.id))}),i.jsx(Vt,{value:"settings",children:i.jsx(gr,{sensors:mo(vo(ln)),collisionDetection:er,onDragEnd:({active:p,over:m})=>{if(!m||p.id===m.id)return;const S=o.findIndex(R=>R.id===p.id),w=o.findIndex(R=>R.id===m.id),j=Et(o,S,w);u?.(j)},children:i.jsx(xr,{items:o.map(p=>p.id),strategy:ks,children:o.map(p=>i.jsx(uc,{filter:p,onVisibilityChange:t,onSizeChange:n},p.id))})})}),i.jsx(Vt,{value:"presets",children:i.jsxs(a.VStack,{align:"stretch",mb:3,children:[b.length===0&&i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),b.map(p=>i.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:l===p.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(a.VStack,{align:"start",gap:0,children:[i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:p.name}),i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(p.date).toLocaleDateString()})]}),i.jsxs(a.HStack,{children:[i.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const m=o.map(S=>({...S,value:p.values[S.id]??S.value}));c?.(m,p.name)},children:"Load"}),i.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Pr(s,p.id),children:i.jsx(ji,{size:14})})]})]},p.id)),i.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(bc,{justify:"space-between",children:i.jsx(yc,{asChild:!0,children:i.jsx(a.CloseButton,{})})})]})})]})]})})},Dc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:l,onLoadPreset:u,activePresetName:d,filterDrawerSize:g="sm"})=>{const[f,b]=h.useState(!1);return i.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(a.HStack,{gapX:1,children:[t.filter(v=>v.visible!==!1).map(v=>i.jsx(a.HStack,{flex:v.size??1,minW:`${(v.size??1)*100}px`,alignItems:"center",children:Nr(v)},v.id)),i.jsx(Cc,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:l,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:v=>{b(v.open)}})]})]})},jc=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Rc=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Ec=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:c,colorScheme:l,loading:u,loadingText:d,rounded:g,type:f="button"})=>i.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:c,colorPalette:l,loading:u,loadingText:d,rounded:g,type:f,children:i.jsxs(a.HStack,{gap:1,children:[o,r,s]})}),Tc=y(a.Dialog.Root),Mc=y(a.Dialog.Backdrop),_c=y(a.Dialog.Positioner),Oc=y(a.Dialog.Content),kc=y(a.Dialog.Header),$c=y(a.Dialog.Body),Ic=y(a.Dialog.Footer),Ac=y(a.Dialog.Title),Lc=y(a.Dialog.CloseTrigger);function Pc({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:s="Confirm",cancelLabel:c="Cancel",icon:l,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return i.jsx(Tc,{open:e,placement:"center",onOpenChange:g=>!g.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(Mc,{}),i.jsx(_c,{children:i.jsxs(Oc,{maxW:"480px",children:[i.jsx(kc,{borderBottom:"1px solid",borderColor:"gray.200",children:i.jsx(Ac,{children:r})}),i.jsx($c,{p:6,children:i.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[i.jsx(a.Box,{color:"orange.500",children:l??i.jsx(Or,{size:40})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),i.jsxs(Ic,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:c}),i.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:s})]}),i.jsx(Lc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Nc=y(a.Dialog.Root),zc=y(a.Dialog.Backdrop),Fc=y(a.Dialog.Positioner),Bc=y(a.Dialog.Content),Yc=y(a.Dialog.Header),Hc=y(a.Dialog.Body),Vc=y(a.Dialog.Footer),Wc=y(a.Dialog.Title),Uc=y(a.Dialog.CloseTrigger);function Gc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:c="Delete",isLoading:l=!1}){const[u,d]=h.useState(""),g=u===s;return i.jsx(Nc,{open:e,placement:"center",onOpenChange:f=>{!f.open&&t(),d("")},children:i.jsxs(a.Portal,{children:[i.jsx(zc,{}),i.jsx(Fc,{children:i.jsxs(Bc,{maxW:"550px",children:[i.jsx(Yc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Wc,{color:"red.600",children:r})}),i.jsx(Hc,{p:2,style:{padding:"16px"},children:i.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(a.Box,{color:"red.600",mt:"2px",children:i.jsx(Or,{size:20})}),i.jsxs(a.Box,{children:[i.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(a.Box,{children:[i.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(a.Input,{placeholder:`Type ${s} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(Vc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),i.jsx(a.Button,{size:"sm",disabled:!g,style:{backgroundColor:"#FF0000"},loading:l,onClick:n,children:c})]}),i.jsx(Uc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const zr=({children:e})=>i.jsx(i.Fragment,{children:e}),Fr=({children:e})=>i.jsx(i.Fragment,{children:e}),Xc=a.Button,qc=y(a.Dialog.Root),Kc=y(a.Dialog.Backdrop),Jc=y(a.Dialog.Positioner),Zc=y(a.Dialog.Content),Qc=y(a.Dialog.Header),el=y(a.Dialog.Body),tl=y(a.Dialog.Footer),nl=y(a.Dialog.Title),rl=y(a.Dialog.CloseTrigger);function ol(e){let t=null,n=null;return h.Children.forEach(e,r=>{h.isValidElement(r)&&(r.type===zr&&(t=r.props.children),r.type===Fr&&(n=r.props.children))}),{body:t,actions:n}}const sl=({open:e,onClose:t,title:n,children:r,width:o,position:s,refetch:c,loading:l=!1})=>{const{body:u,actions:d}=ol(r);return i.jsx(qc,{open:e,onOpenChange:g=>!g.open&&t(),placement:s??"center",children:i.jsxs(a.Portal,{children:[i.jsx(Kc,{bg:"blackAlpha.400"}),i.jsx(Jc,{children:i.jsxs(Zc,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[i.jsx(Qc,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:i.jsxs(a.Flex,{align:"center",justify:"space-between",children:[i.jsx(nl,{fontSize:"16px",fontWeight:"600",children:n}),i.jsx(rl,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})}),c&&i.jsx(dn,{label:"Refresh",refetch:c,isLoading:l})]})}),u&&i.jsx(el,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:i.jsx(a.Flex,{direction:"column",gap:"16px",children:u})}),d&&i.jsx(tl,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:i.jsx(a.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},il=y(a.Field.Root),al=y(a.Field.Label),cl=y(a.Field.HelperText),ll=y(a.Field.ErrorText),ul=y(a.PinInput.Input),dl=y(a.PinInput.Control),fl=y(a.PinInput.HiddenInput),hl=y(a.PinInput.Root),gl=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:s,helperText:c,errorText:l,required:u=!1,visible:d=!0})=>{const g=Array.from({length:n}).map((f,b)=>e?.[b]??"");return i.jsxs(il,{children:[d&&s&&i.jsxs(al,{children:[s,u&&" *"]}),i.jsxs(hl,{value:g,onValueChange:f=>t?.(f.value.join("")),disabled:o,size:r,children:[i.jsx(fl,{}),i.jsx(dl,{children:i.jsx(a.HStack,{children:Array.from({length:n}).map((f,b)=>i.jsx(ul,{index:b},b))})})]}),l&&i.jsx(ll,{fontSize:"xs",children:l}),c&&!l&&i.jsx(cl,{fontSize:"xs",children:c})]})};function dn({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=h.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Ii,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var gt={exports:{}},pl=gt.exports,Gn;function vl(){return Gn||(Gn=1,(function(e,t){(function(n,r){e.exports=r()})(pl,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",c="second",l="minute",u="hour",d="day",g="week",f="month",b="quarter",v="year",p="date",m="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var E=["th","st","nd","rd"],C=k%100;return"["+k+(E[(C-20)%10]||E[C]||E[0])+"]"}},R=function(k,E,C){var _=String(k);return!_||_.length>=E?k:""+Array(E+1-_.length).join(C)+k},I={s:R,z:function(k){var E=-k.utcOffset(),C=Math.abs(E),_=Math.floor(C/60),D=C%60;return(E<=0?"+":"-")+R(_,2,"0")+":"+R(D,2,"0")},m:function k(E,C){if(E.date()<C.date())return-k(C,E);var _=12*(C.year()-E.year())+(C.month()-E.month()),D=E.clone().add(_,f),P=C-D<0,z=E.clone().add(_+(P?-1:1),f);return+(-(_+(C-D)/(P?D-z:z-D))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:f,y:v,w:g,d,D:p,h:u,m:l,s:c,ms:s,Q:b}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},$="en",M={};M[$]=j;var A="$isDayjsObject",L=function(k){return k instanceof H||!(!k||!k[A])},V=function k(E,C,_){var D;if(!E)return $;if(typeof E=="string"){var P=E.toLowerCase();M[P]&&(D=P),C&&(M[P]=C,D=P);var z=E.split("-");if(!D&&z.length>1)return k(z[0])}else{var x=E.name;M[x]=E,D=x}return!_&&D&&($=D),D||!_&&$},B=function(k,E){if(L(k))return k.clone();var C=typeof E=="object"?E:{};return C.date=k,C.args=arguments,new H(C)},O=I;O.l=V,O.i=L,O.w=function(k,E){return B(k,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var H=(function(){function k(C){this.$L=V(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[A]=!0}var E=k.prototype;return E.parse=function(C){this.$d=(function(_){var D=_.date,P=_.utc;if(D===null)return new Date(NaN);if(O.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var z=D.match(S);if(z){var x=z[2]-1||0,T=(z[7]||"0").substring(0,3);return P?new Date(Date.UTC(z[1],x,z[3]||1,z[4]||0,z[5]||0,z[6]||0,T)):new Date(z[1],x,z[3]||1,z[4]||0,z[5]||0,z[6]||0,T)}}return new Date(D)})(C),this.init()},E.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},E.$utils=function(){return O},E.isValid=function(){return this.$d.toString()!==m},E.isSame=function(C,_){var D=B(C);return this.startOf(_)<=D&&D<=this.endOf(_)},E.isAfter=function(C,_){return B(C)<this.startOf(_)},E.isBefore=function(C,_){return this.endOf(_)<B(C)},E.$g=function(C,_,D){return O.u(C)?this[_]:this.set(D,C)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(C,_){var D=this,P=!!O.u(_)||_,z=O.p(C),x=function(J,F){var ie=O.w(D.$u?Date.UTC(D.$y,F,J):new Date(D.$y,F,J),D);return P?ie:ie.endOf(d)},T=function(J,F){return O.w(D.toDate()[J].apply(D.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(F)),D)},N=this.$W,Y=this.$M,X=this.$D,q="set"+(this.$u?"UTC":"");switch(z){case v:return P?x(1,0):x(31,11);case f:return P?x(1,Y):x(0,Y+1);case g:var W=this.$locale().weekStart||0,K=(N<W?N+7:N)-W;return x(P?X-K:X+(6-K),Y);case d:case p:return T(q+"Hours",0);case u:return T(q+"Minutes",1);case l:return T(q+"Seconds",2);case c:return T(q+"Milliseconds",3);default:return this.clone()}},E.endOf=function(C){return this.startOf(C,!1)},E.$set=function(C,_){var D,P=O.p(C),z="set"+(this.$u?"UTC":""),x=(D={},D[d]=z+"Date",D[p]=z+"Date",D[f]=z+"Month",D[v]=z+"FullYear",D[u]=z+"Hours",D[l]=z+"Minutes",D[c]=z+"Seconds",D[s]=z+"Milliseconds",D)[P],T=P===d?this.$D+(_-this.$W):_;if(P===f||P===v){var N=this.clone().set(p,1);N.$d[x](T),N.init(),this.$d=N.set(p,Math.min(this.$D,N.daysInMonth())).$d}else x&&this.$d[x](T);return this.init(),this},E.set=function(C,_){return this.clone().$set(C,_)},E.get=function(C){return this[O.p(C)]()},E.add=function(C,_){var D,P=this;C=Number(C);var z=O.p(_),x=function(Y){var X=B(P);return O.w(X.date(X.date()+Math.round(Y*C)),P)};if(z===f)return this.set(f,this.$M+C);if(z===v)return this.set(v,this.$y+C);if(z===d)return x(1);if(z===g)return x(7);var T=(D={},D[l]=r,D[u]=o,D[c]=n,D)[z]||1,N=this.$d.getTime()+C*T;return O.w(N,this)},E.subtract=function(C,_){return this.add(-1*C,_)},E.format=function(C){var _=this,D=this.$locale();if(!this.isValid())return D.invalidDate||m;var P=C||"YYYY-MM-DDTHH:mm:ssZ",z=O.z(this),x=this.$H,T=this.$m,N=this.$M,Y=D.weekdays,X=D.months,q=D.meridiem,W=function(F,ie,re,he){return F&&(F[ie]||F(_,P))||re[ie].slice(0,he)},K=function(F){return O.s(x%12||12,F,"0")},J=q||function(F,ie,re){var he=F<12?"AM":"PM";return re?he.toLowerCase():he};return P.replace(w,(function(F,ie){return ie||(function(re){switch(re){case"YY":return String(_.$y).slice(-2);case"YYYY":return O.s(_.$y,4,"0");case"M":return N+1;case"MM":return O.s(N+1,2,"0");case"MMM":return W(D.monthsShort,N,X,3);case"MMMM":return W(X,N);case"D":return _.$D;case"DD":return O.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return W(D.weekdaysMin,_.$W,Y,2);case"ddd":return W(D.weekdaysShort,_.$W,Y,3);case"dddd":return Y[_.$W];case"H":return String(x);case"HH":return O.s(x,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(x,T,!0);case"A":return J(x,T,!1);case"m":return String(T);case"mm":return O.s(T,2,"0");case"s":return String(_.$s);case"ss":return O.s(_.$s,2,"0");case"SSS":return O.s(_.$ms,3,"0");case"Z":return z}return null})(F)||z.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(C,_,D){var P,z=this,x=O.p(_),T=B(C),N=(T.utcOffset()-this.utcOffset())*r,Y=this-T,X=function(){return O.m(z,T)};switch(x){case v:P=X()/12;break;case f:P=X();break;case b:P=X()/3;break;case g:P=(Y-N)/6048e5;break;case d:P=(Y-N)/864e5;break;case u:P=Y/o;break;case l:P=Y/r;break;case c:P=Y/n;break;default:P=Y}return D?P:O.a(P)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return M[this.$L]},E.locale=function(C,_){if(!C)return this.$L;var D=this.clone(),P=V(C,_,!0);return P&&(D.$L=P),D},E.clone=function(){return O.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},k})(),G=H.prototype;return B.prototype=G,[["$ms",s],["$s",c],["$m",l],["$H",u],["$W",d],["$M",f],["$y",v],["$D",p]].forEach((function(k){G[k[1]]=function(E){return this.$g(E,k[0],k[1])}})),B.extend=function(k,E){return k.$i||(k(E,H,B),k.$i=!0),B},B.locale=V,B.isDayjs=L,B.unix=function(k){return B(1e3*k)},B.en=M[$],B.Ls=M,B.p={},B}))})(gt)),gt.exports}var ml=vl();const _t=Ct(ml);var pt={exports:{}},xl=pt.exports,Xn;function bl(){return Xn||(Xn=1,(function(e,t){(function(n,r){e.exports=r()})(xl,(function(){return function(n,r,o){n=n||{};var s=r.prototype,c={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(d,g,f,b){return s.fromToBase(d,g,f,b)}o.en.relativeTime=c,s.fromToBase=function(d,g,f,b,v){for(var p,m,S,w=f.$locale().relativeTime||c,j=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],R=j.length,I=0;I<R;I+=1){var $=j[I];$.d&&(p=b?o(d).diff(f,$.d,!0):f.diff(d,$.d,!0));var M=(n.rounding||Math.round)(Math.abs(p));if(S=p>0,M<=$.r||!$.r){M<=1&&I>0&&($=j[I-1]);var A=w[$.l];v&&(M=v(""+M)),m=typeof A=="string"?A.replace("%d",M):A(M,g,$.l,S);break}}if(g)return m;var L=S?w.future:w.past;return typeof L=="function"?L(m):L.replace("%s",m)},s.to=function(d,g){return l(d,g,this,!0)},s.from=function(d,g){return l(d,g,this)};var u=function(d){return d.$u?o.utc():o()};s.toNow=function(d){return this.to(u(this),d)},s.fromNow=function(d){return this.from(u(this),d)}}}))})(pt)),pt.exports}var yl=bl();const Sl=Ct(yl);var vt={exports:{}},wl=vt.exports,qn;function Cl(){return qn||(qn=1,(function(e,t){(function(n,r){e.exports=r()})(wl,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var c=o.prototype,l=c.format;s.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,g=(function(f,b){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,p,m){var S=m&&m.toUpperCase();return p||b[m]||n[m]||b[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,j,R){return j||R.slice(1)}))}))})(u,d===void 0?{}:d);return l.call(this,g)}}}))})(vt)),vt.exports}var Dl=Cl();const jl=Ct(Dl);var mt={exports:{}},Rl=mt.exports,Kn;function El(){return Kn||(Kn=1,(function(e,t){(function(n,r){e.exports=r()})(Rl,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(c){var l=this,u=this.$locale();if(!this.isValid())return s.bind(this)(c);var d=this.$utils(),g=(c||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return d.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return d.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return d.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return s.bind(this)(g)}}}))})(mt)),mt.exports}var Tl=El();const Ml=Ct(Tl);_t.extend(Sl);_t.extend(jl);_t.extend(Ml);const _l={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function Zt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=_t(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??_l[t]):r}function Ol({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:c="gray.700",dateFontSize:l="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:g="12px",timeFontWeight:f="400"}){return i.jsxs(a.Stack,{gap:.5,align:s,children:[i.jsx(a.Text,{fontSize:l,fontWeight:u,color:c,children:Zt({value:e,variant:t,format:r})}),i.jsx(a.Text,{fontSize:g,fontWeight:f,color:d,children:Zt({value:e,variant:n,format:o})})]})}class Br{state=new Map;listeners=new Map;get(t){return this.state.get(t)}set(t){this.state.set(t.key,t),this.notify(t.key)}setMany(t){t.forEach(n=>this.set(n))}subscribe(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),n(this.state.get(t)),()=>{this.listeners.get(t)?.delete(n)}}notify(t){this.listeners.get(t)?.forEach(n=>n(this.state.get(t)))}clear(){this.state.clear()}}class Qt{constructor(t){this.baseUrl=t}async fetchLatest(t){const n=new URLSearchParams;return n.set("keys",t.join(",")),(await(await fetch(`${this.baseUrl}/options?${n}`)).json()).data}}class en{constructor(t){this.api=t}store=new Br;inflight=new Map;getRaw(t){return this.store.get(t)}async getKey(t){const n=this.store.get(t);return n?n.value:(await this.fetchMissing([t]),this.store.get(t)?.value)}async getMultiKey(t){const n={},r=[];for(const o of t){const s=this.store.get(o);s?n[o]=s.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const s=this.store.get(o);s&&(n[o]=s.value)})),n}subscribe(t,n){return this.store.subscribe(t,n)}hydrate(t){this.store.setMany(t)}clear(){this.store.clear()}async fetchMissing(t){const n=t.filter(o=>!this.inflight.has(o));if(!n.length)return;const r=this.api.fetchLatest(n).then(o=>{this.store.setMany(o),n.forEach(s=>this.inflight.delete(s))});n.forEach(o=>this.inflight.set(o,r)),await r}}const Yr=h.createContext(null);function Hr(){const e=h.useContext(Yr);if(!e)throw new Error("OptionsProvider is missing. Wrap your app with <OptionsProvider />");return e}function kl({client:{apiUrl:e},children:t}){const n=h.useRef(new en(new Qt(e)));return n.current||(n.current=new en(new Qt(e))),i.jsx(Yr.Provider,{value:n.current,children:t})}function $l(e){const t=Hr(),[n,r]=h.useState(t.getRaw(e)?.value);return h.useEffect(()=>{let o=!0;t.getKey(e).then(c=>{o&&r(c)});const s=t.subscribe(e,c=>{r(c?.value)});return()=>{o=!1,s()}},[e,t]),n}function Il(e){const t=Hr(),[n,r]=h.useState({});return h.useEffect(()=>{let o=!0;t.getMultiKey(e).then(c=>{o&&r(c)});const s=e.map(c=>t.subscribe(c,l=>{r(u=>({...u,[c]:l?.value}))}));return()=>{o=!1,s.forEach(c=>c())}},[e.join("|"),t]),n}async function Al(e,t){return e.getKey(t)}async function Ll(e,t){await e.getMultiKey(t)}function Pl(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=h.useState(t),[s,c]=h.useState(n),l=h.useCallback(b=>{o(Math.max(1,b))},[]),u=h.useCallback(b=>{c(Math.max(1,b)),o(1)},[]),d=h.useCallback(()=>{o(b=>b+1)},[]),g=h.useCallback(()=>{o(b=>Math.max(1,b-1))},[]),f=h.useCallback(()=>{o(t),c(n)},[t,n]);return{page:r,limit:s,setPage:l,setLimit:u,nextPage:d,prevPage:g,reset:f}}function Nl(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=h.useState(t),s=zl(r,n),c=h.useCallback(u=>{o(u)},[]),l=h.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:s,onSearchChange:c,reset:l}}function zl(e,t=300){const[n,r]=h.useState(e);return h.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}exports.DataTable=ha;exports.Filters=Dc;exports.HttpOptionsApi=Qt;exports.MDSButton=Ec;exports.MDSCheckbox=kr;exports.MDSCombobox=$r;exports.MDSConfirmActionDialog=Pc;exports.MDSConfirmDeleteDialog=Gc;exports.MDSDialogAction=Xc;exports.MDSDialogActions=Fr;exports.MDSDialogBody=zr;exports.MDSDialogWrapper=sl;exports.MDSInput=Jt;exports.MDSPinInput=gl;exports.MDSRefreshButton=dn;exports.MDSSelectBox=Ir;exports.OptionsClientImpl=en;exports.OptionsProvider=kl;exports.OptionsStore=Br;exports.RefreshButton=dn;exports.StackedDateTime=Ol;exports.addPreset=Lr;exports.deletePreset=Pr;exports.formatDateTime=Zt;exports.getColumnWidthKey=Tt;exports.getOption=Al;exports.getPresets=rt;exports.loadOrder=Rc;exports.prefetchOptions=Ll;exports.presetStore=Qe;exports.saveOrder=jc;exports.savePresets=Mt;exports.setActionsConfig=Rr;exports.setColumnWidth=Qs;exports.setData=Dr;exports.setTableId=jr;exports.tableStore=ne;exports.updatePreset=tc;exports.useDebouncedSearch=Nl;exports.useOption=$l;exports.useOptions=Il;exports.usePagination=Pl;exports.withChildren=y;