@mdspl/mds-shared-ui 1.2.0 → 1.2.2

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"),We=require("react-dom");function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tt={exports:{}},Ye={};var vn;function Jr(){if(vn)return Ye;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var c=null;if(i!==void 0&&(c=""+i),o.key!==void 0&&(c=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:i}}return Ye.Fragment=t,Ye.jsx=n,Ye.jsxs=n,Ye}var Be={};var mn;function Zr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===A?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case S:return"Fragment";case R:return"Profiler";case O:return"StrictMode";case _:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case b:return"Portal";case k:return v.displayName||"Context";case M:return(v._context.displayName||"Context")+".Consumer";case I:var T=v.render;return v=v.displayName,v||(v=T.displayName||T.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case N:return T=v.displayName||null,T!==null?T:e(v.type)||"Memo";case H:T=v._payload,v=v._init;try{return e(v(T))}catch{}}return null}function t(v){return""+v}function n(v){try{t(v);var T=!1}catch{T=!0}if(T){T=console;var F=T.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return F.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),t(v)}}function r(v){if(v===S)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===H)return"<...>";try{var T=e(v);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var v=L.A;return v===null?null:v.getOwner()}function i(){return Error("react-stack-top-frame")}function c(v){if(P.call(v,"key")){var T=Object.getOwnPropertyDescriptor(v,"key").get;if(T&&T.isReactWarning)return!1}return v.key!==void 0}function l(v,T){function F(){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))}F.isReactWarning=!0,Object.defineProperty(v,"key",{get:F,configurable:!0})}function u(){var v=e(this.type);return j[v]||(j[v]=!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.")),v=this.props.ref,v!==void 0?v:null}function d(v,T,F,W,q,X){var U=F.ref;return v={$$typeof:x,type:v,key:T,props:F,_owner:W},(U!==void 0?U:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:u}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function g(v,T,F,W,q,X){var U=T.children;if(U!==void 0)if(W)if(D(U)){for(W=0;W<U.length;W++)f(U[W]);Object.freeze&&Object.freeze(U)}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(U);if(P.call(T,"key")){U=e(v);var K=Object.keys(T).filter(function(V){return V!=="key"});W=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Y[U+W]||(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"),We=require("react-dom");function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tt={exports:{}},Ye={};var mn;function Jr(){if(mn)return Ye;mn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var c=null;if(i!==void 0&&(c=""+i),o.key!==void 0&&(c=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:i}}return Ye.Fragment=t,Ye.jsx=n,Ye.jsxs=n,Ye}var Be={};var vn;function Zr(){return vn||(vn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===P?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case S:return"Fragment";case R:return"Profiler";case O:return"StrictMode";case _:return"Suspense";case L:return"SuspenseList";case B: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 b:return"Portal";case I:return m.displayName||"Context";case M:return(m._context.displayName||"Context")+".Consumer";case k:var T=m.render;return m=m.displayName,m||(m=T.displayName||T.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case z:return T=m.displayName||null,T!==null?T:e(m.type)||"Memo";case H:T=m._payload,m=m._init;try{return e(m(T))}catch{}}return null}function t(m){return""+m}function n(m){try{t(m);var T=!1}catch{T=!0}if(T){T=console;var N=T.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.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.",W),t(m)}}function r(m){if(m===S)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===H)return"<...>";try{var T=e(m);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var m=Y.A;return m===null?null:m.getOwner()}function i(){return Error("react-stack-top-frame")}function c(m){if($.call(m,"key")){var T=Object.getOwnPropertyDescriptor(m,"key").get;if(T&&T.isReactWarning)return!1}return m.key!==void 0}function l(m,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(m,"key",{get:N,configurable:!0})}function u(){var m=e(this.type);return j[m]||(j[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,T,N,W,q,X){var U=N.ref;return m={$$typeof:x,type:m,key:T,props:N,_owner:W},(U!==void 0?U: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 g(m,T,N,W,q,X){var U=T.children;if(U!==void 0)if(W)if(D(U)){for(W=0;W<U.length;W++)f(U[W]);Object.freeze&&Object.freeze(U)}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(U);if($.call(T,"key")){U=e(m);var K=Object.keys(T).filter(function(V){return V!=="key"});W=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",F[U+W]||(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} />`,W,U,K,U),Y[U+W]=!0)}if(U=null,F!==void 0&&(n(F),U=""+F),c(T)&&(n(T.key),U=""+T.key),"key"in T){F={};for(var J in T)J!=="key"&&(F[J]=T[J])}else F=T;return U&&l(F,typeof v=="function"?v.displayName||v.name||"Unknown":v),d(v,U,F,o(),q,X)}function f(v){m(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===H&&(v._payload.status==="fulfilled"?m(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function m(v){return typeof v=="object"&&v!==null&&v.$$typeof===x}var p=h,x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),k=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),L=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,D=Array.isArray,w=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(v){return v()}};var C,j={},E=p.react_stack_bottom_frame.bind(p,i)(),z=w(r(i)),Y={};Be.Fragment=S,Be.jsx=function(v,T,F){var W=1e4>L.recentlyCreatedOwnerStacks++;return g(v,T,F,!1,W?Error("react-stack-top-frame"):E,W?w(r(v)):z)},Be.jsxs=function(v,T,F){var W=1e4>L.recentlyCreatedOwnerStacks++;return g(v,T,F,!0,W?Error("react-stack-top-frame"):E,W?w(r(v)):z)}})()),Be}var xn;function Qr(){return xn||(xn=1,process.env.NODE_ENV==="production"?tt.exports=Jr():tt.exports=Zr()),tt.exports}var s=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 bt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Jt(e){return"nodeType"in e}function ae(e){var t,n;return e?$e(e)?e:Jt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Zt(e){const{Document:t}=ae(e);return e instanceof t}function Xe(e){return $e(e)?!1:e instanceof ae(e).HTMLElement}function Gn(e){return e instanceof ae(e).SVGElement}function Ae(e){return e?$e(e)?e.document:Jt(e)?Zt(e)?e:Xe(e)||Gn(e)?e.ownerDocument:document:document:document}const me=bt?h.useLayoutEffect:h.useEffect;function Qt(e){const t=h.useRef(e);return me(()=>{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 Ge(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return me(()=>{n.current!==e&&(n.current=e)},t),n}function Ke(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ht(e){const t=Qt(e),n=h.useRef(null),r=h.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Yt(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let Tt={};function Je(e,t){return h.useMemo(()=>{if(t)return t;const n=Tt[e]==null?0:Tt[e]+1;return Tt[e]=n,e+"-"+n},[e,t])}function qn(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((i,c)=>{const l=Object.entries(c);for(const[u,d]of l){const g=i[u];g!=null&&(i[u]=g+e*d)}return i},{...t})}}const ke=qn(1),gt=qn(-1);function no(e){return"clientX"in e&&"clientY"in e}function en(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 Bt(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}}}),bn="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(bn)?e:e.querySelector(bn)}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 Xn=h.createContext(null);function co(e){const t=h.useContext(Xn);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:i}=r;e.forEach(c=>{var l;return(l=c[o])==null?void 0:l.call(c,i)})},[e]),t]}const fo={draggable:`
6
+ <%s key={someKey} {...props} />`,W,U,K,U),F[U+W]=!0)}if(U=null,N!==void 0&&(n(N),U=""+N),c(T)&&(n(T.key),U=""+T.key),"key"in T){N={};for(var J in T)J!=="key"&&(N[J]=T[J])}else N=T;return U&&l(N,typeof m=="function"?m.displayName||m.name||"Unknown":m),d(m,U,N,o(),q,X)}function f(m){v(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===H&&(m._payload.status==="fulfilled"?v(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function v(m){return typeof m=="object"&&m!==null&&m.$$typeof===x}var p=h,x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),I=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,D=Array.isArray,w=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(m){return m()}};var C,j={},E=p.react_stack_bottom_frame.bind(p,i)(),A=w(r(i)),F={};Be.Fragment=S,Be.jsx=function(m,T,N){var W=1e4>Y.recentlyCreatedOwnerStacks++;return g(m,T,N,!1,W?Error("react-stack-top-frame"):E,W?w(r(m)):A)},Be.jsxs=function(m,T,N){var W=1e4>Y.recentlyCreatedOwnerStacks++;return g(m,T,N,!0,W?Error("react-stack-top-frame"):E,W?w(r(m)):A)}})()),Be}var xn;function Qr(){return xn||(xn=1,process.env.NODE_ENV==="production"?tt.exports=Jr():tt.exports=Zr()),tt.exports}var s=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 bt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Jt(e){return"nodeType"in e}function ae(e){var t,n;return e?$e(e)?e:Jt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Zt(e){const{Document:t}=ae(e);return e instanceof t}function Xe(e){return $e(e)?!1:e instanceof ae(e).HTMLElement}function Gn(e){return e instanceof ae(e).SVGElement}function Ae(e){return e?$e(e)?e.document:Jt(e)?Zt(e)?e:Xe(e)||Gn(e)?e.ownerDocument:document:document:document}const ve=bt?h.useLayoutEffect:h.useEffect;function Qt(e){const t=h.useRef(e);return ve(()=>{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 Ge(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return ve(()=>{n.current!==e&&(n.current=e)},t),n}function Ke(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ht(e){const t=Qt(e),n=h.useRef(null),r=h.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Yt(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let Tt={};function Je(e,t){return h.useMemo(()=>{if(t)return t;const n=Tt[e]==null?0:Tt[e]+1;return Tt[e]=n,e+"-"+n},[e,t])}function qn(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((i,c)=>{const l=Object.entries(c);for(const[u,d]of l){const g=i[u];g!=null&&(i[u]=g+e*d)}return i},{...t})}}const ke=qn(1),gt=qn(-1);function no(e){return"clientX"in e&&"clientY"in e}function en(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 Bt(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}}}),bn="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(bn)?e:e.querySelector(bn)}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 Xn=h.createContext(null);function co(e){const t=h.useContext(Xn);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:i}=r;e.forEach(c=>{var l;return(l=c[o])==null?void 0:l.call(c,i)})},[e]),t]}const fo={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:i,announcement:c}=lo(),l=Je("DndLiveRegion"),[u,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),co(h.useMemo(()=>({onDragStart(f){let{active:m}=f;i(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:p}=f;t.onDragMove&&i(t.onDragMove({active:m,over:p}))},onDragOver(f){let{active:m,over:p}=f;i(t.onDragOver({active:m,over:p}))},onDragEnd(f){let{active:m,over:p}=f;i(t.onDragEnd({active:m,over:p}))},onDragCancel(f){let{active:m,over:p}=f;i(t.onDragCancel({active:m,over:p}))}}),[i,t])),!u)return null;const g=h.createElement(h.Fragment,null,h.createElement(io,{id:r,value:o.draggable}),h.createElement(ao,{id:l,announcement:c}));return n?We.createPortal(g,n):g}var Z;(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"})(Z||(Z={}));function pt(){}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 ge=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 yn(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 Kn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=yn(t,t.left,t.top),i=[];for(const c of r){const{id:l}=c,u=n.get(l);if(u){const d=mo(yn(u),o);i.push({id:l,data:{droppableContainer:c,value:d}})}}return i.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),i=Math.min(t.top+t.height,e.top+e.height),c=o-r,l=i-n;if(r<o&&n<i){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 wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:c}=i,l=n.get(c);if(l){const u=So(l,t);u>0&&o.push({id:c,data:{droppableContainer:i,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 Jn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ge}function Do(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];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 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 Mo(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:i,x:c,y:l}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:g,height:f,top:d,right:u+g,bottom:d+f,left:u}}const Eo={ignoreTransform:!1};function Le(e,t){t===void 0&&(t=Eo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=ae(e).getComputedStyle(e);d&&(n=Mo(n,d,g))}const{top:r,left:o,width:i,height:c,bottom:l,right:u}=n;return{top:r,left:o,width:i,height:c,bottom:l,right:u}}function Sn(e){return Le(e,{ignoreTransform:!0})}function To(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 i=t[o];return typeof i=="string"?n.test(i):!1})}function tn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Zt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Xe(o)||Gn(o)||n.includes(o))return n;const i=ae(e).getComputedStyle(o);return o!==e&&Oo(o,i)&&n.push(o),_o(o,i)?n:r(o.parentNode)}return e?r(e):n}function Zn(e){const[t]=tn(e,1);return t??null}function _t(e){return!bt||!e?null:$e(e)?e:Jt(e)?Zt(e)||e===Ae(e).scrollingElement?window:Xe(e)?e:null:null}function Qn(e){return $e(e)?e.scrollX:e.scrollLeft}function er(e){return $e(e)?e.scrollY:e.scrollTop}function Wt(e){return{x:Qn(e),y:er(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function tr(e){return!bt||!e?!1:e===document.scrollingElement}function nr(e){const t={x:0,y:0},n=tr(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,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:c,isRight:l,maxScroll:r,minScroll:t}}const ko={x:.2,y:.2};function Io(e,t,n,r,o){let{top:i,left:c,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=ko);const{isTop:d,isBottom:g,isLeft:f,isRight:m}=nr(e),p={x:0,y:0},x={x:0,y:0},b={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+b.height?(p.y=Q.Backward,x.y=r*Math.abs((t.top+b.height-i)/b.height)):!g&&u>=t.bottom-b.height&&(p.y=Q.Forward,x.y=r*Math.abs((t.bottom-b.height-u)/b.height)),!m&&l>=t.right-b.width?(p.x=Q.Forward,x.x=r*Math.abs((t.right-b.width-l)/b.width)):!f&&c<=t.left+b.width&&(p.x=Q.Backward,x.x=r*Math.abs((t.left+b.width-c)/b.width)),{direction:p,speed:x}}function $o(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,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 rr(e){return e.reduce((t,n)=>ke(t,Wt(n)),ge)}function Ao(e){return e.reduce((t,n)=>t+Qn(n),0)}function Lo(e){return e.reduce((t,n)=>t+er(n),0)}function Po(e,t){if(t===void 0&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Zn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zo=[["x",["left","right"],Ao],["y",["top","bottom"],Lo]];class nn{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=tn(n),o=rr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,l]of zo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),g=o[i]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ve{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 No(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Ae(e)}function Ot(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 wn(e){e.preventDefault()}function Fo(e){e.stopPropagation()}var G;(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"})(G||(G={}));const or={start:[G.Space,G.Enter],cancel:[G.Esc],end:[G.Space,G.Enter,G.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case G.Right:return{...n,x:n.x+25};case G.Left:return{...n,x:n.x-25};case G.Down:return{...n,y:n.y+25};case G.Up:return{...n,y:n.y-25}}};class sr{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 Ve(Ae(n)),this.windowListeners=new Ve(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(ge)}handleKeyDown(t){if(en(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=or,coordinateGetter:c=Yo,scrollBehavior:l="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:ge;this.referenceCoordinates||(this.referenceCoordinates=g);const f=c(t,{active:n,context:r.current,currentCoordinates:g});if(f){const m=gt(f,g),p={x:0,y:0},{scrollableAncestors:x}=r.current;for(const b of x){const S=t.code,{isTop:O,isRight:R,isLeft:M,isBottom:k,maxScroll:I,minScroll:_}=nr(b),$=$o(b),N={x:Math.min(S===G.Right?$.right-$.width/2:$.right,Math.max(S===G.Right?$.left:$.left+$.width/2,f.x)),y:Math.min(S===G.Down?$.bottom-$.height/2:$.bottom,Math.max(S===G.Down?$.top:$.top+$.height/2,f.y))},H=S===G.Right&&!R||S===G.Left&&!M,B=S===G.Down&&!k||S===G.Up&&!O;if(H&&N.x!==f.x){const A=b.scrollLeft+m.x,L=S===G.Right&&A<=I.x||S===G.Left&&A>=_.x;if(L&&!m.y){b.scrollTo({left:A,behavior:l});return}L?p.x=b.scrollLeft-A:p.x=S===G.Right?b.scrollLeft-I.x:b.scrollLeft-_.x,p.x&&b.scrollBy({left:-p.x,behavior:l});break}else if(B&&N.y!==f.y){const A=b.scrollTop+m.y,L=S===G.Down&&A<=I.y||S===G.Up&&A>=_.y;if(L&&!m.x){b.scrollTo({top:A,behavior:l});return}L?p.y=b.scrollTop-A:p.y=S===G.Down?b.scrollTop-I.y:b.scrollTop-_.y,p.y&&b.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,ke(gt(f,this.referenceCoordinates),p))}}}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()}}sr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=or,onActivation:o}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Cn(e){return!!(e&&"distance"in e)}function Dn(e){return!!(e&&"delay"in e)}class rn{constructor(t,n,r){var o;r===void 0&&(r=No(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=Ae(c),this.documentListeners=new Ve(this.document),this.listeners=new Ve(r),this.windowListeners=new Ve(ae(c)),this.initialCoordinates=(o=Bt(i))!=null?o:ge,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,wn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,wn),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(Dn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Cn(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:i}=this,{onMove:c,options:{activationConstraint:l}}=i;if(!o)return;const u=(n=Bt(t))!=null?n:ge,d=gt(o,u);if(!r&&l){if(Cn(l)){if(l.tolerance!=null&&Ot(d,l.tolerance))return this.handleCancel();if(Ot(d,l.distance))return this.handleStart()}if(Dn(l)&&Ot(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===G.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 on extends rn{constructor(t){const{event:n}=t,r=Ae(n.target);super(t,Bo,r)}}on.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 Wo={move:{name:"mousemove"},end:{name:"mouseup"}};var Vt;(function(e){e[e.RightClick=2]="RightClick"})(Vt||(Vt={}));class Vo extends rn{constructor(t){super(t,Wo,Ae(t.event.target))}}Vo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Vt.RightClick?!1:(r?.({event:n}),!0)}}];const kt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ho extends rn{constructor(t){super(t,kt)}static setup(){return window.addEventListener(kt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(kt.move.name,t)};function t(){}}}Ho.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 He;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(He||(He={}));var vt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(vt||(vt={}));function Uo(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:c=5,order:l=vt.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:m}=e;const p=qo({delta:f,disabled:!i}),[x,b]=to(),S=h.useRef({x:0,y:0}),O=h.useRef({x:0,y:0}),R=h.useMemo(()=>{switch(n){case He.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case He.DraggableRect:return o}},[n,o,u]),M=h.useRef(null),k=h.useCallback(()=>{const _=M.current;if(!_)return;const $=S.current.x*O.current.x,N=S.current.y*O.current.y;_.scrollBy($,N)},[]),I=h.useMemo(()=>l===vt.TreeOrder?[...d].reverse():d,[l,d]);h.useEffect(()=>{if(!i||!d.length||!R){b();return}for(const _ of I){if(r?.(_)===!1)continue;const $=d.indexOf(_),N=g[$];if(!N)continue;const{direction:H,speed:B}=Io(_,N,R,t,m);for(const A of["x","y"])p[A][H[A]]||(B[A]=0,H[A]=0);if(B.x>0||B.y>0){b(),M.current=_,x(k,c),S.current=B,O.current=H;return}}S.current={x:0,y:0},O.current={x:0,y:0},b()},[t,k,r,b,i,c,JSON.stringify(R),JSON.stringify(p),x,d,I,g,JSON.stringify(m)])}const Go={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Yt(t);return Ke(o=>{if(n||!r||!o)return Go;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||i.x===-1,[Q.Forward]:o.x[Q.Forward]||i.x===1},y:{[Q.Backward]:o.y[Q.Backward]||i.y===-1,[Q.Forward]:o.y[Q.Forward]||i.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 Ke(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Ko(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var Ht;(function(e){e.Optimized="optimized"})(Ht||(Ht={}));const jn=new Map;function Jo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,c]=h.useState(null),{frequency:l,measure:u,strategy:d}=o,g=h.useRef(e),f=S(),m=Ge(f),p=h.useCallback(function(O){O===void 0&&(O=[]),!m.current&&c(R=>R===null?O:R.concat(O.filter(M=>!R.includes(M))))},[m]),x=h.useRef(null),b=Ke(O=>{if(f&&!n)return jn;if(!O||O===jn||g.current!==e||i!=null){const R=new Map;for(let M of e){if(!M)continue;if(i&&i.length>0&&!i.includes(M.id)&&M.rect.current){R.set(M.id,M.rect.current);continue}const k=M.node.current,I=k?new nn(u(k),k):null;M.rect.current=I,I&&R.set(M.id,I)}return R}return O},[e,i,n,f,u]);return h.useEffect(()=>{g.current=e},[e]),h.useEffect(()=>{f||p()},[n,f]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{f||typeof l!="number"||x.current!==null||(x.current=setTimeout(()=>{p(),x.current=null},l))},[l,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:i!=null};function S(){switch(d){case qe.Always:return!1;case qe.BeforeDragging:return n;default:return!n}}}function ir(e,t){return Ke(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zo(e,t){return ir(e,t)}function Qo(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function yt(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function es(e){return new nn(Le(e),e)}function Rn(e,t,n){t===void 0&&(t=es);const[r,o]=h.useState(null);function i(){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=Qo({callback(u){if(e)for(const d of u){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=yt({callback:i});return me(()=>{i(),e?(l?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),c?.disconnect())},[e]),r}function ts(e){const t=ir(e);return Jn(e,t)}const Mn=[];function ns(e){const t=h.useRef(e),n=Ke(r=>e?r&&r!==Mn&&e&&t.current&&e.parentNode===t.current.parentNode?r:tn(e):Mn,[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(i=>{const c=_t(i.target);c&&n(l=>l?(l.set(c,Wt(c)),new Map(l)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const l=e.map(u=>{const d=_t(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Wt(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{c(e),c(i)};function c(l){l.forEach(u=>{const d=_t(u);d?.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>ke(i,c),ge):rr(e):ge,[e,t])}function En(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==ge;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?gt(e,n.current):ge}function os(e){h.useEffect(()=>{if(!bt)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:i}=r;return n[o]=c=>{i(c,t)},n},{}),[e,t])}function ar(e){return h.useMemo(()=>e?To(e):null,[e])}const Tn=[];function is(e,t){t===void 0&&(t=Le);const[n]=e,r=ar(n?ae(n):null),[o,i]=h.useState(Tn);function c(){i(()=>e.length?e.map(u=>tr(u)?r:new nn(t(u),u)):Tn)}const l=yt({callback:c});return me(()=>{l?.disconnect(),c(),e.forEach(u=>l?.observe(u))},[e]),o}function as(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xe(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(Xe(g)){r(f=>{const m=t(g);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),i=yt({callback:o}),c=h.useCallback(d=>{const g=as(d);i?.disconnect(),g&&i?.observe(g),r(g?t(g):null)},[t,i]),[l,u]=ht(c);return h.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const cs=[{sensor:on,options:{}},{sensor:sr,options:{}}],us={current:{}},lt={draggable:{measure:Sn},droppable:{measure:Sn,strategy:qe.WhileDragging,frequency:Ht.Optimized},dragOverlay:{measure:Le}};class Ue 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 Ue,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:pt,windowRect:null,measuringScheduled:!1},fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pt,draggableNodes:new Map,over:null,measureDroppableContainers:pt},St=h.createContext(fs),lr=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 Ue}}}function gs(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.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 Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ue(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new Ue(e.droppable.containers);return c.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ue(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ps(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=h.useContext(St),i=Yt(r),c=Yt(n?.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!en(i)||document.activeElement===i.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=oo(g);if(f){f.focus();break}}})}},[r,t,o,c,i]),null}function vs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function ms(e){return h.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function xs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=h.useRef(!1),{x:c,y:l}=typeof o=="boolean"?{x:o,y:o}:o;me(()=>{if(!c&&!l||!t){i.current=!1;return}if(i.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=Jn(g,r);if(c||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=Zn(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,c,l,r,n])}const cr=h.createContext({...ge,scaleX:1,scaleY:1});var je;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(je||(je={}));const ur=h.memo(function(t){var n,r,o,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:g=cs,collisionDetection:f=wo,measuring:m,modifiers:p,...x}=t;const b=h.useReducer(gs,void 0,hs),[S,O]=b,[R,M]=uo(),[k,I]=h.useState(je.Uninitialized),_=k===je.Initialized,{draggable:{active:$,nodes:N,translate:H},droppable:{containers:B}}=S,A=$!=null?N.get($):null,L=h.useRef({initial:null,translated:null}),P=h.useMemo(()=>{var se;return $!=null?{id:$,data:(se=A?.data)!=null?se:us,rect:L}:null},[$,A]),D=h.useRef(null),[w,C]=h.useState(null),[j,E]=h.useState(null),z=Ge(x,Object.values(x)),Y=Je("DndDescribedBy",c),v=h.useMemo(()=>B.getEnabled(),[B]),T=ms(m),{droppableRects:F,measureDroppableContainers:W,measuringScheduled:q}=Jo(v,{dragging:_,dependencies:[H.x,H.y],config:T.droppable}),X=Xo(N,$),U=h.useMemo(()=>j?Bt(j):null,[j]),K=Kr(),J=Zo(X,T.draggable.measure);xs({activeNode:$!=null?N.get($):null,config:K.layoutShiftCompensation,initialRect:J,measure:T.draggable.measure});const V=Rn(X,T.draggable.measure,J),ie=Rn(X?X.parentElement:null),oe=h.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=oe.current.over)==null?void 0:n.id),xe=ls({measure:T.dragOverlay.measure}),Me=(r=xe.nodeRef.current)!=null?r:X,Ee=_?(o=xe.rect)!=null?o:V:null,ln=!!(xe.nodeRef.current&&xe.rect),cn=ts(ln?null:V),Rt=ar(Me?ae(Me):null),ye=ns(_?he??X:null),Qe=is(ye),et=vs(p,{transform:{x:H.x-cn.x,y:H.y-cn.y,scaleX:1,scaleY:1},activatorEvent:j,active:P,activeNodeRect:V,containerNodeRect:ie,draggingNodeRect:Ee,over:oe.current.over,overlayNodeRect:xe.rect,scrollableAncestors:ye,scrollableAncestorRects:Qe,windowRect:Rt}),un=U?ke(U,H):null,dn=rs(ye),Wr=En(dn),Vr=En(dn,[V]),Te=ke(et,Wr),_e=Ee?jo(Ee,et):null,Pe=P&&_e?f({active:P,collisionRect:_e,droppableRects:F,droppableContainers:v,pointerCoordinates:un}):null,fn=yo(Pe,"id"),[Se,hn]=h.useState(null),Hr=ln?et:ke(et,Vr),Ur=Co(Hr,(i=Se?.rect)!=null?i:null,V),Mt=h.useRef(null),gn=h.useCallback((se,le)=>{let{sensor:ce,options:we}=le;if(D.current==null)return;const de=N.get(D.current);if(!de)return;const ue=se.nativeEvent,pe=new ce({active:D.current,activeNode:de,event:ue,options:we,context:oe,onAbort(te){if(!N.get(te))return;const{onDragAbort:ve}=z.current,be={id:te};ve?.(be),R({type:"onDragAbort",event:be})},onPending(te,Ce,ve,be){if(!N.get(te))return;const{onDragPending:Ne}=z.current,De={id:te,constraint:Ce,initialCoordinates:ve,offset:be};Ne?.(De),R({type:"onDragPending",event:De})},onStart(te){const Ce=D.current;if(Ce==null)return;const ve=N.get(Ce);if(!ve)return;const{onDragStart:be}=z.current,ze={activatorEvent:ue,active:{id:Ce,data:ve.data,rect:L}};We.unstable_batchedUpdates(()=>{be?.(ze),I(je.Initializing),O({type:Z.DragStart,initialCoordinates:te,active:Ce}),R({type:"onDragStart",event:ze}),C(Mt.current),E(ue)})},onMove(te){O({type:Z.DragMove,coordinates:te})},onEnd:Oe(Z.DragEnd),onCancel:Oe(Z.DragCancel)});Mt.current=pe;function Oe(te){return async function(){const{active:ve,collisions:be,over:ze,scrollAdjustedTranslate:Ne}=oe.current;let De=null;if(ve&&Ne){const{cancelDrop:Fe}=z.current;De={activatorEvent:ue,active:ve,collisions:be,delta:Ne,over:ze},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(De))&&(te=Z.DragCancel)}D.current=null,We.unstable_batchedUpdates(()=>{O({type:te}),I(je.Uninitialized),hn(null),C(null),E(null),Mt.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(De){const Et=z.current[Fe];Et?.(De),R({type:Fe,event:De})}})}}},[N]),Gr=h.useCallback((se,le)=>(ce,we)=>{const de=ce.nativeEvent,ue=N.get(we);if(D.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const pe={active:ue};se(ce,le.options,pe)===!0&&(de.dndKit={capturedBy:le.sensor},D.current=we,gn(ce,le))},[N,gn]),pn=Ko(g,Gr);os(g),me(()=>{V&&k===je.Initializing&&I(je.Initialized)},[V,k]),h.useEffect(()=>{const{onDragMove:se}=z.current,{active:le,activatorEvent:ce,collisions:we,over:de}=oe.current;if(!le||!ce)return;const ue={active:le,activatorEvent:ce,collisions:we,delta:{x:Te.x,y:Te.y},over:de};We.unstable_batchedUpdates(()=>{se?.(ue),R({type:"onDragMove",event:ue})})},[Te.x,Te.y]),h.useEffect(()=>{const{active:se,activatorEvent:le,collisions:ce,droppableContainers:we,scrollAdjustedTranslate:de}=oe.current;if(!se||D.current==null||!le||!de)return;const{onDragOver:ue}=z.current,pe=we.get(fn),Oe=pe&&pe.rect.current?{id:pe.id,rect:pe.rect.current,data:pe.data,disabled:pe.disabled}:null,te={active:se,activatorEvent:le,collisions:ce,delta:{x:de.x,y:de.y},over:Oe};We.unstable_batchedUpdates(()=>{hn(Oe),ue?.(te),R({type:"onDragOver",event:te})})},[fn]),me(()=>{oe.current={activatorEvent:j,active:P,activeNode:X,collisionRect:_e,collisions:Pe,droppableRects:F,draggableNodes:N,draggingNode:Me,draggingNodeRect:Ee,droppableContainers:B,over:Se,scrollableAncestors:ye,scrollAdjustedTranslate:Te},L.current={initial:Ee,translated:_e}},[P,X,Pe,_e,N,Me,Ee,F,B,Se,ye,Te]),Uo({...K,delta:H,draggingRect:_e,pointerCoordinates:un,scrollableAncestors:ye,scrollableAncestorRects:Qe});const qr=h.useMemo(()=>({active:P,activeNode:X,activeNodeRect:V,activatorEvent:j,collisions:Pe,containerNodeRect:ie,dragOverlay:xe,draggableNodes:N,droppableContainers:B,droppableRects:F,over:Se,measureDroppableContainers:W,scrollableAncestors:ye,scrollableAncestorRects:Qe,measuringConfiguration:T,measuringScheduled:q,windowRect:Rt}),[P,X,V,j,Pe,ie,xe,N,B,F,Se,W,ye,Qe,T,q,Rt]),Xr=h.useMemo(()=>({activatorEvent:j,activators:pn,active:P,activeNodeRect:V,ariaDescribedById:{draggable:Y},dispatch:O,draggableNodes:N,over:Se,measureDroppableContainers:W}),[j,pn,P,V,O,Y,N,Se,W]);return h.createElement(Xn.Provider,{value:M},h.createElement(St.Provider,{value:Xr},h.createElement(lr.Provider,{value:qr},h.createElement(cr.Provider,{value:Ur},d)),h.createElement(ps,{disabled:l?.restoreFocus===!1})),h.createElement(go,{...l,hiddenTextDescribedById:Y}));function Kr(){const se=w?.autoScrollEnabled===!1,le=typeof u=="object"?u.enabled===!1:u===!1,ce=_&&!se&&!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 i=Je(ys),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:m}=h.useContext(St),{role:p=_n,roleDescription:x="draggable",tabIndex:b=0}=o??{},S=u?.id===t,O=h.useContext(S?cr:bs),[R,M]=ht(),[k,I]=ht(),_=ss(c,t),$=Ge(n);me(()=>(f.set(t,{id:t,key:i,node:R,activatorNode:k,data:$}),()=>{const H=f.get(t);H&&H.key===i&&f.delete(t)}),[f,t]);const N=h.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":S&&p===_n?!0:void 0,"aria-roledescription":x,"aria-describedby":g.draggable}),[r,p,b,S,x,g.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:N,isDragging:S,listeners:r?void 0:_,node:R,over:m,setNodeRef:M,setActivatorNodeRef:I,transform:O}}function ws(){return h.useContext(lr)}const Cs="Droppable",Ds={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Je(Cs),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=h.useContext(St),g=h.useRef({disabled:n}),f=h.useRef(!1),m=h.useRef(null),p=h.useRef(null),{disabled:x,updateMeasurementsFor:b,timeout:S}={...Ds,...o},O=Ge(b??r),R=h.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(O.current)?O.current:[O.current]),p.current=null},S)},[S]),M=yt({callback:R,disabled:x||!c}),k=h.useCallback((N,H)=>{M&&(H&&(M.unobserve(H),f.current=!1),N&&M.observe(N))},[M]),[I,_]=ht(k),$=Ge(t);return h.useEffect(()=>{!M||!I.current||(M.disconnect(),f.current=!1,M.observe(I.current))},[I,M]),h.useEffect(()=>(l({type:Z.RegisterDroppable,element:{id:r,key:i,disabled:n,node:I,rect:m,data:$}}),()=>l({type:Z.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==g.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:i,disabled:n}),g.current.disabled=n)},[r,i,n,l]),{active:c,rect:m,isOver:u?.id===r,node:I,over:u,setNodeRef:_}}function wt(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 i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function nt(e){return e!==null&&e>=0}function Ms(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 Es(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const rt={scaleX:1,scaleY:1},Ts=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:c}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=_s(n,c,o);if(c===o){const d=n[i];return d?{x:o<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...rt}:null}return c>o&&c<=i?{x:-l.width-u,y:0,...rt}:c<o&&c>=i?{x:l.width+u,y:0,...rt}:{x:0,y:0,...rt}};function _s(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const dr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=wt(t,r,n),c=t[o],l=i[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}},ot={scaleX:1,scaleY:1},Os=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:c}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const d=i[c];return d?{x:0,y:n<c?d.top+d.height-(l.top+l.height):d.top-l.top,...ot}:null}const u=ks(i,o,n);return o>n&&o<=c?{x:0,y:-l.height-u,...ot}:o<n&&o>=c?{x:0,y:l.height+u,...ot}:{x:0,y:0,...ot}};function ks(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const fr="Sortable",hr=h.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function gr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:i=!1}=e;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:g}=ws(),f=Je(fr,n),m=l.rect!==null,p=h.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),x=c!=null,b=c?p.indexOf(c.id):-1,S=d?p.indexOf(d.id):-1,O=h.useRef(p),R=!Ms(p,O.current),M=S!==-1&&b===-1||R,k=Es(i);me(()=>{R&&x&&g(p)},[R,p,x,g]),h.useEffect(()=>{O.current=p},[p]);const I=h.useMemo(()=>({activeIndex:b,containerId:f,disabled:k,disableTransforms:M,items:p,overIndex:S,useDragOverlay:m,sortedRects:Rs(p,u),strategy:o}),[b,f,k.draggable,k.droppable,M,p,S,u,m,o]);return h.createElement(hr.Provider,{value:I},t)}const Is=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return wt(n,r,o).indexOf(t)},$s=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=e;return!d||!r||l!==i&&o===c?!1:n?!0:c!==o&&t===u},As={duration:200,easing:"ease"},pr="transform",Ls=Ie.Transition.toString({property:pr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function zs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=h.useState(null),l=h.useRef(n);return me(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const d=Le(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(()=>{i&&c(null)},[i]),i}function vr(e){let{animateLayoutChanges:t=$s,attributes:n,disabled:r,data:o,getNewIndex:i=Is,id:c,strategy:l,resizeObserverConfig:u,transition:d=As}=e;const{items:g,containerId:f,activeIndex:m,disabled:p,disableTransforms:x,sortedRects:b,overIndex:S,useDragOverlay:O,strategy:R}=h.useContext(hr),M=Ns(r,p),k=g.indexOf(c),I=h.useMemo(()=>({sortable:{containerId:f,index:k,items:g},...o}),[f,o,k,g]),_=h.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:$,node:N,isOver:H,setNodeRef:B}=js({id:c,data:I,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...u}}),{active:A,activatorEvent:L,activeNodeRect:P,attributes:D,setNodeRef:w,listeners:C,isDragging:j,over:E,setActivatorNodeRef:z,transform:Y}=Ss({id:c,data:I,attributes:{...Ps,...n},disabled:M.draggable}),v=eo(B,w),T=!!A,F=T&&!x&&nt(m)&&nt(S),W=!O&&j,q=W&&F?Y:null,U=F?q??(l??R)({rects:b,activeNodeRect:P,activeIndex:m,overIndex:S,index:k}):null,K=nt(m)&&nt(S)?i({id:c,items:g,activeIndex:m,overIndex:S}):k,J=A?.id,V=h.useRef({activeId:J,items:g,newIndex:K,containerId:f}),ie=g!==V.current.items,oe=t({active:A,containerId:f,isDragging:j,isSorting:T,id:c,index:k,items:g,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:d,wasDragging:V.current.activeId!=null}),he=zs({disabled:!oe,index:k,node:N,rect:$});return h.useEffect(()=>{T&&V.current.newIndex!==K&&(V.current.newIndex=K),f!==V.current.containerId&&(V.current.containerId=f),g!==V.current.items&&(V.current.items=g)},[T,K,f,g]),h.useEffect(()=>{if(J===V.current.activeId)return;if(J!=null&&V.current.activeId==null){V.current.activeId=J;return}const Me=setTimeout(()=>{V.current.activeId=J},50);return()=>clearTimeout(Me)},[J]),{active:A,activeIndex:m,attributes:D,data:I,rect:$,index:k,newIndex:K,items:g,isOver:H,isSorting:T,isDragging:j,listeners:C,node:N,overIndex:S,over:E,setNodeRef:v,setActivatorNodeRef:z,setDroppableNodeRef:B,setDraggableNodeRef:w,transform:he??U,transition:xe()};function xe(){if(he||ie&&V.current.newIndex===k)return Ls;if(!(W&&!en(L)||!d)&&(T||oe))return Ie.Transition.toString({...d,property:pr})}}function Ns(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}}G.Down,G.Right,G.Up,G.Left;var st={exports:{}},It={},it={exports:{}},$t={};var On;function Fs(){if(On)return $t;On=1;var e=h;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,c=e.useDebugValue;function l(f,m){var p=m(),x=r({inst:{value:p,getSnapshot:m}}),b=x[0].inst,S=x[1];return i(function(){b.value=p,b.getSnapshot=m,u(b)&&S({inst:b})},[f,p,m]),o(function(){return u(b)&&S({inst:b}),f(function(){u(b)&&S({inst:b})})},[f]),c(p),p}function u(f){var m=f.getSnapshot;f=f.value;try{var p=m();return!n(f,p)}catch{return!0}}function d(f,m){return m()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,$t}var At={};var kn;function Ys(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}function t(p,x){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 b=x();if(!f){var S=x();i(b,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=c({inst:{value:b,getSnapshot:x}});var O=S[0].inst,R=S[1];return u(function(){O.value=b,O.getSnapshot=x,n(O)&&R({inst:O})},[p,b,x]),l(function(){return n(O)&&R({inst:O}),p(function(){n(O)&&R({inst:O})})},[p]),d(b),b}function n(p){var x=p.getSnapshot;p=p.value;try{var b=x();return!i(p,b)}catch{return!0}}function r(p,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,i=typeof Object.is=="function"?Object.is:e,c=o.useState,l=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,g=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;At.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var In;function mr(){return In||(In=1,process.env.NODE_ENV==="production"?it.exports=Fs():it.exports=Ys()),it.exports}var $n;function Bs(){if($n)return It;$n=1;var e=h,t=mr();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,i=e.useRef,c=e.useEffect,l=e.useMemo,u=e.useDebugValue;return It.useSyncExternalStoreWithSelector=function(d,g,f,m,p){var x=i(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=l(function(){function O(_){if(!R){if(R=!0,M=_,_=m(_),p!==void 0&&b.hasValue){var $=b.value;if(p($,_))return k=$}return k=_}if($=k,r(M,_))return $;var N=m(_);return p!==void 0&&p($,N)?(M=_,$):(M=_,k=N)}var R=!1,M,k,I=f===void 0?null:f;return[function(){return O(g())},I===null?void 0:function(){return O(I())}]},[g,f,m,p]);var S=o(d,x[0],x[1]);return c(function(){b.hasValue=!0,b.value=S},[S]),u(S),S},It}var Lt={};var An;function Ws(){return An||(An=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=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;Lt.useSyncExternalStoreWithSelector=function(d,g,f,m,p){var x=i(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=l(function(){function O(_){if(!R){if(R=!0,M=_,_=m(_),p!==void 0&&b.hasValue){var $=b.value;if(p($,_))return k=$}return k=_}if($=k,r(M,_))return $;var N=m(_);return p!==void 0&&p($,N)?(M=_,$):(M=_,k=N)}var R=!1,M,k,I=f===void 0?null:f;return[function(){return O(g())},I===null?void 0:function(){return O(I())}]},[g,f,m,p]);var S=o(d,x[0],x[1]);return c(function(){b.hasValue=!0,b.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())})()),Lt}var Ln;function Vs(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?st.exports=Bs():st.exports=Ws()),st.exports}var Hs=Vs();const Ut=new WeakMap,Us=new WeakMap,mt={current:[]};let Pt=!1;const at=new Set,Pn=new Map;function xr(e){for(const t of e){if(mt.current.includes(t))continue;mt.current.push(t),t.recompute();const n=Us.get(t);if(n)for(const r of n){const o=Ut.get(r);o?.length&&xr(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(at.add(e),!Pt)try{for(Pt=!0;at.size>0;){const t=Array.from(at);at.clear();for(const n of t){const r=Pn.get(n)??n.prevState;n.prevState=r,Gs(n)}for(const n of t){const r=Ut.get(n);r&&(mt.current.push(n),xr(r))}for(const n of t){const r=Ut.get(n);if(r)for(const o of r)qs(o)}}}finally{Pt=!1,mt.current=[],Pn.clear()}}function Ks(e){return typeof e=="function"}class Js{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,i;this.listeners.add(r);const c=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.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):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 Ze(e,t=r=>r,n={}){const r=n.equal??Zs;return Hs.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=zn(e);if(n.length!==zn(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 zn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const re=new Js({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],columnWidths:{},data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}}),Ct=e=>`datatable:${e}:column-widths`;function br(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:i}=re.state,c=JSON.parse(localStorage.getItem(wr(i))||"[]"),l=[...c.map(f=>o.find(m=>m.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],u=JSON.parse(localStorage.getItem(Cr(i))||"{}"),d=l.reduce((f,m)=>(f[m.id]=u[m.id]??!0,f),{}),g=JSON.parse(localStorage.getItem(Ct(i))||"{}");re.setState(f=>({...f,data:e,columnOrder:l,visibility:d,columnWidths:g,sortableColumns:l.map(m=>({id:m.id,label:m.label,sortable:!0,backgroundColor:m.backgroundColor,minWidth:m.minWidth}))}))}function yr(e){re.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const Sr=e=>{re.setState(t=>({...t,actionsConfig:e}))};function Qs(e,t){re.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const wr=e=>`table_column_order_v1:${e}`,Cr=e=>`table_column_visibility_v1:${e}`,ei=e=>{const{tableId:t}=re.state;localStorage.setItem(wr(t),JSON.stringify(e.map(n=>n.id))),re.setState(n=>({...n,columnOrder:e})),re.setState(n=>({...n,columnOrder:e}))};function ti(e){re.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const ni=e=>{re.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Cr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};function ri(e,t){re.setState(n=>{const r=n.columnOrder.find(c=>c.id===e),o=typeof r?.minWidth=="number"?r.minWidth:120,i={...n.columnWidths,[e]:Math.max(o,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(i)),{...n,columnWidths:i}})}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()),Nn=e=>{const t=si(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dr=(...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 li=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,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:Dr("lucide",o),...!i&&!ii(l)&&{"aria-hidden":"true"},...l},[...c.map(([d,g])=>h.createElement(d,g)),...Array.isArray(i)?i:[i]]));const ee=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(li,{ref:i,iconNode:t,className:Dr(`lucide-${oi(Nn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Nn(e),n};const ci=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ui=ee("arrow-down",ci);const di=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],fi=ee("arrow-left-right",di);const hi=[["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"}]],gi=ee("arrow-up-down",hi);const pi=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],vi=ee("arrow-up",pi);const mi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],xi=ee("bookmark",mi);const bi=[["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"}]],jr=ee("calendar",bi);const yi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Si=ee("chevron-left",yi);const wi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ci=ee("chevron-right",wi);const Di=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ji=ee("columns-2",Di);const Ri=[["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"}]],Mi=ee("delete",Ri);const Ei=[["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"}]],Ti=ee("ellipsis",Ei);const _i=[["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"}]],Oi=ee("funnel",_i);const ki=[["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"}]],Rr=ee("grip-vertical",ki);const Ii=[["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"}]],$i=ee("pen",Ii);const Ai=[["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"}]],Li=ee("refresh-ccw",Ai);const Pi=[["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"}]],zi=ee("settings",Pi);const Ni=[["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"}]],Mr=ee("triangle-alert",Ni);const Fi=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Er=ee("x",Fi);function y(e){return h.forwardRef((t,n)=>{const{children:r,...o}=t;return s.jsx(e,{ref:n,...o,children:r})})}const Yi=y(a.Menu.Trigger),Bi=y(a.Menu.Positioner),Wi=y(a.Menu.Content),Vi=y(a.Menu.Item),Hi=y(a.Checkbox.Label),Ui=y(a.Checkbox.HiddenInput),Gi=y(a.Checkbox.Control);function qi({visibility:e,onToggle:t}){const{sortableColumns:n}=Ze(re);return s.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[s.jsx(Yi,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:s.jsx(ji,{size:18})})}),s.jsx(a.Portal,{children:s.jsx(Bi,{children:s.jsx(Wi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return s.jsx(Vi,{value:r.id,closeOnSelect:!1,children:s.jsxs(a.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[s.jsx(Ui,{}),s.jsx(Gi,{}),s.jsx(Hi,{children:r.label})]})},r.id)})})})})]})}function Xi({id:e,children:t,onClick:n,cursor:r,borderRight:o,backgroundColor:i,minW:c}){const{columnWidths:l}=Ze(re),u=l[e],d=h.useRef(0),g=h.useRef(0),{setNodeRef:f,attributes:m,listeners:p,transform:x,transition:b}=vr({id:e}),S=M=>{M.stopPropagation(),d.current=M.clientX,g.current=u??150;const k=_=>{ri(e,g.current+(_.clientX-d.current))},I=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",k),document.addEventListener("mouseup",I)},[O,R]=h.useState(!1);return s.jsx(a.Table.ColumnHeader,{ref:f,onClick:n,backgroundColor:i,w:u?`${u}px`:void 0,minW:c,style:{transform:Ie.Transform.toString(x),transition:b,cursor:r,borderRight:o},...m,children:s.jsxs(a.HStack,{position:"relative",children:[s.jsx("span",{...p,children:s.jsx(Rr,{size:12,style:{cursor:"grab"}})}),t,s.jsx(a.Box,{position:"absolute",right:0,top:0,h:"100%",w:"10px",cursor:"col-resize",onMouseDown:S,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,children:O&&s.jsx(fi,{size:14,style:{pointerEvents:"none",opacity:.8}})})]})})}function Ki(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:i}=Ze(re),c=e.map(l=>o.find(u=>u.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]);return s.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:s.jsxs(a.Table.Row,{height:"28px",children:[i?.showSNo&&s.jsx(a.Table.ColumnHeader,{width:"80px",minW:80,maxW:80,textAlign:"center",backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.indexChildren||"S.No"}),c.map(l=>{const u=n===l?.id,d=l.minWidth;return s.jsx(Xi,{id:l?.id,onClick:()=>l?.sortable&&ti(l?.id),borderRight:"2px solid #dcdcdc",backgroundColor:l?.backgroundColor,minW:d,children:s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l.label,l?.sortable&&(u?r==="asc"?s.jsx(vi,{size:14}):s.jsx(ui,{size:14}):s.jsx(gi,{size:14,opacity:.4}))]})},l?.id)}),i?.showActionColumn&&s.jsx(a.Table.ColumnHeader,{width:i.width,backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.children||"Actions"}),i?.showColumnVisibilityMenu&&s.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:i.backgroundColorColumnVisibilityMenu,children:s.jsx(qi,{visibility:t,onToggle:ni})})]})})}const Ji=[10,20,50,100],Zi=y(a.Select.Positioner),Qi=y(a.Select.Content),ea=y(a.Select.Item),ta=y(a.Pagination.PrevTrigger),na=y(a.Pagination.NextTrigger),ra=y(a.Select.HiddenSelect),oa=y(a.Select.Control),sa=y(a.Select.Trigger),ia=y(a.Select.ValueText),aa=y(a.Select.IndicatorGroup),la=y(a.Select.Indicator);function ca({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:i=2,pageSizeOptions:c=Ji}){const l=a.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return s.jsx(a.Box,{width:"100%",children:s.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[s.jsxs(a.HStack,{children:[s.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),s.jsxs(a.Select.Root,{collection:l,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[s.jsx(ra,{}),s.jsxs(oa,{children:[s.jsx(sa,{children:s.jsx(ia,{placeholder:""})}),s.jsx(aa,{children:s.jsx(la,{})})]}),s.jsx(a.Portal,{children:s.jsx(Zi,{children:s.jsx(Qi,{children:l.items.map(u=>s.jsxs(ea,{item:u.value,children:[u.label,s.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]}),s.jsxs(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),s.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:i,onPageChange:u=>r&&r(u.page),children:s.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[s.jsx(ta,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Previous page",children:s.jsx(Si,{size:18})})}),s.jsx(a.Pagination.Items,{render:u=>s.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)}),s.jsx(na,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Next page",children:s.jsx(Ci,{size:18})})})]})})]})})}const ua=y(a.Menu.Item),da=y(a.Menu.Content),fa=y(a.Menu.Positioner),ha=y(a.Menu.Trigger);function ga({data:e=[],actions:t=[],actionConfig:n,onRowSelect:r,onRowSelectEvent:o="left",startIndex:i=0}){const{columnOrder:c,visibility:l,columnWidths:u}=Ze(re);return s.jsx(a.Table.Body,{children:e?.map((d,g)=>s.jsxs(a.Table.Row,{onClick:()=>o==="left"&&r?.(d.__raw),_hover:{bg:"blue.50"},onContextMenu:o==="right"?f=>{f.preventDefault(),r?.(d.__raw,f)}:void 0,children:[n?.showSNo&&s.jsx(a.Table.Cell,{textAlign:"center",fontWeight:"medium",children:i+g+1}),c.filter(f=>l[f.id]).map(f=>{const m=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth;return s.jsx(a.Table.Cell,{w:u[f.id]?`${u[f.id]}px`:void 0,minW:`${m}px`,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:d[f.id]},f.id)}),n?.showActionColumn&&s.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:s.jsxs(a.Menu.Root,{children:[s.jsx(ha,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:s.jsx(Ti,{size:16})})}),s.jsx(fa,{children:s.jsx(da,{children:t?.filter(f=>typeof f.visible=="function"?f.visible(d.__raw):f.visible!==!1).map(f=>s.jsxs(ua,{onClick:()=>f.onClick(d.__raw),colorScheme:f.colorScheme,value:f.label,children:[f.icon,f.label]},f.label))})})]})}),n?.showColumnVisibilityMenu&&s.jsx(a.Table.Cell,{})]},d.__key||d.id))})}function pa({rows:e=6,columns:t}){return s.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>s.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,i)=>s.jsx(a.Table.Cell,{children:s.jsx(a.Skeleton,{height:"25px"})},i))},r))})}function va({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:i=!1,emptyMessage:c="No data",actions:l,page:u=1,pageSize:d=10,onPageChange:g,onPageSizeChange:f,density:m="sm",totalCount:p=0,actionConfig:x,pageSizeOptions:b,onRowSelect:S,onRowSelectEvent:O="left"}){h.useEffect(()=>{yr(e)},[e]),h.useEffect(()=>{br(t,n)},[t,n]),h.useEffect(()=>{x&&Sr(x)},[x]);const{sortColumn:R,sortDirection:M,data:k,columnOrder:I}=Ze(re),_=h.useMemo(()=>{const L=[...k];return R&&L.sort((P,D)=>M==="asc"?String(P[R]).localeCompare(String(D[R])):String(D[R]).localeCompare(String(P[R]))),L},[k,R,M,u,d]),$=h.useMemo(()=>(Math.max(1,u||1)-1)*d,[u,d]);h.useEffect(()=>{u<1&&g&&g(1)},[u,g]);const N=L=>{const{active:P,over:D}=L;if(!D||P.id===D.id)return;const w=I.findIndex(E=>E.id===P.id),C=I.findIndex(E=>E.id===D.id),j=wt(I,w,C);ei(j)},H=r&&!i,B=i&&!r,A=!r&&!i&&_.length===0;return s.jsx(ur,{collisionDetection:Kn,onDragEnd:N,children:s.jsx(gr,{items:I.map(L=>L.id),strategy:Ts,children:s.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[s.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflowX:"auto",overflowY:"auto",children:[H&&s.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??s.jsx(a.Spinner,{})}),s.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:m,tableLayout:"fixed",minW:"max-content",children:[s.jsx(Ki,{}),B?s.jsx(pa,{rows:d,columns:n.length+(l?2:0)}):A?s.jsx(a.Table.Body,{children:s.jsx(a.Table.Row,{children:s.jsx(a.Table.Cell,{colSpan:n.length+(l?1:0),children:s.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):s.jsx(ga,{data:_,actions:l,actionConfig:x,onRowSelect:S,startIndex:$,onRowSelectEvent:O})]},e)]}),s.jsx(a.Box,{mt:.5,children:s.jsx(ca,{totalCount:p,pageSize:d,currentPage:u,onPageChange:g,onPageSizeChange:L=>{f?.(L),u>1&&g?.(1)},pageSizeOptions:b})})]})})})}const ne=[];for(let e=0;e<256;++e)ne.push((e+256).toString(16).slice(1));function ma(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}let zt;const xa=new Uint8Array(16);function ba(){if(!zt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zt=crypto.getRandomValues.bind(crypto)}return zt(xa)}const ya=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fn={randomUUID:ya};function Sa(e,t,n){e=e||{};const r=e.random??e.rng?.()??ba();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ma(r)}function wa(e,t,n){return Fn.randomUUID&&!e?Fn.randomUUID():Sa(e)}const Ca=y(a.Checkbox.Root),Da=y(a.Checkbox.HiddenInput),ja=y(a.Checkbox.Control),Ra=y(a.Checkbox.Label),Tr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:i,required:c,errorText:l})=>s.jsxs(Ca,{value:e,onChange:t,size:n,children:[s.jsx(Da,{}),s.jsx(ja,{disabled:i,required:c,errorText:l,helperText:o}),r&&s.jsx(Ra,{children:r})]}),Ma=y(a.Combobox.Root),Ea=y(a.Combobox.Control),Ta=y(a.Combobox.Input),_a=y(a.Combobox.IndicatorGroup),Oa=y(a.Combobox.ClearTrigger),ka=y(a.Combobox.Trigger),Ia=y(a.Combobox.Positioner),$a=y(a.Combobox.Content);function _r({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:i,itemToValue:c,renderItem:l,value:u,loading:d,error:g,errorMessage:f,placeholder:m,helpText:p,onInputChange:x,onSelect:b,visible:S=!0,rootProps:O,inputProps:R,controlProps:M,contentProps:k,itemProps:I}){const[_,$]=h.useState(""),N=h.useMemo(()=>Array.isArray(o)?o:[],[o]),{collection:H,set:B}=a.useListCollection({initialItems:N,itemToString:i,itemToValue:c}),A=h.useMemo(()=>{if(!_)return N;const L=_.toLowerCase();return N.filter(P=>i(P).toLowerCase().includes(L))},[o,_,i]);return h.useEffect(()=>{B(A)},[A,B]),h.useEffect(()=>{u&&$(i(u))},[u,i]),s.jsxs(Ma,{width:n,size:t,variant:r,collection:H,placeholder:m,onInputValueChange:L=>{x?.(L.inputValue),$(L.inputValue)},value:u?[c(u)]:[],onValueChange:L=>{const P=L.value?.[0];if(!P)return;const D=H.items.find(w=>c(w)===P);D&&b?.(D)},positioning:{sameWidth:!1,placement:"bottom-start"},...O,children:[S&&e&&s.jsx(a.Text,{fontSize:"sm",children:e}),s.jsxs(Ea,{...M,children:[s.jsx(Ta,{placeholder:m??"Type to search",...R}),s.jsxs(_a,{children:[s.jsx(Oa,{}),s.jsx(ka,{})]})]}),s.jsx(Ia,{children:s.jsxs($a,{minW:"sm",...k,children:[d?s.jsxs(a.HStack,{p:"2",children:[s.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),s.jsx(a.Span,{children:"Loading..."})]}):g?s.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):H.items.map(L=>s.jsxs(a.Combobox.Item,{item:L,...I,children:[l(L),s.jsx(a.Combobox.ItemIndicator,{})]},c(L))),p&&!g&&!d&&s.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:p})]})})]})}const Aa=y(a.Popover.Root),La=y(a.Popover.Content),Pa=y(a.Popover.Arrow),za=y(a.Popover.Trigger),Na=y(a.Popover.Positioner);function Re(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Yn(e){const t=e.split(/\s+to\s+/i),n=t[0],r=t[1],o=l=>{if(!l)return null;const u=l.trim().split("-");if(u.length!==3)return null;const[d,g,f]=u,m=parseInt(d),p=parseInt(g)-1,x=parseInt(f);if(isNaN(m)||isNaN(p)||isNaN(x)||f.length!==4)return null;const b=new Date(x,p,m);return b.getDate()===m&&b.getMonth()===p?b:null},i=o(n),c=o(r);return{start:i,end:c}}function Or({startDate:e,endDate:t,onChange:n,width:r="280px",showLabel:o=!0,label:i="Select date range",visible:c=!0}){const[l,u]=h.useState(!1),[d,g]=h.useState(e||new Date),[f,m]=h.useState(null),[p,x]=h.useState(e||null),[b,S]=h.useState(t||null),O=(L,P)=>L&&P?`${Re(L)} to ${Re(P)}`:L?`${Re(L)}`:"",[R,M]=h.useState(O(e,t));h.useEffect(()=>{x(e||null),S(t||null)},[e,t]);const k=new Date(d.getFullYear(),d.getMonth()+1,0).getDate(),I=new Date(d.getFullYear(),d.getMonth(),1).getDay(),_=()=>{g(new Date(d.getFullYear(),d.getMonth()-1,1))},$=()=>{g(new Date(d.getFullYear(),d.getMonth()+1,1))},N=L=>{const P=new Date(d.getFullYear(),d.getMonth(),L);if(!p||p&&b){x(P),S(null),n(P,null),M(Re(P));return}if(p&&!b){const D=P<p?P:p,w=P<p?p:P;x(D),S(w),n(D,w),M(`${Re(D)} to ${Re(w)}`),u(!1)}},H=L=>{const P=L.target.value;M(P);const{start:D,end:w}=Yn(P);if(D&&w){const C=D<w?D:w,j=D<w?w:D;n(C,j),g(C)}else D&&!P.toLowerCase().includes("to")&&n(D,null)},B=L=>{if(L.key!=="Enter")return;const{start:P,end:D}=Yn(R);if(P&&!D&&!R.toLowerCase().includes("to")){const w=`${Re(P)} to `;M(w),x(P),S(null),n(P,null),requestAnimationFrame(()=>{L.target.setSelectionRange(w.length,w.length)});return}if(P&&D){const w=P<D?P:D,C=P<D?D:P;x(w),S(C),n(w,C),u(!1)}},A=()=>{x(null),S(null),M(""),n(null,null)};return s.jsxs(a.Box,{width:r,onKeyDown:B,children:[o&&!c&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:i}),s.jsxs(Aa,{open:l,onOpenChange:L=>u(L.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[s.jsx(a.Input,{placeholder:"DD-MM-YYYY to DD-MM-YYYY",value:R,onChange:H,size:"sm",autoComplete:"off"}),R&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:A,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",children:s.jsx(Er,{size:14})}),s.jsx(za,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Na,{children:s.jsxs(La,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Pa,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:_,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:d.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:$,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((L,P)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:L},`${L}-${P}`)),Array(I).fill(null).map((L,P)=>s.jsx(a.Box,{},`empty-${P}`)),Array.from({length:k},(L,P)=>{const D=P+1,w=new Date(d.getFullYear(),d.getMonth(),D);let C=e,j=t;if(C&&j&&f)if(e&&t){const W=e.getTime()+(t.getTime()-e.getTime())/2;f.getTime()<=W?C=f:j=f,C>j&&([C,j]=[j,C])}else e&&!t&&(C=f<e?f:e,j=f<e?e:f);const E=C&&w.getTime()===C.getTime(),z=j&&w.getTime()===j.getTime(),Y=C&&j&&w>C&&w<j;let v="transparent",T="gray";E||z?T="blue":Y&&(v="blue.100");let F="md";return Y&&(F="0"),E&&j&&(F=z?"md":"md 0 0 md"),z&&C&&(F=E?"md":"0 md md 0"),s.jsx(a.Button,{size:"xs",variant:"ghost",colorPalette:T,bg:v!=="transparent"?v:void 0,onClick:()=>N(D),onMouseEnter:()=>m(w),onMouseLeave:()=>m(null),minW:"32px",h:"32px",fontSize:"xs",borderRadius:F,_hover:{bg:E||z?void 0:"gray.100"},children:D},D)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Select Start Date then End Date"})]})})]})]})}const Fa=y(a.Popover.Root),Ya=y(a.Popover.Content),Ba=y(a.Popover.Arrow),Wa=y(a.Popover.Trigger),Va=y(a.Popover.Positioner);function Bn(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Ha(e){const t=e.split("-");if(t.length!==3)return null;const[n,r,o]=t,i=parseInt(n),c=parseInt(r)-1,l=parseInt(o);if(isNaN(i)||isNaN(c)||isNaN(l)||o.length!==4)return null;const u=new Date(l,c,i);return u.getDate()===i&&u.getMonth()===c?u:null}function kr({value:e,onChange:t,width:n="220px",visible:r=!0,label:o="Select date"}){const[i,c]=h.useState(!1),[l,u]=h.useState(e||new Date),[d,g]=h.useState(Bn(e));h.useEffect(()=>{g(Bn(e))},[e]);const f=new Date(l.getFullYear(),l.getMonth()+1,0).getDate(),m=new Date(l.getFullYear(),l.getMonth(),1).getDay(),p=()=>{u(new Date(l.getFullYear(),l.getMonth()-1,1))},x=()=>{u(new Date(l.getFullYear(),l.getMonth()+1,1))},b=R=>{const M=new Date(l.getFullYear(),l.getMonth(),R);t(M),c(!1)},S=R=>{if(i)switch(R.key){case"ArrowLeft":p();break;case"ArrowRight":x();break;case"Escape":c(!1);break}},O=()=>{g(""),t(null)};return s.jsxs(a.Box,{width:n,onKeyDown:S,children:[!r&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:o}),s.jsxs(Fa,{open:i,onOpenChange:R=>c(R.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[d&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:O,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",zIndex:1,children:s.jsx(Er,{size:14})}),s.jsx(a.Input,{placeholder:"DD-MM-YYYY",value:d,onChange:R=>{const M=R.target.value;g(M);const k=Ha(M);k&&(t(k),u(k))},size:"sm",autoComplete:"off"}),s.jsx(Wa,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Va,{children:s.jsxs(Ya,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Ba,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:p,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:l.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:x,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((R,M)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:R},`${R}-${M}`)),Array(m).fill(null).map((R,M)=>s.jsx(a.Box,{},`empty-${M}`)),Array.from({length:f},(R,M)=>{const k=M+1,I=e&&e.getDate()===k&&e.getMonth()===l.getMonth()&&e.getFullYear()===l.getFullYear();return s.jsx(a.Button,{size:"xs",variant:I?"solid":"ghost",colorPalette:I?"blue":"gray",onClick:()=>b(k),minW:"32px",h:"32px",fontSize:"xs",borderRadius:"md",children:k},k)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Use Arrow Keys to change months • Esc to close"})]})})]})]})}const Ua=y(a.Field.Root),Ga=y(a.Field.Label),qa=y(a.Field.HelperText),Xa=y(a.Field.ErrorText),Gt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:i="outline",width:c="100%",label:l,helperText:u,isDisabled:d=!1,required:g=!1,errorText:f,visible:m,type:p="text",min:x=0,max:b=100,step:S=1})=>s.jsxs(Ua,{width:c,children:[m&&s.jsx(Ga,{children:l}),s.jsx(a.InputGroup,{startElement:e,children:s.jsx(a.Input,{value:t,onChange:O=>n?.(O.target.value),placeholder:r,size:o,type:p,variant:i,disabled:d,required:g,min:x,max:b,step:S})}),f&&s.jsx(Xa,{fontSize:"xs",children:f}),u&&s.jsx(qa,{fontSize:"xs",children:u})]}),Ka=y(a.Field.Root),Ja=y(a.Field.HelperText),Za=y(a.Field.ErrorText),Qa=y(a.Select.Root),el=y(a.Select.Label),tl=y(a.Select.Control),nl=y(a.Select.Trigger),rl=y(a.Select.ValueText),ol=y(a.Select.IndicatorGroup),sl=y(a.Select.Indicator),il=y(a.Select.Content),al=y(a.Select.Item),ll=y(a.Select.ItemIndicator),cl=y(a.Select.HiddenSelect),ul=y(a.Select.Positioner),Ir=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:i="xs",width:c="100%",variant:l="outline",helperText:u,isDisabled:d,required:g,errorText:f,visible:m})=>{const p=h.useMemo(()=>a.createListCollection({items:e}),[e]),x=e.find(S=>S.value===n),b=S=>{S.preventDefault(),S.stopPropagation(),r?.(void 0)};return s.jsxs(Ka,{disabled:d,required:g,children:[s.jsxs(Qa,{collection:p,variant:l,size:i,width:c,value:n?[n]:[],onValueChange:S=>{r?.(S.value[0])},children:[s.jsx(cl,{}),m&&s.jsx(el,{children:t}),s.jsxs(tl,{children:[s.jsx(nl,{children:s.jsx(rl,{placeholder:o,children:x?.displayValue??x?.label})}),s.jsxs(ol,{children:[n&&!d&&s.jsx("div",{style:{pointerEvents:"auto",display:"flex",alignItems:"center"},onPointerDown:S=>S.stopPropagation(),onClick:S=>S.stopPropagation(),children:s.jsx(a.CloseButton,{size:"sm",variant:"ghost",onPointerDown:b,onClick:b,position:"relative",zIndex:10})}),s.jsx(sl,{})]})]}),s.jsx(ul,{children:s.jsx(il,{children:p.items.map((S,O)=>s.jsxs(al,{item:S,children:[S.label,s.jsx(ll,{})]},O))})})]}),u&&s.jsx(Ja,{children:u}),f&&s.jsx(Za,{children:f})]})},dl="FILTER_PRESETS_",$r=e=>`${dl}${e}`,Dt=e=>{if(typeof window>"u")return[];const t=localStorage.getItem($r(e));try{return t?JSON.parse(t):[]}catch(n){return console.error("Failed to parse presets",n),[]}},sn=(e,t)=>{typeof window>"u"||(localStorage.setItem($r(e),JSON.stringify(t)),window.dispatchEvent(new Event("storage_updated")))},Ar=(e,t)=>{const n=Dt(e);sn(e,[t,...n])},Lr=(e,t)=>{const n=Dt(e).filter(r=>r.id!==t);sn(e,n)},fl=y(a.Checkbox.Root),hl=y(a.Checkbox.HiddenInput),gl=y(a.Checkbox.Control),pl=y(a.Slider.Root),vl=y(a.Slider.Track),ml=y(a.Slider.Range),xl=y(a.Slider.Thumbs),bl=y(a.Slider.Control),yl=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:i,transform:c,transition:l}=vr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:l};return s.jsxs(a.VStack,{ref:i,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[s.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[s.jsx(Rr,{size:16}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),s.jsxs(a.HStack,{justify:"space-between",children:[s.jsx(a.Text,{fontSize:"sm",children:"Visible"}),s.jsxs(fl,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[s.jsx(hl,{}),s.jsx(gl,{})]})]}),s.jsxs(a.VStack,{align:"stretch",gap:1,children:[s.jsx(a.Text,{fontSize:"sm",children:"Size"}),s.jsx(pl,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:s.jsxs(bl,{children:[s.jsx(vl,{children:s.jsx(ml,{})}),s.jsx(xl,{})]})})]})]})},Sl=y(a.Drawer.Root),wl=y(a.Drawer.Trigger),Cl=y(a.Drawer.Backdrop),Dl=y(a.Drawer.Positioner),jl=y(a.Drawer.Content),Rl=y(a.Drawer.Header),Ml=y(a.Drawer.Title),El=y(a.Drawer.Body),Tl=y(a.Drawer.Footer),_l=y(a.Drawer.CloseTrigger),Ol=y(a.Tabs.Root),kl=y(a.Tabs.List),Nt=y(a.Tabs.Trigger),Ft=y(a.Tabs.Content),Pr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return s.jsx(Gt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return s.jsx(Gt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return s.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return s.jsx(Ir,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return s.jsx(kr,{value:e.value,onChange:e.onChange,visible:t,label:e.label});case"date-range":return s.jsx(Or,{startDate:e.startDate?new Date(e.startDate):void 0,endDate:e.endDate?new Date(e.endDate):void 0,onChange:e.onChange,visible:t,label:e.label});case"combobox":return s.jsx(_r,{visible:!0,label:e.label,itemToString:n=>String(n.label),itemToValue:n=>n.value,renderItem:n=>s.jsx("span",{children:n.label})});default:return null}},Il=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:i="default",onLoadPreset:c,activePresetName:l,onReorder:u,open:d,onOpenChange:g})=>{const[f,m]=h.useState([]);h.useEffect(()=>{const x=()=>{m(Dt(i))};return x(),window.addEventListener("storage",x),window.addEventListener("storage_updated",x),()=>{window.removeEventListener("storage",x),window.removeEventListener("storage_updated",x)}},[i]);const p=()=>{const x=prompt("Preset name?");if(!x)return;const b=o.reduce((S,O)=>(S[O.id]=O.value,S),{});Ar(i,{id:wa(),name:x,date:new Date().toISOString(),values:b})};return s.jsx(a.HStack,{wrap:"wrap",children:s.jsxs(Sl,{size:e,open:d,onOpenChange:g,children:[s.jsx(wl,{asChild:!0,children:s.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[s.jsx(Oi,{size:16}),"Filters"]})}),s.jsxs(a.Portal,{children:[s.jsx(Cl,{}),s.jsx(Dl,{children:s.jsxs(jl,{children:[s.jsx(Rl,{children:s.jsx(Ml,{children:"Filters"})}),s.jsx(El,{overflowY:"auto",pt:1,children:s.jsxs(Ol,{defaultValue:"view",children:[s.jsxs(kl,{mb:4,children:[s.jsxs(Nt,{value:"view",children:[s.jsx($i,{size:16}),"Edit"]}),s.jsxs(Nt,{value:"settings",children:[s.jsx(zi,{size:16}),"Settings"]}),s.jsxs(Nt,{value:"presets",children:[s.jsx(xi,{size:16}),"Presets"]})]}),s.jsx(Ft,{value:"view",children:o.filter(x=>x.visible).map(x=>s.jsx(a.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:x.size??1,minW:`${(x.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Pr(x,d)},x.id))}),s.jsx(Ft,{value:"settings",children:s.jsx(ur,{sensors:vo(po(on)),collisionDetection:Kn,onDragEnd:({active:x,over:b})=>{if(!b||x.id===b.id)return;const S=o.findIndex(M=>M.id===x.id),O=o.findIndex(M=>M.id===b.id),R=wt(o,S,O);u?.(R)},children:s.jsx(gr,{items:o.map(x=>x.id),strategy:Os,children:o.map(x=>s.jsx(yl,{filter:x,onVisibilityChange:t,onSizeChange:n},x.id))})})}),s.jsx(Ft,{value:"presets",children:s.jsxs(a.VStack,{align:"stretch",mb:3,children:[f.length===0&&s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),f.map(x=>s.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:l===x.name?"blue.300":"gray.200",rounded:"md",p:2,children:[s.jsxs(a.VStack,{align:"start",gap:0,children:[s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:x.name}),s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(x.date).toLocaleDateString()})]}),s.jsxs(a.HStack,{children:[s.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const b=o.map(S=>({...S,value:x.values[S.id]??S.value}));c?.(b,x.name)},children:"Load"}),s.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Lr(i,x.id),children:s.jsx(Mi,{size:14})})]})]},x.id)),s.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:p,children:"Save Current Filters"})]})})]})}),s.jsx(Tl,{justify:"space-between",children:s.jsx(_l,{asChild:!0,children:s.jsx(a.CloseButton,{})})})]})})]})]})})},$l=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,onLoadPreset:u,activePresetName:d,filterDrawerSize:g="sm"})=>{const[f,m]=h.useState(!1);return s.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,s.jsxs(a.HStack,{gapX:1,children:[t.filter(p=>p.visible!==!1).map(p=>s.jsx(a.HStack,{flex:p.size??1,minW:`${(p.size??1)*100}px`,alignItems:"center",children:Pr(p)},p.id)),s.jsx(Il,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:p=>{m(p.open)}})]})]})},Al=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Ll=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Pl=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:i,isDisabled:c,colorScheme:l,loading:u,loadingText:d,rounded:g,type:f="button",textColor:m="white",borderColor:p})=>s.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:c,loading:u,loadingText:d,rounded:g,type:f,background:l,color:m,border:p,children:s.jsxs(a.HStack,{gap:1,children:[o,r,i]})}),zl=y(a.Dialog.Root),Nl=y(a.Dialog.Backdrop),Fl=y(a.Dialog.Positioner),Yl=y(a.Dialog.Content),Bl=y(a.Dialog.Header),Wl=y(a.Dialog.Body),Vl=y(a.Dialog.Footer),Hl=y(a.Dialog.Title),Ul=y(a.Dialog.CloseTrigger);function Gl({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:i="Confirm",cancelLabel:c="Cancel",icon:l,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return s.jsx(zl,{open:e,placement:"center",onOpenChange:g=>!g.open&&t(),children:s.jsxs(a.Portal,{children:[s.jsx(Nl,{}),s.jsx(Fl,{children:s.jsxs(Yl,{maxW:"480px",children:[s.jsx(Bl,{borderBottom:"1px solid",borderColor:"gray.200",children:s.jsx(Hl,{children:r})}),s.jsx(Wl,{p:6,children:s.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[s.jsx(a.Box,{color:"orange.500",children:l??s.jsx(Mr,{size:40})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),s.jsxs(Vl,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:c}),s.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:i})]}),s.jsx(Ul,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const ql=y(a.Dialog.Root),Xl=y(a.Dialog.Backdrop),Kl=y(a.Dialog.Positioner),Jl=y(a.Dialog.Content),Zl=y(a.Dialog.Header),Ql=y(a.Dialog.Body),ec=y(a.Dialog.Footer),tc=y(a.Dialog.Title),nc=y(a.Dialog.CloseTrigger);function rc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:i="DELETE",confirmLabel:c="Delete",isLoading:l=!1}){const[u,d]=h.useState(""),g=u===i;return s.jsx(ql,{open:e,placement:"center",onOpenChange:f=>{!f.open&&t(),d("")},children:s.jsxs(a.Portal,{children:[s.jsx(Xl,{}),s.jsx(Kl,{children:s.jsxs(Jl,{maxW:"550px",children:[s.jsx(Zl,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:s.jsx(tc,{color:"red.600",children:r})}),s.jsx(Ql,{p:2,style:{padding:"16px"},children:s.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[s.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:s.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[s.jsx(a.Box,{color:"red.600",mt:"2px",children:s.jsx(Mr,{size:20})}),s.jsxs(a.Box,{children:[s.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),s.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",s.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),s.jsxs(a.Box,{children:[s.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",s.jsx("b",{children:i})," to continue"]}),s.jsx(a.Input,{placeholder:`Type ${i} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),s.jsxs(ec,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),s.jsx(a.Button,{size:"sm",disabled:!g,style:{backgroundColor:"#FF0000"},loading:l,onClick:n,children:c})]}),s.jsx(nc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const zr=({children:e})=>s.jsx(s.Fragment,{children:e}),Nr=({children:e})=>s.jsx(s.Fragment,{children:e}),oc=a.Button,sc=y(a.Dialog.Root),ic=y(a.Dialog.Backdrop),ac=y(a.Dialog.Positioner),lc=y(a.Dialog.Content),cc=y(a.Dialog.Header),uc=y(a.Dialog.Body),dc=y(a.Dialog.Footer),fc=y(a.Dialog.Title),hc=y(a.Dialog.CloseTrigger);function gc(e){let t=null,n=null;return h.Children.forEach(e,r=>{h.isValidElement(r)&&(r.type===zr&&(t=r.props.children),r.type===Nr&&(n=r.props.children))}),{body:t,actions:n}}const pc=({open:e,onClose:t,title:n,children:r,width:o,position:i,refetch:c,loading:l=!1})=>{const{body:u,actions:d}=gc(r);return s.jsx(sc,{open:e,onOpenChange:g=>!g.open&&t(),placement:i??"center",children:s.jsxs(a.Portal,{children:[s.jsx(ic,{bg:"blackAlpha.400"}),s.jsx(ac,{children:s.jsxs(lc,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[s.jsx(cc,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:s.jsxs(a.Flex,{align:"center",justify:"space-between",children:[s.jsx(fc,{fontSize:"16px",fontWeight:"600",children:n}),s.jsx(hc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})}),c&&s.jsx(an,{label:"Refresh",refetch:c,isLoading:l})]})}),u&&s.jsx(uc,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:s.jsx(a.Flex,{direction:"column",gap:"16px",children:u})}),d&&s.jsx(dc,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:s.jsx(a.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},vc=y(a.Field.Root),mc=y(a.Field.Label),xc=y(a.Field.HelperText),bc=y(a.Field.ErrorText),yc=y(a.PinInput.Input),Sc=y(a.PinInput.Control),wc=y(a.PinInput.HiddenInput),Cc=y(a.PinInput.Root),Dc=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:i,helperText:c,errorText:l,required:u=!1,visible:d=!0})=>{const g=Array.from({length:n}).map((f,m)=>e?.[m]??"");return s.jsxs(vc,{children:[d&&i&&s.jsxs(mc,{children:[i,u&&" *"]}),s.jsxs(Cc,{value:g,onValueChange:f=>t?.(f.value.join("")),disabled:o,size:r,children:[s.jsx(wc,{}),s.jsx(Sc,{children:s.jsx(a.HStack,{children:Array.from({length:n}).map((f,m)=>s.jsx(yc,{index:m},m))})})]}),l&&s.jsx(bc,{fontSize:"xs",children:l}),c&&!l&&s.jsx(xc,{fontSize:"xs",children:c})]})};function an({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=h.useState(!1),i=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return s.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:i,ml:2,children:s.jsx(Li,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var ct={exports:{}},jc=ct.exports,Wn;function Rc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(jc,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",c="second",l="minute",u="hour",d="day",g="week",f="month",m="quarter",p="year",x="date",b="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|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,R={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(D){var w=["th","st","nd","rd"],C=D%100;return"["+D+(w[(C-20)%10]||w[C]||w[0])+"]"}},M=function(D,w,C){var j=String(D);return!j||j.length>=w?D:""+Array(w+1-j.length).join(C)+D},k={s:M,z:function(D){var w=-D.utcOffset(),C=Math.abs(w),j=Math.floor(C/60),E=C%60;return(w<=0?"+":"-")+M(j,2,"0")+":"+M(E,2,"0")},m:function D(w,C){if(w.date()<C.date())return-D(C,w);var j=12*(C.year()-w.year())+(C.month()-w.month()),E=w.clone().add(j,f),z=C-E<0,Y=w.clone().add(j+(z?-1:1),f);return+(-(j+(C-E)/(z?E-Y:Y-E))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:p,w:g,d,D:x,h:u,m:l,s:c,ms:i,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},I="en",_={};_[I]=R;var $="$isDayjsObject",N=function(D){return D instanceof L||!(!D||!D[$])},H=function D(w,C,j){var E;if(!w)return I;if(typeof w=="string"){var z=w.toLowerCase();_[z]&&(E=z),C&&(_[z]=C,E=z);var Y=w.split("-");if(!E&&Y.length>1)return D(Y[0])}else{var v=w.name;_[v]=w,E=v}return!j&&E&&(I=E),E||!j&&I},B=function(D,w){if(N(D))return D.clone();var C=typeof w=="object"?w:{};return C.date=D,C.args=arguments,new L(C)},A=k;A.l=H,A.i=N,A.w=function(D,w){return B(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var L=(function(){function D(C){this.$L=H(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[$]=!0}var w=D.prototype;return w.parse=function(C){this.$d=(function(j){var E=j.date,z=j.utc;if(E===null)return new Date(NaN);if(A.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var Y=E.match(S);if(Y){var v=Y[2]-1||0,T=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,T)):new Date(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,T)}}return new Date(E)})(C),this.init()},w.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()},w.$utils=function(){return A},w.isValid=function(){return this.$d.toString()!==b},w.isSame=function(C,j){var E=B(C);return this.startOf(j)<=E&&E<=this.endOf(j)},w.isAfter=function(C,j){return B(C)<this.startOf(j)},w.isBefore=function(C,j){return this.endOf(j)<B(C)},w.$g=function(C,j,E){return A.u(C)?this[j]:this.set(E,C)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(C,j){var E=this,z=!!A.u(j)||j,Y=A.p(C),v=function(J,V){var ie=A.w(E.$u?Date.UTC(E.$y,V,J):new Date(E.$y,V,J),E);return z?ie:ie.endOf(d)},T=function(J,V){return A.w(E.toDate()[J].apply(E.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(V)),E)},F=this.$W,W=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(Y){case p:return z?v(1,0):v(31,11);case f:return z?v(1,W):v(0,W+1);case g:var U=this.$locale().weekStart||0,K=(F<U?F+7:F)-U;return v(z?q-K:q+(6-K),W);case d:case x:return T(X+"Hours",0);case u:return T(X+"Minutes",1);case l:return T(X+"Seconds",2);case c:return T(X+"Milliseconds",3);default:return this.clone()}},w.endOf=function(C){return this.startOf(C,!1)},w.$set=function(C,j){var E,z=A.p(C),Y="set"+(this.$u?"UTC":""),v=(E={},E[d]=Y+"Date",E[x]=Y+"Date",E[f]=Y+"Month",E[p]=Y+"FullYear",E[u]=Y+"Hours",E[l]=Y+"Minutes",E[c]=Y+"Seconds",E[i]=Y+"Milliseconds",E)[z],T=z===d?this.$D+(j-this.$W):j;if(z===f||z===p){var F=this.clone().set(x,1);F.$d[v](T),F.init(),this.$d=F.set(x,Math.min(this.$D,F.daysInMonth())).$d}else v&&this.$d[v](T);return this.init(),this},w.set=function(C,j){return this.clone().$set(C,j)},w.get=function(C){return this[A.p(C)]()},w.add=function(C,j){var E,z=this;C=Number(C);var Y=A.p(j),v=function(W){var q=B(z);return A.w(q.date(q.date()+Math.round(W*C)),z)};if(Y===f)return this.set(f,this.$M+C);if(Y===p)return this.set(p,this.$y+C);if(Y===d)return v(1);if(Y===g)return v(7);var T=(E={},E[l]=r,E[u]=o,E[c]=n,E)[Y]||1,F=this.$d.getTime()+C*T;return A.w(F,this)},w.subtract=function(C,j){return this.add(-1*C,j)},w.format=function(C){var j=this,E=this.$locale();if(!this.isValid())return E.invalidDate||b;var z=C||"YYYY-MM-DDTHH:mm:ssZ",Y=A.z(this),v=this.$H,T=this.$m,F=this.$M,W=E.weekdays,q=E.months,X=E.meridiem,U=function(V,ie,oe,he){return V&&(V[ie]||V(j,z))||oe[ie].slice(0,he)},K=function(V){return A.s(v%12||12,V,"0")},J=X||function(V,ie,oe){var he=V<12?"AM":"PM";return oe?he.toLowerCase():he};return z.replace(O,(function(V,ie){return ie||(function(oe){switch(oe){case"YY":return String(j.$y).slice(-2);case"YYYY":return A.s(j.$y,4,"0");case"M":return F+1;case"MM":return A.s(F+1,2,"0");case"MMM":return U(E.monthsShort,F,q,3);case"MMMM":return U(q,F);case"D":return j.$D;case"DD":return A.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return U(E.weekdaysMin,j.$W,W,2);case"ddd":return U(E.weekdaysShort,j.$W,W,3);case"dddd":return W[j.$W];case"H":return String(v);case"HH":return A.s(v,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(v,T,!0);case"A":return J(v,T,!1);case"m":return String(T);case"mm":return A.s(T,2,"0");case"s":return String(j.$s);case"ss":return A.s(j.$s,2,"0");case"SSS":return A.s(j.$ms,3,"0");case"Z":return Y}return null})(V)||Y.replace(":","")}))},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(C,j,E){var z,Y=this,v=A.p(j),T=B(C),F=(T.utcOffset()-this.utcOffset())*r,W=this-T,q=function(){return A.m(Y,T)};switch(v){case p:z=q()/12;break;case f:z=q();break;case m:z=q()/3;break;case g:z=(W-F)/6048e5;break;case d:z=(W-F)/864e5;break;case u:z=W/o;break;case l:z=W/r;break;case c:z=W/n;break;default:z=W}return E?z:A.a(z)},w.daysInMonth=function(){return this.endOf(f).$D},w.$locale=function(){return _[this.$L]},w.locale=function(C,j){if(!C)return this.$L;var E=this.clone(),z=H(C,j,!0);return z&&(E.$L=z),E},w.clone=function(){return A.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D})(),P=L.prototype;return B.prototype=P,[["$ms",i],["$s",c],["$m",l],["$H",u],["$W",d],["$M",f],["$y",p],["$D",x]].forEach((function(D){P[D[1]]=function(w){return this.$g(w,D[0],D[1])}})),B.extend=function(D,w){return D.$i||(D(w,L,B),D.$i=!0),B},B.locale=H,B.isDayjs=N,B.unix=function(D){return B(1e3*D)},B.en=_[I],B.Ls=_,B.p={},B}))})(ct)),ct.exports}var Mc=Rc();const jt=xt(Mc);var ut={exports:{}},Ec=ut.exports,Vn;function Tc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(Ec,(function(){return function(n,r,o){n=n||{};var i=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,m){return i.fromToBase(d,g,f,m)}o.en.relativeTime=c,i.fromToBase=function(d,g,f,m,p){for(var x,b,S,O=f.$locale().relativeTime||c,R=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"}],M=R.length,k=0;k<M;k+=1){var I=R[k];I.d&&(x=m?o(d).diff(f,I.d,!0):f.diff(d,I.d,!0));var _=(n.rounding||Math.round)(Math.abs(x));if(S=x>0,_<=I.r||!I.r){_<=1&&k>0&&(I=R[k-1]);var $=O[I.l];p&&(_=p(""+_)),b=typeof $=="string"?$.replace("%d",_):$(_,g,I.l,S);break}}if(g)return b;var N=S?O.future:O.past;return typeof N=="function"?N(b):N.replace("%s",b)},i.to=function(d,g){return l(d,g,this,!0)},i.from=function(d,g){return l(d,g,this)};var u=function(d){return d.$u?o.utc():o()};i.toNow=function(d){return this.to(u(this),d)},i.fromNow=function(d){return this.from(u(this),d)}}}))})(ut)),ut.exports}var _c=Tc();const Oc=xt(_c);var dt={exports:{}},kc=dt.exports,Hn;function Ic(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(kc,(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,i){var c=o.prototype,l=c.format;i.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,g=(function(f,m){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,x,b){var S=b&&b.toUpperCase();return x||m[b]||n[b]||m[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(O,R,M){return R||M.slice(1)}))}))})(u,d===void 0?{}:d);return l.call(this,g)}}}))})(dt)),dt.exports}var $c=Ic();const Ac=xt($c);var ft={exports:{}},Lc=ft.exports,Un;function Pc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Lc,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(c){var l=this,u=this.$locale();if(!this.isValid())return i.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 i.bind(this)(g)}}}))})(ft)),ft.exports}var zc=Pc();const Nc=xt(zc);jt.extend(Oc);jt.extend(Ac);jt.extend(Nc);const Fc={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 qt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=jt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Fc[t]):r}function Yc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:i="start",dateColor:c="gray.700",dateFontSize:l="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:g="12px",timeFontWeight:f="400",showTime:m=!0}){return s.jsxs(a.Stack,{gap:.5,align:i,children:[s.jsx(a.Text,{fontSize:l,fontWeight:u,color:c,children:qt({value:e,variant:t,format:r})}),m&&s.jsx(a.Text,{fontSize:g,fontWeight:f,color:d,children:qt({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 Xt{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 Kt{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 i=this.store.get(o);i?n[o]=i.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const i=this.store.get(o);i&&(n[o]=i.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(i=>this.inflight.delete(i))});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 Bc({client:{apiUrl:e},children:t}){const n=h.useRef(new Kt(new Xt(e)));return n.current||(n.current=new Kt(new Xt(e))),s.jsx(Yr.Provider,{value:n.current,children:t})}function Wc(e){const t=Br(),[n,r]=h.useState(t.getRaw(e)?.value);return h.useEffect(()=>{let o=!0;t.getKey(e).then(c=>{o&&r(c)});const i=t.subscribe(e,c=>{r(c?.value)});return()=>{o=!1,i()}},[e,t]),n}function Vc(e){const t=Br(),[n,r]=h.useState({});return h.useEffect(()=>{let o=!0;t.getMultiKey(e).then(c=>{o&&r(c)});const i=e.map(c=>t.subscribe(c,l=>{r(u=>({...u,[c]:l?.value}))}));return()=>{o=!1,i.forEach(c=>c())}},[e.join("|"),t]),n}async function Hc(e,t){return e.getKey(t)}async function Uc(e,t){await e.getMultiKey(t)}function Gc(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=h.useState(t),[i,c]=h.useState(n),l=h.useCallback(m=>{o(Math.max(1,m))},[]),u=h.useCallback(m=>{c(Math.max(1,m)),o(1)},[]),d=h.useCallback(()=>{o(m=>m+1)},[]),g=h.useCallback(()=>{o(m=>Math.max(1,m-1))},[]),f=h.useCallback(()=>{o(t),c(n)},[t,n]);return{page:r,limit:i,setPage:l,setLimit:u,nextPage:d,prevPage:g,reset:f}}function qc(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=h.useState(t),i=Xc(r,n),c=h.useCallback(u=>{o(u)},[]),l=h.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:i,onSearchChange:c,reset:l}}function Xc(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=va;exports.Filters=$l;exports.HttpOptionsApi=Xt;exports.MDSButton=Pl;exports.MDSCheckbox=Tr;exports.MDSCombobox=_r;exports.MDSConfirmActionDialog=Gl;exports.MDSConfirmDeleteDialog=rc;exports.MDSDatePicker=kr;exports.MDSDateRangePicker=Or;exports.MDSDialogAction=oc;exports.MDSDialogActions=Nr;exports.MDSDialogBody=zr;exports.MDSDialogWrapper=pc;exports.MDSInput=Gt;exports.MDSPinInput=Dc;exports.MDSRefreshButton=an;exports.MDSSelectBox=Ir;exports.OptionsClientImpl=Kt;exports.OptionsProvider=Bc;exports.OptionsStore=Fr;exports.RefreshButton=an;exports.StackedDateTime=Yc;exports.addPreset=Ar;exports.deletePreset=Lr;exports.formatDateTime=qt;exports.getColumnWidthKey=Ct;exports.getOption=Hc;exports.getPresets=Dt;exports.loadOrder=Ll;exports.prefetchOptions=Uc;exports.saveOrder=Al;exports.savePresets=sn;exports.setActionsConfig=Sr;exports.setColumnWidth=Qs;exports.setData=br;exports.setTableId=yr;exports.tableStore=re;exports.useDebouncedSearch=qc;exports.useOption=Wc;exports.useOptions=Vc;exports.usePagination=Gc;exports.withChildren=y;
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:i,announcement:c}=lo(),l=Je("DndLiveRegion"),[u,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),co(h.useMemo(()=>({onDragStart(f){let{active:v}=f;i(t.onDragStart({active:v}))},onDragMove(f){let{active:v,over:p}=f;t.onDragMove&&i(t.onDragMove({active:v,over:p}))},onDragOver(f){let{active:v,over:p}=f;i(t.onDragOver({active:v,over:p}))},onDragEnd(f){let{active:v,over:p}=f;i(t.onDragEnd({active:v,over:p}))},onDragCancel(f){let{active:v,over:p}=f;i(t.onDragCancel({active:v,over:p}))}}),[i,t])),!u)return null;const g=h.createElement(h.Fragment,null,h.createElement(io,{id:r,value:o.draggable}),h.createElement(ao,{id:l,announcement:c}));return n?We.createPortal(g,n):g}var Z;(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"})(Z||(Z={}));function pt(){}function po(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 ge=Object.freeze({x:0,y:0});function vo(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 yn(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 Kn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=yn(t,t.left,t.top),i=[];for(const c of r){const{id:l}=c,u=n.get(l);if(u){const d=vo(yn(u),o);i.push({id:l,data:{droppableContainer:c,value:d}})}}return i.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),i=Math.min(t.top+t.height,e.top+e.height),c=o-r,l=i-n;if(r<o&&n<i){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 wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:c}=i,l=n.get(c);if(l){const u=So(l,t);u>0&&o.push({id:c,data:{droppableContainer:i,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 Jn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ge}function Do(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];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 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 Mo(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:i,x:c,y:l}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:g,height:f,top:d,right:u+g,bottom:d+f,left:u}}const Eo={ignoreTransform:!1};function Le(e,t){t===void 0&&(t=Eo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=ae(e).getComputedStyle(e);d&&(n=Mo(n,d,g))}const{top:r,left:o,width:i,height:c,bottom:l,right:u}=n;return{top:r,left:o,width:i,height:c,bottom:l,right:u}}function Sn(e){return Le(e,{ignoreTransform:!0})}function To(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 i=t[o];return typeof i=="string"?n.test(i):!1})}function tn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Zt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Xe(o)||Gn(o)||n.includes(o))return n;const i=ae(e).getComputedStyle(o);return o!==e&&Oo(o,i)&&n.push(o),_o(o,i)?n:r(o.parentNode)}return e?r(e):n}function Zn(e){const[t]=tn(e,1);return t??null}function _t(e){return!bt||!e?null:$e(e)?e:Jt(e)?Zt(e)||e===Ae(e).scrollingElement?window:Xe(e)?e:null:null}function Qn(e){return $e(e)?e.scrollX:e.scrollLeft}function er(e){return $e(e)?e.scrollY:e.scrollTop}function Wt(e){return{x:Qn(e),y:er(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function tr(e){return!bt||!e?!1:e===document.scrollingElement}function nr(e){const t={x:0,y:0},n=tr(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,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:c,isRight:l,maxScroll:r,minScroll:t}}const ko={x:.2,y:.2};function Io(e,t,n,r,o){let{top:i,left:c,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=ko);const{isTop:d,isBottom:g,isLeft:f,isRight:v}=nr(e),p={x:0,y:0},x={x:0,y:0},b={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+b.height?(p.y=Q.Backward,x.y=r*Math.abs((t.top+b.height-i)/b.height)):!g&&u>=t.bottom-b.height&&(p.y=Q.Forward,x.y=r*Math.abs((t.bottom-b.height-u)/b.height)),!v&&l>=t.right-b.width?(p.x=Q.Forward,x.x=r*Math.abs((t.right-b.width-l)/b.width)):!f&&c<=t.left+b.width&&(p.x=Q.Backward,x.x=r*Math.abs((t.left+b.width-c)/b.width)),{direction:p,speed:x}}function $o(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,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 rr(e){return e.reduce((t,n)=>ke(t,Wt(n)),ge)}function Ao(e){return e.reduce((t,n)=>t+Qn(n),0)}function Lo(e){return e.reduce((t,n)=>t+er(n),0)}function Po(e,t){if(t===void 0&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Zn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zo=[["x",["left","right"],Ao],["y",["top","bottom"],Lo]];class nn{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=tn(n),o=rr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,l]of zo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),g=o[i]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ve{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 No(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Ae(e)}function Ot(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 wn(e){e.preventDefault()}function Fo(e){e.stopPropagation()}var G;(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"})(G||(G={}));const or={start:[G.Space,G.Enter],cancel:[G.Esc],end:[G.Space,G.Enter,G.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case G.Right:return{...n,x:n.x+25};case G.Left:return{...n,x:n.x-25};case G.Down:return{...n,y:n.y+25};case G.Up:return{...n,y:n.y-25}}};class sr{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 Ve(Ae(n)),this.windowListeners=new Ve(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(ge)}handleKeyDown(t){if(en(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=or,coordinateGetter:c=Yo,scrollBehavior:l="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:ge;this.referenceCoordinates||(this.referenceCoordinates=g);const f=c(t,{active:n,context:r.current,currentCoordinates:g});if(f){const v=gt(f,g),p={x:0,y:0},{scrollableAncestors:x}=r.current;for(const b of x){const S=t.code,{isTop:O,isRight:R,isLeft:M,isBottom:I,maxScroll:k,minScroll:_}=nr(b),L=$o(b),z={x:Math.min(S===G.Right?L.right-L.width/2:L.right,Math.max(S===G.Right?L.left:L.left+L.width/2,f.x)),y:Math.min(S===G.Down?L.bottom-L.height/2:L.bottom,Math.max(S===G.Down?L.top:L.top+L.height/2,f.y))},H=S===G.Right&&!R||S===G.Left&&!M,B=S===G.Down&&!I||S===G.Up&&!O;if(H&&z.x!==f.x){const P=b.scrollLeft+v.x,Y=S===G.Right&&P<=k.x||S===G.Left&&P>=_.x;if(Y&&!v.y){b.scrollTo({left:P,behavior:l});return}Y?p.x=b.scrollLeft-P:p.x=S===G.Right?b.scrollLeft-k.x:b.scrollLeft-_.x,p.x&&b.scrollBy({left:-p.x,behavior:l});break}else if(B&&z.y!==f.y){const P=b.scrollTop+v.y,Y=S===G.Down&&P<=k.y||S===G.Up&&P>=_.y;if(Y&&!v.x){b.scrollTo({top:P,behavior:l});return}Y?p.y=b.scrollTop-P:p.y=S===G.Down?b.scrollTop-k.y:b.scrollTop-_.y,p.y&&b.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,ke(gt(f,this.referenceCoordinates),p))}}}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()}}sr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=or,onActivation:o}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Cn(e){return!!(e&&"distance"in e)}function Dn(e){return!!(e&&"delay"in e)}class rn{constructor(t,n,r){var o;r===void 0&&(r=No(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=Ae(c),this.documentListeners=new Ve(this.document),this.listeners=new Ve(r),this.windowListeners=new Ve(ae(c)),this.initialCoordinates=(o=Bt(i))!=null?o:ge,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,wn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,wn),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(Dn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Cn(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:i}=this,{onMove:c,options:{activationConstraint:l}}=i;if(!o)return;const u=(n=Bt(t))!=null?n:ge,d=gt(o,u);if(!r&&l){if(Cn(l)){if(l.tolerance!=null&&Ot(d,l.tolerance))return this.handleCancel();if(Ot(d,l.distance))return this.handleStart()}if(Dn(l)&&Ot(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===G.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 on extends rn{constructor(t){const{event:n}=t,r=Ae(n.target);super(t,Bo,r)}}on.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 Wo={move:{name:"mousemove"},end:{name:"mouseup"}};var Vt;(function(e){e[e.RightClick=2]="RightClick"})(Vt||(Vt={}));class Vo extends rn{constructor(t){super(t,Wo,Ae(t.event.target))}}Vo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Vt.RightClick?!1:(r?.({event:n}),!0)}}];const kt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ho extends rn{constructor(t){super(t,kt)}static setup(){return window.addEventListener(kt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(kt.move.name,t)};function t(){}}}Ho.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 He;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(He||(He={}));var mt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(mt||(mt={}));function Uo(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:c=5,order:l=mt.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:v}=e;const p=qo({delta:f,disabled:!i}),[x,b]=to(),S=h.useRef({x:0,y:0}),O=h.useRef({x:0,y:0}),R=h.useMemo(()=>{switch(n){case He.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case He.DraggableRect:return o}},[n,o,u]),M=h.useRef(null),I=h.useCallback(()=>{const _=M.current;if(!_)return;const L=S.current.x*O.current.x,z=S.current.y*O.current.y;_.scrollBy(L,z)},[]),k=h.useMemo(()=>l===mt.TreeOrder?[...d].reverse():d,[l,d]);h.useEffect(()=>{if(!i||!d.length||!R){b();return}for(const _ of k){if(r?.(_)===!1)continue;const L=d.indexOf(_),z=g[L];if(!z)continue;const{direction:H,speed:B}=Io(_,z,R,t,v);for(const P of["x","y"])p[P][H[P]]||(B[P]=0,H[P]=0);if(B.x>0||B.y>0){b(),M.current=_,x(I,c),S.current=B,O.current=H;return}}S.current={x:0,y:0},O.current={x:0,y:0},b()},[t,I,r,b,i,c,JSON.stringify(R),JSON.stringify(p),x,d,k,g,JSON.stringify(v)])}const Go={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Yt(t);return Ke(o=>{if(n||!r||!o)return Go;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||i.x===-1,[Q.Forward]:o.x[Q.Forward]||i.x===1},y:{[Q.Backward]:o.y[Q.Backward]||i.y===-1,[Q.Forward]:o.y[Q.Forward]||i.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 Ke(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Ko(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var Ht;(function(e){e.Optimized="optimized"})(Ht||(Ht={}));const jn=new Map;function Jo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,c]=h.useState(null),{frequency:l,measure:u,strategy:d}=o,g=h.useRef(e),f=S(),v=Ge(f),p=h.useCallback(function(O){O===void 0&&(O=[]),!v.current&&c(R=>R===null?O:R.concat(O.filter(M=>!R.includes(M))))},[v]),x=h.useRef(null),b=Ke(O=>{if(f&&!n)return jn;if(!O||O===jn||g.current!==e||i!=null){const R=new Map;for(let M of e){if(!M)continue;if(i&&i.length>0&&!i.includes(M.id)&&M.rect.current){R.set(M.id,M.rect.current);continue}const I=M.node.current,k=I?new nn(u(I),I):null;M.rect.current=k,k&&R.set(M.id,k)}return R}return O},[e,i,n,f,u]);return h.useEffect(()=>{g.current=e},[e]),h.useEffect(()=>{f||p()},[n,f]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{f||typeof l!="number"||x.current!==null||(x.current=setTimeout(()=>{p(),x.current=null},l))},[l,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:i!=null};function S(){switch(d){case qe.Always:return!1;case qe.BeforeDragging:return n;default:return!n}}}function ir(e,t){return Ke(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zo(e,t){return ir(e,t)}function Qo(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function yt(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function es(e){return new nn(Le(e),e)}function Rn(e,t,n){t===void 0&&(t=es);const[r,o]=h.useState(null);function i(){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=Qo({callback(u){if(e)for(const d of u){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=yt({callback:i});return ve(()=>{i(),e?(l?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),c?.disconnect())},[e]),r}function ts(e){const t=ir(e);return Jn(e,t)}const Mn=[];function ns(e){const t=h.useRef(e),n=Ke(r=>e?r&&r!==Mn&&e&&t.current&&e.parentNode===t.current.parentNode?r:tn(e):Mn,[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(i=>{const c=_t(i.target);c&&n(l=>l?(l.set(c,Wt(c)),new Map(l)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const l=e.map(u=>{const d=_t(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Wt(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{c(e),c(i)};function c(l){l.forEach(u=>{const d=_t(u);d?.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>ke(i,c),ge):rr(e):ge,[e,t])}function En(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==ge;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?gt(e,n.current):ge}function os(e){h.useEffect(()=>{if(!bt)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:i}=r;return n[o]=c=>{i(c,t)},n},{}),[e,t])}function ar(e){return h.useMemo(()=>e?To(e):null,[e])}const Tn=[];function is(e,t){t===void 0&&(t=Le);const[n]=e,r=ar(n?ae(n):null),[o,i]=h.useState(Tn);function c(){i(()=>e.length?e.map(u=>tr(u)?r:new nn(t(u),u)):Tn)}const l=yt({callback:c});return ve(()=>{l?.disconnect(),c(),e.forEach(u=>l?.observe(u))},[e]),o}function as(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xe(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(Xe(g)){r(f=>{const v=t(g);return f?{...f,width:v.width,height:v.height}:v});break}},[t]),i=yt({callback:o}),c=h.useCallback(d=>{const g=as(d);i?.disconnect(),g&&i?.observe(g),r(g?t(g):null)},[t,i]),[l,u]=ht(c);return h.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const cs=[{sensor:on,options:{}},{sensor:sr,options:{}}],us={current:{}},lt={draggable:{measure:Sn},droppable:{measure:Sn,strategy:qe.WhileDragging,frequency:Ht.Optimized},dragOverlay:{measure:Le}};class Ue 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 Ue,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:pt,windowRect:null,measuringScheduled:!1},fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pt,draggableNodes:new Map,over:null,measureDroppableContainers:pt},St=h.createContext(fs),lr=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 Ue}}}function gs(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.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 Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ue(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new Ue(e.droppable.containers);return c.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ue(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ps(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=h.useContext(St),i=Yt(r),c=Yt(n?.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!en(i)||document.activeElement===i.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=oo(g);if(f){f.focus();break}}})}},[r,t,o,c,i]),null}function ms(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function vs(e){return h.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function xs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=h.useRef(!1),{x:c,y:l}=typeof o=="boolean"?{x:o,y:o}:o;ve(()=>{if(!c&&!l||!t){i.current=!1;return}if(i.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=Jn(g,r);if(c||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const v=Zn(d);v&&v.scrollBy({top:f.y,left:f.x})}},[t,c,l,r,n])}const cr=h.createContext({...ge,scaleX:1,scaleY:1});var je;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(je||(je={}));const ur=h.memo(function(t){var n,r,o,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:g=cs,collisionDetection:f=wo,measuring:v,modifiers:p,...x}=t;const b=h.useReducer(gs,void 0,hs),[S,O]=b,[R,M]=uo(),[I,k]=h.useState(je.Uninitialized),_=I===je.Initialized,{draggable:{active:L,nodes:z,translate:H},droppable:{containers:B}}=S,P=L!=null?z.get(L):null,Y=h.useRef({initial:null,translated:null}),$=h.useMemo(()=>{var se;return L!=null?{id:L,data:(se=P?.data)!=null?se:us,rect:Y}:null},[L,P]),D=h.useRef(null),[w,C]=h.useState(null),[j,E]=h.useState(null),A=Ge(x,Object.values(x)),F=Je("DndDescribedBy",c),m=h.useMemo(()=>B.getEnabled(),[B]),T=vs(v),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:q}=Jo(m,{dragging:_,dependencies:[H.x,H.y],config:T.droppable}),X=Xo(z,L),U=h.useMemo(()=>j?Bt(j):null,[j]),K=Kr(),J=Zo(X,T.draggable.measure);xs({activeNode:L!=null?z.get(L):null,config:K.layoutShiftCompensation,initialRect:J,measure:T.draggable.measure});const V=Rn(X,T.draggable.measure,J),ie=Rn(X?X.parentElement:null),oe=h.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:z,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=oe.current.over)==null?void 0:n.id),xe=ls({measure:T.dragOverlay.measure}),Me=(r=xe.nodeRef.current)!=null?r:X,Ee=_?(o=xe.rect)!=null?o:V:null,ln=!!(xe.nodeRef.current&&xe.rect),cn=ts(ln?null:V),Rt=ar(Me?ae(Me):null),ye=ns(_?he??X:null),Qe=is(ye),et=ms(p,{transform:{x:H.x-cn.x,y:H.y-cn.y,scaleX:1,scaleY:1},activatorEvent:j,active:$,activeNodeRect:V,containerNodeRect:ie,draggingNodeRect:Ee,over:oe.current.over,overlayNodeRect:xe.rect,scrollableAncestors:ye,scrollableAncestorRects:Qe,windowRect:Rt}),un=U?ke(U,H):null,dn=rs(ye),Wr=En(dn),Vr=En(dn,[V]),Te=ke(et,Wr),_e=Ee?jo(Ee,et):null,Pe=$&&_e?f({active:$,collisionRect:_e,droppableRects:N,droppableContainers:m,pointerCoordinates:un}):null,fn=yo(Pe,"id"),[Se,hn]=h.useState(null),Hr=ln?et:ke(et,Vr),Ur=Co(Hr,(i=Se?.rect)!=null?i:null,V),Mt=h.useRef(null),gn=h.useCallback((se,le)=>{let{sensor:ce,options:we}=le;if(D.current==null)return;const de=z.get(D.current);if(!de)return;const ue=se.nativeEvent,pe=new ce({active:D.current,activeNode:de,event:ue,options:we,context:oe,onAbort(te){if(!z.get(te))return;const{onDragAbort:me}=A.current,be={id:te};me?.(be),R({type:"onDragAbort",event:be})},onPending(te,Ce,me,be){if(!z.get(te))return;const{onDragPending:Ne}=A.current,De={id:te,constraint:Ce,initialCoordinates:me,offset:be};Ne?.(De),R({type:"onDragPending",event:De})},onStart(te){const Ce=D.current;if(Ce==null)return;const me=z.get(Ce);if(!me)return;const{onDragStart:be}=A.current,ze={activatorEvent:ue,active:{id:Ce,data:me.data,rect:Y}};We.unstable_batchedUpdates(()=>{be?.(ze),k(je.Initializing),O({type:Z.DragStart,initialCoordinates:te,active:Ce}),R({type:"onDragStart",event:ze}),C(Mt.current),E(ue)})},onMove(te){O({type:Z.DragMove,coordinates:te})},onEnd:Oe(Z.DragEnd),onCancel:Oe(Z.DragCancel)});Mt.current=pe;function Oe(te){return async function(){const{active:me,collisions:be,over:ze,scrollAdjustedTranslate:Ne}=oe.current;let De=null;if(me&&Ne){const{cancelDrop:Fe}=A.current;De={activatorEvent:ue,active:me,collisions:be,delta:Ne,over:ze},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(De))&&(te=Z.DragCancel)}D.current=null,We.unstable_batchedUpdates(()=>{O({type:te}),k(je.Uninitialized),hn(null),C(null),E(null),Mt.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(De){const Et=A.current[Fe];Et?.(De),R({type:Fe,event:De})}})}}},[z]),Gr=h.useCallback((se,le)=>(ce,we)=>{const de=ce.nativeEvent,ue=z.get(we);if(D.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const pe={active:ue};se(ce,le.options,pe)===!0&&(de.dndKit={capturedBy:le.sensor},D.current=we,gn(ce,le))},[z,gn]),pn=Ko(g,Gr);os(g),ve(()=>{V&&I===je.Initializing&&k(je.Initialized)},[V,I]),h.useEffect(()=>{const{onDragMove:se}=A.current,{active:le,activatorEvent:ce,collisions:we,over:de}=oe.current;if(!le||!ce)return;const ue={active:le,activatorEvent:ce,collisions:we,delta:{x:Te.x,y:Te.y},over:de};We.unstable_batchedUpdates(()=>{se?.(ue),R({type:"onDragMove",event:ue})})},[Te.x,Te.y]),h.useEffect(()=>{const{active:se,activatorEvent:le,collisions:ce,droppableContainers:we,scrollAdjustedTranslate:de}=oe.current;if(!se||D.current==null||!le||!de)return;const{onDragOver:ue}=A.current,pe=we.get(fn),Oe=pe&&pe.rect.current?{id:pe.id,rect:pe.rect.current,data:pe.data,disabled:pe.disabled}:null,te={active:se,activatorEvent:le,collisions:ce,delta:{x:de.x,y:de.y},over:Oe};We.unstable_batchedUpdates(()=>{hn(Oe),ue?.(te),R({type:"onDragOver",event:te})})},[fn]),ve(()=>{oe.current={activatorEvent:j,active:$,activeNode:X,collisionRect:_e,collisions:Pe,droppableRects:N,draggableNodes:z,draggingNode:Me,draggingNodeRect:Ee,droppableContainers:B,over:Se,scrollableAncestors:ye,scrollAdjustedTranslate:Te},Y.current={initial:Ee,translated:_e}},[$,X,Pe,_e,z,Me,Ee,N,B,Se,ye,Te]),Uo({...K,delta:H,draggingRect:_e,pointerCoordinates:un,scrollableAncestors:ye,scrollableAncestorRects:Qe});const qr=h.useMemo(()=>({active:$,activeNode:X,activeNodeRect:V,activatorEvent:j,collisions:Pe,containerNodeRect:ie,dragOverlay:xe,draggableNodes:z,droppableContainers:B,droppableRects:N,over:Se,measureDroppableContainers:W,scrollableAncestors:ye,scrollableAncestorRects:Qe,measuringConfiguration:T,measuringScheduled:q,windowRect:Rt}),[$,X,V,j,Pe,ie,xe,z,B,N,Se,W,ye,Qe,T,q,Rt]),Xr=h.useMemo(()=>({activatorEvent:j,activators:pn,active:$,activeNodeRect:V,ariaDescribedById:{draggable:F},dispatch:O,draggableNodes:z,over:Se,measureDroppableContainers:W}),[j,pn,$,V,O,F,z,Se,W]);return h.createElement(Xn.Provider,{value:M},h.createElement(St.Provider,{value:Xr},h.createElement(lr.Provider,{value:qr},h.createElement(cr.Provider,{value:Ur},d)),h.createElement(ps,{disabled:l?.restoreFocus===!1})),h.createElement(go,{...l,hiddenTextDescribedById:F}));function Kr(){const se=w?.autoScrollEnabled===!1,le=typeof u=="object"?u.enabled===!1:u===!1,ce=_&&!se&&!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 i=Je(ys),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:v}=h.useContext(St),{role:p=_n,roleDescription:x="draggable",tabIndex:b=0}=o??{},S=u?.id===t,O=h.useContext(S?cr:bs),[R,M]=ht(),[I,k]=ht(),_=ss(c,t),L=Ge(n);ve(()=>(f.set(t,{id:t,key:i,node:R,activatorNode:I,data:L}),()=>{const H=f.get(t);H&&H.key===i&&f.delete(t)}),[f,t]);const z=h.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":S&&p===_n?!0:void 0,"aria-roledescription":x,"aria-describedby":g.draggable}),[r,p,b,S,x,g.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:z,isDragging:S,listeners:r?void 0:_,node:R,over:v,setNodeRef:M,setActivatorNodeRef:k,transform:O}}function ws(){return h.useContext(lr)}const Cs="Droppable",Ds={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Je(Cs),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=h.useContext(St),g=h.useRef({disabled:n}),f=h.useRef(!1),v=h.useRef(null),p=h.useRef(null),{disabled:x,updateMeasurementsFor:b,timeout:S}={...Ds,...o},O=Ge(b??r),R=h.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(O.current)?O.current:[O.current]),p.current=null},S)},[S]),M=yt({callback:R,disabled:x||!c}),I=h.useCallback((z,H)=>{M&&(H&&(M.unobserve(H),f.current=!1),z&&M.observe(z))},[M]),[k,_]=ht(I),L=Ge(t);return h.useEffect(()=>{!M||!k.current||(M.disconnect(),f.current=!1,M.observe(k.current))},[k,M]),h.useEffect(()=>(l({type:Z.RegisterDroppable,element:{id:r,key:i,disabled:n,node:k,rect:v,data:L}}),()=>l({type:Z.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==g.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:i,disabled:n}),g.current.disabled=n)},[r,i,n,l]),{active:c,rect:v,isOver:u?.id===r,node:k,over:u,setNodeRef:_}}function wt(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 i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function nt(e){return e!==null&&e>=0}function Ms(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 Es(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const rt={scaleX:1,scaleY:1},Ts=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:c}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=_s(n,c,o);if(c===o){const d=n[i];return d?{x:o<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...rt}:null}return c>o&&c<=i?{x:-l.width-u,y:0,...rt}:c<o&&c>=i?{x:l.width+u,y:0,...rt}:{x:0,y:0,...rt}};function _s(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const dr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=wt(t,r,n),c=t[o],l=i[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}},ot={scaleX:1,scaleY:1},Os=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:c}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const d=i[c];return d?{x:0,y:n<c?d.top+d.height-(l.top+l.height):d.top-l.top,...ot}:null}const u=ks(i,o,n);return o>n&&o<=c?{x:0,y:-l.height-u,...ot}:o<n&&o>=c?{x:0,y:l.height+u,...ot}:{x:0,y:0,...ot}};function ks(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const fr="Sortable",hr=h.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function gr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:i=!1}=e;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:g}=ws(),f=Je(fr,n),v=l.rect!==null,p=h.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),x=c!=null,b=c?p.indexOf(c.id):-1,S=d?p.indexOf(d.id):-1,O=h.useRef(p),R=!Ms(p,O.current),M=S!==-1&&b===-1||R,I=Es(i);ve(()=>{R&&x&&g(p)},[R,p,x,g]),h.useEffect(()=>{O.current=p},[p]);const k=h.useMemo(()=>({activeIndex:b,containerId:f,disabled:I,disableTransforms:M,items:p,overIndex:S,useDragOverlay:v,sortedRects:Rs(p,u),strategy:o}),[b,f,I.draggable,I.droppable,M,p,S,u,v,o]);return h.createElement(hr.Provider,{value:k},t)}const Is=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return wt(n,r,o).indexOf(t)},$s=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=e;return!d||!r||l!==i&&o===c?!1:n?!0:c!==o&&t===u},As={duration:200,easing:"ease"},pr="transform",Ls=Ie.Transition.toString({property:pr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function zs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=h.useState(null),l=h.useRef(n);return ve(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const d=Le(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(()=>{i&&c(null)},[i]),i}function mr(e){let{animateLayoutChanges:t=$s,attributes:n,disabled:r,data:o,getNewIndex:i=Is,id:c,strategy:l,resizeObserverConfig:u,transition:d=As}=e;const{items:g,containerId:f,activeIndex:v,disabled:p,disableTransforms:x,sortedRects:b,overIndex:S,useDragOverlay:O,strategy:R}=h.useContext(hr),M=Ns(r,p),I=g.indexOf(c),k=h.useMemo(()=>({sortable:{containerId:f,index:I,items:g},...o}),[f,o,I,g]),_=h.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:L,node:z,isOver:H,setNodeRef:B}=js({id:c,data:k,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...u}}),{active:P,activatorEvent:Y,activeNodeRect:$,attributes:D,setNodeRef:w,listeners:C,isDragging:j,over:E,setActivatorNodeRef:A,transform:F}=Ss({id:c,data:k,attributes:{...Ps,...n},disabled:M.draggable}),m=eo(B,w),T=!!P,N=T&&!x&&nt(v)&&nt(S),W=!O&&j,q=W&&N?F:null,U=N?q??(l??R)({rects:b,activeNodeRect:$,activeIndex:v,overIndex:S,index:I}):null,K=nt(v)&&nt(S)?i({id:c,items:g,activeIndex:v,overIndex:S}):I,J=P?.id,V=h.useRef({activeId:J,items:g,newIndex:K,containerId:f}),ie=g!==V.current.items,oe=t({active:P,containerId:f,isDragging:j,isSorting:T,id:c,index:I,items:g,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:d,wasDragging:V.current.activeId!=null}),he=zs({disabled:!oe,index:I,node:z,rect:L});return h.useEffect(()=>{T&&V.current.newIndex!==K&&(V.current.newIndex=K),f!==V.current.containerId&&(V.current.containerId=f),g!==V.current.items&&(V.current.items=g)},[T,K,f,g]),h.useEffect(()=>{if(J===V.current.activeId)return;if(J!=null&&V.current.activeId==null){V.current.activeId=J;return}const Me=setTimeout(()=>{V.current.activeId=J},50);return()=>clearTimeout(Me)},[J]),{active:P,activeIndex:v,attributes:D,data:k,rect:L,index:I,newIndex:K,items:g,isOver:H,isSorting:T,isDragging:j,listeners:C,node:z,overIndex:S,over:E,setNodeRef:m,setActivatorNodeRef:A,setDroppableNodeRef:B,setDraggableNodeRef:w,transform:he??U,transition:xe()};function xe(){if(he||ie&&V.current.newIndex===I)return Ls;if(!(W&&!en(Y)||!d)&&(T||oe))return Ie.Transition.toString({...d,property:pr})}}function Ns(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}}G.Down,G.Right,G.Up,G.Left;var st={exports:{}},It={},it={exports:{}},$t={};var On;function Fs(){if(On)return $t;On=1;var e=h;function t(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,c=e.useDebugValue;function l(f,v){var p=v(),x=r({inst:{value:p,getSnapshot:v}}),b=x[0].inst,S=x[1];return i(function(){b.value=p,b.getSnapshot=v,u(b)&&S({inst:b})},[f,p,v]),o(function(){return u(b)&&S({inst:b}),f(function(){u(b)&&S({inst:b})})},[f]),c(p),p}function u(f){var v=f.getSnapshot;f=f.value;try{var p=v();return!n(f,p)}catch{return!0}}function d(f,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,$t}var At={};var kn;function Ys(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}function t(p,x){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 b=x();if(!f){var S=x();i(b,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=c({inst:{value:b,getSnapshot:x}});var O=S[0].inst,R=S[1];return u(function(){O.value=b,O.getSnapshot=x,n(O)&&R({inst:O})},[p,b,x]),l(function(){return n(O)&&R({inst:O}),p(function(){n(O)&&R({inst:O})})},[p]),d(b),b}function n(p){var x=p.getSnapshot;p=p.value;try{var b=x();return!i(p,b)}catch{return!0}}function r(p,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,i=typeof Object.is=="function"?Object.is:e,c=o.useState,l=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,g=!1,f=!1,v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;At.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var In;function vr(){return In||(In=1,process.env.NODE_ENV==="production"?it.exports=Fs():it.exports=Ys()),it.exports}var $n;function Bs(){if($n)return It;$n=1;var e=h,t=vr();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,i=e.useRef,c=e.useEffect,l=e.useMemo,u=e.useDebugValue;return It.useSyncExternalStoreWithSelector=function(d,g,f,v,p){var x=i(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=l(function(){function O(_){if(!R){if(R=!0,M=_,_=v(_),p!==void 0&&b.hasValue){var L=b.value;if(p(L,_))return I=L}return I=_}if(L=I,r(M,_))return L;var z=v(_);return p!==void 0&&p(L,z)?(M=_,L):(M=_,I=z)}var R=!1,M,I,k=f===void 0?null:f;return[function(){return O(g())},k===null?void 0:function(){return O(k())}]},[g,f,v,p]);var S=o(d,x[0],x[1]);return c(function(){b.hasValue=!0,b.value=S},[S]),u(S),S},It}var Lt={};var An;function Ws(){return An||(An=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=vr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;Lt.useSyncExternalStoreWithSelector=function(d,g,f,v,p){var x=i(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=l(function(){function O(_){if(!R){if(R=!0,M=_,_=v(_),p!==void 0&&b.hasValue){var L=b.value;if(p(L,_))return I=L}return I=_}if(L=I,r(M,_))return L;var z=v(_);return p!==void 0&&p(L,z)?(M=_,L):(M=_,I=z)}var R=!1,M,I,k=f===void 0?null:f;return[function(){return O(g())},k===null?void 0:function(){return O(k())}]},[g,f,v,p]);var S=o(d,x[0],x[1]);return c(function(){b.hasValue=!0,b.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())})()),Lt}var Ln;function Vs(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?st.exports=Bs():st.exports=Ws()),st.exports}var Hs=Vs();const Ut=new WeakMap,Us=new WeakMap,vt={current:[]};let Pt=!1;const at=new Set,Pn=new Map;function xr(e){for(const t of e){if(vt.current.includes(t))continue;vt.current.push(t),t.recompute();const n=Us.get(t);if(n)for(const r of n){const o=Ut.get(r);o?.length&&xr(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(at.add(e),!Pt)try{for(Pt=!0;at.size>0;){const t=Array.from(at);at.clear();for(const n of t){const r=Pn.get(n)??n.prevState;n.prevState=r,Gs(n)}for(const n of t){const r=Ut.get(n);r&&(vt.current.push(n),xr(r))}for(const n of t){const r=Ut.get(n);if(r)for(const o of r)qs(o)}}}finally{Pt=!1,vt.current=[],Pn.clear()}}function Ks(e){return typeof e=="function"}class Js{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,i;this.listeners.add(r);const c=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.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):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 Ze(e,t=r=>r,n={}){const r=n.equal??Zs;return Hs.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=zn(e);if(n.length!==zn(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 zn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function Qs(e,t,n){return e.map((r,o)=>{const i={};return t.forEach(c=>{i[c.id]=ei(r[c.id])}),{__key:r.id??o,__raw:r,cells:i}})}function ei(e){return e==null?"—":h.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="boolean"?e?"Yes":"No":e instanceof Date?e.toLocaleDateString():Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}const re=new Js({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],columnWidths:{},data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}}),Ct=e=>`datatable:${e}:column-widths`;function br(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:i}=re.state,c=JSON.parse(localStorage.getItem(wr(i))||"[]"),l=[...c.map(f=>o.find(v=>v.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],u=JSON.parse(localStorage.getItem(Cr(i))||"{}"),d=l.reduce((f,v)=>(f[v.id]=u[v.id]??!0,f),{}),g=JSON.parse(localStorage.getItem(Ct(i))||"{}");re.setState(f=>({...f,data:e,columnOrder:l,visibility:d,columnWidths:g,sortableColumns:l.map(v=>({id:v.id,label:v.label,sortable:!0,backgroundColor:v.backgroundColor,minWidth:v.minWidth}))}))}function yr(e){re.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const Sr=e=>{re.setState(t=>({...t,actionsConfig:e}))};function ti(e,t){re.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const wr=e=>`table_column_order_v1:${e}`,Cr=e=>`table_column_visibility_v1:${e}`,ni=e=>{const{tableId:t}=re.state;localStorage.setItem(wr(t),JSON.stringify(e.map(n=>n.id))),re.setState(n=>({...n,columnOrder:e})),re.setState(n=>({...n,columnOrder:e}))};function ri(e){re.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const oi=e=>{re.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Cr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};function si(e,t){re.setState(n=>{const r=n.columnOrder.find(c=>c.id===e),o=typeof r?.minWidth=="number"?r.minWidth:120,i={...n.columnWidths,[e]:Math.max(o,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(i)),{...n,columnWidths:i}})}const ii=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ai=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Nn=e=>{const t=ai(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),li=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ci={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 ui=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:c,...l},u)=>h.createElement("svg",{ref:u,...ci,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Dr("lucide",o),...!i&&!li(l)&&{"aria-hidden":"true"},...l},[...c.map(([d,g])=>h.createElement(d,g)),...Array.isArray(i)?i:[i]]));const ee=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(ui,{ref:i,iconNode:t,className:Dr(`lucide-${ii(Nn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Nn(e),n};const di=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],fi=ee("arrow-down",di);const hi=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],gi=ee("arrow-left-right",hi);const pi=[["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"}]],mi=ee("arrow-up-down",pi);const vi=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xi=ee("arrow-up",vi);const bi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],yi=ee("bookmark",bi);const Si=[["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"}]],jr=ee("calendar",Si);const wi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ci=ee("chevron-left",wi);const Di=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ji=ee("chevron-right",Di);const Ri=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Mi=ee("columns-2",Ri);const Ei=[["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"}]],Ti=ee("delete",Ei);const _i=[["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"}]],Oi=ee("ellipsis",_i);const ki=[["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"}]],Ii=ee("funnel",ki);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"}]],Rr=ee("grip-vertical",$i);const Ai=[["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"}]],Li=ee("pen",Ai);const Pi=[["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"}]],zi=ee("refresh-ccw",Pi);const Ni=[["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"}]],Fi=ee("settings",Ni);const Yi=[["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"}]],Mr=ee("triangle-alert",Yi);const Bi=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Er=ee("x",Bi);function y(e){return h.forwardRef((t,n)=>{const{children:r,...o}=t;return s.jsx(e,{ref:n,...o,children:r})})}const Wi=y(a.Menu.Trigger),Vi=y(a.Menu.Positioner),Hi=y(a.Menu.Content),Ui=y(a.Menu.Item),Gi=y(a.Checkbox.Label),qi=y(a.Checkbox.HiddenInput),Xi=y(a.Checkbox.Control);function Ki({visibility:e,onToggle:t}){const{sortableColumns:n}=Ze(re);return s.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[s.jsx(Wi,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:s.jsx(Mi,{size:18})})}),s.jsx(a.Portal,{children:s.jsx(Vi,{children:s.jsx(Hi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return s.jsx(Ui,{value:r.id,closeOnSelect:!1,children:s.jsxs(a.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[s.jsx(qi,{}),s.jsx(Xi,{}),s.jsx(Gi,{children:r.label})]})},r.id)})})})})]})}function Ji({id:e,children:t,onClick:n,cursor:r,borderRight:o,backgroundColor:i,minW:c}){const{columnWidths:l}=Ze(re),u=l[e],d=h.useRef(0),g=h.useRef(0),{setNodeRef:f,attributes:v,listeners:p,transform:x,transition:b}=mr({id:e}),S=M=>{M.stopPropagation(),d.current=M.clientX,g.current=u??150;const I=_=>{si(e,g.current+(_.clientX-d.current))},k=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",I),document.addEventListener("mouseup",k)},[O,R]=h.useState(!1);return s.jsx(a.Table.ColumnHeader,{ref:f,onClick:n,backgroundColor:i,w:u?`${u}px`:void 0,minW:c,style:{transform:Ie.Transform.toString(x),transition:b,cursor:r,borderRight:o},...v,children:s.jsxs(a.HStack,{position:"relative",children:[s.jsx("span",{...p,children:s.jsx(Rr,{size:12,style:{cursor:"grab"}})}),t,s.jsx(a.Box,{position:"absolute",right:0,top:0,h:"100%",w:"10px",cursor:"col-resize",onMouseDown:S,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,children:O&&s.jsx(gi,{size:14,style:{pointerEvents:"none",opacity:.8}})})]})})}function Zi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:i}=Ze(re),c=e.map(l=>o.find(u=>u.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]);return s.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:s.jsxs(a.Table.Row,{height:"28px",children:[i?.showSNo&&s.jsx(a.Table.ColumnHeader,{width:"80px",minW:80,maxW:80,textAlign:"center",backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.indexChildren||"S.No"}),c.map(l=>{const u=n===l?.id,d=l.minWidth;return s.jsx(Ji,{id:l?.id,onClick:()=>l?.sortable&&ri(l?.id),borderRight:"2px solid #dcdcdc",backgroundColor:l?.backgroundColor,minW:d,children:s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l.label,l?.sortable&&(u?r==="asc"?s.jsx(xi,{size:14}):s.jsx(fi,{size:14}):s.jsx(mi,{size:14,opacity:.4}))]})},l?.id)}),i?.showActionColumn&&s.jsx(a.Table.ColumnHeader,{width:i.width,backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.children||"Actions"}),i?.showColumnVisibilityMenu&&s.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:i.backgroundColorColumnVisibilityMenu,width:"50px",children:s.jsx(Ki,{visibility:t,onToggle:oi})})]})})}const Qi=[10,20,50,100],ea=y(a.Select.Positioner),ta=y(a.Select.Content),na=y(a.Select.Item),ra=y(a.Pagination.PrevTrigger),oa=y(a.Pagination.NextTrigger),sa=y(a.Select.HiddenSelect),ia=y(a.Select.Control),aa=y(a.Select.Trigger),la=y(a.Select.ValueText),ca=y(a.Select.IndicatorGroup),ua=y(a.Select.Indicator);function da({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:i=2,pageSizeOptions:c=Qi}){const l=a.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return s.jsx(a.Box,{width:"100%",children:s.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[s.jsxs(a.HStack,{children:[s.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),s.jsxs(a.Select.Root,{collection:l,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[s.jsx(sa,{}),s.jsxs(ia,{children:[s.jsx(aa,{children:s.jsx(la,{placeholder:""})}),s.jsx(ca,{children:s.jsx(ua,{})})]}),s.jsx(a.Portal,{children:s.jsx(ea,{children:s.jsx(ta,{children:l.items.map(u=>s.jsxs(na,{item:u.value,children:[u.label,s.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]}),s.jsxs(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),s.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:i,onPageChange:u=>r&&r(u.page),children:s.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[s.jsx(ra,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Previous page",children:s.jsx(Ci,{size:18})})}),s.jsx(a.Pagination.Items,{render:u=>s.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)}),s.jsx(oa,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Next page",children:s.jsx(ji,{size:18})})})]})})]})})}const fa=y(a.Menu.Item),ha=y(a.Menu.Content),ga=y(a.Menu.Positioner),pa=y(a.Menu.Trigger);function ma({data:e=[],actions:t,actionConfig:n,onRowSelect:r,onRowSelectEvent:o="left",startIndex:i=0}){const{columnOrder:c,visibility:l,columnWidths:u}=Ze(re);return s.jsx(a.Table.Body,{children:e?.map((d,g)=>s.jsxs(a.Table.Row,{onClick:()=>o==="left"&&d.__raw&&r?.(d.__raw),_hover:{bg:"blue.50"},onContextMenu:o==="right"?f=>{f.preventDefault(),d.__raw&&r?.(d.__raw,f)}:void 0,children:[n?.showSNo&&s.jsx(a.Table.Cell,{textAlign:"center",fontWeight:"medium",children:i+g+1}),c.filter(f=>l[f.id]).map(f=>{const v=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth;return s.jsx(a.Table.Cell,{w:u[f.id]?`${u[f.id]}px`:void 0,minW:`${v}px`,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:d[f.id]},f.id)}),n?.showActionColumn&&s.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:s.jsxs(a.Menu.Root,{children:[s.jsx(pa,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:s.jsx(Oi,{size:16})})}),s.jsx(ga,{children:s.jsx(ha,{children:t?.filter(f=>typeof f.visible=="function"?d.__raw&&f.visible(d.__raw):f.visible!==!1).map(f=>s.jsxs(fa,{onClick:()=>d.__raw&&f.onClick(d.__raw),colorScheme:f.colorScheme,value:f.label,children:[f.icon,f.label]},f.label))})})]})}),n?.showColumnVisibilityMenu&&s.jsx(a.Table.Cell,{})]},d.__key||d.id))})}function va({rows:e=6,columns:t}){return s.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>s.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,i)=>s.jsx(a.Table.Cell,{children:s.jsx(a.Skeleton,{height:"25px"})},i))},r))})}function xa({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:i=!1,emptyMessage:c="No data",actions:l,page:u=1,pageSize:d=10,onPageChange:g,onPageSizeChange:f,density:v="sm",totalCount:p=0,actionConfig:x,pageSizeOptions:b,onRowSelect:S,onRowSelectEvent:O="left"}){h.useEffect(()=>{yr(e)},[e]),h.useEffect(()=>{br(t,n)},[t,n]),h.useEffect(()=>{x&&Sr(x)},[x]);const{sortColumn:R,sortDirection:M,data:I,columnOrder:k}=Ze(re),_=h.useMemo(()=>{const $=[...I];return R&&$.sort((D,w)=>M==="asc"?String(D[R]).localeCompare(String(w[R])):String(w[R]).localeCompare(String(D[R]))),$},[I,R,M,u,d]),L=h.useMemo(()=>(Math.max(1,u||1)-1)*d,[u,d]);h.useEffect(()=>{u<1&&g&&g(1)},[u,g]);const z=$=>{const{active:D,over:w}=$;if(!w||D.id===w.id)return;const C=k.findIndex(A=>A.id===D.id),j=k.findIndex(A=>A.id===w.id),E=wt(k,C,j);ni(E)},H=r&&!i,B=i&&!r,P=!r&&!i&&_.length===0,Y=h.useMemo(()=>Qs(_,k),[_,k]);return s.jsx(ur,{collisionDetection:Kn,onDragEnd:z,children:s.jsx(gr,{items:k.map($=>$.id),strategy:Ts,children:s.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[s.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflowX:"auto",overflowY:"auto",children:[H&&s.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??s.jsx(a.Spinner,{})}),s.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:v,tableLayout:"fixed",minW:"max-content",children:[s.jsx(Zi,{}),B?s.jsx(va,{rows:d,columns:n.length+(l?2:0)}):P?s.jsx(a.Table.Body,{children:s.jsx(a.Table.Row,{children:s.jsx(a.Table.Cell,{colSpan:n.length+(l?1:0),children:s.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):s.jsx(ma,{data:Y,actions:l,actionConfig:x,onRowSelect:S,startIndex:L,onRowSelectEvent:O})]},e)]}),s.jsx(a.Box,{mt:.5,children:s.jsx(da,{totalCount:p,pageSize:d,currentPage:u,onPageChange:g,onPageSizeChange:$=>{f?.($),u>1&&g?.(1)},pageSizeOptions:b})})]})})})}const ne=[];for(let e=0;e<256;++e)ne.push((e+256).toString(16).slice(1));function ba(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}let zt;const ya=new Uint8Array(16);function Sa(){if(!zt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zt=crypto.getRandomValues.bind(crypto)}return zt(ya)}const wa=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fn={randomUUID:wa};function Ca(e,t,n){e=e||{};const r=e.random??e.rng?.()??Sa();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ba(r)}function Da(e,t,n){return Fn.randomUUID&&!e?Fn.randomUUID():Ca(e)}const ja=y(a.Checkbox.Root),Ra=y(a.Checkbox.HiddenInput),Ma=y(a.Checkbox.Control),Ea=y(a.Checkbox.Label),Tr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:i,required:c,errorText:l})=>s.jsxs(ja,{value:e,onChange:t,size:n,children:[s.jsx(Ra,{}),s.jsx(Ma,{disabled:i,required:c,errorText:l,helperText:o}),r&&s.jsx(Ea,{children:r})]}),Ta=y(a.Combobox.Root),_a=y(a.Combobox.Control),Oa=y(a.Combobox.Input),ka=y(a.Combobox.IndicatorGroup),Ia=y(a.Combobox.ClearTrigger),$a=y(a.Combobox.Trigger),Aa=y(a.Combobox.Positioner),La=y(a.Combobox.Content);function _r({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:i,itemToValue:c,renderItem:l,value:u,loading:d,error:g,errorMessage:f,placeholder:v,helpText:p,onInputChange:x,onSelect:b,visible:S=!0,rootProps:O,inputProps:R,controlProps:M,contentProps:I,itemProps:k}){const[_,L]=h.useState(""),z=h.useMemo(()=>Array.isArray(o)?o:[],[o]),{collection:H,set:B}=a.useListCollection({initialItems:z,itemToString:i,itemToValue:c}),P=h.useMemo(()=>{if(!_)return z;const Y=_.toLowerCase();return z.filter($=>i($).toLowerCase().includes(Y))},[o,_,i]);return h.useEffect(()=>{B(P)},[P,B]),h.useEffect(()=>{u&&L(i(u))},[u,i]),s.jsxs(Ta,{width:n,size:t,variant:r,collection:H,placeholder:v,onInputValueChange:Y=>{x?.(Y.inputValue),L(Y.inputValue)},value:u?[c(u)]:[],onValueChange:Y=>{const $=Y.value?.[0];if(!$)return;const D=H.items.find(w=>c(w)===$);D&&b?.(D)},positioning:{sameWidth:!1,placement:"bottom-start"},...O,children:[S&&e&&s.jsx(a.Text,{fontSize:"sm",children:e}),s.jsxs(_a,{...M,children:[s.jsx(Oa,{placeholder:v??"Type to search",...R}),s.jsxs(ka,{children:[s.jsx(Ia,{}),s.jsx($a,{})]})]}),s.jsx(Aa,{children:s.jsxs(La,{minW:"sm",...I,children:[d?s.jsxs(a.HStack,{p:"2",children:[s.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),s.jsx(a.Span,{children:"Loading..."})]}):g?s.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):H.items.map(Y=>s.jsxs(a.Combobox.Item,{item:Y,...k,children:[l(Y),s.jsx(a.Combobox.ItemIndicator,{})]},c(Y))),p&&!g&&!d&&s.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:p})]})})]})}const Pa=y(a.Popover.Root),za=y(a.Popover.Content),Na=y(a.Popover.Arrow),Fa=y(a.Popover.Trigger),Ya=y(a.Popover.Positioner);function Re(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Yn(e){const t=e.split(/\s+to\s+/i),n=t[0],r=t[1],o=l=>{if(!l)return null;const u=l.trim().split("-");if(u.length!==3)return null;const[d,g,f]=u,v=parseInt(d),p=parseInt(g)-1,x=parseInt(f);if(isNaN(v)||isNaN(p)||isNaN(x)||f.length!==4)return null;const b=new Date(x,p,v);return b.getDate()===v&&b.getMonth()===p?b:null},i=o(n),c=o(r);return{start:i,end:c}}function Or({startDate:e,endDate:t,onChange:n,width:r="280px",showLabel:o=!0,label:i="Select date range",visible:c=!0}){const[l,u]=h.useState(!1),[d,g]=h.useState(e||new Date),[f,v]=h.useState(null),[p,x]=h.useState(e||null),[b,S]=h.useState(t||null),O=(Y,$)=>Y&&$?`${Re(Y)} to ${Re($)}`:Y?`${Re(Y)}`:"",[R,M]=h.useState(O(e,t));h.useEffect(()=>{x(e||null),S(t||null)},[e,t]);const I=new Date(d.getFullYear(),d.getMonth()+1,0).getDate(),k=new Date(d.getFullYear(),d.getMonth(),1).getDay(),_=()=>{g(new Date(d.getFullYear(),d.getMonth()-1,1))},L=()=>{g(new Date(d.getFullYear(),d.getMonth()+1,1))},z=Y=>{const $=new Date(d.getFullYear(),d.getMonth(),Y);if(!p||p&&b){x($),S(null),n($,null),M(Re($));return}if(p&&!b){const D=$<p?$:p,w=$<p?p:$;x(D),S(w),n(D,w),M(`${Re(D)} to ${Re(w)}`),u(!1)}},H=Y=>{const $=Y.target.value;M($);const{start:D,end:w}=Yn($);if(D&&w){const C=D<w?D:w,j=D<w?w:D;n(C,j),g(C)}else D&&!$.toLowerCase().includes("to")&&n(D,null)},B=Y=>{if(Y.key!=="Enter")return;const{start:$,end:D}=Yn(R);if($&&!D&&!R.toLowerCase().includes("to")){const w=`${Re($)} to `;M(w),x($),S(null),n($,null),requestAnimationFrame(()=>{Y.target.setSelectionRange(w.length,w.length)});return}if($&&D){const w=$<D?$:D,C=$<D?D:$;x(w),S(C),n(w,C),u(!1)}},P=()=>{x(null),S(null),M(""),n(null,null)};return s.jsxs(a.Box,{width:r,onKeyDown:B,children:[o&&!c&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:i}),s.jsxs(Pa,{open:l,onOpenChange:Y=>u(Y.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[s.jsx(a.Input,{placeholder:"DD-MM-YYYY to DD-MM-YYYY",value:R,onChange:H,size:"sm",autoComplete:"off"}),R&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:P,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",children:s.jsx(Er,{size:14})}),s.jsx(Fa,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Ya,{children:s.jsxs(za,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Na,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:_,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:d.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:L,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((Y,$)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:Y},`${Y}-${$}`)),Array(k).fill(null).map((Y,$)=>s.jsx(a.Box,{},`empty-${$}`)),Array.from({length:I},(Y,$)=>{const D=$+1,w=new Date(d.getFullYear(),d.getMonth(),D);let C=e,j=t;if(C&&j&&f)if(e&&t){const W=e.getTime()+(t.getTime()-e.getTime())/2;f.getTime()<=W?C=f:j=f,C>j&&([C,j]=[j,C])}else e&&!t&&(C=f<e?f:e,j=f<e?e:f);const E=C&&w.getTime()===C.getTime(),A=j&&w.getTime()===j.getTime(),F=C&&j&&w>C&&w<j;let m="transparent",T="gray";E||A?T="blue":F&&(m="blue.100");let N="md";return F&&(N="0"),E&&j&&(N=A?"md":"md 0 0 md"),A&&C&&(N=E?"md":"0 md md 0"),s.jsx(a.Button,{size:"xs",variant:"ghost",colorPalette:T,bg:m!=="transparent"?m:void 0,onClick:()=>z(D),onMouseEnter:()=>v(w),onMouseLeave:()=>v(null),minW:"32px",h:"32px",fontSize:"xs",borderRadius:N,_hover:{bg:E||A?void 0:"gray.100"},children:D},D)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Select Start Date then End Date"})]})})]})]})}const Ba=y(a.Popover.Root),Wa=y(a.Popover.Content),Va=y(a.Popover.Arrow),Ha=y(a.Popover.Trigger),Ua=y(a.Popover.Positioner);function Bn(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Ga(e){const t=e.split("-");if(t.length!==3)return null;const[n,r,o]=t,i=parseInt(n),c=parseInt(r)-1,l=parseInt(o);if(isNaN(i)||isNaN(c)||isNaN(l)||o.length!==4)return null;const u=new Date(l,c,i);return u.getDate()===i&&u.getMonth()===c?u:null}function kr({value:e,onChange:t,width:n="220px",visible:r=!0,label:o="Select date"}){const[i,c]=h.useState(!1),[l,u]=h.useState(e||new Date),[d,g]=h.useState(Bn(e));h.useEffect(()=>{g(Bn(e))},[e]);const f=new Date(l.getFullYear(),l.getMonth()+1,0).getDate(),v=new Date(l.getFullYear(),l.getMonth(),1).getDay(),p=()=>{u(new Date(l.getFullYear(),l.getMonth()-1,1))},x=()=>{u(new Date(l.getFullYear(),l.getMonth()+1,1))},b=R=>{const M=new Date(l.getFullYear(),l.getMonth(),R);t(M),c(!1)},S=R=>{if(i)switch(R.key){case"ArrowLeft":p();break;case"ArrowRight":x();break;case"Escape":c(!1);break}},O=()=>{g(""),t(null)};return s.jsxs(a.Box,{width:n,onKeyDown:S,children:[!r&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:o}),s.jsxs(Ba,{open:i,onOpenChange:R=>c(R.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[d&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:O,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",zIndex:1,children:s.jsx(Er,{size:14})}),s.jsx(a.Input,{placeholder:"DD-MM-YYYY",value:d,onChange:R=>{const M=R.target.value;g(M);const I=Ga(M);I&&(t(I),u(I))},size:"sm",autoComplete:"off"}),s.jsx(Ha,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Ua,{children:s.jsxs(Wa,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Va,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:p,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:l.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:x,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((R,M)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:R},`${R}-${M}`)),Array(v).fill(null).map((R,M)=>s.jsx(a.Box,{},`empty-${M}`)),Array.from({length:f},(R,M)=>{const I=M+1,k=e&&e.getDate()===I&&e.getMonth()===l.getMonth()&&e.getFullYear()===l.getFullYear();return s.jsx(a.Button,{size:"xs",variant:k?"solid":"ghost",colorPalette:k?"blue":"gray",onClick:()=>b(I),minW:"32px",h:"32px",fontSize:"xs",borderRadius:"md",children:I},I)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Use Arrow Keys to change months • Esc to close"})]})})]})]})}const qa=y(a.Field.Root),Xa=y(a.Field.Label),Ka=y(a.Field.HelperText),Ja=y(a.Field.ErrorText),Gt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:i="outline",width:c="100%",label:l,helperText:u,isDisabled:d=!1,required:g=!1,errorText:f,visible:v,type:p="text",min:x=0,max:b=100,step:S=1})=>s.jsxs(qa,{width:c,children:[v&&s.jsx(Xa,{children:l}),s.jsx(a.InputGroup,{startElement:e,children:s.jsx(a.Input,{value:t,onChange:O=>n?.(O.target.value),placeholder:r,size:o,type:p,variant:i,disabled:d,required:g,min:x,max:b,step:S})}),f&&s.jsx(Ja,{fontSize:"xs",children:f}),u&&s.jsx(Ka,{fontSize:"xs",children:u})]}),Za=y(a.Field.Root),Qa=y(a.Field.HelperText),el=y(a.Field.ErrorText),tl=y(a.Select.Root),nl=y(a.Select.Label),rl=y(a.Select.Control),ol=y(a.Select.Trigger),sl=y(a.Select.ValueText),il=y(a.Select.IndicatorGroup),al=y(a.Select.Indicator),ll=y(a.Select.Content),cl=y(a.Select.Item),ul=y(a.Select.ItemIndicator),dl=y(a.Select.HiddenSelect),fl=y(a.Select.Positioner),Ir=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:i="xs",width:c="100%",variant:l="outline",helperText:u,isDisabled:d,required:g,errorText:f,visible:v})=>{const p=h.useMemo(()=>a.createListCollection({items:e}),[e]),x=e.find(S=>S.value===n),b=S=>{S.preventDefault(),S.stopPropagation(),r?.(void 0)};return s.jsxs(Za,{disabled:d,required:g,children:[s.jsxs(tl,{collection:p,variant:l,size:i,width:c,value:n?[n]:[],onValueChange:S=>{r?.(S.value[0])},children:[s.jsx(dl,{}),v&&s.jsx(nl,{children:t}),s.jsxs(rl,{children:[s.jsx(ol,{children:s.jsx(sl,{placeholder:o,children:x?.displayValue??x?.label})}),s.jsxs(il,{children:[n&&!d&&s.jsx("div",{style:{pointerEvents:"auto",display:"flex",alignItems:"center"},onPointerDown:S=>S.stopPropagation(),onClick:S=>S.stopPropagation(),children:s.jsx(a.CloseButton,{size:"sm",variant:"ghost",onPointerDown:b,onClick:b,position:"relative",zIndex:10})}),s.jsx(al,{})]})]}),s.jsx(fl,{children:s.jsx(ll,{children:p.items.map((S,O)=>s.jsxs(cl,{item:S,children:[S.label,s.jsx(ul,{})]},O))})})]}),u&&s.jsx(Qa,{children:u}),f&&s.jsx(el,{children:f})]})},hl="FILTER_PRESETS_",$r=e=>`${hl}${e}`,Dt=e=>{if(typeof window>"u")return[];const t=localStorage.getItem($r(e));try{return t?JSON.parse(t):[]}catch(n){return console.error("Failed to parse presets",n),[]}},sn=(e,t)=>{typeof window>"u"||(localStorage.setItem($r(e),JSON.stringify(t)),window.dispatchEvent(new Event("storage_updated")))},Ar=(e,t)=>{const n=Dt(e);sn(e,[t,...n])},Lr=(e,t)=>{const n=Dt(e).filter(r=>r.id!==t);sn(e,n)},gl=y(a.Checkbox.Root),pl=y(a.Checkbox.HiddenInput),ml=y(a.Checkbox.Control),vl=y(a.Slider.Root),xl=y(a.Slider.Track),bl=y(a.Slider.Range),yl=y(a.Slider.Thumbs),Sl=y(a.Slider.Control),wl=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:i,transform:c,transition:l}=mr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:l};return s.jsxs(a.VStack,{ref:i,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[s.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[s.jsx(Rr,{size:16}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),s.jsxs(a.HStack,{justify:"space-between",children:[s.jsx(a.Text,{fontSize:"sm",children:"Visible"}),s.jsxs(gl,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[s.jsx(pl,{}),s.jsx(ml,{})]})]}),s.jsxs(a.VStack,{align:"stretch",gap:1,children:[s.jsx(a.Text,{fontSize:"sm",children:"Size"}),s.jsx(vl,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:s.jsxs(Sl,{children:[s.jsx(xl,{children:s.jsx(bl,{})}),s.jsx(yl,{})]})})]})]})},Cl=y(a.Drawer.Root),Dl=y(a.Drawer.Trigger),jl=y(a.Drawer.Backdrop),Rl=y(a.Drawer.Positioner),Ml=y(a.Drawer.Content),El=y(a.Drawer.Header),Tl=y(a.Drawer.Title),_l=y(a.Drawer.Body),Ol=y(a.Drawer.Footer),kl=y(a.Drawer.CloseTrigger),Il=y(a.Tabs.Root),$l=y(a.Tabs.List),Nt=y(a.Tabs.Trigger),Ft=y(a.Tabs.Content),Pr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return s.jsx(Gt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return s.jsx(Gt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return s.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return s.jsx(Ir,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return s.jsx(kr,{value:e.value,onChange:e.onChange,visible:t,label:e.label});case"date-range":return s.jsx(Or,{startDate:e.startDate?new Date(e.startDate):void 0,endDate:e.endDate?new Date(e.endDate):void 0,onChange:e.onChange,visible:t,label:e.label});case"combobox":return s.jsx(_r,{visible:!0,label:e.label,itemToString:n=>String(n.label),itemToValue:n=>n.value,renderItem:n=>s.jsx("span",{children:n.label})});default:return null}},Al=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:i="default",onLoadPreset:c,activePresetName:l,onReorder:u,open:d,onOpenChange:g})=>{const[f,v]=h.useState([]);h.useEffect(()=>{const x=()=>{v(Dt(i))};return x(),window.addEventListener("storage",x),window.addEventListener("storage_updated",x),()=>{window.removeEventListener("storage",x),window.removeEventListener("storage_updated",x)}},[i]);const p=()=>{const x=prompt("Preset name?");if(!x)return;const b=o.reduce((S,O)=>(S[O.id]=O.value,S),{});Ar(i,{id:Da(),name:x,date:new Date().toISOString(),values:b})};return s.jsx(a.HStack,{wrap:"wrap",children:s.jsxs(Cl,{size:e,open:d,onOpenChange:g,children:[s.jsx(Dl,{asChild:!0,children:s.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[s.jsx(Ii,{size:16}),"Filters"]})}),s.jsxs(a.Portal,{children:[s.jsx(jl,{}),s.jsx(Rl,{children:s.jsxs(Ml,{children:[s.jsx(El,{children:s.jsx(Tl,{children:"Filters"})}),s.jsx(_l,{overflowY:"auto",pt:1,children:s.jsxs(Il,{defaultValue:"view",children:[s.jsxs($l,{mb:4,children:[s.jsxs(Nt,{value:"view",children:[s.jsx(Li,{size:16}),"Edit"]}),s.jsxs(Nt,{value:"settings",children:[s.jsx(Fi,{size:16}),"Settings"]}),s.jsxs(Nt,{value:"presets",children:[s.jsx(yi,{size:16}),"Presets"]})]}),s.jsx(Ft,{value:"view",children:o.filter(x=>x.visible).map(x=>s.jsx(a.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:x.size??1,minW:`${(x.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Pr(x,d)},x.id))}),s.jsx(Ft,{value:"settings",children:s.jsx(ur,{sensors:mo(po(on)),collisionDetection:Kn,onDragEnd:({active:x,over:b})=>{if(!b||x.id===b.id)return;const S=o.findIndex(M=>M.id===x.id),O=o.findIndex(M=>M.id===b.id),R=wt(o,S,O);u?.(R)},children:s.jsx(gr,{items:o.map(x=>x.id),strategy:Os,children:o.map(x=>s.jsx(wl,{filter:x,onVisibilityChange:t,onSizeChange:n},x.id))})})}),s.jsx(Ft,{value:"presets",children:s.jsxs(a.VStack,{align:"stretch",mb:3,children:[f.length===0&&s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),f.map(x=>s.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:l===x.name?"blue.300":"gray.200",rounded:"md",p:2,children:[s.jsxs(a.VStack,{align:"start",gap:0,children:[s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:x.name}),s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(x.date).toLocaleDateString()})]}),s.jsxs(a.HStack,{children:[s.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const b=o.map(S=>({...S,value:x.values[S.id]??S.value}));c?.(b,x.name)},children:"Load"}),s.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Lr(i,x.id),children:s.jsx(Ti,{size:14})})]})]},x.id)),s.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:p,children:"Save Current Filters"})]})})]})}),s.jsx(Ol,{justify:"space-between",children:s.jsx(kl,{asChild:!0,children:s.jsx(a.CloseButton,{})})})]})})]})]})})},Ll=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,onLoadPreset:u,activePresetName:d,filterDrawerSize:g="sm"})=>{const[f,v]=h.useState(!1);return s.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,s.jsxs(a.HStack,{gapX:1,children:[t.filter(p=>p.visible!==!1).map(p=>s.jsx(a.HStack,{flex:p.size??1,minW:`${(p.size??1)*100}px`,alignItems:"center",children:Pr(p)},p.id)),s.jsx(Al,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:p=>{v(p.open)}})]})]})},Pl=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},zl=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Nl=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:i,isDisabled:c,colorScheme:l,loading:u,loadingText:d,rounded:g,type:f="button",textColor:v="white",borderColor:p})=>s.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:c,loading:u,loadingText:d,rounded:g,type:f,background:l,color:v,border:p,children:s.jsxs(a.HStack,{gap:1,children:[o,r,i]})}),Fl=y(a.Dialog.Root),Yl=y(a.Dialog.Backdrop),Bl=y(a.Dialog.Positioner),Wl=y(a.Dialog.Content),Vl=y(a.Dialog.Header),Hl=y(a.Dialog.Body),Ul=y(a.Dialog.Footer),Gl=y(a.Dialog.Title),ql=y(a.Dialog.CloseTrigger);function Xl({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:i="Confirm",cancelLabel:c="Cancel",icon:l,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return s.jsx(Fl,{open:e,placement:"center",onOpenChange:g=>!g.open&&t(),children:s.jsxs(a.Portal,{children:[s.jsx(Yl,{}),s.jsx(Bl,{children:s.jsxs(Wl,{maxW:"480px",children:[s.jsx(Vl,{borderBottom:"1px solid",borderColor:"gray.200",children:s.jsx(Gl,{children:r})}),s.jsx(Hl,{p:6,children:s.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[s.jsx(a.Box,{color:"orange.500",children:l??s.jsx(Mr,{size:40})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),s.jsxs(Ul,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:c}),s.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:i})]}),s.jsx(ql,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Kl=y(a.Dialog.Root),Jl=y(a.Dialog.Backdrop),Zl=y(a.Dialog.Positioner),Ql=y(a.Dialog.Content),ec=y(a.Dialog.Header),tc=y(a.Dialog.Body),nc=y(a.Dialog.Footer),rc=y(a.Dialog.Title),oc=y(a.Dialog.CloseTrigger);function sc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:i="DELETE",confirmLabel:c="Delete",isLoading:l=!1}){const[u,d]=h.useState(""),g=u===i;return s.jsx(Kl,{open:e,placement:"center",onOpenChange:f=>{!f.open&&t(),d("")},children:s.jsxs(a.Portal,{children:[s.jsx(Jl,{}),s.jsx(Zl,{children:s.jsxs(Ql,{maxW:"550px",children:[s.jsx(ec,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:s.jsx(rc,{color:"red.600",children:r})}),s.jsx(tc,{p:2,style:{padding:"16px"},children:s.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[s.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:s.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[s.jsx(a.Box,{color:"red.600",mt:"2px",children:s.jsx(Mr,{size:20})}),s.jsxs(a.Box,{children:[s.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),s.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",s.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),s.jsxs(a.Box,{children:[s.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",s.jsx("b",{children:i})," to continue"]}),s.jsx(a.Input,{placeholder:`Type ${i} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),s.jsxs(nc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),s.jsx(a.Button,{size:"sm",disabled:!g,style:{backgroundColor:"#FF0000"},loading:l,onClick:n,children:c})]}),s.jsx(oc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const zr=({children:e})=>s.jsx(s.Fragment,{children:e}),Nr=({children:e})=>s.jsx(s.Fragment,{children:e}),ic=a.Button,ac=y(a.Dialog.Root),lc=y(a.Dialog.Backdrop),cc=y(a.Dialog.Positioner),uc=y(a.Dialog.Content),dc=y(a.Dialog.Header),fc=y(a.Dialog.Body),hc=y(a.Dialog.Footer),gc=y(a.Dialog.Title),pc=y(a.Dialog.CloseTrigger);function mc(e){let t=null,n=null;return h.Children.forEach(e,r=>{h.isValidElement(r)&&(r.type===zr&&(t=r.props.children),r.type===Nr&&(n=r.props.children))}),{body:t,actions:n}}const vc=({open:e,onClose:t,title:n,children:r,width:o,position:i,refetch:c,loading:l=!1})=>{const{body:u,actions:d}=mc(r);return s.jsx(ac,{open:e,onOpenChange:g=>!g.open&&t(),placement:i??"center",children:s.jsxs(a.Portal,{children:[s.jsx(lc,{bg:"blackAlpha.400"}),s.jsx(cc,{children:s.jsxs(uc,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[s.jsx(dc,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:s.jsxs(a.Flex,{align:"center",justify:"space-between",children:[s.jsx(gc,{fontSize:"16px",fontWeight:"600",children:n}),s.jsx(pc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})}),c&&s.jsx(an,{label:"Refresh",refetch:c,isLoading:l})]})}),u&&s.jsx(fc,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:s.jsx(a.Flex,{direction:"column",gap:"16px",children:u})}),d&&s.jsx(hc,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:s.jsx(a.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},xc=y(a.Field.Root),bc=y(a.Field.Label),yc=y(a.Field.HelperText),Sc=y(a.Field.ErrorText),wc=y(a.PinInput.Input),Cc=y(a.PinInput.Control),Dc=y(a.PinInput.HiddenInput),jc=y(a.PinInput.Root),Rc=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:i,helperText:c,errorText:l,required:u=!1,visible:d=!0})=>{const g=Array.from({length:n}).map((f,v)=>e?.[v]??"");return s.jsxs(xc,{children:[d&&i&&s.jsxs(bc,{children:[i,u&&" *"]}),s.jsxs(jc,{value:g,onValueChange:f=>t?.(f.value.join("")),disabled:o,size:r,children:[s.jsx(Dc,{}),s.jsx(Cc,{children:s.jsx(a.HStack,{children:Array.from({length:n}).map((f,v)=>s.jsx(wc,{index:v},v))})})]}),l&&s.jsx(Sc,{fontSize:"xs",children:l}),c&&!l&&s.jsx(yc,{fontSize:"xs",children:c})]})};function an({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=h.useState(!1),i=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return s.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:i,ml:2,children:s.jsx(zi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var ct={exports:{}},Mc=ct.exports,Wn;function Ec(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Mc,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",c="second",l="minute",u="hour",d="day",g="week",f="month",v="quarter",p="year",x="date",b="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|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,R={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(D){var w=["th","st","nd","rd"],C=D%100;return"["+D+(w[(C-20)%10]||w[C]||w[0])+"]"}},M=function(D,w,C){var j=String(D);return!j||j.length>=w?D:""+Array(w+1-j.length).join(C)+D},I={s:M,z:function(D){var w=-D.utcOffset(),C=Math.abs(w),j=Math.floor(C/60),E=C%60;return(w<=0?"+":"-")+M(j,2,"0")+":"+M(E,2,"0")},m:function D(w,C){if(w.date()<C.date())return-D(C,w);var j=12*(C.year()-w.year())+(C.month()-w.month()),E=w.clone().add(j,f),A=C-E<0,F=w.clone().add(j+(A?-1:1),f);return+(-(j+(C-E)/(A?E-F:F-E))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:p,w:g,d,D:x,h:u,m:l,s:c,ms:i,Q:v}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},k="en",_={};_[k]=R;var L="$isDayjsObject",z=function(D){return D instanceof Y||!(!D||!D[L])},H=function D(w,C,j){var E;if(!w)return k;if(typeof w=="string"){var A=w.toLowerCase();_[A]&&(E=A),C&&(_[A]=C,E=A);var F=w.split("-");if(!E&&F.length>1)return D(F[0])}else{var m=w.name;_[m]=w,E=m}return!j&&E&&(k=E),E||!j&&k},B=function(D,w){if(z(D))return D.clone();var C=typeof w=="object"?w:{};return C.date=D,C.args=arguments,new Y(C)},P=I;P.l=H,P.i=z,P.w=function(D,w){return B(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var Y=(function(){function D(C){this.$L=H(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[L]=!0}var w=D.prototype;return w.parse=function(C){this.$d=(function(j){var E=j.date,A=j.utc;if(E===null)return new Date(NaN);if(P.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var F=E.match(S);if(F){var m=F[2]-1||0,T=(F[7]||"0").substring(0,3);return A?new Date(Date.UTC(F[1],m,F[3]||1,F[4]||0,F[5]||0,F[6]||0,T)):new Date(F[1],m,F[3]||1,F[4]||0,F[5]||0,F[6]||0,T)}}return new Date(E)})(C),this.init()},w.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()},w.$utils=function(){return P},w.isValid=function(){return this.$d.toString()!==b},w.isSame=function(C,j){var E=B(C);return this.startOf(j)<=E&&E<=this.endOf(j)},w.isAfter=function(C,j){return B(C)<this.startOf(j)},w.isBefore=function(C,j){return this.endOf(j)<B(C)},w.$g=function(C,j,E){return P.u(C)?this[j]:this.set(E,C)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(C,j){var E=this,A=!!P.u(j)||j,F=P.p(C),m=function(J,V){var ie=P.w(E.$u?Date.UTC(E.$y,V,J):new Date(E.$y,V,J),E);return A?ie:ie.endOf(d)},T=function(J,V){return P.w(E.toDate()[J].apply(E.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(V)),E)},N=this.$W,W=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(F){case p:return A?m(1,0):m(31,11);case f:return A?m(1,W):m(0,W+1);case g:var U=this.$locale().weekStart||0,K=(N<U?N+7:N)-U;return m(A?q-K:q+(6-K),W);case d:case x:return T(X+"Hours",0);case u:return T(X+"Minutes",1);case l:return T(X+"Seconds",2);case c:return T(X+"Milliseconds",3);default:return this.clone()}},w.endOf=function(C){return this.startOf(C,!1)},w.$set=function(C,j){var E,A=P.p(C),F="set"+(this.$u?"UTC":""),m=(E={},E[d]=F+"Date",E[x]=F+"Date",E[f]=F+"Month",E[p]=F+"FullYear",E[u]=F+"Hours",E[l]=F+"Minutes",E[c]=F+"Seconds",E[i]=F+"Milliseconds",E)[A],T=A===d?this.$D+(j-this.$W):j;if(A===f||A===p){var N=this.clone().set(x,1);N.$d[m](T),N.init(),this.$d=N.set(x,Math.min(this.$D,N.daysInMonth())).$d}else m&&this.$d[m](T);return this.init(),this},w.set=function(C,j){return this.clone().$set(C,j)},w.get=function(C){return this[P.p(C)]()},w.add=function(C,j){var E,A=this;C=Number(C);var F=P.p(j),m=function(W){var q=B(A);return P.w(q.date(q.date()+Math.round(W*C)),A)};if(F===f)return this.set(f,this.$M+C);if(F===p)return this.set(p,this.$y+C);if(F===d)return m(1);if(F===g)return m(7);var T=(E={},E[l]=r,E[u]=o,E[c]=n,E)[F]||1,N=this.$d.getTime()+C*T;return P.w(N,this)},w.subtract=function(C,j){return this.add(-1*C,j)},w.format=function(C){var j=this,E=this.$locale();if(!this.isValid())return E.invalidDate||b;var A=C||"YYYY-MM-DDTHH:mm:ssZ",F=P.z(this),m=this.$H,T=this.$m,N=this.$M,W=E.weekdays,q=E.months,X=E.meridiem,U=function(V,ie,oe,he){return V&&(V[ie]||V(j,A))||oe[ie].slice(0,he)},K=function(V){return P.s(m%12||12,V,"0")},J=X||function(V,ie,oe){var he=V<12?"AM":"PM";return oe?he.toLowerCase():he};return A.replace(O,(function(V,ie){return ie||(function(oe){switch(oe){case"YY":return String(j.$y).slice(-2);case"YYYY":return P.s(j.$y,4,"0");case"M":return N+1;case"MM":return P.s(N+1,2,"0");case"MMM":return U(E.monthsShort,N,q,3);case"MMMM":return U(q,N);case"D":return j.$D;case"DD":return P.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return U(E.weekdaysMin,j.$W,W,2);case"ddd":return U(E.weekdaysShort,j.$W,W,3);case"dddd":return W[j.$W];case"H":return String(m);case"HH":return P.s(m,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(m,T,!0);case"A":return J(m,T,!1);case"m":return String(T);case"mm":return P.s(T,2,"0");case"s":return String(j.$s);case"ss":return P.s(j.$s,2,"0");case"SSS":return P.s(j.$ms,3,"0");case"Z":return F}return null})(V)||F.replace(":","")}))},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(C,j,E){var A,F=this,m=P.p(j),T=B(C),N=(T.utcOffset()-this.utcOffset())*r,W=this-T,q=function(){return P.m(F,T)};switch(m){case p:A=q()/12;break;case f:A=q();break;case v:A=q()/3;break;case g:A=(W-N)/6048e5;break;case d:A=(W-N)/864e5;break;case u:A=W/o;break;case l:A=W/r;break;case c:A=W/n;break;default:A=W}return E?A:P.a(A)},w.daysInMonth=function(){return this.endOf(f).$D},w.$locale=function(){return _[this.$L]},w.locale=function(C,j){if(!C)return this.$L;var E=this.clone(),A=H(C,j,!0);return A&&(E.$L=A),E},w.clone=function(){return P.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D})(),$=Y.prototype;return B.prototype=$,[["$ms",i],["$s",c],["$m",l],["$H",u],["$W",d],["$M",f],["$y",p],["$D",x]].forEach((function(D){$[D[1]]=function(w){return this.$g(w,D[0],D[1])}})),B.extend=function(D,w){return D.$i||(D(w,Y,B),D.$i=!0),B},B.locale=H,B.isDayjs=z,B.unix=function(D){return B(1e3*D)},B.en=_[k],B.Ls=_,B.p={},B}))})(ct)),ct.exports}var Tc=Ec();const jt=xt(Tc);var ut={exports:{}},_c=ut.exports,Vn;function Oc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(_c,(function(){return function(n,r,o){n=n||{};var i=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,v){return i.fromToBase(d,g,f,v)}o.en.relativeTime=c,i.fromToBase=function(d,g,f,v,p){for(var x,b,S,O=f.$locale().relativeTime||c,R=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"}],M=R.length,I=0;I<M;I+=1){var k=R[I];k.d&&(x=v?o(d).diff(f,k.d,!0):f.diff(d,k.d,!0));var _=(n.rounding||Math.round)(Math.abs(x));if(S=x>0,_<=k.r||!k.r){_<=1&&I>0&&(k=R[I-1]);var L=O[k.l];p&&(_=p(""+_)),b=typeof L=="string"?L.replace("%d",_):L(_,g,k.l,S);break}}if(g)return b;var z=S?O.future:O.past;return typeof z=="function"?z(b):z.replace("%s",b)},i.to=function(d,g){return l(d,g,this,!0)},i.from=function(d,g){return l(d,g,this)};var u=function(d){return d.$u?o.utc():o()};i.toNow=function(d){return this.to(u(this),d)},i.fromNow=function(d){return this.from(u(this),d)}}}))})(ut)),ut.exports}var kc=Oc();const Ic=xt(kc);var dt={exports:{}},$c=dt.exports,Hn;function Ac(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})($c,(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,i){var c=o.prototype,l=c.format;i.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,g=(function(f,v){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,x,b){var S=b&&b.toUpperCase();return x||v[b]||n[b]||v[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(O,R,M){return R||M.slice(1)}))}))})(u,d===void 0?{}:d);return l.call(this,g)}}}))})(dt)),dt.exports}var Lc=Ac();const Pc=xt(Lc);var ft={exports:{}},zc=ft.exports,Un;function Nc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(zc,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(c){var l=this,u=this.$locale();if(!this.isValid())return i.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 i.bind(this)(g)}}}))})(ft)),ft.exports}var Fc=Nc();const Yc=xt(Fc);jt.extend(Ic);jt.extend(Pc);jt.extend(Yc);const Bc={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 qt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=jt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Bc[t]):r}function Wc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:i="start",dateColor:c="gray.700",dateFontSize:l="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:g="12px",timeFontWeight:f="400",showTime:v=!0}){return s.jsxs(a.Stack,{gap:.5,align:i,children:[s.jsx(a.Text,{fontSize:l,fontWeight:u,color:c,children:qt({value:e,variant:t,format:r})}),v&&s.jsx(a.Text,{fontSize:g,fontWeight:f,color:d,children:qt({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 Xt{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 Kt{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 i=this.store.get(o);i?n[o]=i.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const i=this.store.get(o);i&&(n[o]=i.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(i=>this.inflight.delete(i))});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 Vc({client:{apiUrl:e},children:t}){const n=h.useRef(new Kt(new Xt(e)));return n.current||(n.current=new Kt(new Xt(e))),s.jsx(Yr.Provider,{value:n.current,children:t})}function Hc(e){const t=Br(),[n,r]=h.useState(t.getRaw(e)?.value);return h.useEffect(()=>{let o=!0;t.getKey(e).then(c=>{o&&r(c)});const i=t.subscribe(e,c=>{r(c?.value)});return()=>{o=!1,i()}},[e,t]),n}function Uc(e){const t=Br(),[n,r]=h.useState({});return h.useEffect(()=>{let o=!0;t.getMultiKey(e).then(c=>{o&&r(c)});const i=e.map(c=>t.subscribe(c,l=>{r(u=>({...u,[c]:l?.value}))}));return()=>{o=!1,i.forEach(c=>c())}},[e.join("|"),t]),n}async function Gc(e,t){return e.getKey(t)}async function qc(e,t){await e.getMultiKey(t)}function Xc(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=h.useState(t),[i,c]=h.useState(n),l=h.useCallback(v=>{o(Math.max(1,v))},[]),u=h.useCallback(v=>{c(Math.max(1,v)),o(1)},[]),d=h.useCallback(()=>{o(v=>v+1)},[]),g=h.useCallback(()=>{o(v=>Math.max(1,v-1))},[]),f=h.useCallback(()=>{o(t),c(n)},[t,n]);return{page:r,limit:i,setPage:l,setLimit:u,nextPage:d,prevPage:g,reset:f}}function Kc(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=h.useState(t),i=Jc(r,n),c=h.useCallback(u=>{o(u)},[]),l=h.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:i,onSearchChange:c,reset:l}}function Jc(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=xa;exports.Filters=Ll;exports.HttpOptionsApi=Xt;exports.MDSButton=Nl;exports.MDSCheckbox=Tr;exports.MDSCombobox=_r;exports.MDSConfirmActionDialog=Xl;exports.MDSConfirmDeleteDialog=sc;exports.MDSDatePicker=kr;exports.MDSDateRangePicker=Or;exports.MDSDialogAction=ic;exports.MDSDialogActions=Nr;exports.MDSDialogBody=zr;exports.MDSDialogWrapper=vc;exports.MDSInput=Gt;exports.MDSPinInput=Rc;exports.MDSRefreshButton=an;exports.MDSSelectBox=Ir;exports.OptionsClientImpl=Kt;exports.OptionsProvider=Vc;exports.OptionsStore=Fr;exports.RefreshButton=an;exports.StackedDateTime=Wc;exports.addPreset=Ar;exports.deletePreset=Lr;exports.formatDateTime=qt;exports.getColumnWidthKey=Ct;exports.getOption=Gc;exports.getPresets=Dt;exports.loadOrder=zl;exports.prefetchOptions=qc;exports.saveOrder=Pl;exports.savePresets=sn;exports.setActionsConfig=Sr;exports.setColumnWidth=ti;exports.setData=br;exports.setTableId=yr;exports.tableStore=re;exports.useDebouncedSearch=Kc;exports.useOption=Hc;exports.useOptions=Uc;exports.usePagination=Xc;exports.withChildren=y;